A well-structured framework for analysing petri net extensions

26
A. Finkel, P. McKenzie and C. Picaronny A Well-Structured Framework for Analysing Petri Nets Extensions Research Report LSV-99-2, Feb. 1999 Ecole Normale Supérieure de Cachan 61, avenue du Président Wilson 94235 Cachan Cedex France

Transcript of A well-structured framework for analysing petri net extensions

A. Finkel, P. McKenzie and C. Picaronny

A Well−Structured Framework for Analysing

Petri Nets Extensions

Research Report LSV−99−2, Feb. 1999

Ecole Normale Supérieure de Cachan 61, avenue du Président W ilson94235 Cachan Cedex France

http://www.lsv.ens−cachan.fr/Publis/Research Report LSV−99−2, Lab. Spécification et Vérification, CNRS & ENS de Cachan, France, Feb. 1999A Well-Structured Framework for Analysing Petri NetExtensionsAlain Finkel�ENS Cachan Pierre McKenzieyMontr�eal and T�ubingen Claudine Picaronny�ENS CachanFebruary 23, 1999

(Classi�cation: Logic and veri�cation of computer programs, theory of parallel and dis-tributed computation, algorithms, decidability)�Laboratoire Sp�eci�cation et V�eri�cation (CNRS URA 2236), �Ecole Normale Sup�erieure de Cachan, 61,Avenue du Pr�esident Wilson, 94235 Cachan Cedex, FranceyInformatique et recherche op�erationnelle, Universit�e de Montr�eal, C.P. 6128, succ. Centre-Ville, Montr�eal(Qu�ebec), H3C 3J7 Canada. Research performed while on leave at Universit�at T�ubingen. Supported by the(German) DFG, the (Canadian) NSERC and the (Qu�ebec) FCAR.1

Proposed running head: A Well-Structured FrameworkAlain FinkelLaboratoire Sp�eci�cation et V�eri�cation (CNRS URA 2236)�Ecole Normale Sup�erieure de Cachan61, Avenue du Pr�esident Wilson94235 Cachan Cedex, France�[email protected]

2

AbstractTransition systems de�ned from recursive functions INp ! INp are introduced and named WSN,or well-structured nets. Such \minimally Petri net-like" transition systems sit conveniently betweenPetri net extensions and general transition systems. In a �rst part, we study decidability propertiesof WSN classes obtained by imposing natural restrictions to their de�ning functions, with respectto termination, to coverability, and to four variants of the boundedness problem. We are able toanswer optimally almost all the questions which arise, thus gaining much insight into old and newgeneralized Petri net decidability results. In a second part, we specialize our analysis to WSN de�nedfrom a�ne functions. Such a�ne WSN elegantly encompass most Petri net extensions studied inthe litterature. Again, we study decidability properties of natural classes of a�ne WSN with respectto six computational problems. In particular, we develop a nontrivial algorithm computing limits ofiterated nonnegative a�ne functions, in order to decide the path-place variant of the boundednessproblem for the relevant a�ne WSN. Undecidability results are scattered throughout the paper,concerning, for example, extending the domain of a recursive function from INp to (IN [ f!g)p.

3

