arxiv: v2 [cs.lo] 26 Dec 2016

Size: px
Start display at page:

Download "arxiv: v2 [cs.lo] 26 Dec 2016"

Transcription

1 On Negotition s Concurrency Primitive II: Deterministic Cyclic Negotitions Jvier Esprz 1 nd Jörg Desel 2 1 Fkultät für Informtik, Technische Universität München, Germny 2 Fkultät für Mthemtik und Informtik, FernUniversität in Hgen, Germny rxiv: v2 [cs.lo] 26 Dec 26 Astrct. We continue our study of negottions, concurrency model with multiprty negotition s primitive. In previous pper [7] we hve provided correct nd complete set of reduction rules for sound, cyclic, nd (wekly) deterministic negotitions. In this pper we extend this result to ll deterministic negotitions, including cyclic ones. We lso show tht this set of rules llows one to decide soundness nd to summrize negotitions in polynomil time. Retrction Unfortuntely, while prepring journl version of this contriution we hve discovered tht Lemm 6 is wrong. Since the lemm is used in line 3 of the reduction procedure descried in Section 5.4, the procedure is lso incorrect. We hve uploded preprint of the journl version to rxiv ( The preprint contins counterexmple to Lemm 6 (see Section 7.7). It lso presents corrected reduction procedure with the sme chrcteristics s the incorrect one. So, fortuntely, while the specific reduction procedure presented in this contriution is wrong, our min results still hold: The merge, itertion, nd shortcut reduction rules re complete for the clss of sound nd deterministic negotitions, i.e., they completely reduce ll nd only the sound deterministic negotitions to n tomic negotition. There exists polynomil p(x) such tht every sound deterministic negotition of size n cn e reduced to n tomic negotition y mens of t most p(n) pplictions of the reduction rules. There exists polynomil-time lgorithm tht, given sound deterministic negotition of size n, constructs reduction sequence of length t most p(n). 1 Introduction Negotition hs long een identified s prdigm for process interction [5]. It hs een pplied to different prolems (see e.g. [15, 3]), nd studied on its own [14]. However, it hs not yet een studied from concurrency-theoretic point of view. In [7] we hve initited study of negotition s communiction primitive.

2 2 Oservtionlly, negotition is n interction in which severl prtners come together to gree on one out of numer of possile outcomes ( synchronized nondeterministic choice). In [7] we hve introduced negotitions, Petri-net like concurrency model comining multiprty tomic negotitions or toms into more complex distriuted negotitions. Ech possile outcome of n tom hs ssocited stte-trnsformer. Negotition prtners enter the tom in certin initil sttes, nd leve it in the sttes otined y pplying to the initil sttes the stte-trnsformer of the outcome greed upon. Atoms re comined into more complex, distriuted negotitions, y mens of next-toms function tht determines for ech tom, negotiting gent, nd outcome, the set of toms the gent is redy to engge in next if the tom ends with tht outcome. Negotitions re close to colored version of vn der Alst s workflow nets [1]. Like in workflow nets, distriuted negotitions cn e unsound ecuse of dedlocks or livelocks. The soundness prolem consists of deciding if given negotition is sound. Moreover, sound negotition is equivlent to single tom whose stte trnsformtion function determines the possile finl internl sttes of ll prties s function of their initil internl sttes. The summriztion prolem consists of computing such n tomic negotition, clled summry. Negotitions cn simulte 1-sfe Petri nets (see the rxiv version of [7]), which proves tht the soundness prolem nd ( decision version of) the summriztion prolem re, unsurprisingly, PSPACE-complete. For this reson we hve studied in [7] two nturl clsses: deterministic nd wekly deterministic negotitions. Only deterministic negotitions re relevnt for this pper. Loosely speking, negotition is deterministic if, for ech gent nd ech outcome of n tomic negotition, the next-tom function yields only one next tom, i.e., ech gent cn lwys engge in one tom only. In prticulr, we hve shown in [7] tht the soundness nd summriztion prolems for cyclic deterministic negotitions cn e solved in polynomil time. (Notice tht the stte spce of deterministic negotition cn e exponentilly lrger then the negotition itself). The lgorithm tkes the grphicl representtion of reduction procedure in which the originl negotition is progressively reduced to simpler one y mens of set of reduction rules. Ech rule preserves soundness nd summries (i.e., the negotition efore the ppliction of the rule is sound iff the negotition fter the ppliction is sound, nd oth hve the sme summry). Reduction rules hve een extensively pplied to Petri nets or workflow nets, ut most of this work hs een devoted to the liveness or soundness prolems [4, 11, 12, 10, 6], nd mny rules, like for exmple the liner dependency rule of [6], do not preserve summries. In [7] we conjectured tht the ddition of simple rule llowing one to reduce trivil cycles yields complete set of rules for ll sound deterministic negotitions. In this pper we prove this result, nd show tht the numer of rule pplictions required to summrize negotition is still polynomil. While the new rule is very simple, the proof of our result is very involved. It is structured in severl sections, nd some technicl proofs hve een moved to

3 3 n ppendix. More precisely, the pper is structured s follows. Sections 2 nd 3 presents the min definitions of [7] in compct form. Section 4 introduces our set of three reduction rules. Section 5 proves tht the rules summrize ll sound deterministic negotitions. Section 6 proves tht the summriztion requires polynomil numer of steps. 2 Negotitions: Syntx nd Semntics We recll the min definitions of [7], nd refer to this pper for more detils. We fix finite set A of gents. Ech gent A hs (possily infinite) nonempty set Q of internl sttes. We denote y Q A the crtesin product A Q. A trnsformer is left-totl reltion τ Q A Q A. Given S( A, we sy tht trnsformer τ is n S-trnsformer ) if, for ech i / S, (q 1,..., q i,..., q A ), (q 1,..., q i,..., q A ) τ implies q i = q i. So n S-trnsformer only trnsforms the internl sttes of gents in S. Definitio. A negotition tom, or just n tom, is triple n = (P n, R n, δ n ), where P n A is nonempty set of prties, R n is finite, nonempty set of outcomes, nd δ n is mpping ssigning to ech outcome r in R n P n -trnsformer δ n (r). Intuitively, if the sttes of the gents efore negotition n re given y tuple q nd the outcome of the negotition is r, then the gents chnge their sttes to q for some (q, q ) δ n (r). For simple exmple, consider negotition tom n FD with prties F (Fther) nd D (teenge Dughter). The gol of the negotition is to determine whether D cn go to prty, nd the time t which she must return home. The possile outcomes re yes (y) nd no. Both sets Q F nd Q D contin stte plus stte t for every time T 1 t T 2 in given intervl [T 1, T 2 ]. Initilly, F is in stte t f nd D in stte t d. The trnsformer δ nfd is given y δ nfd (yes) = {((t f, t d ), (t, t)) t f t t d t d t t f } δ nfd (no) = {((t f, t d ), (, )) } 2.1 Comining tomic negotitions A negotition is composition of toms. We dd trnsition function X tht ssigns to every triple (n,, r) consisting of n tom n, prticipnt of n, nd n outcome r of n set X(n,, r) of toms. Intuitively, this is the set of tomic negotitions gent is redy to engge in fter the tom n, if the outcome of n is r. Definitio. Given finite set of toms N, let T (N) denote the set of triples (n,, r) such tht n N, P n, nd r R n. A negotition is tuple N = (N, n 0, n f, X), where n 0, n f N re the initil nd finl toms, nd X: T (N) 2 N is the trnsition function. Further, N stisfies the following properties: (1) every gent of A prticiptes in oth n 0 nd n f ; (2) for every (n,, r) T (N): X(n,, r) = iff n = n f.

4 4 n 0 F D st st F D m y,n y,n,m y,n M st D M y,n n f F D M n n 0 F y F r y n f y D D M tm tm n r n r F D M y F D M y y Fig. 1. Acyclic nd cyclic negotitions. Negotitions re grphiclly represented s shown in Figure 1. For ech tom n N we drw lck r; for ech prty of P n we drw white circle on the r, clled port. For ech (n,, r) T (N), we drw hyperrc leding from the port of in n to ll the ports of in the toms of X(n,, r), nd lel it y r. Figure 1 shows two Fther-Dughter-Mother negotitions. On the left, Dughter nd Fther negotite with possile outcomes yes (y), no (n), nd sk mother (m). If the outcome is the ltter, then Dughter nd Mother negotite with outcomes yes, no. In the negotition on the right, Fther, Dughter nd Mother negotite with outcomes yes nd no. If the outcome is yes, then Fther nd Dughter negotite return time (tom ) nd propose it to Mother (tom ). If Mother pproves (outcome yes), then the negotition termintes, otherwise (outcome r) Dughter nd Fther renegotite the return time. For the ske of revity we do not descrie the trnsformers of the toms. Definition 3. The grph ssocited to negotition N = (N, n 0, n f, X) is the directed grph with vertices N nd edges {(n, n ) N N (n,, r) T (N): n X(n,, r)}. The negotition N is cyclic if its grph hs no cycles, otherwise it is cyclic. The negotition on the left of Figure 1 is cyclic, the one the right is cyclic. 2.2 Semntics A mrking of negotition N = (N, n 0, n f, X) is mpping x: A 2 N. Intuitively, x() is the set of toms tht gent is currently redy to engge in next. The initil nd finl mrkings, denoted y x 0 nd x f respectively, re given y x 0 () = {n 0 } nd x f () = for every A. A mrking x enles n tom n if n x() for every P n, i.e., if every prty of n is currently redy to engge in it. If x enles n, then n cn tke plce nd its prties gree on n outcome r; we sy tht (n, r) occurs. Ausing lnguge, we will cll this pir lso n outcome. The occurrence of (n, r) produces next mrking x given y x () = X(n,, r) for every P n, nd x () = x()

5 for every A \ P n. We write x (n,r) x to denote this, nd cll it smll step. By this definition, x() is lwys either {n 0 } or equls X(n,, r) for some tom n nd outcome r. The mrking x f cn only e reched y the occurrence of (n f, r) (r eing possile outcome of n f ), nd it does not enle ny tom. Any other mrking tht does not enle ny tom is considered dedlock. Rechle mrkings re grphiclly represented y plcing tokens (lck dots) on the forking points of the hyperrcs (or in the middle of n rc). Figure 1 shows on the right mrking in which F nd D re redy to engge in nd M is redy to engge in. σ We write x 1 to denote tht there is sequence x 1 (,r 1) x 2 (,r 2) (n k 1,r k 1 ) x k (n k,r k ) x k+1 σ of smll steps such tht σ = (, r 1 )... (n k, r k ).... If x 1, then σ is n occurrence sequence from the mrking x 1, nd x 1 enles σ. If σ is finite, then σ we write x 1 x k+1 nd sy tht x k+1 is rechle from x 1. If x 1 is the initil mrking then we cll σ initil occurrence sequence. If moreover x k+1 is the finl mrking, then σ is lrge step. Negotitions nd Petri nets. A negotition cn e ssoicted n equivlent Petri net with the sme occurrence sequences (see [7], rxiv version). However, in the worst cse the Petri net is exponentilly lrger Soundness Following [1, 2], we introduce notion of well-formedness of negotition: Definition 4. A negotition is sound if () every tom is enled t some rechle mrking, nd () every occurrence sequence from the initil mrking is either lrge step or cn e extended to lrge step. The negotitions of Figure 1 re sound. However, if we set in the left negotition X(n 0, M, st) = {n DM } insted of X(n 0, M, st) = {n DM, n f }, then the occurrence sequence (n 0, st)(n FD, yes) leds to dedlock. Definition 5. Given negotition N = (N, n 0, n f, X), we ttch to ech outcome r of n f summry trnsformer N, r s follows. Let E r e the set of lrge steps of N tht end with (n f, r). We define N, r = σ E r σ, where for σ = (, r 1 )... (n k, r k ) we define σ = δ n1 (r 1 ) δ nk (r k ) (ech δ ni (r i ) is reltion on Q A ; conctention is the usul conctention of reltions). N, r (q 0 ) is the set of possile finl sttes of the gents fter the negotition concludes with outcome r, if their initil sttes re given y q 0.

6 6 Definition 6. Two negotitions N 1 nd N 2 over the sme set of gents re equivlent if they re either oth unsound, or if they re oth sound, hve the sme finl outcomes (outcomes of the finl tom), nd N 1, r = N 2, r for every finl outcome r. If N 1 re equivlent nd N 2 nd N 2 consists of single tom, then N 2 is the summry of N 1. Notice tht, ccording to this definition, ll unsound negotitions re equivlent. This mounts to considering soundness essentil for negotition: if it fils, we do not cre out the rest. 3 Deterministic Negotitions We introduce deterministic negotitions. Definition 7. A negotition N is deterministic if for every (n,, r) T (N) there is n tom n such tht X(n,, r) = {n } In the rest of the pper we write X(n,, r) = n insted of X(n,, r) = {n }. Grphiclly, negotition is deterministic if there re no proper hyperrcs. The negotition on the left of Figure 1 is not deterministic (it contins proper hyperrc for Mother), while the one on the right is deterministic. In the sequel, we often ssume tht negotition is sound nd deterministic, nd revite sound nd deterministic negotition to SDN. 4 Reduction Rules for Deterministic Negotitions We present three equivlence-preserving reduction rules for negotitions. Two of them were lredy introduced in [7], while the itertion rule is new. A reduction rule, or just rule, is inry reltion on the set of negotitions. R Given rule R, we write N 1 N 2 for (N 1, N 2 ) R. A rule R is correct if R it preserves equivlence, i.e., if N 1 N 2 implies N 1 N 2. In prticulr, this implies tht N 1 is sound iff N 2 is sound. Given set of rules R = {R 1,..., R k }, we denote y R the reflexive nd trnsitive closure of R 1... R k. We sy tht R is complete with respect to clss of negotitions if, for every negotition N in the clss, there is negotition N consisting of single tom such tht N R N. We descrie rules s pirs R of gurd nd n ction; N 1 N 2 holds if N 1 stisfies the gurd nd N 2 is possile result of pplying the ction to N 1. Slightly more generl versions of the following rules hve een presented in [7]. Here we only consider deterministic negotitions. Merge rule. Intuitively, the merge rule merges two outcomes with identicl next enled toms into one single outcome.

7 7 Definition 8. Merge rule Gurd: N contins n tom n with two distinct outcomes r 1, r 2 R n such tht X(n,, r 1 ) = X(n,, r 2 ) for every A n. Action: (1) R n (R n \ {r 1, r 2 }) {r f }, where r f is fresh nme. (2) For ll P n : X(n,, r f ) X(n,, r 1 ). (3) δ(n, r f ) δ(n, r 1 ) δ(n, r 2 ). Shortcut rule. Inituitively, the shortcut rule merges the outcomes of two toms tht cn occur one fter the other into one single outcome with the sme effect. Figure 6 illustrtes the definition (ignore the ig circle for the moment): the outcome (n, r f ), shown in red, is the shortcut of the outcome (n, r) followed y the outcome (n, r ). Definition 9. Given toms n, n, we sy tht (n, r) unconditionlly enles n if P n P n nd X(n,, r) = n for every P n. Oserve tht if (n, r) unconditionlly enles n then, for every mrking x tht enles n, the mrking x given y x (n,r) x enles n. Moreover, n cn only e disled y its own occurrence. Definitio0. Shortcut rule for deterministic negotitions Gurd: N contins n tom n with n outcome r, nd n tom n, n n, such tht (n, r) unconditionlly enles n. Action: (1) R n (R n \ {r}) {r f r R n }, where r f re fresh nmes. (2) For ll P n, r R n : X(n,, r f ) X(n,, r ). For ll P \ P n, r R n : X(n,, r f ) X(n,, r). (3) For ll r R n : δ n (r f ) δ n(r)δ n (r ). (4) If X 1 (n ) = fter (1)-(3), then remove n from N, where X 1 (n ) = {(ñ, ã, r) T (N) n X(ñ, ã, r)}. Itertion rule. Loosely speking, the itertion rule replces the itertion of negotition y one single tom with the sme effect. Definitio1. Itertion rule Gurd: N contins n tom n with n outcome r such tht X(n,, r) = n for every prty of n. Action: (1) R n {r f r R n \ {r}}. (2) For every r f R n: δ n (r f ) δ n(r) δ n (r ). It is importnt to notice tht reductions preserve determinism: Propositio. If negotition N is deterministic nd the ppliction of the shortcut, merge or itertion rule yields negotition N then N is deterministic, too. Theorem 1. The merge, shortcut, nd itertion rules re correct.

8 8 Proof. Correctness of the merge nd itertion rules is ovious. The correctness of more generl version of the shortcut rule is proved in [7] 3. 5 Completeness In [7] we show tht every sound nd wekly deterministic cyclic negotition cn e summrized to single tom, nd tht in the deterministic cse the numer of rule pplictions is polynomil (ctully, [7] provides shrper ound thn the one in this theorem): Theorem 2 ([7]). Every sound deterministic cyclic negotition N cn e reduced to single tom y mens of N 2 + Out(N) pplictions of the merge nd shortcut rules, where N is the set of toms of N, nd Out(N) is the set of ll outcomes of ll toms of N. In the rest of the pper section we prove tht, surprisingly, the ddition of the very simple itertion rule suffices to extend this result to cyclic deterministic negotitions, lthough with higher exponent. The rgument is complex, nd requires detiled nlysis of the structure of SDNs. In this section we present the completeness proof, while the complexity result is presented in the next. We illustrte the reduction lgorithm y mens of n exmple. Figure 2 () shows cyclic SDN similr to the Fther-Dughter-Mother negotition on the right of Figure 1. We identify n lmost cyclic frgment, nmely the frgment coloured lue in the figure. Intuitively, lmost cyclic mens tht the frgment cn e otined y merging the initil nd finl toms of n cyclic SDN; in our exmple, this is the lue cyclic SDN shown in Figure 2 (). This cyclic SDN cn e summrized using the shortcut nd merge rules. If we pply the sme sequence of rules to the lue frgment (with the exception of the lst rule, which reduces negotition with two different toms nd one single outcome to n tomic negotition) we otin the negotition shown in (c). The lue self-loop cn now e eliminted with the help of the itertion rule, nd the procedure cn e iterted: We identify n lmost cyclic frgment, coloured red. Its reduction yields the the negotition shown in (e). The self-loop is eliminted y the itertion rule, yielding n cyclic negotition, which cn e summrized. In order to prove completeness we must show tht every cyclic SDN contins t lest one lmost cyclic frgment, which is non-trivil. The proof hs three prts: We first show tht every cyclic SDN hs loop: n occurrence sequence from some rechle mrking x ck to x. Then we show tht ech miniml loop hs synchronizer: n tom involving ech gent tht is prty of ny tom of the loop. Finlly we show how to use synchronizers to identify nonempty nd lmost cyclic frgment. 3 The rule of [7] hs n dditionl condition in the gurd which is lwys true for deterministic negotitions.

9 9 () (c) (e) n 0 n 3 n 4 n 5 n f () (d) n 4 Fig. 2. The reduction procedure 5.1 Lssos nd Loops Definitio2. A lsso of negotition is pir (ρ, σ) of occurrence sequences ρ such tht σ is not the empty sequence nd x 0 x σ x for some mrking x. A loop is n occurrence sequence σ such tht (ρ, σ) is lsso for some occurrence sequence ρ. A miniml loop is loop σ stisfying the property tht there is no other loop σ such tht the set of toms in σ is proper suset of the set of toms in σ. Oserve tht lssos nd loops re ehviourl notions, i.e., structures of the rechility grph of negotition. The following result estlishes reltions etween loops nd cycles, where cycles re defined on the grph of negotition. Lemm 1. (1) Every cyclic SDN hs loop.

10 10 (2) The set of toms of miniml loop genertes strongly connected sugrph of the grph of the considered negotition. Proof. (1) Let π e cycle of the grph of the negotition N. Let e n ritrry tom occurring in π, nd let e its successor in π. We hve n f ecuse n f hs no successor, nd hence no cycle contins n f. By soundness, some rechle mrking x 1 enles. There is n gent nd result r such tht X(,, r) contins. By determinism we hve (,r) X(,, r) = { }. Let x 1 x 1. Agin y soundness, there is n occurrence sequence from x 1 tht leds to the finl mrking. This sequence necessrily contins n occurrence of ecuse this is the only tom gent is redy to engge in. In prticulr, some prefix of this sequence leds to mrking x 2 tht enles. Repeting this rgument for ll nodes,, n 3,..., n k = of the cycle π, we conclude tht there is n infinite occurrence sequence, contining infinitely mny occurrences of toms of the cycle π. Since the set of rechle mrkings is finite, this sequence contins loop. (2) For ech gent involved in ny tom of the loop, consider the sequence of toms this gent is involved in. By the definition of the grph of the negotition, this sequence is pth of the grph. It is moreover (not necessrily simple) cycle of teh grph, ecuse loop strts nd ends with the sme mrking. So the sugrph generted y the toms in the loop is covered y cycles. It is moreover strongly connected ecuse, for ech proper strongly connected component, the projection of the toms of the loop onto the toms in the component is smller loop, contrdicting the minimlity of the loop. 5.2 Synchronizers Definitio3. A loop σ = (, r 1 )... (n k, r k ) is synchronized if there is n tom n i in σ such tht P j P i for every 1 j k, i.e., every prty of every tom in the loop is lso prty of n i. We cll n i synchronizer of the loop. An tom is synchronizer of negotition if it is synchronizer of t lest one of its loops. Oserve tht ech loop x (n,r) x is synchronized. In the grph ssocited to negotition, such loop ppers s self-loop, i.e., s n edge from tom n to tom n. Some of the loops of the SDN shown in Figure 2 () re (, ) (, ) (n 4, ) (n 5, ), (, ) (n 3, ) (n 5, ), nd (, ) (n 4, ). The first loop is synchronized y (, ) nd y (n 5, ), the two others re synchronized y ll their outcomes. The min result of this pper is strongly sed on the following lemm. Lemm 2. Every miniml loop of SDN is synchronized.

11 11 Proof. Let σ e miniml loop, enled t rechle mrking x. Define N σ s the set of toms tht occur in σ nd A σ s the set of gents involved in toms of N σ. Since N is sound, there is n occurrence sequence σ f enled y x tht ends with the finl tom n f. Now choose n ritrry gent â of A σ. Using σ f, we construct pth π of the grph of N s follows: We egin this pth with the lst tom n N σ tht ppers in σ f nd involves gent â. We cll this tom n π. Then we repetedly choose the lst tom in σ f tht involves â nd moreover is successor of the lst vertex of the pth constructed so fr. By construction, this pth hs no cycles (i.e., ll vertices re distinct), strts with n tom of N σ nd hs not further toms of N σ, ends with n f, nd only contins toms involving â. Since x enles the loop σ nd since n π N σ, fter some prefix of σ mrking x π is reched which enles n π. The loop σ continues with some outcome (n π, r 1 ), where r 1 is one possile result of n π. By construction of the pth π, there is n lterntive result r 2 of n π such tht X(n π, â, r 2 ) is the second tom of the pth π, nd this tom does not elong to N σ. Let x π e the mrking reched fter the occurrence of (n π, r 2 ) t x π. From x π, we itertively construct n occurrence sequence s follows: (1) if n tom n of N σ is enled nd thus some (n, r) occurs in σ, we continue with (n, r), (2) otherwise, if n tom n of the pth π is enled, we let this tom occur with n outcome r such tht X(n, â, r) is the successor tom w.r.t. the pth π, (3) otherwise we dd miniml occurrence sequence tht either leds to the finl mrking or enles n tom of σ or n tom of π, so tht fter this sequence one of the previous rules cn e pplied. Such n occurrence sequence exists ecuse N is sound nd hence the finl mrking cn e reched. First oserve tht gent â will lwys e redy to engge only in n tom of the pth π. So its token is moved long π. Conversely, ll toms of π involve â. Therefore only finitely mny toms of π occur in the sequence. This limits the totl numer of occurrences of type (2). Agent â is no more redy to engge in ny tom of N σ during the sequence. So t lest n π cnnot occur ny more in the sequence ecuse â is prty of n π. By minimlity of the loop σ, there is no loop with set of toms in N σ \ {n π }. Since the set of rechle mrkings is finite, there cnnot e n infinite sequence of toms of N σ (type (1)) without occurrences of other toms. By determinism, ech gent redy to engge in n tom of N σ cn only engge in this tom. So the set of these gents is only chnged y occurrences of type (1). By construction, no gent ever leves the loop fter the occurrence of (n π, r 2 ), i.e. every gent of this set remins in this set y n occurrence of type (1). Therefore, the set of gents redy to engge in n tom of N σ never decreses. For ech sequence of type (3) we hve three possiilities. () It ends with the finl mrking.

12 12 () It ends with mrking tht enles n tom of (2), which then occurs next. However, toms of (2) cn occur only finitely often in the constructed sequence, s lredy mentioned. (c) It ends with mrking tht enles n tom of (1) which then occurs next. In tht cse the lst outcome of this sequence necessrily involves n gent of A σ, which fter this occurrence is redy to engge in n tom of N σ. So it increses the numer of gents redy to engge in n tom of N σ. Since this numer never decreses, this option cn lso hppen only finitely often. Hence, eventully only option () is possile, nd the sequence will rech the finl mrking. Since the finl tom involves ll gents, no gent ws le to remin in the loop. In other words: ll gents of A σ left the loop when (n π, r 2 ) hs occurred. As consequence, ll these gents re prties of n π, nd n π therefore is synchronizer of the loop σ. Oserve tht this lemm does not hold for ritrry (i.e., non-deterministic) sound negotitions. For the negotition on the right of Figure 3 (ll toms hve only one outcome, whose nme is omitted), the sequence is loop without synchronizers. The negotition on the left shows tht Lemm 3(1) lso holds only in the deterministic cse. It is sound nd cyclic, ut hs no loops, ecuse the only ig step is n 0 n f (the nme of the outcome is gin omitted). n 0 n 0 n f n f Fig. 3. Two sound nd cyclic negotitions 5.3 Frgments We ssign to ech tom n of n SDN frgment F n s follows: we tke ll the loops synchronized y n, nd (informlly) define F n s the toms nd outcomes tht pper in these loops. Figure 4 () nd (c) show F n1 nd F n2 for the SDN of Figure 2. Since cyclic SDN hs t lest one loop nd hence lso miniml one, nd since every loop hs synchronizer, t lest one of the frgments of cyclic SDN is nonempty. Given frgment F n, let N n denote the negotition otined y, intuitively, splitting the tom n into n initil nd finl tom. Figure 4 () nd (d)

13 13 show the splittings N n1 nd N n2 of F n1 nd F n2. Not ll frgments re lmost cyclic. For instnce, N n1 is not cyclic, nd so F n1 is not lmost cyclic. However, we prove tht if frgment is not lmost cyclic, then it contins smller frgment (for instnce, F n1 contins F n2 ). This shows tht every miniml frgment is lmost cyclic. () () (c) (d) n 3 n 4 n 5 n 3 n 4 n 5 n 4 n 4 Fig. 4. Frgments of the SDN of Figure 2() nd their splittings Definitio4. Let L e set of loops of N. Ausing lnguge, we write (n, r) L resp. n L to denote tht (n, r) resp. n ppers in some loop of L. The projection of n tom n = (P n, R n, δ n ) L onto L is the tom n L = (P L, R L, δ L ), where P L = P n, R L = {r (n, r) L}, nd δ L ((n L, r)) = δ((n, r)) for every (n, r) L. Definitio5. Let s e n tom of negotition N, nd let L e the set of loops synchronized y s. The s-frgment of N is the pir F s = (F s, X s ), where F s = {n L n L} nd X s (n L,, r) = X(n,, r) for every P L nd r R L. The s-negotition of N is the negotition N s = (N s, n s0, n sf, X s), where N s contins the toms of F s plus fresh tom n sf ; n s0 = s L ; nd For every n L F s, P L, nd r R L : { X X(n,, r) if X(n,, r) s s(n L,, r) = otherwise n sf The following proposition proves some sic properties of s-negotitions. Propositio. Let s e n tom of negotition N. If N is SDN, then N s is SDN.

14 14 Proof. Let n e n tom of N n. By definition, there is lsso (ρ, σ) of N, synchronized y n, such tht n ppers in σ. By the definition of N n, we hve tht σ is n occurrence sequence of N n, nd so tht n cn occur in N n. Assume now tht σ is n occurrence sequence of N n tht is not lrge step of N n nd cnnot e extended to lrge step of N n. W.l.o.g. we cn ssume tht σ does not enle ny tom of N n. Let x e the mrking reched y σ. It follows esily from the definition of N n tht there is n occurrence sequence ρσ of N. Moreover, if x e the mrking reched y this sequence, then x is the projection of x onto the set P of prties of n. By soundness there is mximl occurrence sequence ρρ such tht ρ contins only toms with prties in A \ P n. Clerly ρρ σ is n occurrence sequence of N. Let x e the mrking reched y ρρ σ. Clerly, we still hve tht x is the projection of x onto P. We clim tht x is dedlock, contrdicting the soundness of N. To prove the clim, ssume tht x enles some tom n with set of prties P. If P P t, then n is lso enled t x, contrdicting tht σ does not enle ny tom of N n. If P A \ P, then ρρ enles n, contrdicting the mximlity of ρρ. Finlly, if P P P (A \ P ), then there is n gent P such tht x () / N n. But y definition of σ we hve x () N n, contrdicting tht x is the projection onto P of x. Lemm 3. A cyclic SDN contins n tom n such tht N n is n cyclic SDN. Proof. Let N e cyclic SDN. By Lemm 3, N hs loop nd hence lso miniml loop. By Lemm 4 this loop hs synchronizer n, nd so N n is nonempty. Choose n so tht N n is nonempty, ut its numer of toms is miniml. We clim tht N n is cyclic. Assume the contrry. By Lemm 3, N n is SDN. By Lemms 3 nd 4, exctly s ove, N n contins n tom n such tht N nn is nonempty. Clerly, N nn contins fewer toms thn N n nd is isomorphic to N n. This contrdicts the minimlity of N n. The exmple on the left of Figure 3 shows tht this result does not hold for the non-deterministic cse. 5.4 The reduction procedure We cn now finlly formulte reduction procedure to summrize n ritrry SDN. Input: deterministic negotition N 0 ; 1 N result of exhustively pplying the merge rule to N 0 ; 2 while N is cyclic do 3 select s N such tht N s is cyclic; 4 pply to N the sequence of rules used to summrize N s (ut the lst); 5 pply the itertion rule to s; 6 exhustively pply the merge rule 7 pply the reduction sequence of Theorem 2

15 15 Theorem 3. The reduction procedure returns summry of N 0 iff N 0 is sound. Proof. By induction on the numer k of toms of N tht synchonize t lest one loop. If k = 0, then y Lemm 3 nd 4 N is cyclic, nd the result follows from Theorem 2. If k > 0, then y Lemm 6 N contins n lmost cylic frgment F s, nd so N s is cyclic. Since the sequence of rules of line 4 summrizes N s, its ppliction to N ends with negotition hving unique self-loop-outcome on s. After removing this outcome with the itertion rule in line 5, we otin SDN with k 1 synchronizers, which cn e summrized y induction hypothesis (line 6 is not necessry for completeness, ut required for the complexity result of the next section). 6 Complexity We nlyze the numer of rule pplictions required y the reduction procedure. Let N i = (N i, n 0i, n fi, X i ) e the negotition efore the i-th execution of the while oop. The next lemm collects some sic properties of the sequence N 1, N 2,.... Lemm 4. For every i 1: () N i+1 N i ; () the merge rule cnnot e pplied to N i ; nd (c) N i+1 hs fewer synchronizers thn N i. In prticulr, y (c) the while loop is executed t most N 1 = N 0 times. Proof. Prts () nd () follow immeditely from the definitions of the rules nd the reduction lgorithm. For (c), we oserve tht every synchronizer of N i+1 is synchronizer of N i, ut the tom s selected t the i-th loop execution is not synchronizer of N i+1, ecuse ll loops synchronized y s re collpsed to self-loops on s during the i-th itertion of the loop, nd then removed y the itertion rule. By Theorem 2, during the i-th itertion of the while loop line 4 requires t most N i 2 + Out(N i ) rule pplictions. Line 5 only requires one ppliction. Now, let N i e the negotition otined fter the execution of line 5. The numer of rule pplictions of line 6 is clerly ounded y the numer of outcomes of Out(N i ). For the totl numer of rule pplictions Appl(N 0) we then otin. Lemm 5. N 0 Appl(N 0 ) O( N N 0 Out(N i ) + Out(N i) ) i=1

16 16 Proof. N 0 Appl(N 0 ) ( N i 2 + Out(N i ) Out(N i) ) i=1 N 0 ( N Out(N i ) + Out(N i) ) i=1 Lemm 4(c), Theorem 2 Lemm 4() O( N N 0 N 0 i=1 Out(N i) + Out(N i ) ) However, we cnnot yet ound Appl(N 0 ) y polynomil in N 0 nd Out(N 0 ), ecuse, in principle, the numer of outcomes of N i or N i might grow exponentilly with i. Indeed, the shortcut rule cn increse the numer of outcomes. Consider the degenerte negotition N with only one gent shown in Figure 5(). N hs one single loop, nmely (, ) (n 3, ) (n 4, ). The frgment F n1 is n 0 n 3 c n n 3 c n 0 n 3 c n 0 n 3 c n 4 n 5 n 6 n 4 n 5 n 6 n 4 n 5 n 6 n 4 n 5 n 6 n n 4 n 1 n 4 n 1 n 1 () () (c) (d) Fig. 5. Reducing n SND with one gent shown in lue, nd N n1 is shown elow N. The negotition N n1 cn e summrized y mens of three plictions of the shortcut rule, shown in the lower row of the figure. The upper row shows the result of ppliction of the sme rules to N. The first ppliction removes n 3 from N n1 ut not from N, ecuse n 3 hs more thn one input rc in N (Figure 5()). Moreover, the rule dds three

17 outcomes to N, shown in red. The second ppliction removes n 4 from N n1 ut not from N, nd dds two new outcomes (, 4 ) nd (, 5 ) (Figure 5(c)). The third ppliction removes n 1 from N n1 ; in N it is replced y n ppliction of the itertion rule, yielding the negotition t the top of Figure 5(d), which hs two outcomes more thn the initil one. To solve this prolem we introduce trgets nd exits Sources, trgets, nd exits Definitio6. Let N = (N, n 0, n f, X) e negotition, nd let (n, r) e n outcome. The source of (n, r) is n. The trget of (n, r) is the prtil function A N tht ssigns to every prty P n the tom X(n,, r), nd is undefined for every A \ P n. The set of trgets of N, denoted y T(N), contins the trgets of ll outcomes of N. Consider the reduction process from N i to N i+1. It proceeds y pplying to N i the sme sequence of rules tht summrizes n cyclic negotition N s. This sequence progressively reduces the frgment F s until it consists of selfloops on the tom s, which cn then e reduced y the itertion rule. However, the sequence lso produces new outcomes of s tht leve F s, nd which ecome outcomes of N i+1 not present in N i. Consider for instnce Figure 6(), which sketches n ppliction of the shorcut rule. The outcome (n, r) unconditionlly enles n, whose outcome (n, r ) mkes the left gent leve F s. The trget of (n, r f ) ssigns the gents of the negotitions to toms, nd n 3, respectively. This trget is different from the trgets of the other toms in the figure. F s F s r f r r r f r r n r n r f n 3 r f r r f r r r n r r n r f n 3 () () Fig. 6. Exits of SNDs We investigte the sources nd trgets of outcomes tht leve F s. We cll them exits of F s.

18 18 Definitio7. Let F s e frgment of N. An exit of F s is n outcome (n, r) Out(N) such tht n F s ut (n, r) / Out(F s ). The following lemm presents key property of the exits of frgments of SDNs: the occurrence of n exit (n, r) of F s forces ll gents of P s to leve the frgment F s. In other words: ll gents of P s re prties of n, nd the occurrence of (n, r) does not led ny gent ck to n tom of F s. Lemm 6. Let F s e frgment of SDN N, nd let (e, r e ) e n exit of F s. Then e hs the sme gents s s (i.e., e is lso synchronizer of F s ), nd X(e,, r e ) / F s for every gent of e. Proof. We proceed indirectly nd ssume tht either P e P s (P e P s y the definition of frgment) or X(e,, r e ) F s for some P e. Then t lest one gent h P s stisfies either h / P e or X(e, h, r e ) F s. We cll h home gent (intuitively, n gent tht does not leve home, i.e., F s, y the occurrence of the exit). We show tht the existence of h leds to contrdiction. We prtition the set of A of gents into internl gents, the gents of P s, nd externl gents, the gents of A \ P s. We lso prtition the set of toms: n tom is internl if it hs only internl prties, otherwise it is externl. Clerly ll toms of F s re internl, ut there cn lso e internl toms outside F s. If P s contins ll gents of the negotition, then ll gents re internl, nd so re ll toms (lso the finl tom n f ). Otherwise t lest n f hs n externl prty nd is hence n externl tom. Next we define function p: N Out(N) tht ssigns to ech tom one of its outcomes (the preferred outcome). p is defined for internl nd externl toms seprtely, i.e., it is the union of functions p i ssigning outcomes to internl toms, nd p e ssigning outcomes to externl toms. If there re externl toms, nd hence n f is externl, p e is defined s follows. First we set p e (n f ) to n ritrry outcome of n f. Then we proceed itertively: If some externl tom n hs n outcome r nd n externl gent such tht p e (X(n,, r)) is defined, then set p e (n) := r (if there re severl possiilities, we choose one of them ritrrily). At the end of the procedure p e is defined for every externl tom, ecuse ech externl tom n hs n externl gent, sy, nd, since prticiptes in n f, the grph of N hs pth of toms, ll of them with s prty, leding from n to n f. Now we define p i for internl toms. For the internl toms n not in F s we define p i (n) ritrrily. For the internl toms n F s such tht X(n,, r) = s for some gent we set p i (n) = r. For the rest of the internl toms of F s we proceed itertively. If n F s hs n outcome r nd n gent (necessrily internl) such tht p i (X(n,, r)) is defined, then we set p i (n, ) := r (if there re severl possiilities, we choose one of them). By Lemm 4(2), the grph of F s is strongly connected, nd so eventully p i is defined for ll toms of F s. Let σ e n ritrry occurrence sequence leding to mrking x s tht enles s (rememer tht N is sound). By the definition of F s, the mrking x s enles n occurrence sequence σ e tht strts with n occurrence of s, contins

19 19 only toms of F s, nd ends with n occurrence of (e, r e ), the considered exit of F s. We now define mximl occurrence sequence τ enled t x s. We strt with τ := ɛ nd while τ enles some tom proceed itertively s follows: If τ enles σ e, then τ := τσ e, i.e., we extend the current sequence with σ e. Otherwise, choose ny enled tom n, nd set τ := τ(n, p(n)), i.e., we extend the current sequence with (n, p(n). We first show tht τ is infinite, i.e., tht we never exit the while loop. By soundness, there is lwys n enled tom s long s the finl mrking is not reched, i.e., s long s t lest one gent is redy to engge in n tom. So it suffices to show tht this is the cse. We prove tht the home gent h is redy to engge in n tom fter the occurrence of n ritrry finite prefix of τ. This result follows from the following clim. Clim. If x s τ x for some prefix τ of τ then x (h) F s, i.e., the home gent h only prticiptes in toms of the frgment nd is lwys only redy to prticipte in toms of the frgment. Proof of clim. The proof follows the itertive construction of τ. We strt t mrking x s, nd we hve x s (h) = s ecuse h is prty of s nd x s enles s. Whenever σ e or prefix of σ e occurs, the property is preserved, ecuse first, X(n, h, r) F s holds for ll outcomes (n, r) of σ e except the lst one (this holds for ll prties of n); nd second, for the lst outcome, which is (e, r e ), h is either not prty of e whence the mrking of h does not chnge, or X(e, h, r e ) F s y definition of h. Whenever n outcome (n, p(n)) occurs, either h is not prty of n, nd then the mrking of h does not chnge, or h is prty of n, nd n is n tom of F s. By construction of p (ctully, of p i ), the property is preserved, which finishes the proof of the clim. Let us now investigte the occurrences of externl nd internl toms in τ. Let G E e the grph with the externl toms s nodes nd n edge from n to n if p e (n) = n. By the definition of p e, the grph G E is cyclic with n f s sink. By the definition of τ, fter n externl tom n occurs in τ, none of its predecessors in G E cn occur in τ. So τ contins only finitely mny occurrences of externl toms. Since τ is infinite, it therefore hs n infinite suffix τ in which only internl toms occur. Since s is synchronizer with miniml set of prties, every internl gent prticiptes in infinitely mny outcomes of τ, in prticulr the home gent h. By the clim, τ contins infinitely mny occurrences of toms of F s. Now let G s e the grph with the toms of F s s nodes, nd n edge from n to n if p i (n) = n. By the definition of p i, every cycle of the grph G s goes through the synchronizer s. So τ contins infinitely mny occurrences of s. Whenever s is enled, σ e is enled, too, nd ctully occurs y the definition of τ. Since

20 20 σ e ends with the outcome (e, r e ), τ lso contins infinitely mny occurrences of (e, r e ). Since negotitions hve finitely mny rechle mrkings, τ contins loop synchronized y s (y minimlity of the synchronizer) nd contining (e, r e ). However, y the definition of frgment this implies tht this loop nd thus (e, r e ) elongs to F s s well, contrdicting tht (e, r e ) is n exit of F s. In prticulr, the sitution of Figure 6() cnnot occur, nd so in SDNs the correct picture for the ppliction of the shorcut rule to exits is the one of Figure 6(): the exit n hs the sme gents s the synchronizer s. Moreover, the new trget of (s, r f ) equls the lredy existing trget of (n, r ). So Lemm 7 leds to the following ound on the numer of trgets of N i : Lemm 7. For every 1 i N 0 : T(N i ) T(N 0 ). Proof. It suffices to prove T(N i+1 ) T(N i ) for i < N 0. Let (n, r) e n ritrry outcome of N i+1. We show tht there exists n outcome (n, r ) of N i such tht (n, r) nd (n, r ) hve the sme trgets. If (n, r) is lso n outcome of N i, then we re done. So ssume this is not the cse. Then (n, r) is generted y prticulr ppliction of the shortcut rule during the reduction process leding from N i to N i+1. Let N nd N e the negotitions right efore nd fter this ppliction of the rule. N contins frgment F s otined y pplying to F s the sme sequence of rules leding from N i to N. Similrly, N contins frgment F s. By the definition of the shortcut rule, N hs n outcome (, r 1 ) such tht is n tom of F s nd (, r 1 ) unconditionlly enles nother tom of F s. Moreover, (n, r) is the shortcut of (, r 1 ) nd (, r 2 ), i.e., (n, r) is otined from cluse (2) in Definitio0. We prove the following three clims: (1) (, r 1 ) is n outcome of F s, i.e., X(,, r 1 ) F s for every prty of. Assume the contrry. Then, since F s, (, r 1 ) is n exit of F s, y Lemm 7 we hve X(,, r 1 ) / F s for every prty of, contrdicting tht (, r 1 ) unconditionlly enles n tom of F s. (2) (, r 2 ) is n exit of F s. Assume the contrry, i.e., (, r 2 ) F s. By (1), oth (, r 1 ) nd (, r 2 ) re outcomes of F s, nd so (n, r) is n outcome of F s. But then, since F s is completely reduced y the reductions leding from N to N i+1, the outcome (n, r) is removed y some rule in the reduction pth etween N nd N i+1, contrdicting our ssumption tht (n, r) is n outcome of N i+1. (3) (n, r) nd (, r 2 ) hve the sme trget. By (2) nd Lemm 7, hs exctly the sme prties s the synchronizer s. Since (, r 1 ) unconditionlly enles, the sme holds for. So we hve P n1 = P n2 = P s nd X(,, r 1 ) = for every P n2. By the definition of the shortcut rule, X(n,, r) = X(,, r 2 ) for every P n2, nd we re done. To finlly prove tht (n, r) hs the sme trget s some outcome of N i we proceed y induction on the numer k of times the shortcut rule hs een pplied

21 21 etween N i nd N. If k = 0, then (, r 2 ) is n outcome of N i, nd y (3) we re done. If k > 0, then either (, r 2 ) is n outcome of N i, nd y (3) we re done, or it is produced y former ppliction of the shortcut rule. In this cse, y induction hypothesis, (, r 2 ) hs the sme trget in N i nd therefore, y (3), so hs (n, r). We use this lemm to ound Out(N i ). Lemm 8. For every 1 i N 0 : Out(N i ) O( N 0 2 Out(N 0 ) ). Proof. We first give n upper ound for Out(N i ). Since the merge rule cnnot e pplied to N i, no two outcomes of N i hve the sme source nd the sme trget, nd so Out(N i ) N i T(N i ). By Lemm 8, Out(N i ) N 0 Out(N 0 ). Now we consider Out(N i ). Ech outcome of Out(N i ) \ Out(N i) hs some tom of F s s source, nd is generted y some exit of F s. So the numer of such outcomes is t most the product of the numers of nodes of F s nd the numer of exits of F s. Since these numers re ounded y N i nd Out(N i ), respectively, we get Out(N i ) Out(N i) + N i Out(N i ). The result now follows from Out(N i ) N 0 Out(N 0 ) nd Lemm 4(). Finlly, comining Lemm 5 nd Lemm 8 we get Theorem 4. Let N 0 e n SDN. Then Appl(N 0 ) O( N 0 4 Out(N 0 ) ). We conjecture tht more detiled complexity nlysis cn improve this ound to t lest O( N 0 3 Out(N 0 )), ut this is eyond the scope of this pper. 7 Conclusions We hve continued the nlysis of negotitions strted in [7]. We hve provided set of three reduction rules tht cn summrize ll nd only the sound deterministic negotitions. Moreover, the numer of rule pplictions is polynomil in teh size of the negotition. The completeness nd polynomility proofs turned out to e quite involved. At the sme time, we think they provide interesting insights. In prticulr, the completeness proofs shows how in deterministic negotitions soundness requires to synchronize ll gents t lest once in every loop. It lso shows tht, intuitively, loops must e properly nested. Intuitively, sound deterministic negotitions re necessrily well structured, in the sense of structured progrmming. Our rules generlize the rules used to trnsform finite utomt into regulr expressions y eliminting sttes [13]. Indeed, deterministic negotitions cn e seen s clss of communicting deterministic utomt, nd thus our result ecomes generliztion of Kleene s theorem to concurrency model. In future work we pln to investigte the connection to other concurrent Kleene theorems in the literture like e.g. [8, 9].

22 22 References 1. W. M. P. vn der Alst. The ppliction of Petri nets to workflow mngement. J. Circuits, Syst. nd Comput., 08():21 66, W. M. P. vn der Alst, K. M. vn Hee, A. H. M. ter Hofstede, N. Sidorov, H. M. W. Vereek, M. Voorhoeve, nd M. T. Wynn. Soundness of workflow nets: clssifiction, decidility, nd nlysis. Forml Asp. Comput., 23(3): , T. Atdelzter, E. M. Atkins, nd K. G. Shin. Qos negotition in rel-time systems nd its ppliction to utomted flight control. Computers, IEEE Trnsctions on, 49(11): , G. Berthelot. Trnsformtions nd decompositions of nets. In W. Bruer, W. Reisig, nd G. Rozenerg, editors, Advnces in Petri Nets, volume 254 of LNCS, pges Springer, R. Dvis nd R. G. Smith. Negotition s metphor for distriuted prolem solving. Artificil intelligence, 20(1):63 109, J. Desel nd J. Esprz. Free choice Petri nets. Cmridge University Press, New York, NY, USA, J. Esprz nd J. Desel. On negotition s concurrency primitive. In P. R. D Argenio nd H. C. Melgrtti, editors, CONCUR, volume 8052 of Lecture Notes in Computer Science, pges Springer, 23. ISBN Extended version in rxiv: P. Gstin, A. Petit, nd W. Zielonk. A kleene theorem for infinite trce lnguges. In J. L. Alert, B. Monien, nd M. Rodríguez-Artlejo, editors, ICALP, volume 510 of Lecture Notes in Computer Science, pges Springer, ISBN B. Genest, A. Muscholl, nd D. Kuske. A kleene theorem for clss of communicting utomt with effective lgorithms. In C. Clude, E. Clude, nd M. J. Dinneen, editors, Developments in Lnguge Theory, volume 3340 of Lecture Notes in Computer Science, pges Springer, ISBN H. J. Genrich nd P. S. Thigrjn. A theory of ipolr synchroniztion schemes. Theor. Comput. Sci., 30: , S. Hddd. A reduction theory for coloured nets. In G. Rozenerg, editor, Advnces in Petri Nets, volume 424 of LNCS, pges Springer, S. Hddd nd J.-F. Prdt-Peyre. New efficient Petri nets reductions for prllel progrms verifiction. Prllel Processing Letters, 16(1):1 116, J. E. Hopcroft, R. Motwni, nd J. D. Ullmn. Introduction to Automt Theory, Lnguges, nd Computtion (3rd Edition). Addison-Wesley Longmn Pulishing Co., Inc., Boston, MA, USA, N. R. Jennings, P. Frtin, A. R. Lomuscio, S. Prsons, M. J. Wooldridge, nd C. Sierr. Automted negotition: prospects, methods nd chllenges. Group Decision nd Negotition, 10(2): , W. H. Winsorough, K. E. Semons, nd V. E. Jones. Automted trust negotition. In DARPA Informtion Survivility Conference nd Exposition, DISCEX 00. Proceedings, volume 1, pges IEEE, Appendix 7.1 Proofs of Section 5.1 Lemm 3. (1) Every cyclic SDN hs loop.

23 23 (2) The set of toms of miniml loop genertes strongly connected sugrph of the grph of the considered negotition. Proof. (1) Let π e cycle of the grph of the negotition N. Let e n ritrry tom occurring in π, nd let e its successor in π. n f ecuse n f hs no successor, nd hence no cycle contins n f. By soundness some rechle mrking x 1 enles. For t lest one gent nd one result r, X(,, r) contins, nd y determinism it contins (,r) only. Let x 1 x 1. Agin y soundness, there is n occurrence sequence from x 1 tht leds to the finl mrking. This sequence hs to contin n occurrence of ecuse this is the only tom gent is redy to engge in. In prticulr, some prefix of this sequence leds to mrking x 2 tht enles. Repeting this rgument ritrrily for the nodes,, n 3,..., n k = of the cycle π, we conclude tht there is n infinite occurrence sequence, contining infinitely mny occurrences of toms of the cycle π. Since the set of rechle mrkings is finite, this sequence contins loop. (2) For ech gent involved in ny tom of the loop, consider the sequence of toms it is involved in. By definition of the grph of the negotition, this sequence is pth. It is moreover (not necessrily simple) cycle, ecuse loop strts nd ends with the sme mrking. So the generted sugrph is covered y cycles. It is moreover strongly connected ecuse, for ech connected component, the projection of the outcomes of the loop to those with toms in this component is smller loop, ginst minimlity of the loop. 7.2 Proofs of Section 5.2 Lemm 4. Every miniml loop of SDN is synchronized. Proof. Let σ e miniml loop, enled t rechle mrking x. Define N σ s the set of toms tht occur in σ nd A σ s the set of gents involved in toms of N σ. Since N is sound, there is n occurrence sequence σ f enled y x tht ends with the finl tom n f. Now choose n gent â of A σ such tht x(â) N σ. In σ f, eventully â is involved in n f, nd it is first involved in n tom of N σ. Using σ f, we construct pth π of the grph of N s follows: We egin this pth with the lst tom n N σ tht ppers in σ f nd involves gent â. We cll this tom n π. Then we repetedly choose the lst tom in σ f tht involves â nd moreover is successor of the lst vertex of the pth constructed so fr. By construction, this pth hs no cycles (i.e., ll vertices re distinct), strts with n tom of N σ nd hs not further toms of N σ, ends with n f, nd only contins toms involving â. Since x enles the loop σ nd since n π N σ, fter some prefix of σ mrking x π is reched which enles n π. The loop σ continues with some outcome (n π, r 1 ), where r 1 is one possile result of n π.

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

Model Reduction of Finite State Machines by Contraction

Model Reduction of Finite State Machines by Contraction Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

DFA minimisation using the Myhill-Nerode theorem

DFA minimisation using the Myhill-Nerode theorem DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite

More information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

More information

Revision Sheet. (a) Give a regular expression for each of the following languages:

Revision Sheet. (a) Give a regular expression for each of the following languages: Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions

More information

Lecture 09: Myhill-Nerode Theorem

Lecture 09: Myhill-Nerode Theorem CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

Exercises with (Some) Solutions

Exercises with (Some) Solutions Exercises with (Some) Solutions Techer: Luc Tesei Mster of Science in Computer Science - University of Cmerino Contents 1 Strong Bisimultion nd HML 2 2 Wek Bisimultion 31 3 Complete Lttices nd Fix Points

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

CM10196 Topic 4: Functions and Relations

CM10196 Topic 4: Functions and Relations CM096 Topic 4: Functions nd Reltions Guy McCusker W. Functions nd reltions Perhps the most widely used notion in ll of mthemtics is tht of function. Informlly, function is n opertion which tkes n input

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016 CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

State Minimization for DFAs

State Minimization for DFAs Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets Concepts of Concurrent Computtion Spring 205 Lecture 9: Petri Nets Sebstin Nnz Chris Poskitt Chir of Softwre Engineering Petri nets Petri nets re mthemticl models for describing systems with concurrency

More information

1.3 Regular Expressions

1.3 Regular Expressions 56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

More information

Lecture 2: January 27

Lecture 2: January 27 CS 684: Algorithmic Gme Theory Spring 217 Lecturer: Év Trdos Lecture 2: Jnury 27 Scrie: Alert Julius Liu 2.1 Logistics Scrie notes must e sumitted within 24 hours of the corresponding lecture for full

More information

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems Centrum voor Wiskunde en Informtic REPORTRAPPORT Supervisory control for nondeterministic systems A. Overkmp Deprtment of Opertions Reserch, Sttistics, nd System Theory BS-R9411 1994 Supervisory Control

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

More information

The size of subsequence automaton

The size of subsequence automaton Theoreticl Computer Science 4 (005) 79 84 www.elsevier.com/locte/tcs Note The size of susequence utomton Zdeněk Troníček,, Ayumi Shinohr,c Deprtment of Computer Science nd Engineering, FEE CTU in Prgue,

More information

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems Globl Types for Dynmic Checking of Protocol Conformnce of Multi-Agent Systems (Extended Abstrct) Dvide Ancon, Mtteo Brbieri, nd Vivin Mscrdi DIBRIS, University of Genov, Itly emil: dvide@disi.unige.it,

More information

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers 80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES 2.6 Finite Stte Automt With Output: Trnsducers So fr, we hve only considered utomt tht recognize lnguges, i.e., utomt tht do not produce ny output on ny input

More information

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

CSE396 Prelim I Answer Key Spring 2017

CSE396 Prelim I Answer Key Spring 2017 Nme nd St.ID#: CSE96 Prelim I Answer Key Spring 2017 (1) (24 pts.) Define A to e the lnguge of strings x {, } such tht x either egins with or ends with, ut not oth. Design DFA M such tht L(M) = A. A node-rc

More information

Tutorial Automata and formal Languages

Tutorial Automata and formal Languages Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we

More information

Global Session Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems

Global Session Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems Globl Session Types for Dynmic Checking of Protocol Conformnce of Multi-Agent Systems (Extended Abstrct) Dvide Ancon, Mtteo Brbieri, nd Vivin Mscrdi DIBRIS, University of Genov, Itly emil: dvide@disi.unige.it,

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

MTH 505: Number Theory Spring 2017

MTH 505: Number Theory Spring 2017 MTH 505: Numer Theory Spring 207 Homework 2 Drew Armstrong The Froenius Coin Prolem. Consider the eqution x ` y c where,, c, x, y re nturl numers. We cn think of $ nd $ s two denomintions of coins nd $c

More information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

More information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation Strong Bisimultion Overview Actions Lbeled trnsition system Trnsition semntics Simultion Bisimultion References Robin Milner, Communiction nd Concurrency Robin Milner, Communicting nd Mobil Systems 32

More information

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Converting Regular Expressions to Discrete Finite Automata: A Tutorial Converting Regulr Expressions to Discrete Finite Automt: A Tutoril Dvid Christinsen 2013-01-03 This is tutoril on how to convert regulr expressions to nondeterministic finite utomt (NFA) nd how to convert

More information

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

More information

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30 Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100

More information

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7 CS103 Hndout 32 Fll 2016 Novemer 11, 2016 Prolem Set 7 Wht cn you do with regulr expressions? Wht re the limits of regulr lnguges? On this prolem set, you'll find out! As lwys, plese feel free to drop

More information

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A. 378 Reltions 16.7 Solutions for Chpter 16 Section 16.1 Exercises 1. Let A = {0,1,2,3,4,5}. Write out the reltion R tht expresses > on A. Then illustrte it with digrm. 2 1 R = { (5,4),(5,3),(5,2),(5,1),(5,0),(4,3),(4,2),(4,1),

More information

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

Surface maps into free groups

Surface maps into free groups Surfce mps into free groups lden Wlker Novemer 10, 2014 Free groups wedge X of two circles: Set F = π 1 (X ) =,. We write cpitl letters for inverse, so = 1. e.g. () 1 = Commuttors Let x nd y e loops. The

More information

1B40 Practical Skills

1B40 Practical Skills B40 Prcticl Skills Comining uncertinties from severl quntities error propgtion We usully encounter situtions where the result of n experiment is given in terms of two (or more) quntities. We then need

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,

More information

Torsion in Groups of Integral Triangles

Torsion in Groups of Integral Triangles Advnces in Pure Mthemtics, 01,, 116-10 http://dxdoiorg/1046/pm011015 Pulished Online Jnury 01 (http://wwwscirporg/journl/pm) Torsion in Groups of Integrl Tringles Will Murry Deprtment of Mthemtics nd Sttistics,

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont. NFA DFA Exmple 3 CMSC 330: Orgniztion of Progrmming Lnguges NFA {B,D,E {A,E {C,D {E Finite Automt, con't. R = { {A,E, {B,D,E, {C,D, {E 2 Equivlence of DFAs nd NFAs Any string from {A to either {D or {CD

More information

Thoery of Automata CS402

Thoery of Automata CS402 Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...

More information

Linear Systems with Constant Coefficients

Linear Systems with Constant Coefficients Liner Systems with Constnt Coefficients 4-3-05 Here is system of n differentil equtions in n unknowns: x x + + n x n, x x + + n x n, x n n x + + nn x n This is constnt coefficient liner homogeneous system

More information

Name Ima Sample ASU ID

Name Ima Sample ASU ID Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Lexical Analysis Finite Automate

Lexical Analysis Finite Automate Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition

More information

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck. Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

More information

The Minimum Label Spanning Tree Problem: Illustrating the Utility of Genetic Algorithms

The Minimum Label Spanning Tree Problem: Illustrating the Utility of Genetic Algorithms The Minimum Lel Spnning Tree Prolem: Illustrting the Utility of Genetic Algorithms Yupei Xiong, Univ. of Mrylnd Bruce Golden, Univ. of Mrylnd Edwrd Wsil, Americn Univ. Presented t BAE Systems Distinguished

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 9 1. (4pts) ((p q) (q r)) (p r), prove tutology using truth tles. p

More information

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v. 1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,

More information