Semntic rechbility for simple process lgebrs Richrd Myr Abstrct This pper is n pproch to combine the rechbility problem with semntic notions like bisimultion equivlence. It dels with questions of the following form: Is stte rechble tht is bisimultion equivlent to given stte? Here we show some decidbility results for process lgebrs nd Petri nets. Keywords: bisimultion, rechbility problem, process lgebrs, Petri nets 1 Introduction The rechbility problem plys n importnt role in the theory of concurrent systems. The question is if given stte is rechble from the initil stte by sequence of ctions. The complexity of this problem hs been extensively studied (for exmple it is decidble nd EXPSPACE-hrd for generl Petri nets nd NP-complete for Bsic Prllel Processes (BPP) [Esp95]). Here we generlize the rechbility problem by regrding clsses of semnticlly equivlent sttes insted of single sttes. The question is now if stte is rechble (from the initil stte) tht is member of given clss. In other words: Is it possible to rech stte tht is t lest semnticlly equivlent to given stte? It is nturl to choose strong bisimultion equivlence s semntic equivlence, s it hs become one of the most successful equivlence notions in concurrency theory. We will cll this new problem the bisimultion-rechbility problem. The question is now for which clsses of concurrent systems this problem is decidble, nd if ecient lgorithms cn be found. In section 2 we dene strong bisimultion, the bisimultion-rechbility problem nd severl process lgebrs. Section 3 contins some hrdness results for the bisimultionrechbility problem. In sections 4, 5 nd 6 we study the bisimultion-rechbility problem for Bsic Prllel Processes (BPP), context-free processes nd normed PA-processes. Section 7 is bout relted problem clled the non-bisimultion-rechbility problem nd section 8 describes some open problems. Address: Institut fur Informtik, Technische Universitt Munchen, Arcisstr. 21, D-80290 Munchen, Germny; e-mil: myrri@informtik.tu-muenchen.de
2 Preliminries Denition 2.1 A binry reltion R over the sttes of lbeled trnsition system (LTS) is strong bisimultion (often simply clled bisimultion) i 8(s1; s2) 2 R 8 2 Act : (s1! s 0 1 ) 9s2! s 0 2 : s 0 1 Rs 0 2) ^ (s2! s 0 2 ) 9s 1! s 0 1 : s 0 1 Rs 0 2 ) There is lwys lrgest bisimultion, which is n equivlence reltion, denoted by. Two sttes s1 nd s2 re clled strongly bisimultion equivlent (or strongly bisimilr) i s1 s2. The most generl form of the bisimultion-rechbility problem cn be formulted for lbeled trnsition systems (LTS): Instnce: An LTS R with initil stte s0 nd stte s in R. Question: Is there stte s 0 nd sequence of trnsitions s.t. s0! s 0 nd s s 0? In the sequel we consider trnsition systems described by process lgebrs or Petri nets. In process lgebrs processes re described by process terms nd set of dynmic rules of the form t! t 0, mening tht process t cn perform ction nd become process t 0. Processes dene n LTS, whose nodes re mrked with process terms. The semntics of the processes is given by dening n equivlence reltion over the term lgebr. The equivlence clsses then represent the intended processes. It follows tht the dynmic rules describe unmbiguously the dynmics of the quotient lgebr, only if the chosen equivlence on the term lgebr is bisimultion. This is min reson why bisimultion equivlence is the preferred choice for process equivlence. The Bsic Process Algebr PA is simple model of innite stte concurrent systems. It hs opertors for nondeterministic choice, prllel composition nd sequentil composition. PA-processes nd Petri nets re incomprble, mening tht neither model is more expressive tht the other one. PA is not syntcticl subset of CCS [Mil89], becuse CCS does not hve n explicit opertor for sequentil composition. However, s CCS cn simulte sequentil composition by prllel composition nd synchroniztion, PA is still weker model for concurrent systems thn CCS. The denition of PA is s follows: Assume countbly innite set of tomic ctions Act = f; b; c; : : :g nd countbly innite set of process vribles Vr = fx ; Y ; Z ; : : :g. The clss of PA expressions is dened by the following bstrct syntx E ::= j X j E j E + E j EkE j E :E A PA is dened by fmily of recursive equtions fx i := E i j 1 i ng, where the X i re distinct nd the E i re PA expressions t most contining the vribles fx1; : : : ; X n g. We ssume tht every vrible occurrence in the E i is gurded, i.e. ppers within the scope of n ction prex, which ensures tht PA-processes generte nitely brnching trnsition grphs. This would not be true if ungurded expressions were llowed. For exmple, the process X := + kx genertes n innitely brnching trnsition grph.
For every 2 Act the trnsition reltion! is the lest reltion stisfying the following inference rules: E! E E! E 0! F 0 F E E + F! E 0 E + F! F 0! E 0 X! (X := E) 0 E EkF E! E 0! E 0 kf F! F 0 E! E 0 EkF! EkF 0 E :F! E 0 :F Alterntively, PA-processes cn be described by stte represented by term of the form G ::= j X j G1:G2 j G1kG2 nd set of dynmic rules of the form X! G whose ppliction to sttes must respect sequentil composition. This is described by the following inference rules: EkF E! E 0 X! G if (X! G) 2! E 0 kf F! F 0 E! E 0 EkF! EkF 0 E :F! E 0 :F Bsic Prllel Processes (BPP) re the subset of PA-processes without sequentil composition, while context-free processes re the subset of PA-processes without prllel composition. Unlike for PA-processes there is one-to-one correspondence between BPPs nd clss of lbeled Petri nets, the communiction-free nets [Esp95]. In these nets every trnsition hs exctly one input plce with n rc lbeled by 1. The trnsltion of BPP lgebr into communiction-free net goes s follows: Introduce plce for ech process vrible nd trnsition for ech trnsition rule. For rule X! Y m 1 1 k ky mn n introduce trnsition t lbeled by, n rc lbeled by 1 leding from plce X to t nd rcs lbeled by m i leding from t to plces Y i. The other direction is nlogous. 3 Generl hrdness results How does the computtionl complexity of the bisimultion-rechbility problem compre to the complexities of the rechbility problem nd the problem of deciding strong bisimilrity? For most models of systems the bisimultion-rechbility problem is t lest s hrd s the other two problems. Lemm 3.1 For ll clsses of Petri nets tht re t lest s powerful s communictionfree nets the bisimultion-rechbility problem is t lest s hrd s the problem of deciding strong bisimilrity. Proof The problem of deciding strong bisimilrity cn be reduced to the bisimultion rechbility problem by constructing slightly modied system s.t. the only rechble
stte tht cn possibly be bisimilr to the given stte is the initil stte itself. This construction is possible for ll models tht llow the cretion of new prllel processes. Without restriction we cn regrd the problems for dierent mrkings 1 ; 2 in the sme Petri net N. Let A = f1; : : : ; n g be the set of ctions occurring in N nd A 0 = f1 0 ; : : : ; ng 0 new set of ctions s.t. A \ A 0 = ;. Now construct new net N 0 in the following wy. For ech trnsition t in N lbeled by i introduce new plce s nd new trnsition t 0 lbeled by 0 with n rc from i t to s nd from s to t 0. Any mrking of N cn be extended to mrking of N 0 in nturl wy by dening (s) = 0 for ll plces s tht re not in N. Let L be the lbeling function tht ssigns ctions to the trnsitions in N 0. We show tht (N ; 1 ) (N ; 2 ) () 9(N 0 ; 1 )! (N 0 ; 0 1 ) (N 0 ; 2 ). ) If (N ; 1 ) (N ; 2 ) then f((n 0 ; ); (N 0 ; 0 )) j (N ; jn ) (N ; 0 jn ) ^ 8 0 2 A 0 : X L(s)= 0 (s) = X L(s)= 0 0 (s)g is strong bisimultion. It follows tht (N 0 ; 1 ) (N 0 ; 2 ), becuse (N ; 1 ) (N ; 2 ) nd P L(s)= 0 (s) = 0 = P L(s)= 0 0 (s) for every 0 2 A 0. So we cn simply choose = nd 0 1 = 1 nd the condition is stised. ( Assume tht 9(N 0 ; 1 )! (N 0 ; 0 1):(N 0 ; 0 1) (N 0 ; 2 ). It follows tht length() = 0 nd 0 1 = 1, becuse otherwise (N 0 ; 0 1 ) could do n ction from A0 while (N 0 ; 2 ) cn't. As A nd A 0 re disjoint f((n ; jn ); (N ; 0 jn )) j (N 0 ; ) (N 0 ; 0 )g is bisimultion nd therefore (N ; 1 ) (N ; 2 ). This construction is possible for communiction-free nets nd T-systems, s well s for ll models more generl thn them. This is becuse the construction does not exceed the bounds of the model (i.e. if N is communiction-free net then N 0 is communiction-free net s well). Figure 1 illustrtes the construction for Petri net. 2 Theorem 3.2 The bisimultion-rechbility problem is undecidble for Petri nets. Proof Directly from Lemm 3.1 nd the result from Jncr [Jn95] tht strong bisimilrity is undecidble for generl Petri nets. 2 Unfortuntely Lemm 3.1 yields no complexity bounds for BPPs s, to our knowledge, there is no hrdness result for the problem of deciding strong bisimilrity of BPPs yet. We cn give complexity bounds by showing tht for mny models of systems the bisimultion rechbility problem is t lest s hrd s the rechbility problem. Lemm 3.3 For BPPs the bisimultion-rechbility problem is t lest s hrd s the rechbility problem. Proof by reduction of the rechbility problem to the bisimultion-rechbility problem. Let N be communiction-free net, A the set of tomic ctions occurring in A, 0 the
Figure 1: How to reduce the problem of deciding strong bisimilrity to the bisimultionrechbility problem. New in N 0 b b 0 0 0 initil mrking nd mrking of N. Now construct new lrger net N 0 : for ech plce s in N dd new trnsition t s in the postset of s tht is lbeled by unique new ction s. Then dd one new plce ^s nd one new trnsition ^t to the net nd n rc from every t s to ^s nd n rc from ^s to ^t nd from ^t to ^s. Let ^t be lbeled by unique new ction ^. Figure 2 illustrtes the construction. It follows tht if 1 nd 2 re mrkings of N 0 nd 1 2 nd 1 (^s) = 0 then 1 = 2. Now we show tht 9:(N ; )! (N ; 0 ) () 9 0 :(N 0 ; )! 0 (N 0 ; 00 ) (N 0 ; 0 ) ) If (N ; )! (N ; 0 ) then (N 0 ; )! (N 0 ; 0 ). Choose 0 = nd 00 = 0 nd the condition is stised. ( As 0 (^s) = 0 it follows tht 00 = 0 nd thus 00 (^s) = 0. Therefore no trnsition t s occurs in 0. So 0 is sequence enbled by (N ; ) nd the condition is stised with = 0. 2 Corollry 3.4 The bisimultion-rechbility problem for BPPs is NP-hrd. Proof Directly from Lemm 3.3 nd the fct tht the rechbility problem for BPPs is NP-compete [Esp95]. 2
Figure 2: How to reduce the rechbility problem to the bisimultion-rechbility problem. New in N 0 x x t x b y z t z z ^s ^ ^t y c d t y Remrk 3.5 The construction used in Lemm 3.3 is possible for mny clsses of Petri nets, but not for T-systems nd free-choice nets. Also the newly constructed net is never normed, so Lemm 3.3 yields no hrdness result for normed BPP. A process t is normed if every process t 0 rechble from t hs terminting computtion. The length of the shortest terminting computtion is clled the norm of t. It is denoted by [t]. A BPP is normed i in the corresponding communiction-free net N with initil mrking 0 it is impossible to rech mrking s.t. mrks trp of N. This property cn be decided in polynomil time, becuse the mximl trp cn be computed in polynomil time nd becuse in these nets tokens cn move independently. Lemm 3.6 The bisimultion-rechbility problem is NP-hrd even for normed BPP. Proof The proof is done by reduction of SAT to the bisimultion-rechbility problem. We illustrte the construction by n exmple (see Figure 3): The formul (x1 _ :x2 _ x3) ^ (x2 _ :x3) ^ (:x1 _ x3) is stisble i stte is rechble from fx1; x2; x3g tht is bisimilr to fy1; y2; y3g. (The only such stte is fy1; y2; y3g itself). Note tht the constructed communiction-free net is nite stte nd normed. 2
Figure 3: NP-hrdness of the bisimultion-rechbility problem for normed BPP. x1 x2 x3 t f t f t f y1 y2 y3 b c In the next sections we show tht the bisimultion-rechbility problem is decidble for severl specil clsses of process lgebrs. 4 Bsic Prllel Processes Lemm 4.1 Let t0 be BPP nd t BPP tht hs terminting computtion. decidble if there is sequence t0! t 0 s.t. t t 0. Proof We know tht [t] 2 IN. If such t 0 exists tht is rechble from t0 nd bisimilr to t, then [t 0 ] = [t] nd therefore size(t 0 ) [t]. There re only nitely mny cndidtes for such t 0. It is decidble if cndidte t 0 is rechble from t0 nd it is decidble if t 0 t [CHM93b]. Check ll cndidtes until correct one is found (nswer \yes") or none is left (nswer \no"). 2 Note tht this lemm is especilly true if t is normed. Lemm 4.2 Let t0 be normed BPP nd t BPP. It is decidble if there is sequence t0! t 0 s.t. t t 0. Proof As t0 is normed, every t 0 tht is rechble from t0 hs terminting computtion. It cn be decided in polynomil time if t hs terminting computtion. First pply mrking lgorithm tht mrks ll vribles X s.t. 9: X!. Then check if ll vribles in t re mrked. There re two cses: It is
1. If t hs no terminting computtion, then t 6 t 0 for every t 0 tht is rechble from t0, becuse t 0 is normed. Thus the nswer to the question is \no". 2. If t hs terminting computtion, then we hve the sme cse s in Lemm 4.1. The lgorithms used in Lemm 4.1 nd Lemm 4.2 hve non-elementry complexity, s they use the lgorithm from [CHM93] for deciding strong bisimilrity of BPPs. The only known lower bound is NP-hrdness. However, for the specil cse of two normed BPPs we cn give n ccurte complexity mesure. Lemm 4.3 Let t0 nd t be normed BPPs. It is decidble in NP if there is sequence t0! t 0 s.t. t t 0. Proof It suces to prove the property for normed mrkings 0 (corresponding to t0) nd (corresponding to t) of communiction-free net. As 0 is normed, every 0 rechble from 0 is normed. The norm [] of is t most exponentil. If correct 0 exists, then it must hve the sme norm s. So it cn contin t most exponentilly mny tokens nd cn therefore be described in polynomil spce. Thus it cn be reched by sequence of t most exponentil length [Esp95]. So the Prikh-vector of this sequence of trnsitions cn be described in polynomil spce. As nd 0 re normed, it is decidble in polynomil time if 0 [CHM93b]. The lgorithm goes like this: Nondeterministiclly guess Prikh-vector of trnsitions of polynomil size. Then check in polynomil time if there is reble sequence of trnsitions strting t 0 with this Prikh-vector [Esp95b], clculte the result 0 (lso in polynomil time) nd check in polynomil time if 0 [CHM93b]. 2 Theorem 4.4 The bisimultion-rechbility problem for normed BPP is NP-complete. Proof Directly from Lemm 4.3 nd Lemm 3.6. 2 2 5 Context-free processes Lemm 5.1 The bisimultion-rechbility problem is decidble for context-free processes if the initil stte t0 is normed or the given stte t hs terminting computtion. Proof The proofs re nlogous to the proofs of Lemm 4.1 nd Lemm 4.2. The lgorithm used for deciding bisimilrity of context-free processes is the one described in [CHS92]. 2 The complexity of the lgorithms used in Lemm 5.1 is non-elementry, becuse the lgorithm for deciding bisimilrity of context-free processes hs non-elementry complexity. Unfortuntely, there is no hrdness result yet. Lemm 3.1 does not crry over to context-free processes. However, just like for BPPs, the problem for two normed processes is esier to solve.
Theorem 5.2 The bisimultion-rechbility problem for normed context-free processes is decidble in exponentil spce. Proof Let t0 be the initil stte nd t the given stte. As t0 is normed, every t 0 tht is rechble from t0 is normed. The norm [t] of t is t most exponentil in size(t). If correct t 0 exists, then it must hve the sme norm s t nd cn therefore be described in exponentil spce. Now for ech of these cndidtes for t 0 with size(t 0 ) O(2 size(t) ) rst check if it is rechble from t0. This requires O(2 size(t) ) time s the rechbility problem for context-free processes is polynomil. Then check if it is bisimilr to t. As both t 0 nd t re normed the time needed for this is polynomil in size(t0) + size(t 0 ) size(t0) + O(2 size(t) ). This is becuse deciding bisimilrity for normed context-free processes is polynomil [HJM94]. So overll the lgorithm requires t most exponentil spce. 2 6 Normed PA-processes vs. nite stte systems As rst step we prove decidbility of the rechbility problem for PA-processes. Lemm 6.1 The rechbility problem for PA is decidble in polynomil spce. Proof Let n be the size of the instnce of the problem. We show tht if t cn be reched from t0, then it cn be reched vi pth s.t. the size of every intermedite stte t 0 is bounded by constnt c O(n 2 ). Every intermedite stte t 0 consists of three prts: A The stble prt. This prt will not chnge in the rest of the sequence nd will be prt of t. B The ctive prt. This prt will chnge in the rest of the sequence nd t lest prt of the result will be prt of t. C The wste prt. This prt will be reduced to in the rest of the sequence. It is vlid strtegy to reduce prt C to rst whenever C isn't empty, before doing nything else. It is cler tht the sum of the sizes of prt A nd B must never exceed size(t). To keep prt C smll we will rst reduce the ccessible vribles in C tht hve the lowest norm. How big cn prt C ever become if we follow this strtegy? Let m be the number of vribles in the PA-lgebr nd l the mximl size of the right hnd side of rule X! G. So the size of the wste descending from vrible X will never exceed (l? 1)(m? 2) + l. The size of the C -prt of t0 is t most size(t0)? 1 nd the wste generted by the ppliction of reduction rule is t most l? 1. Therefore the size of the C -prt of t 0 never exceeds mx(size(t0)? 1; l? 1) + (l? 1)(m? 2) + l. Thus size(t 0 ) size(t) + mx(size(t0)? 1; l? 1) + (l? 1)(m? 2) + l O(n 2 ). There re only exponentilly mny such terms t 0. So if t cn be reched t ll, then it cn be reched by sequence of t most exponentil length, nd thus the problem cn be decided in polynomil spce. 2
Remrk 6.2 The rgument in Lemm 6.1 bout the mximl length of the sequence needed to rech given term is somewht crude. A longer nd more creful nlysis of the structure of PA terms shows tht the problem is in fct NP-complete. However, in the sequel we only need continment in PSPACE. Theorem 6.3 Let t0 be normed PA-process nd R nite stte LTS with initil stte r0. It is decidble in PSPACE if there is sequence t0! t s.t. t r0. Proof It is decidble in polynomil time if r0 is normed. 1. If r0 is not normed then the nswer is \no". This is becuse t is lwys normed nd normed process is never bisimilr to n unnormed one. 2. If r0 is normed, then [r0] k? 1, where k is the number of sttes in R. So if ny correct t exists, then [t] = [r0] k? 1 nd thus size(t) k? 1. So there re only nitely mny cndidtes for t, ech of which hs only polynomil size. It remins to check for ech cndidte t if it is rechble from t0 nd if t r0. By Lemm 6.1 the rst condition cn be checked in polynomil spce. The second condition cn be checked in polynomil spce s well, s in bisimultion gme the size of child ^t of t must never exceed k? 1, becuse ^t nd r0 re normed nd R hs k sttes. Remrk 6.4 As the BPPs re subset of PA, the problem of Theorem 6.3 is t lest NP-hrd, becuse of Lemm 3.6. 2 7 The non-bisimultion-rechbility problem So fr we hve studied the bisimultion-rechbility problem: \Is there rechble stte tht is bisimilr to given stte?". The opposite question is if there is rechble stte tht is not bisimilr to given stte. This cn be generlized to nite sets of sttes. The non-bisimultion-rechbility problem. Instnce: An LTS with initil stte s nd nite set of given sttes fs1; : : : ; s n g. Question: Is there sequence of trnsitions s.t. s! s 0 nd 8i 2 f1; : : : ; ng: s 0 6 s i. In section 3 we hve shown tht the bisimultion-rechbility problem is undecidble for Petri nets (Theorem 3.2). On the other hnd the non-bisimultion-rechbility problem is decidble. Theorem 7.1 The non-bisimultion-rechbility problem is decidble for Petri nets. Proof Let N be Petri net with initil mrking nd 1 ; : : : ; n mrkings of N. Let R() be the set of rechble mrkings. There re two cses:
1. If j[r()] j = k n then there is nite stte LTS U with k sttes nd n initil stte u0 s.t. u0. If 9u 2 U :8i 2 f1; : : : ; ng:u 6 i then the nswer is \yes" else the nswer is \no". 2. In this cse the system (N ; ) hs more thn n dierent sttes w.r.t. strong bisimilrity (possibly even innitely mny). If j[r()] j > n then there is t lest one 0 2 R() s.t. 8i 2 f1; : : : ; ng: 0 6 i nd the nswer to the question is \yes". This yields decision procedure, becuse there re only nitely mny nite stte LTS with n sttes nd it is decidble if Petri net nd nite stte LTS re strongly bisimilr [JM95]. 2 8 Conclusion The bisimultion-rechbility problem is decidble for severl simple clsses of process lgebrs, but mny cses re still open. We conjecture tht the problem is decidble even for unnormed BPP nd context-free processes. Decidbility for (normed) PA-processes is lso open. To our knowledge, it isn't even known yet if strong bisimultion equivlence is decidble for (normed) PA-processes. Another interesting eld would be studying the sme problems for wek bisimultion equivlence. References [CHM93] S. Christensen, Y. Hirshfeld, nd F. Moller. Bisimultion equivlence is decidble for bsic prllel processes. In E. Best, editor, Proceedings of CONCUR 93, number 715 in LNCS. Springer Verlg, 1993. [CHM93b] S. Christensen, Y. Hirshfeld, nd F. Moller. Decomposbility, decidbility nd xiomtisbility for bisimultion equivlence on bsic prllel processes. In Proceedings of LICS93. IEEE Computer Society Press, 1993. [CHS92] [Esp95] S. Christensen, H. Huttel, nd C. Stirling. Bisimultion equivelence is decidble for ll context-free processes. In W.R. Clevelnd, editor, Proceedings of CONCUR 92, number 630 in LNCS. Springer Verlg, 1992. Jvier Esprz. Decidbility of model checking for innite-stte concurrent systems. Act Informtic, 1995. [Esp95b] Jvier Esprz. Petri nets, commuttive context-free grmmrs nd bsic prllel processes. In Horst Reichel, editor, Fundmentls of Computtion Theory, number 965 in LNCS. Springer Verlg, 1995. [HJM94] Y. Hirshfeld, M. Jerrum, nd F. Moller. A polynomil lgorithm for deciding bisimultion of normed context free processes. Technicl report, LFCS report series 94-286, Edinburgh University, 1994.
[Jn95] [JM95] P. Jncr. Undecidbility of bisimilrity for petri nets nd relted problems. Theoreticl Computer Science, 1995. P. Jncr nd F. Moller. Checking regulr properties of petri nets. In Insup Lee nd Scott A. Smolk, editors, Proceedings of CONCUR'95, number 962 in LNCS. Springer Verlg, 1995. [Mil89] R. Milner. Communiction nd Concurrency. Prentice Hll, 1989.