1 IntroductionA transition system is a set S endowed with a transition relation \!". It is a WSTS, i.e. awell-structured transition system, if a re exive and transitive well-quasi-ordering on S existswhich is compatible with \!" ([11, 1, 13], or see Section 3 below). We deal in this paperwith in�nite state systems, with WSTS, and with Petri net extensions.Our motivating theme is that Petri net extensions can naturally and fruitfully be de�nedand studied from the perspective of WSTS. This theme is only marginally new: WSTSwere introduced as abstractions of Petri nets in the �rst place, as a means of identifyingthe essential properties of Petri net problems, algorithms, and extensions. But WSTS infact capture many other in�nite state systems [13], and WSTS are so general that (1) onlyrather coarse Petri net extension decidability results, concerning boundedness detection forexample, are inherited fromWSTS, and (2) the classi�cation of Petri net extensions a�ordedby WSTS is not as complete as one might have hoped.In this paper we respond to both weaknesses of the WSTS with the introduction of theWSN, or well-structured net. A WSN is a WSTS in which the set S is INp and the transitionrelation \!" is given by a �nite set of recursive functions with upward-closed domains (seeSection 3). Thus a WSN is a \minimally Petri net-like" WSTS. We convincingly establishthe suitability of the WSN model for a systematic study of Petri net extensions and theirdecidability properties.Our paper is formed of two parts. The �rst part deals with WSN in general. The secondpart deals with WSN de�ned from a�ne functions.In the �rst part, we de�ne progressively stronger properties of functions: nondecreasing,increasing, �-increasing, strongly increasing, each with or without the !-recursivity hypoth-esis that the extension of the function to the domain (IN [ f!g)p is recursive (see Section 3for formal de�nitions). These properties give rise to two groups of four WSN classes. Weexhaustively study these classes with respect to six decision problems. These problems aretermination, coverability, and four variants of the boundedness problem, of which the path-unbounded-witness and the path-place-boundedness are new and are introduced here todemonstrate the subtleties of boundedness detection. Our results are summarized on Figure2: only four of the 48 relevant decidability questions (some of whose answers were implicitlyor explicitly known) remain open. We also claim new results on !-recursive functions. Wesingle out, from the �rst part of our paper, the following:� Coverability for !-WSN, i.e. WSN whose functions satisfy the !-recursivity hypothesis,is shown decidable, while coverability is shown undecidable for our most restrictiveWSN class in the absence of the !-recursivity hypothesis. The decidability proof usesthe \e�ective pred basis" criterion [13] for decidability of coverability for WSTS (alsoapplied in [9] to prove decidability of coverability for Reset Petri nets), coupled witha characterization of e�ective upward-closed subsets of INp.� The decidability status of the four boundedness problems for WSN is resolved. Thisprovably separates three of our WSN classes, and the fourth class is distinguished fromthe others when viewed as a !-WSN class.� Boundedness is shown decidable for increasing WSN but undecidable for !-WSN.� Path-unbounded-witness is shown decidable for �-increasing WSN but undecidable forincreasing WSN.� Path-place-boundedness, known to be decidable for reset Petri nets (and for transferPetri nets), is shown undecidable for strongly increasing WSN and for !-WSN.4

� Place-boundedness is shown decidable for strongly increasing !-WSN. This is provedby generalizing both the coverability tree of Karp and Miller [20] and the minimalcoverability tree [12], noticing that the exact computation of the limit of an in�niterepetitive sequence can be replaced by the computation of a good enough approxi-mation. This construction and this result are shown to extend neither to stronglyincreasing WSN nor to �-increasing !-WSN.In the second part of our paper, we specialize our study to a�ne WSN, i.e. to WSNde�ned from a�ne functions. We do this because testing for nontrivial properties of generalrecursive functions is mostly undecidable (see Section 7.1), and because, in the concretecases likely to be encountered in \practice", functions are either a�ne, or their propertiesare known a priori, or these are easy to test. On Figure 3, we record some easy (butappealing) connections between a�ne WSN, Petri net extensions, and general WSN. Forexample, generalized transfer Petri nets can be seen as WSN de�ned from a�ne functionsf(X) = AX+B satisfying A � 0 with every column of the matrix A di�erent from 0. A�neWSN thus capture a wealth of known Petri net extensions, including Petri nets themselves,Reset Petri nets, Post SM nets, Double Petri nets, and they suggest new extensions ofindependent interest.We then develop a nontrivial polynomial time algorithm to solve the following problem:given a nonnegative n � n-matrix A and two nonnegative n-vectors B and X, computed � 1 such that limn!! fnd(X) exists, where f is the a�ne function f(X) = AX + B, andcompute this limit. We use this algorithm to solve the path-place-boundedness problem fora�ne WSN de�ned from nonnegative matrices and vectors.Finally, we record the decidability status of our six computational problems, for �veprominent classes of a�ne WSN, including Petri nets and Self-Modifying nets [26, 27]: onlyfour out of the 30 resulting questions (whose answers were known for Petri nets and Self-Modifying nets) remain open. See Figure 4.Section 2 in this paper introduces our various functions (excluding �-increasing func-tions), the notion of limit, !-recursivity, and proves relevant undecidability results. Section3 formally de�nes well-structured nets and our computational problems. Section 4 exam-ines decidability of termination and coverability for WSN. Section 5 does the same for thefour boundedness problems, after de�ning �-increasing functions. Section 6 summarizes ourdecidability results for WSN. Section 7 discusses a�ne WSN, their relationship with WSNand extended Petri nets, and their decidability properties. Section 8 concludes.2 Notation and preliminariesSets. When X is a set, a word v 2 X� is a possibly empty sequence of elements of X; theempty word is denoted �; we write jvj for the length of v. We write [p] for f1; 2; : : : ; pg,IN+ for IN n f0g, and IN! for the classical completion IN [ f!g of the set IN of nonnegativeintegers (where n < ! for any n 2 IN).Upward-closed sets. Fix any integer p � 1. Let � be the usual ordering on IN! . We alsounambiguously write � for the ordering on INp! de�ned by: for every u; v 2 INp!, u � v i�for every i 2 [p], u(i) � v(i). We write u < v if u � v and u 6= v. Addition in IN! and inINp! is de�ned as expected, with x + ! = ! + x = ! for any x 2 IN!. Let U + V denotethe sum of two subsets U; V � INp!: U + V = fu + v : u 2 U; v 2 V g. We say that a setK � INp is upward-closed (for �) if K = K + INp. A basis of an upward-closed set K is aset b(K) such that K = b(K) + INp. We de�ne the downward-closure of u 2 INp!, written#u, as #u = fv 2 INp : v � ug. The two well-known facts which follow can be found in [14],or in [13] where their proofs are brie y recalled:5

1. Every upward-closed set K � INp has a �nite basis.2. Any strictly increasing sequence K0 � K1 � K2 � � � of upward-closed sets in INp is�nite.We will require another result from Valk and Jantzen:Theorem 2.1 [29] A �nite basis of an upward-closed set K � INp is e�ectively computablei� for any vector u 2 INp! the predicate #u \K 6= ; is decidable.Transition systems. A transition system (TS) is a structure S = hS;!; : : :i where S =fs; t; : : :g is a set of states, and ! � S � S is any set of transitions. We write Succ(s)(resp. Pred(s)) for the set ft 2 S : s ! tg of immediate successors of s (resp. for the setft 2 S : t ! sg of immediate predecessors of s). We write s +! t to mean that there existsk > 0 and a sequence of states s0 = s; s1; : : : ; sk = t such that s0 ! s1 ! � � � ! sk. Wewrite s �! t to mean that s +! t or s = t. We say that S is �nitely branching if Succ(s) is�nite for each s 2 S; the usefulness of this property is tied to K�onig's lemma [21] statingthat an in�nite tree, �nitely branching, has an in�nite path.Reachability. A state t of a TS S is reachable from a state s if s �! t. The reachability treeRT (S; s0) of S with initial state s0 is a directed unordered tree where nodes are labelled bystates of S. The root node n0 is labelled by s0. A node labelled by s has a son labelled byt if and only if t 2 Succ(s). The reachability set of S from s0 is denoted RS(S; s0) and isde�ned as the set of states reachable from s0.Orders and limits. Consider an in�nite nondecreasing sequence fungn�1 of natural num-bers. This sequence is bounded i� there exists v 2 IN such that un � v holds for everyn 2 IN. We de�ne limun = � ! if fungn�1 is not bounded,maxfung otherwise.Now consider a nondecreasing in�nite sequence fungn�1 of p-tuples un 2 INp. Then we have: limun = (limun(1); limun(2); : : : ; limun(p)):For our purpose, we shall need the following orders : for any nonempty subset Q � [p],let <Q be the order relation de�ned on INp! by:u <Q v i� (8i 2 Q)[u(i) < v(i)] and (8i =2 Q)[u(i) � v(i)]:Note that u <Q v implies u <Q0 v for any ; 6= Q0 � Q. It is well-known that the ordering� on INp! is a well-ordering [8]: for any in�nite sequence u0; u1; : : : 2 INp!, there exist twoindices i < j with ui � uj. Using <Q, we can be more precise:Lemma 2.2 For any in�nite strictly increasing sequence u0 < u1 < u2 : : : in INp!, there ex-ists a nonempty maximal set Q � [p] such that one can extract an in�nite strictly increasingsubsequence ui0 <Q ui1 <Q ui2 : : : ( with i0 < i1 < i2 : : :):Proof. Q = fk 2 [p] j 8i; ui(k) 6= ! ^ limi!! ui(k) = !g.6

2.1 Transitions as functionsThroughout this paper, we shall consider transitions systems whose set of states is a subsetof INp, for some p in IN. Transitions are considered as recursive functions on INp. Thus,functions are not necessarily total. Consider a function f : X ! Y . We write Dom f forfx 2 X j f(x) is de�nedg. We adopt the convention that we compose functions from rightto left, i.e. gf(n) = g(f(n)). A function f : INp ! INp is(type 1) nondecreasing if u � v ) f(u) � f(v) for all u; v 2 Dom f ,(type 2) increasing if u < v ) f(u) < f(v) for all u; v 2 Dom f ,(type 3) strongly increasing if(8Q � [p]; Q 6= ;)(8u; v 2 Dom f)[u <Q v =) f(u) <Q f(v)]:(�-increasing functions, intermediate between increasing functions and strongly increasingfunctions, will be de�ned and motivated in Section 5.2.)Proposition 2.3 Let f and g be two functions from INp to INp.(1) If f and g are of type t above, 1 � t � 3, then gf is again of type t.(2) If f is nondecreasing and both f and g have upward-closed domains, then the domain ofgf is upward-closed.(3) If f and g are recursive, then gf is recursive.Proof. Straightforward.Extension of a nondecreasing function with upward-closed domain. For any v 2INp!, de�ne the sequence fv[!=n]gn�0 by setting v[!=n](i) = v(i) if v(i) 2 IN, and v[!=n](i) =n otherwise. Then fv[!=n]gn�0 is a nondecreasing sequence, and limv[!=n] = v. Theextension f : INp! ! INp! of a nondecreasing function f : INp ! INp with upward-closeddomain is de�ned by setting Dom �f = Dom f + INp! and, for any v 2 Dom �f ,f (v) = limn!! f(v[!=n]):Since f is nondecreasing, ff(v[!=n])gn�0 is a nondecreasing sequence and it admits a limitin INp!. Note that if v 2 Dom f then �f (v) = f(v).!-recursive functions. Let f be a nondecreasing function f : INp ! INp with upward-closed domain. We say f is !-recursive if its extension �f is recursive.We will see in Section 4 that computing �f plays a crucial role in deciding the coverabilityproblem and the place-boundedness problem (de�ned below). Here we note that the com-putability of �f is a nonvacuous hypothesis in a strong sense. Indeed, although f is recursivefor any �xed nondecreasing recursive function f : IN ! IN (because f agrees with f on IN,and because f(!) can be hardwired into a machine, i.e. there exists a machine computing�f even though we may not know which one), even for a �xed two-argument function whoselimit exists, it may not be possible to compute �f :Proposition 2.4 There is a nondecreasing total recursive function g : IN2 ! IN2 which isnot !-recursive.Proof. Let g(m;n) = (0; jfj � m : TM j halts on input j in at most n stepsgj ). Theng is a nondecreasing total recursive function, and g is not computable becauseg(m;!)� g(m � 1; !) = � (0; 1) if the mth Turing machine halts on input m,(0; 0) otherwise.7

In a similar vein, we haveProposition 2.5 The language of all m 2 IN such the m-th Turing machine computes afunction f : IN! IN for which �f (!) is de�ned and di�erent from !, is undecidable.Proof. The (well-de�ned) extensions �fm of the recursive functions fm, de�ned asfm(n) = � t if t � n and the TM m halts on m in exactly t steps,n otherwise,have the property that the TM m halts on m i� �fm(!) 6= !.Proposition 2.5 further implies that any function e : IN! IN for which e(m) is a Turingmachine computing �f whenever m is a Turing machine computing a nondecreasing totalfunction f : IN ! IN, is not recursive. A similar statement holds for strongly increasingfunctions, when we allow two-argument functions f :Proposition 2.6 Any function e : IN! IN for which e(m) is a Turing machine computing �fwhenever m is a Turing machine computing a strongly increasing total function f : IN�IN!IN� IN, is not recursive.Proof. For each j, de�ne fj by :fj(n; k) = 8<: (n; 0) if k = 0 and TM j does not halt on j within n steps(n; n) if k = 0 and TM j halts on j within n steps(n; n+ k) otherwise.For each j, fj is strongly increasing, recursive, and total. Furthermore, the TM j halts onj i� �fj(!; 0) 6= (!; 0). Now suppose to the contrary that the recursive function e exists. Todetermine, given j, whether the TM j halts on j, it su�ces to compute the TM mj whichcomputes fj , and to run the TM e(mj) (computing �fj, since TM mj computes a stronglyincreasing total function as promised) on input (!; 0). The TM e(mj) will necessarily halt,since �fj(!; 0) is well de�ned, and will output (!; 0) i� j runs forever on j.3 Well-structured netsWe recall [13] that a well-structured transition system (WSTS) is a TS S = (S;!;�)equipped with a re exive and transitive relation � � S � S ful�lling the two followingconditions:(1) well-quasi-ordering: for any in�nite sequence u0; u1; : : : 2 S, there exist two indices i < jwith ui � uj.(2) compatibility: � is (upward) compatible with !, i.e. for all s1 � t1 and transitions1 ! s2, there exists a sequence t1 �! t2 such that s2 � t2.For every state s we denote by "s the set ft 2 S; t � sg. A WSTS has e�ective Pred-basisif there exists an algorithm which, given s 2 S, returns a �nite basis of "Pred("s).Well-Structured Nets. A Well-Structured Net (WSN) is a TS S = (S; F�!;�) such that� there exists p 2 IN such that S = INp,� F is a �nite set of nondecreasing recursive functions de�ned on upward-closed subsetsof INp, and s F�!t for (s; t) 2 INp � INp means that f(s) = t for some f 2 F , alsowritten s f! t, 8

� � is the usual well-ordering on INp.A WSN S = (S; F�!;�) is increasing (resp. strongly increasing) if every function in Fis increasing (resp. strongly increasing). In the context of a WSN, we can speak of theboundedness of a place: given S and an initial state s0, the ith component (or the place pi)is bounded i� there exists k 2 IN such that for each s 2 RS(S; s0), s(i) � k.Note that a WSN is a WSTS ! Note also that every WSN is �nitely branching (in factjF j-ary).!-Well-Structured Nets. A !-WSN S = (S; F�!;�) is a WSN such that every functionin F is !-recursive.Problems. We will consider the following computational problems, where in each case, aWSN S = (S; F�!;�) is given as part of the input:1. Termination. Given a state s0, is the reachability tree RT (S; s0) �nite?2. Coverability. Given states s0 and s, does there exist a state s0 in RS(S; s0) whichcovers s, i.e. which satis�es s0 � s?3. Boundedness. Given a state s0, is the reachability set RS(S; s0) �nite?4. Path-unbounded-witness 1: Given a state s0 and a �nite sequence f1; f2; : : : ; fk in F ,can we �nd an unbounded place on the possibly in�nite path from s0 obtained byiterating the sequence fkfk�1 : : : f1 ?5. Path-place-boundedness: Given a state s0, a �nite sequence f1; f2; : : : ; fk 2 F , and aplace i, is the place i bounded on the in�nite path from s0 obtained by iterating thesequence fkfk�1 : : : f1 ?6. Place-boundedness: Given an initial state s0 and a place i, is i bounded?In this list, we have introduced two new problems related to the boundedness problem :� The Path-place-boundedness can be seen as the place-boundedness problem restrictedto regular paths of the reachability tree. It may be decidable when the boundednessproblem is not (e.g. reset Petri Nets [9]). Note that decidability of the path-place-boundedness problem implies decidability of the path-unbounded-witness problem.We do not mention the usual Reachability problem (given two states s and s0, does s �! s0hold ?), as it is irrelevant to our paper, being undecidable in all the classes we shall study.4 When are termination and coverability decidable?Theorem 4.1 Termination is decidable for well-structured nets (WSN).Proof. A WSN S = (INp; F�!;�) is a WSTS. If s1 f�!s2 for a function f 2 F ands1 � t1, then because f is nondecreasing and Dom f = "Dom f , we have t1 f�!t2 ands2 � t2. The latter property (called strong compatibility) and the recursivity of f allow usto apply Theorem 4.6 from [13] and then to decide termination.1Formally, decidability of this problem, for a given class of WSNs, will mean that there is a Turingmachine which, given a WSN and a function sequence and a state s0, is guaranteed to halt with the nameof an unbounded place found along the path iterating the sequence from s0, whenever the WSN is indeedfrom the class and iterating the sequence from s0 indeed yields at least one unbounded place.9

Theorem 4.2 Coverability is decidable for !-well-structured nets (!-WSN).Proof. We will show that it is possible to compute a �nite basis of "Pred("s) for anys 2 INp. Then by using Theorem 3.6 from [13], we will conclude that coverability is decidable.Recall Theorem 2.1, namely Valk and Jantzen's result, which we now apply to K ="Pred("s) for s 2 INp. We have K = "K and, de�ning Predf ("s) as ft 2 INp j f(t) � sg,K = " [f2F Predf ("s) = [f2F "Predf("s) = [f2F Predf ("s);where the rightmost equality holds because Dom f = "Dom f and f is nondecreasing.Because F is �nite, it su�ces to be able to compute Predf ("s) for f 2 F . The Valk andJantzen result yields that Predf ("s) is computable i� the predicate #t \ Predf ("s) 6= ; iscomputable for all t 2 INp!. Two cases arise:� t 2 INp. Then #t \ Predf ("s) 6= ; i� f(t) � s. Since f is recursive, this is obviouslydecidable.� t 2 INp! n INp. Then #t \ Predf ("s) 6= ; i� (9t0 2 INp, t0 � t)[f(t0) � s] i� �f (t) � s,which is decidable because �f is recursive.The computability of �f is a hypothesis required to decide coverability, since we have asa counterpart to theorem 4.2 that our most restrictive class of WS nets has an undecidablecoverability when this hypothesis is absent:Theorem 4.3 The coverability problem for strongly increasing well-structured nets is un-decidable 2.Proof. Consider the family ffj : IN2 ! IN2g of strongly increasing recursive functionsfj(n; k) = 8<: (n; 0) if k = 0 and TM j does not halt on j within n steps(n; n) if k = 0 and TM j halts on j within n steps(n; n+ k) otherwise,and the strongly increasing function g : IN2 ! IN2 de�ned by g(n; k) = (n + 1; k). Thestrongly increasing WSN Sj = (IN2; ffj; gg;�) with initial state (0; 0) have the propertythat the state (1; 1) is coverable i� the TM j halts on j. Hence there is no Turing machinewhich correctly determines coverability and halts whenever its input is a strongly increasingWSN.5 When are boundedness problems decidable ?5.1 The boundedness problemAn increasing WSN is a well-structured transition system with strict strong compatibility,i.e. s1 ! s2 and t1 > s1 imply t1 ! t2 with t2 > s2, while a WSN only enjoys strongcompatibility. Given strict strong compatibility, boundedness can be decided by searchingfor a sequence s0 �! s1 �! s2 with s1 < s2. Then, � can be iterated to produce an increasing2The precise technical meaning of this statement is that there is no Turing machine which correctlydecides whether some state in RS(S; s0) covers s, and halts, whenever its input S is indeed a stronglyincreasing WSN (with its de�ning functions given by Turing machines) together with s0 and s.10

sequence of reachable states s0 �! s1 �! s2 �! s3 : : : with s1 < s2 < s3 : : :, and the system isunbounded. Because any WSN by de�nition has a recursive Succ (i.e. Succ(s) is computable,for every s in S), Theorem 4.11 from [13] yields:Theorem 5.1 Boundedness is decidable for increasing well-structured nets.We note that extending a recursive function f to �f was never needed in Theorem 5.1.We note further that Theorem 5.1 is tight:Theorem 5.2 Boundedness is undecidable for !-well-structured nets.Proof. Boundedness is undecidable for reset Petri nets [9], and reset Petri nets are !-WSN.5.2 The path-unbounded-witness problemIn this section, we show how to detect at least one unbounded place in some unboundedsystems. To guarantee that this is possible, we must restrict increasing WSN to use only�-increasing functions, which we now de�ne.Growth graph. We de�ne the growth graph G(f) = (N;A) of an arbitrary functionf : INp ! INp as follows:� N is the set of all nonempty subsets of [p],� for each Q 2 N , consider the unique (possibly empty) largest subset R of [p] such that(8u; v 2 Dom f)[u <Q v ) f(u) <R f(v)];the arc (Q; f;R) is present i� R 6= ;.Note that G(f) is generally not computable (even when f is recursive, see Proposition5.3), that 0 � jAj � jN j by construction, and that each node Q in G(f) has at most oneoutgoing arc.�-increasing function. A function f : INp ! INp is �-increasing if jAj = jN j in its growthgraph G(f) = (N;A).Observe that the outdegree of each node in the graph of a �-increasing function f isprecisely one. (The name �-increasing was chosen to re ect the fact that the unique pathstarting from any node in the graph leads into a cycle, albeit possibly of length 1, andresembles the Greek letter �.)Proposition 5.3 There is no Turing machine which, given m, computes the growth graphG(f) whenever f : INp ! INp is a �-increasing function and m is a Turing machine com-puting f .Proof. For each m 2 IN, de�ne fm : IN3 ! IN3 as follows:fm(j; k; n) = � (j + k + n; k; n+ 1) if the mth TM halts on m within k � 1 steps(j + k + n; k + 1; n) otherwise.Every fm is recursive, and also �-increasing because(8Q � [p]; Q 6= ;)(8u; v 2 IN3)[u <Q v =) f(u) <f1g f(v)]:11

Now we claim that the mth TM halts on m i� G(fm) possesses an arc (f2g; R) with 2 =2 R.Indeed, if the mth TM halts on m in some number k � 1 of steps, then (0; k � 1; 0) <f2g(0; k; 0), while fm(0; k� 1; 0) = (k � 1; k; 0) and fm(0; k; 0) = (k; k; 1), so that the (unique)arc out of node f2g points to a node R for some R not containing 2. Conversely, if the mthTM runs forever on m, G(fm) clearly contains the arc (f2g; f1; 2g).Clearly, any strongly increasing function is �-increasing. And since u < v obviouslyimplies the existence of a Q such that u <Q v, any �-increasing function is increasing. Theconverse is false however: the total (hence upward-closed) increasing function f : IN2 ! IN2given by f(i; j) = 8>><>>: (0; 0) if i = j = 0,(i; i� 1) if j = 0 and i is odd,(i� 1; i) if j = 0 and i > 0 is even,(i+ 1; i+ j) if j > 0has the property that no restriction of f to an upward-closed domain is �-increasing (thisis because, for each n > 0, (2n; 0) <f1g (2n+ 1; 0) <f1g (2n+ 2; 0) and applying f to thesepairs yields (2n � 1; 2n) <f1g (2n + 1; 2n) <f2g (2n + 1; 2n + 2), so that no nonempty setR � f1; 2g ful�lls the condition that, for each u <f1g v in any upward-closed subset ofIN � IN, f(u) <R f(v); on the other hand, the reader can check by case analysis that f isindeed increasing).Consider a set F of �-increasing functions f : INp ! INp. We denote by G(F ) the labelledgraph ( fQ � [p] : Q 6= ;g ; f(Q; f;R) : (Q;R) is an arc in G(f)g ). For a node Q in G(F )and f in F , we denote by Qf the unique node such that (Q;Qf ) is an arc of G(f) and moregenerally, for � in F �, we denote by Q� the unique node reached in G(f) by starting at nodeQ and by following the unique path labelled �. Formally :Q� = � Q if j�j = 0,(Qf )�0 if � = �0f where f 2 F .Proposition 5.4 The composition of two �-increasing functions from INp to INp is �-increasing.Because a �-increasing WSN is increasing, boundedness is also decidable for �-increasingWSN. Moreover we have:Theorem 5.5 There is a TM which is guaranteed to halt with on its tape a nonempty subsetof unbounded places, whenever the TM input is a �-increasing well-structured net S and astate s0 from which S is unbounded.Proof. We �rst compute the �nite reachability tree FRT(S; s0) of S from s0, as introducedin [13]. We recall that a leaf node in FRT(S; s0) is either (1) a node whose state label iswithout successor or (2) a node n (labelled s) such that there exists a path from the root n0(labelled s0) to n which contains another node n0 (labelled s0) such that s0 � s. Because S isunbounded from s0 and increasing, there exists a path n0(s0)! n0(s0)! n(s) in FRT(S; s0)with s0 < s. Let � 2 F+ be the sequence of functions which lead from s0 to s.Dom � is upward-closed (from Proposition 2.3), and since � is a sequence of the �-increasing functions, we claim that(8Q � [p]; Q 6= ;)(8u; v 2 Dom �)[u <Q v ) �(u) <Q� �(v)]:Let us prove the claim for a sequence � = gf of length 2. Consider ; 6= Q � [p]. Picku; v 2 Dom gf . Then u; v 2 Dom f and f(u); f(v) 2 Dom g. Hence by the �-increase12

properties of f and g,u <Q v =) f(u) <Qf f(v) =) g(f(u)) <(Qf )g g(f(v)):Now (Qf )g = Qgf is independent of u and v, proving the claim.Now we show that it is possible to �nd some unbounded places along the in�nite pathobtained by iterating �. Let Q be the largest subset of [p] verifying s0 <Q s and let k; n � 1verify Q�n = Q�n+k . An inductive application of the claim proved above yieldss = v1 <Q� v2 <Q�2 v3 <Q�3 � � �where v1 �! v2 �! v3 � � �. De�ne ui = vn+ik for each i � 0. Then for each i � 0,ui = vn+ik <Q�n+ik vn+ik+1 <Q�n+ik+1 � � �<Q�n+(i+1)k�1 vn+(i+1)k = ui+1:But it follows from Q�n = Q�n+k that Q�n+j = Q�n+ik+j holds for each i; j � 0, so thatui = vn+ik <Q�n vn+ik+1 <Q�n+1 vn+ik+2 <Q�n+2 � � � <Q�n+k�1 vn+(i+1)k = ui+1:This precisely implies ui <R ui+1 for R = Skj=1Q�n+j 6= ;. It follows that all places in Rare unbounded along the in�nite path s0 �! s0 �! s �! � � � : This concludes the proof.Corollary 5.6 The path-unbounded-witness problem is decidable for �-increasing well-structurednets.Theorem 5.5 is tight. It provably extends neither to the guaranteed identi�cation ofat least one unbounded place in increasing well-structured nets (nor to the decidability ofpath-place-boundedness in �-increasing WSN, cf. next section), as we now show.Theorem 5.7 The path-unbounded-witness problem is not decidable for increasing well-structured nets.Proof. For each m, we de�ne f 0m : IN2 ! IN2 by neglecting the �rst component of thefunction fm(j; k; n) de�ned in proving proposition 5.3:f 0m(k; n) = � (k; n+ 1) if the mth TM halts on m within k � 1 steps(k + 1; n) otherwise.Every f 0m is total (hence upward-closed), recursive, and increasing3. Now, from any initialstate (k; n) 2 IN2, the increasing WS net Sm = (IN2; u ff 0mg�! v;�) possesses one and onlyone unbounded place, which is the second place i� the mth TM halts. This proves that thepath-unbounded-witness problem is undecidable for increasing WSN.5.3 The path-place-boundedness problemTheorem 5.8 Path-place-boundedness is undecidable for strongly increasing well-structurednets and for !-well-structured nets.Proof.3We note that f 0m is �-increasing i� the mth TM does not halt. Similar observations are systematicallygrouped together in Section 7. 13

� Consider the strongly increasing WSN Sj = (IN2; ffj; gg;�) from the proof of theo-rem 4.3, with initial state (0; 0) and the sequence � = gfj . Then, place 2 is unboundedalong the in�nite path (0; 0) �! �! �! ::: if and only if the jth TM halts on j.� Consider the family of functions gj : IN! IN de�ned bygj(n) = � n if the jth TM halts on j within n stepsn+ 1 otherwise.For every j � 1, the function gj is nondecreasing, total and !-recursive (�gj(!) = !).Let Tj = (IN; fgjg;�) with initial state 0. The only place is bounded along the in�nitepath 0 gj! ::: gj! ::: if and only if the jth TM halts on j.The following proposition essentially justi�es our interest in the path-place bounded-ness problem. Although boundedness in undecidable for Reset Petri nets [9], path-placeboundedness is decidable.Proposition 5.9 Path-place-boundedness is decidable for reset Petri nets.Proof. Given a reset Petri net N , a markingm, a place p and a sequence � of transitions,it is easy to see that p is unbounded along the (possibly) in�nite path m �! m1 �! m2 �! � � �i� m2 � m1 � m and m2(p) > m1(p) > m(p).5.4 The place-boundedness problemLet us recall the construction of the coverability tree of a Petri net, which is used to solvethe place-boundedness problem. The strategy of the construction is to develop every pathof the reachability tree until one meets two markingsm and m0 such that m0 ��! m ��! m0with m <Q m0 and Q a nonempty subset of places. When one meets two such markings mand m0, one replaces m0 by the limit of the in�nite sequence of markings obtained from mby iterating �. This limit is computable for Petri nets (and for transfer and reset Petri netsas well): limn!!�n(m)(i) = � ! if i 2 Qm(i) if i =2 Q.Then one continues using the same strategy with all transitions extended from INp to INp!.Termination is guaranteed because � is still a well-ordering on INp!.To apply the above strategy to construct a coverability tree for a WSN, it is �rst nec-essary to be able to e�ectively extend functions to INp!. This means that functions haveto be !-recursive. Moreover, either limn!! �n(u) must be computable, or a good enoughapproximation �u must be computable such that u < �u � limn!! �n(u) and �u has at leastone more !-component than u. (Note that in general, �u can satisfy �u < limn!! �n(u), forexample when f(m;n) = (m + n; n+ 1) and u = (0; 0), in which case f(u) = (0; 1) and �ucan be chosen as (0; !), while limn!! fn(u) = (!; !).) Furthermore, the extension �f of anynondecreasing function f is nondecreasing, but any type i-property of f may not be pre-served on �f . In particular, strongly increasing functions extended to INp! may no longer bestrongly increasing (for example, when f is de�ned as f(m;n) = (m;m+ n)). Nevertheless,any strongly increasing WSN (S; F�!;�) veri�es the interesting property:Proposition 5.10 Let u; v be in INp!. If there exists f1; : : : ; fk in F such that u ��! v for� = �fk �fk�1 : : : �f1, and there exists a nonempty Q such that u <Q v, then limn!! �n(u) ��u > u, where �u is de�ned by �u(i) = ! if i 2 Q, and �u(i) = u(i) otherwise.14

Proof. As f�n(u)g is a nondecreasing sequence, limn!! �n(u) exists. As a compositionof strongly increasing functions, � is strongly increasing. So u ��! v and u <Q v imply�n(u) <Q �n+1(u), for any positive integer n. So for i in Q, limn!! �n(u)(i) = ! and for inot in Q, we do not know if this limit is �nite or not, but at least we have limn!! �n(u)(i) �u(i). Note that �u contains at least jQj more ! than u.We thus obtain :Theorem 5.11 For a strongly increasing !-well-structured net (S; F�!;�), place-boundednessis decidable.Proof sketch. With the strongly increasing hypothesis, it is possible to generalize theKarp-Miller coverability tree [20] and the minimal coverability tree [12] algorithms (MCT).Finkel [11, 12] constructs a (minimal) coverability tree for well-structured transition systemsexplicitely gives the algorithm computing this set for standard Petri nets. The algorithmgeneralisation to WSN consists in appealing to a function \approximate-limit (s; �)"that computes, possibly in clever ways, the limit (or a good enough approximation to thelimit) of a sequence fsng. For standard Petri nets, the function approximate-limit (s; �)reduces to a trivial computation performed on each place p separately: for standard Petrinets, approximate-limit in the algorithm spelled out below consists of the instruction ifs1(p) < s(p), then s(p) !.The generalized minimal coverability tree (MCT) algorithm as it applies to a stronglyincreasing !-WSN is given next, followed by a paragraph explaining its operation:MCT tree with single node (1; s0) f* \(node number, marking)" *grepeat. (n; s) next unprocessed node in MCT;. f* \processed" means that the case statement has been executed on it*g. case [1::4] of. 1:a processed node (n1; s) exists in MCT: f* Do nothing *g. 2:a processed node (n1; s1) with s1 > s exists in MCT: remove (n; s) from MCT;. 3:a processed node (n1; s1) with s1 < s exists in MCT:. if an ancestor (n1; s1) of (n; s) exists such that s1 < s then. pick among these the ancestor (n1; s1) closest to the root. write (\The reachability tree is in�nite"). let �(s1) = s. if � is increasing then write (\The reachability set is in�nite"). (n1; s1) (n1; approximate-limit(s1; �)). (n1; s1) becomes unprocessed. delete any node subtended by (n1; s1). (n; s) becomes unprocessed. for each processed node (n1; s1) in MCT for which s1 < s do. remove (n1; s1) and any node subtended by (n1; s1) from MCT. 4:otherwise:. for each function f 2 F such that f(s) = s0 do. n0 new node number. add node (n0; s0) with arc (n; f; n0) to MCTuntil all nodes in MCT have been processedThe case statement is such that upon completion of case i, control exits the case statement.The algorithm initially executes case 4. Whenever it is activated, case 4 replaces a leaf15

marked s with a depth-one subtree whose leaves are unprocessed and arise each from afunction de�ned at s. An unprocessed leaf is also created in case 3 when a node markeds selected for processing has an ancestor marked s1 < s: then the subtree rooted at s1 isreplaced with an unprocessed leaf marked with a limit resulting from iterating the path �that led from s1 to s. When the node selected for processing is marked s, case 3 also takescare of deleting any subtree not containing s and rooted at a node marked s1 < s (thisdeletion process is actually postponed until a subsequent iteration, when an ancestor of smarked smaller than s is found upon entering case 3). We point out �nally that case 2 canonly arise when s1 is the immediate ancestor of (leaf) s.Then we de�ne the function approximate-limit as follows:function approximate-limit(m1; �)for each p such that m1(p) < m(p) do m(p) !approximate-limit mThe function trivially terminates. It computes a good enough approximation to limmn(\good enough" in the sense that it computes �u ful�lling the hypothesis of Proposition 5.10)having at least one new ! component. Now, we show that the MCT algorithm terminates.Assume the contrary. Then the algorithm computes an in�nite set of markings. Let usdenote by Pi the set of tree markings at the end of the ith iteration of the repeat loop. Thesequence (Pi) is in�nite. For every i, (i) Pi is a �nite set of pairwise incomparable elements,(ii) for any m 2 Pi there exists m0 2 Pi+1 such that m � m0, and (iii) for any m 2 Pithere exists m0 2 Pi+1 such that :(m0 � m). Hence, for each i, Pi 6= Pi+1. Because � is awell-ordering on INp!, we can extract from the sequence (Pi)i�1 an in�nite subsequence (Pij )such that, for each j, the ijth iteration involved case 3. For every j, there exists m 2 Pij ,there exists m0 2 Pij+1 , such that m < m0. Intuitively, every execution of case (3) in theMCT algorithm inserts a \new real" ! in some place of some vector. After a �nite numberof executions of case (3), no \new !" can be inserted. Hence case (3) is executed a �nitenumber of times, yielding a contradiction. Hence the algorithm terminates. The formalcorrectness proof is the same as that of the minimal coverability tree algorithm [12].Theorem 5.11 is optimal in the following sense :Theorem 5.12 Place boundedness is undecidable for both strongly increasing well-structurednets and for �-increasing !-well-structured nets.Proof. Undecidability of place-boundedness holds for �-increasing !-WSN because trans-fer Petri nets [9] are �-increasing !-WSN and undecidability of place-boundedness holds forthose. For proving the undecidability for strongly increasing WSN, we again use the familyfSjg with initial state (0; 0) as in Theorem 4.3. The place 2 is unbounded if and only if thejth TM halts on j.6 SummaryConsider the shorthand notation for our nets de�ned on Figure 1:Theorem 6.1 The decidability status of the six problems de�ned in Section 3 of this paper,for the eight classes depicted in Figure 1, is summarized on Figure 2.16

S1 WSN (well-structured nets)S2 increasing WSNS3 �-increasing WSNS4 strongly increasing WSN�S1 !-WSN�S2 increasing !-WSN�S3 �-increasing !-WSN�S4 strongly increasing !-WSNFigure 1: AbbreviationsS1 S2 S3 S4 �S1 �S2 �S3 �S4Termination D D D D D D D DCoverability U U U U D D D DBoundedness U D D D U D D DPath-unbounded-witness U U D D ? ? D DPath-place boundedness U U U U U ? ? DPlace-boundedness U U U U U U U DFigure 2: Decidability (D) or undecidability (U) for well-structured nets7 A�ne realizations of well-structured nets7.1 On the di�culty of testing general recursive functionsGiven a set F of functions INp ! INp prescribed by their respective Turing machines,deciding whether F gives rise to a WSN is undecidable, as is shown in Proposition 7.1:Proposition 7.1 For each type (t) of function chosen from (1) nondecreasing, (2) increas-ing, (3) strongly increasing, and (4) �-increasing, the following languages(a) fk j the kth TM computes f : IN! IN of type (t)g(b) fk j the kth TM computes f : IN! IN of type (t) whose domain is upward-closedg(c) fk j the kth TM computes f : IN! IN whose domain is upward-closedgare undecidable.Proof. In all cases, the idea is to reduce the complement of the halting problem to therelevant language. The following reduction takes care of the eight cases in (a) and (b). Foreach m 2 IN, de�ne the function fm : IN! IN asfm(n) = � n� 2 if the mth TM, on input m, halts in exactly n� 2 steps,n otherwise.If the mth Turing machine halts on m, it does so in a certain number, n, of steps. Forthis n, fm(n + 1) = n + 1 > fm(n + 2) = n, so that fm is not strongly increasing (andhence possesses none of the properties listed in cases (a) and (b)). Conversely, if the mth17

Turing machine runs forever on m, then fm is the identity function, which possesses all theproperties listed in cases (a) and (b).To take care of case (c) dealing with the upward-closure property alone, we modify fmas follows:fm(n) = � unde�ned if the mth TM, on input m, halts in exactly n� 1 steps,0 otherwise.Nevertheless, in concrete cases, it is generally known or easy to decide in which class thegiven set of functions lies. In many Petri net extensions, this given set is in fact containedin the set of a�ne functions. Many connections between a�ne functions and Petri netextensions are not so well-known. For example, (generalized) transfer Petri nets are preciselythose WSN obtained using a�ne functions f(X) = AX + B with A a matrix with nonnegative coe�cients and no null column [9]. Section 7.2 describes WSN for which decidingthe properties of relevant functions is easy. Section 7.4 summarizes the decidability statusof problems involving a�ne functions.7.2 Petri net extensions and a�ne well-structured netsAn a�ne function f : INp ! INp is given by f(X) = AX + B for some A = (Ai;j) 2 INp�pand B 2 ZZp. We denote by Aj the jth column of the matrix A, for any j in f1; :::; pg. Wewrite A � 0 to mean that Ai;j � 0, for all i; j. The following holds:1. f is nondecreasing i� A � 0,2. f is increasing i� f is �-increasing i� A � 0 and Aj 6= 0, for every j in f1; :::; pg3. f is strongly increasing i� A � Id (i.e. for all i; j, Aii = 1 and Aij � 0).Hence, given an a�ne function f , it is very simple to test its \increasing" property.Moreover, Dom f = fX 2 INp : AX +B � 0g is easy to compute, and it is easy to see thatDom f is upward-closed whenever f is nondecreasing (A � 0).The composition of two a�ne functions is a�ne and every a�ne function is recursive.Furthermore, the extension of a nondecreasing a�ne function f is recursive as the extensioncan also be de�ned by its a�ne form AX+B on X 2 INp! with the usual conventions 0! = 0and m! = !, for all m 2 IN such that m > 0. Hence every a�ne WSN is a !-WSN.Many Petri net extensions are thus surprisingly well parametrized by a�ne functions.Figures 3 and 4 locate such Petri net extensions within our classes of a�ne functions. Figure3 also locates the a�ne classes within our general framework of well-structured nets.The Double Petri nets [9] appearing on Figure 3 are extended Petri nets in which somearc from a transition to a place p may double the content of p. Double Petri nets are thena�ne WSN such that every a�ne function f(X) = AX+B satis�es Id � A � 2Id. TransferPetri nets [9] are extended Petri nets in which some transitions may transfer the contentof a place p to another place p0. Transfer Petri nets are then a�ne WSN such that everya�ne function f(X) = AX + B satis�es A � 0 and every column Aj satis�es �iAij = 1.Generalized Transfer Petri nets may transfer and duplicate, so that they are a�ne WSNsuch that A � 0 and every column Aj is nonnull. Reset Petri nets [3, 9] are extended Petrinets in which an arc may clear a place. This class corresponds to a�ne WSN such thatevery a�ne function f(X) = AX + B satis�es Id � A � 0.18

Petri net extensions A�ne WSN !-WSN WSNTransfer PN Petri netsDouble PNPost SM netsGeneralizedTransfer PN

Reset PNA = IdId � A � 2IdId � A0 � AAj 6= 0; 8j0 � A0 � A � Id

�S4strongly inc.!-WSN�S3�-inc.!-WSN�S2inc.!-WSN�S1!-WSN S4strongly inc.WSNS3�-inc. WSNS2inc. WSNS1WSN----

--6 666 6666? 666 666����:����:����:����:

Figure 3: The world of well-structured nets. An arrow C ! D indicates C � D and adouble line indicates equality.19

7.3 A polynomial time algorithm for path-place-boundednessDe�nition. A nonnegative a�ne function is an a�ne function f : INp ! INp such thatf(X) = AX + B with B � 0.A nonnegative a�ne WSN is a WSN such that every function f 2 F is nonnegativea�ne. We prove here that path-place-boundedness is decidable for nonnegative a�ne WSN.For f a nonnegative a�ne function and X a nonnegative vector in INp, we prove thatthe limit of fnd(X) for a suitable d is computable. We can determine precisely whichentries in fnd(X) go to in�nity. Furthermore, we show that this limit is polynomial timecomputable by searching a graph. Let f(X) = AX + B be a nonnegative a�ne function.Then fn(X) = AnX + (An�1 +An�2 + � � �+A + I)B for n 2 IN.Note that multiplication is extended by 0! = 0 and x! = !, 8x 2 IN! � f0g. Let's �rstremark the following :Lemma 7.2 Let fAngn�0 a sequence of non negative matrices having a limit A with possibly! coe�cients. Let X be any non negative vector. Then limn!!AnX = AX.So we may restrict the problem to the study of the sequences fAngn�0 and fI + A +:::+Angn�0.Notations. Let M be a matrix. We abusively write M = 0 or M = ! when eachcoe�cient of M is respectively 0 or !. We write M! for limn!!Mn when the limit exists.Let A = (Ai;j)(i;j) 2 f1; :::; pg� f1; :::; pg be a matrix with nonnegative integers coe�-cients. Let's denote An = (A(n)i;j ).We associate to A the directed graph GA whose vertices are 1; :::; p and whose arcs are :an arc joins vertex i to vertex j if and only if Ai;j 6= 0 ; then, the coe�cient Ai;j is calledthe weight of this arc. The weight of a path in the graph is the product of the weigths of itsarcs. For all subgraph G of GA, we shall denote by AC the submatrix (Ai;j)(i;j)2C�C.Let's recall the index of imprimitivity of a graph is the g.c.d. of the lengths of all circuitsof the graph.As we shall see, the behaviour of the sequence fAngn�0 may be completely described bythe graph GA. All the proof is based on the fact that A(n)i;j is the sum of the weights of allpathes of length n from i to j.Lemma 7.3 Let C be a strongly connected component of GA whose index of imprimitivityis equal to 1. Then AC = 1 or A!C = !.Proof. We begin by justify quite well-known facts about primitive strongly connectedgraphs : Let i; j in C. Note that because C is strongly connected there exists a path fromi to j (so there exists t such that A(t)i;j > 0) and because C is maximal for this property,all pathes from i to j in GA are in fact in C. Furthermore, we may �nd circuits in C withlengths l1,l2, ..., lr such that g.c.d.(l1; l2; :::; lr) = 1. So with a path of length q from i to jcrossing all these circuits, we can build a path in C of length q+ n1l1+ n2l2+ :::+ nrlr , forany non negative integers n1; n2; :::nr. It means there exists a path from i to j of any largeenough lentgh, i.e. A(n)i;j > 0 for any large enough n.� If A(n)i;i = 1, for su�ciently large integer n, then there is only one circuit in AC with alledges labelled by 1. So AC is a permutation matrix and, as its index of imprimitivityis equal to 1, AC = 1. 20

� Otherwise, there exists s such that A(s)i;i � 2. Let (i; i2); :::; (ir; j) a path from i to jand let q be such that A(n)j;j > 0, if n > q. Now, if n > s+ q + r, we may decompose nas u+ r+ tp with u 2 fq; :::; q+ s�1g such that u � n� r modulo s and t > n�q�s�rs .Then m(n)i;j > (m(s)i;i )tmi;i2 :::mir;jm(q)j;j � 2t which shows limn!!m(n)i;j = !.Proposition 7.4 Let C be a strongly connected component of GA with index of imprimi-tivity equal to c. Let D;E two strongly connected components of GAcC and (i; j) 2 D � E.Then (Ac)!i;j = 8<: O; if D 6= E(1); if fig = D = E = fjg and A(c)i;i = (1)!; otherwise:Proof. If D 6= E , for example, i may not be joined to j by a path of length multiple ofc in GA. As all loops have lengths multiple of c, j may not be joined either to i by a pathof length multiple of c. So 8n , A(nc)i;j = A(nc)j;i = 0. When D = E, we apply lemma 7.3 to(A(c)(i;j))(i;j)2D�D which is irreducible with index of imprimitivity equal to 1.The general case :We compute the strongly connected components of GA. Grouping nodes by components,we �nd a permutation matrix S such that SAS�1 is a triangular-blocks matrix where eachdiagonal block is irreducible (corresponding to a strongly connected component of GA). Letd be the l.c.m. of the indices of imprimitivity of all components of GA. We already knowhow to compute in polynomial time the limit of the powers of each irreducible diagonalblock of Ad. Let's partition the matrix B = SAdS�1 = (Bi;j)(i;j)2f1;:::;rg�f1;:::;rg such thateach block Bi;i corresponds to a strongly connected component of GAd . We shall call thiscomponent a 0, 1 or ! block according to the nature of its limit in lemma 7.3.As the matrix B is upper-triangular, each path in GB is increasing. If i < j , we denoteby Pi;j the set of strictly increasing pathes connecting i to j ; this set contains only pathesof length < j � i so is easily compu�gure. All theses sets allow us to express the powers ofB : B(n)i;j = X(i;i1;:::;it;j)2Pi;j Xp0+:::+pt+1=pBp0i;iBi;i1Bp1i1;i1 � � �Bit;jBpt+1j;j :So we get the next result which describe the behaviour of the sequence fAndgn�0 :Theorem 7.5 Let i < j � r.� If there exists a strictly increasing path in GB connecting i to j which goes through anode in a ! block or through two nodes in di�erent 1 blocks, then B!i;j = !.� If all strictly increasing pathes in GB connecting i to j go through nodes in 0 blocks orif there exists no path connecting i to j, then limn!!B(n)i;j = 0.� Otherwise, all strictly increasing pathes in GB connecting i to j go through nodes in 0block except one 1 block Bl;l. Then B!i;j =P(i;i1;:::;l;:::;it;j)2Pi;j Bi;iBi;i1Bi1;i2 :::B!l;l:::Bit;j:The same considerations allow to computeL = limn!!(And+An�1d+: : :+I). If limn!!A(nd)i;j 6=0, the i; j-term in L is !. If limn!! A(nd)i;j = 0, the number of pathes from i to j is �nite ;21

in particular, they do not cross any loop and they must be of length < n. So the i; j-termin L is Adi;j + :::+ Akdi;j where k is such that kd < n � (k + 1)d if i 6= j or 1 if i = j.Remark. This result may in fact be extended to matrices with non negative real coef-�cients (see [25]).Theorem 7.6 Let f(X) = AX+B be a nonnegative a�ne function on INp. Then there ex-ists an integer d � 1 such that limn!! fnd(X) exists in INp!. Furthermore, d and limn!! fnd(X)are computable in polynomial time.Proof. The notation used and the results quoted heavily refer to the Appendix, wherewe have developed the full theoretical justi�cation for the algorithm.1. Get the strongly connected components (C) of GA and their imprimitivity indices (dC)2. Compute CdC! for each irreducible diagonal block of A, corresponding to a stronglyconnected component of GAi) Search for connected components (E) of CdCii) If one of E = (1), then E! = (1) for all Eiii) Else, E! = ! for all E3. Compute the index d and Ad! (using Theorem 7.5)4. ComputePnAnd5. Compute (PnAnd)(X) (using Lemma 7.2)Corollary 7.7 Path-place boundedness is decidable in poly time for nonnegative a�ne WSN.Interestingly, although the procedure in Theorem 7.6 computes limits and always ter-minates, we do not see how to bound the number of limit computations required by theminimal coverability tree strategy from Section 5 (and Appendix).Gaubert (personal communication, see also [2, 6]) suggests that it may possible to ex-ploit facts developed by the \minmax community", in particular about topical functions,to extend Corollary 7.7 and decide the path-place-boundedness for a�ne WSN (improvingour nonnegative a�ne WSN results). The resulting algorithm would likely no longer run inpolynomial time, however.7.4 A�ne Well-Structured NetsTheorem 7.8 The decidability status of the six problems de�ned in Section 3 of this paper,for �ve classes of a�ne !-WSN, is summarized on Figure 4.Proof. First column: Termination and coverability are decidable because a�ne WSNwith A � 0 are !-WSN (i.e. in �S1); then see Figure 2. Boundedness, and hence place-boundedness, are undecidable because boundedness is already undecidable for reset Petrinets [9] and reset Petri nets are a�ne WSN with 0 � A � Id; then see Figure 3.Second column: path-place-boundedness, hence path-unbounded-witness, is decidable(Corollary 7.7). The case of boundedness is open; boundedness does not reduce to the22

A � 0 A � 0; B � 0 Aj > 0; 8j A � Id A = IdTermination D D D D DCoverability D D D D DBoundedness U ? D D DPath-unbounded-witness ? D D D DPath-place boundedness ? D D D DPlace-boundedness U ? U D DFigure 4: A�ne !-well-structured netspath-place-boundedness problem for (A � 0; B � 0)-a�ne WSN directly because one couldimagine detecting a �nite path s ��! s1 ��! s2 with s1 < s2 and limsn 2 INp.Third column: Boundedness is decidable because a�ne WSN with each column of eachmatrix greater than 0 are increasing !-WSN (i.e. in �S2). Path-place-boundedness, and thuspath-unbounded-witness as well, are decidable because pi is unbounded along the in�nitepath s ��! s1 ��! s2 � � � i� s2 > s1 > s and s2(i) > s1(i) > s(i). Place-boundednessis undecidable because it is undecidable for transfer Petri nets [9] which are included in(Aj > 0)-a�ne WSN.Fourth column: follows from [26, 27, 28].Fifth column: a�ne !-WSN with A = Id are Petri nets!8 ConclusionWe have answered all but eight decidability questions concerning termination, coverability,boundedness, path-unbounded-witness, path-place boundedness, and place-boundedness, forour eight classes of general WSN, and for �ve classes of a�ne WSN. These results aresummarized on Figures 2 and 4. We highlight speci�c contributions:� The coverability problem (and the termination problem) are shown decidable for every!-WSN. This uses a characterization of e�ective upward-closed subsets of INp.� To clarify the delicate role of model variations on the di�culty of deciding boundedness,we introduced two new boundedness problems, called the path-unbounded-witnessand the path-place-boundedness problems, as companions to the boundedness and theplace-boundedness problems classically studied. Our WSN classes provably distinguishthe decidability properties of these four boundedness problem variants.� The place-boundedness problem remains decidable for any class of WSN in which eachfunction is !-recursive and increases in the strong sense.� Reset Petri nets, Generalized transfer Petri nets, transfer Petri nets, post-SM nets,double Petri nets, and Petri nets (!) arise as particular cases of WSN in which everyfunction is a�ne and is de�ned by matrices satisfying simple conditions: see Figure3. This point of view is new and puts the decidability results of [28, 9] in a clearerperspective.� A new polynomial time algorithm of independent interest was developped to computethe limit of a nonnegative a�ne function (the algorithm extends to nonnegative a�nefunctions with real coe�cients). 23

We leave open the questions for which \?" appears in Figures 2 and 4. It would beinteresting to complete the global picture a�orded by WSN and a�ne WSN by answeringthese questions.Finally, we have mentioned that well-structured transition systems capture many in�nitestate systems beyond generalized Petri nets (see for instance [13]). Clearly, any useful suchtransition system ought to be de�ned from recursive functions over some domain, so thatWSN could in principle represent such systems as well. But there is one limitation of WSN,namely �niteness of their de�ning sets of functions, which could be lifted to make WSNmore expressive. Are there in�nite state systems which would require this generality to bemodelled conveniently by WSN, and if so, what would become of our Figures 2 and 4 in thismore general context?AcknowledgmentWe thank Philippe Schnoebelen for useful comments on two earlier versions of this paper.References[1] P. Abdulla, K. Cerans, B. Jonsson and T. Yih-Kuen, General decidability theoremsfor in�nite-state systems, Proc. 11th IEEE Symp. Logic in Computer Science (LICS 96), pp.313-321, 1996.[2] M. Akian, R. Bapat and S. Gaubert, INRIA Research report RR-3450, July 1998, RR-3450.ps,RR-3450.ps.gz[3] T. Araki and T. Kasami, Some decision problems related to the reachability problem for Petrinets, Theoretical Computer Science 3 (1977), pp. 85-104.[4] W. Brauer and G. Rozenberg (Eds.), Petri Nets: Central Models and Their Properties,Advances in Petri Nets 1986, Part 1, LNCS 254, Springer-Verlag, (1987).[5] G. Ciardo, Petri Nets with Marking-Dependent Arc Cardinality: Properties and Analysis,Advances in Petri Nets (1994), LNCS, Springer-Verlag, pp. 179-198.[6] J. Cochet-Terrasson, S. Gaubert and J. Gunawardena, Dynamics of min-max functions,HP Laboratories Technical Report HPL-BRIMS-97-13, August 1997.[7] T. Cormen, C. Leiserson and R. Rivest, Introduction to algorithms, MIT Press (1990).[8] L. Dickson, Finiteness of the odd perfect and primitive abundant numbers with distinct primefactors, Amer. J. Math., 35 (1913), pp. 413-422.[9] C. Dufourd, A. Finkel and P. Schnoebelen, Reset nets between decidability and unde-cidability, ICALP'98, LNCS 1443, pp. 103-115 (1998).[10] A. Finkel, A Generalization of the Procedure of Karp and Miller to Well Structured TransitionSystems, ICALP'87, LNCS 267, Springer-Verlag, pp. 499-508, (1987).[11] A. Finkel, Reduction and Covering of In�nite Reachability Trees, Information and Computa-tion, Vol.89, N.2, pp. 144-179, (December 1990).[12] A. Finkel, The minimal coverability graph for Petri nets, Advances in Petri Nets, LNCS 674,Springer-Verlag, pp. 210-243, (1993).[13] A. Finkel and P. Schnoebelen, Fundamental structures in well-structured in�nite transitionsystems, Proc. 3rd Latin American Theoretical Informatics Symp. (LATIN'98), LNCS 1380,pp. 102-118 (1998). Extended version accessible from the �rst author's Web address: Well-Structured Transition Systems Everywhere ! Research Report LSV-98-4, April 1998, to appearin TCS. 24

[14] G. Higman, Ordering by divisibility in abstract algebras, Proc. London Math. Soc. (3),2(7):326{336 (1952).[15] F.R. Gantmacher, Th�eorie des matrices, J. Gabay (1966).[16] C. Ghezzi, Mandrioli D., Morasca S. and Pezzi M., A Uni�ed High-Level Petri NetFormalism for Time-Critical Systems, IEEE Trans. on Soft. Engin., vol. 17, N.2, pp. 160-172,(February 1991).[17] S. Greibach, Remarks on blind and partially blind one-way multicounter machines, Theoret-ical Computer Science 7, pp. 311-324, (1978).[18] M. Hack, Decision problems for Petri nets and vector addition systems,MAC Tech. Mem. 59,MIT, (1975).[19] K. Jensen, Coloured Petri nets Basic Concepts, Analysis Methods and Practical Use, Vol. 1(1992), Vol. 2 (1995), Springer-Verlag.[20] R.M. Karp and R.E. Miller, Parallel program schemata, J. Computer and Systems Science4 (1969), pp. 147-195..[21] D. K�onig, Theorie der endlichen und unendlichen graphen, in Akademische Verlagsge-sellschaft, Leipzig, (1936).[22] C. Lakos and S. Christensen, A General Systematic Approach to Arc Extensions forColoured Petri Nets, Advances in Petri Nets (1994), LNCS, Springer-Verlag, pp. 338-357.[23] H. Minc, Non negative matrices, Wiley-Interscience (1988).[24] J. Peterson, Petri Net Theory and the Modeling of Systems, Prentice-Hall, (1981).[25] C. Picaronny, On the powers of non negative matrices, Tech. Rep. LSV-95, �Ecole NormaleSup�erieure de Cachan (1995), http://www.lsv.ens-cachan.fr.[26] R. Valk, Self-modifying Nets, IFI-HH-B-34/77, Hamburg University, pp. 1-36, (1977).[27] R. Valk, Self-modifyingNets, a natural extension of Petri nets, ICALP'78, LNCS 62, Springer-Verlag, pp.464-476, (september 1978).[28] R. Valk, Generalizations of Petri nets, 7th MFCS'81, LNCS 118, pp. 140-155, Springer-Verlag,(1981).[29] R. Valk and M. Jantzen, The residue of vector sets with applications to decidability prob-lems in Petri nets, Acta Informatica 21 (1985), pp. 643{674.25