ebook img

Petri automata for Kleene allegories PDF

18 Pages·2017·0.69 MB·French
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Petri automata for Kleene allegories

Petri automata for Kleene allegories Paul Brunet, Damien Pous To cite this version: Paul Brunet, Damien Pous. Petri automata for Kleene allegories. Logic in Computer Science, Jul 2015, Kyoto, Japan. pp.68-79, ￿10.1109/LICS.2015.17￿. ￿hal-01073936v3￿ HAL Id: hal-01073936 https://hal.science/hal-01073936v3 Submitted on 16 Mar 2015 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Petri automata for Kleene allegories Paul Brunet and Damien Pous Plume team – LIP, CNRS, ENS de Lyon, Inria, UCBL, Université de Lyon, UMR 5668 {paul.brunet,damien.pous}@ens-lyon.fr Abstract—Kleenealgebraaxiomsarecompletewithrespectto reflexive-transitive closures are not allowed. They are both language models and binary relation models. In particular, decidable [8, page 208]; Inequation (3) is known as the two regular expressions recognise the same language if and only modularity law in this setting. iftheyareuniversallyequivalentinthemodelofbinaryrelations. We consider Kleene allegories, i.e., Kleene algebras with To the best of our knowledge, the decidability of the whole two additional operations which are natural in binary relation theory, Kleene allegories, is open. Here we obtain several models: intersection and converse. While regular languages are important steps towards the resolution of this problem: closedunderthoseoperations,theabovecharacterisationbreaks. 1) wegiveacharacterisationofthefull(in)equationaltheory Instead, we give a characterisation in terms of languages of directed and labelled graphs. We then design a finite automata in terms of graph languages; model allowing to recognise such graphs, by taking inspiration 2) we design an automata model inspired by Petri nets, that from Petri nets. makes it possible to recognise such graphs; This model allows us to obtain decidability of identity-free 3) weshowhowtoassociatesuchagraphautomatontoany relational Kleene lattices, i.e., the equational theory generated term of Kleene allegories; by binary relations on the signature of regular expressions with intersection,butwhereoneforbidsunit.Thisrestrictionisusedto 4) using these graph automata, we give a decision proce- ensurethatthecorrespondinggraphsareacyclic.Thedecidability dure for the fragment where converse and identity are of graph-language equivalence in the full model remains open. forbidden. I. INTRODUCTION ThelatterfragmentwasstudiedrecentlybyAndrékaetal.[1]; its decidability was open as far as we know. The restriction We consider binary relations and the operations of to this fragment allows us to exploit simplifying assumptions union (∪), intersection (∩), composition (⋅), converse (⋅⌣), about the produced automata, and to obtain a coinductive al- transitive closure (⋅+), reflexive-transitive closure (⋅⋆), and the gorithmforlanguageinclusion(SectionV).Weactuallyshow constantsidentity(1)andemptyrelation(0).Thismodelgives that language inclusion for these automata is EXPSPACE- rise to an (in)equational theory: a pair of terms e,f made complete (Section VI). from those operations and some variables a,b,... is a valid The next problem, which remains open, consists in ob- equation, denoted Rel ⊧ e = f, if the corresponding equality taining the decidability of language inclusion in the full holdsuniversally.Similarly,aninequationRel⊧e≤f isvalid automatamodel:togetherwiththepresentedresults,thiswould when the corresponding containment holds universally. Here entail decidability of Kleene allegories. We outline some of are valid equations and inequations: they hold whatever the the difficulties arising with converse or unit in presence of relations we assign to variables a, b, and c. intersection in Section V-D. Rel ⊧ (a∪b)⋆⋅b⋅(a∪b)⋆ = (a⋆⋅b⋅a⋆)+ (1) We continue this introductory section by an informal de- Rel ⊧ a⋆ ≤ 1 ∪ a⋅a⌣⋅a+ (2) scription of the graph language characterisation and our au- Rel ⊧ a⋅b ∩ c ≤ a⋅(b ∩ a⌣⋅c) (3) tomata model. Rel ⊧ a+ ∩ 1 ≤ (a⋅a)+ (4) A. Languages Various fragments of this theory have been studied in the In the simple case of Kleene algebra, i.e., without converse literature: and intersection, the (in)equational theory generated by rela- ● Kleene algebra [7], where one removes intersection and tions can be characterised by using regular languages. Write converse,sothattermsareplainregularexpressions.The e for the language denoted by a regular expression e; for theory is decidable by Kleene’s work [11], and actually a(cid:74)n(cid:75)y two regular expressions e,f, we have PSPACE-complete [14], [15]. Equation (1) lies in this Rel⊧e≤f if and only if e ⊆ f . (5) fragment, and one can notice that the two expressions (cid:74) (cid:75) (cid:74) (cid:75) recognise the same language. (This result is easy and folklore; proving that this is also ● Kleene algebra with converse, where one only removes equivalent to provability using Kleene algebra axioms [4], intersection, is also a decidable fragment [3]. It remains [12], [13] is much harder.) PSPACE [5]. Inequation (2) belongs to this fragment. While regular languages are closed under intersection and ● (representable, distributive) allegories [8], sometimes converse, the above characterisation does not extend to those called positive relation algebras, where transitive and operations. For intersection, consider two distinct variables a G(a): a C. Graph languages To extend the above graph-theoretical characterisation to a b Kleene allegories, we need to handle union and (reflexive-) G((a⋅(b∩c))∩d): c transitive closures. It suffices for that to consider sets of d graphs: to each expression e, we associate a set of graphs a b G(e). This set is most often infinite when the expression e G((a⋅b)∩(a⋅c)): contains (reflexive-)transitive closures. a c Writing ◂X for the downward closure of a set of graphs a X by the preorder ◂ on graphs, we obtain the following d G((a ∩ b⋅c)⋅d): generalisation of both (5) and (6): for any two expressions b c e and f, Rel⊧e≤f if and only if ◂G(e)⊆◂G(f) . (7) G(a⋅b ∩ 1): a b This is Theorem 6 in the sequel, and this result is almost thereintheworkbyAndrékaetal.[1],[2].Tothebestofour Figure 1: Graphs associated to some ground terms. knowledge this explicit formulation is new, as well as its use towards decidability results. When e and f are ground terms, we recover the charac- and b. The extended regular expressions a ∩ b and 0 both terisation (6) for representable allegories: G(e) and G(f) are recognise the empty language, while Rel ⊧/ a∩b = 0: one singleton sets in this case. For plain regular expressions, the can interpret a and b with intersecting relations. For converse, graphs are just words and the preorder ◂ reduces to isomor- the extended regular expressions a and a⌣ both recognise the phism. We thus recover the characterisation (5) for Kleene singleton language consisting of the single-letter word a. Yet algebra. This result also generalises the characterisation pro- Rel⊧/ a=a⌣, as there are non-symmetric relations. vided by Ésik et al. [3] for Kleene algebra with converse: graphs of expressions without intersection are just words over B. Graphs a duplicated alphabet, and the corresponding restriction of the preorder◂preciselycorrespondstothewordrewritingsystem Freyd and Scedrov’ decision procedure for representable they use (see Remark 7). allegories[8,page208]reliesonanotionofdirected,labelled, 2-pointedgraph.Thesamenotionwasproposedindependently D. Petri automata by Andréka and Bredikhin [2], in a more comprehensive way. In order to exploit the above characterisation and obtain Call ground terms the terms in the syntax of allegories decidability results, one has first to represent graph languages (composition,intersection,converse,andunit).Agroundterm in a finitary way. We propose for that a new finite automata u can be represented as a labelled directed graph G(u) with model, largely based on Petri nets [16]–[18]. We describe this two distinguished vertices called the input and the output. We modelbelow,ignoringconverseandunitforthesakeofclarity. givesomeexamplesinFigure1,seeDefinition1foraprecise Recall that a Petri net consists of definition. ● a finite set of places, denoted with circles; These graphs can be endowed with a preorder relation: we ● a set of transitions, denoted with rectangles; write G◂F when there exists a graph homomorphism from ● foreachtransition,asetofinputplacesandasetofoutput F to G preserving labels, inputs, and outputs. For instance places, denoted with arrows; the graph corresponding to (a⋅(b∩c))∩d is smaller than ● an initial place, denoted by an entrant arrow; the graph of (a⋅b)∩(a⋅c), thanks to the homomorphism ● a set of final markings, denoted by dotted boxes (a depicted in Figure 2 using dotted arrows. Notice that the marking, or configuration, being a set of places). homomorphism needs not be injective or surjective, so that The execution model is the following: start by putting a token this preorder has nothing to do with the respective sizes of on the initial place; choose a transition whose input places all the graphs: a graph may very well be smaller than another in contain a token, remove those tokens and put new tokens in the sense of ◂, while having more vertices or edges (and vice the output places of the transition; repeat this process until a versa). finalmarkingisreached.Theobtainedsequenceoftransitions The key result from Freyd and Scedrov [8, page 208], or is called an accepting run. (We actually restrict ourselves to Andréka and Bredikhin [2, Theorem 1], is that for any two safePetrinets,toensurethatthereisalwaysatmostonetoken ground terms u,v, we have in a given place when playing this game.) APetriautomatonisjustasafePetrinet1 withvariablesla- Rel⊧u≤v if and only if G(u)◂G(v) . (6) bellingtheoutputsofeachtransition.Theautomatondepicted The graphs are finite so that one can search exhaustively for 1For everyreachable markingin asafe net, thereis atmost onetoken in a homomorphism, whence the decidability result. anygivenplace. 2 a b same vertex (5). This actually corresponds to composing the 5 functions used to accept F with the homomorphism depicted G : 4 c 6 with dotted arrows. d This automata model is expressive enough for Kleene ▲ allegories: for any expression e, we can construct a Petri a 1 b automaton A(e) such that L (A(e))=◂G(e) (Section IV). F : 0 3 We give three other examples of Petri automata to give more a 2 c intuition on their behaviour. Figure 2: A graph homomorphism. ThefirsttransitioninthepreviousPetriautomatonsplitsthe initialtokenintotwotokens,whicharemovedconcurrentlyin the remainder of the run. This corresponds to an intersection below is the automaton we will construct for the ground term in the considered expression. This is to be contrasted with the a⋅b ∩ a⋅c.Anyrunmuststartbyfiringtheleft-mosttransition, behaviour of the following automaton, which we would con- reaching the marking {B,C}; then we have the choice of structforthenon-groundexpressiona⋅b∪a⋅c.Thisautomaton firing the upper transition first, reaching the marking {D,C}, has twoaccepting runs: {A},{B},{D} and {A},{C},{E}, or the lower one, reaching the marking {B,E}. In both cases which can be used to accept the (graphs of the) ground terms we reach the final marking {D,E} by firing the remaining a⋅b and a⋅c. transition. a b B D b a B D A A a C c E a C E c In a sense, two transitions competing for the same tokens represent a non-deterministic choice, i.e., a union in the To read a graph in such an automaton, we try to find an starting expression. accepting run that matches the graph up to homomorphism Still in the first example, the two tokens created by the first (Definitions 10 and 11). We do that by using an evolving transition are later collected in the final marking. Tokens may function from the tokens to the vertices of the graph. We also be collected and merged by a transition. Consider for startwiththefunctionmappingtheuniquetoken,intheinitial place, to the input vertex of the graph. To fire a transition, we instance the following automaton for (a∩b⋅c)⋅d. It has only must check that all its input tokens are mapped to the same one accepting run, {A},{B,C},{B,D},{E}, and this run can be used to read the fourth graph from Figure 1. vertex in the graph, and that this vertex has several outgoing edges, labelled according to the outputs of the transition. If a B this is the case, we update the function by removing the d A E mappings corresponding to the deleted tokens, and by adding new mappings for each of the created tokens (using the target b C c D vertices of the aforementioned outgoing edges, according to the labels). The graph is accepted by the Petri automaton if Asalastexample,considerthefollowingautomatonforthe we can reach a final marking of the Petri automaton, with all expression a ∩ b+⋅c. The upper transition introduces a loop, tokens mapped to the output vertex of the graph. sothatthereareinfinitelymanyacceptingruns.Foranyn>0, For instance, the previous automaton accepts the graph of the graph of the ground term a ∩ bn⋅c is accepted by this automaton. a⋅b ∩ a⋅c (F in Figure 2). We start with the function {A↦0}.Wecanfirethefirsttransition,updatingthefunction into {B↦1,C ↦2} (We could also choose to update the b functioninto{B↦2,C ↦1},or{B,C ↦1},or{B,C ↦2} c B C butthiswouldleadtoadead-end).Thenwecanfiretheupper b transition,evolvingthefunctioninto{D↦3,C ↦2},andwe A a finishbyfiringtheremainingtransition,obtainingthefunction D {D,E ↦3}. We call language of A the set of graphs L (A) accepted According to characterisation (7), the next step is to decide by a Petri automaton A. This language is downward-closed: whether the containment L (A) ⊆ L (B) holds, for two L (A)=◂L (A).Forinstance,thepreviousautomatonalso given Petri automata A and B. Several difficulties arise, accepts the graph G from Figure 2, which is smaller than that do not appear with classical word automata. Our solution F. Indeed, when we fire the first transition, we can associate nevertheless uses a standard coinductive approach, where we the two newly created tokens (in places B and C) to the define an appropriate notion of simulation (Section V-C). 3 G(1)∶= relation gives rise to a preorder on ground terms, written ⊲ a and defined by u⊲v if G(u)◂G(v). ∗ G(a)∶= Given a set S of graphs, we write ◂S for its downward G(w⌣)∶= G(w) closure: ◂S ∶= {G ∣ G◂G′,G′∈S}. Similarly, we write ⊲S G(u⋅v)∶= G(u) G(v) for the downward closure of a set of ground terms w.r.t. ⊲. G(u) As explained in the introduction, the above preorder on G(u∩v)∶= ground terms precisely characterises inclusion under arbitrary G(v) relational interpretations: Figure3:Inductiveconstructionofthegraphofagroundterm. Theorem3([2,Theorem1],or[8,page208]). Forallground terms u,v, we have Rel⊧u≤v⇔u⊲v . Standard notations. For any sets A,B, we write P(S) ∶= To extend this result to Kleene allegories, we introduce {P ∣ P ⊆A} for the set of subsets of A, A → B for the the following generalisation of the language of a regular setoffunctionsfromAtoB,andA⇀B forthesetofpartial expression. Sets of words become sets of ground terms. maps from A to B. The domain of a partial map f is denoted Definition 4 (Terms and graphs of an expression) by dom(f). The set of terms of an expression e ∈ Reg⌣X∩, written e , is the set of ground terms defined inductively as follows:(cid:74) (cid:75) II. GRAPH-THEORETICALCHARACTERISATION 1 ∶={1} 0 ∶=∅ x ∶={x} We consider the signature ⟨∩,∪,⋅,⋅+,⋅⌣,0,1⟩ of Kleene (cid:74) (cid:75) (cid:74) (cid:75) (cid:74) (cid:75) allegories, where e⋆ is an abbreviation for 1∪e+. We fix a set (cid:74)e⋅f(cid:75)∶={w⋅w′ ∣ w∈(cid:74)e(cid:75) and w′∈(cid:74)f(cid:75)} X ofvariables,andwedenotebyReg⌣∩ thesetofexpressions e∩f ∶={w∩w′ ∣ w∈ e and w′∈ f } X (cid:74) (cid:75) (cid:74) (cid:75) (cid:74) (cid:75) e,f... built from variables in X with these connectives. e∪f ∶= e ∪ f Gwritohunthdetesrumb-ssaigrenathtuereex⟨p∩r,e⋅s,s⋅i⌣o,n1s⟩.uI,fvσ,w∶.X..→buPilt(fSro×mSX) iosnalny (cid:74) (cid:74)e⋆(cid:75)(cid:75)∶=⋃(cid:74) n(cid:75)∈N(cid:74){w(cid:75)1⋅⋯⋅wn ∣ ∀i,wi∈(cid:74)e(cid:75)} interpretation of the alphabet X into some space of relations, e⌣ ∶={w⌣ ∣ w∈ e } . (cid:74) (cid:75) (cid:74) (cid:75) we write ̂σ for the unique homomorphism extending σ into The set of graphs produced by an expression e, denoted by a function from Reg⌣X∩ to P(S×S). An inequation between G(e) is the set of graphs associated to the ground terms in two expressions e and f is valid, written Rel ⊧ e ≤ f, if for e : any relational interpretation σ we have ̂σ(e)⊆̂σ(f). (cid:74) (cid:75) We let G range over 2-pointed labelled directed graphs, G(e)∶={G(w) ∣ w∈ e } . ∗ (cid:74) (cid:75) which we simply call graphs in the sequel. Those are tuples Toobtainthecharacterisationannouncedintheintroduction, ⟨V,E,ι,o⟩withV afinitesetofvertices,E ⊆V ×X×V aset we need a slight refinement of a lemma established by of edges labelled with X, and ι,o∈V the two distinguished Andréka, Mikulás, and Németi [1]: vertices, respectively called input and output. Lemma 5. For all expression e∈Reg⌣X∩X, and all relational Definition 1 (Graph of a ground term: G(w)) interpretations σ∶X →P(S×S), we have To each ground term w, we associate a graph G(w), by induction on w. The graph of a∈X has one edge labelled by ̂σ(e)= ⋃ ̂σ(u)= ⋃ ̂σ(w) . a linking its input to its output. The graph for 1 has only one u∈ e w∈⊲ e (cid:74) (cid:75) (cid:74) (cid:75) vertex, both input and output. The composition of two graphs Proof. The first equality is exactly [1, Lemma 2.1]; for the with disjoint sets of vertices can be performed by identifying secondone,weusethefactthat̂σ(w)⊆̂σ(u)wheneverw⊲u, the output of the first graph and the input of the second one. thanks to Theorem 3 (i.e., [2, Theorem 1]). The intersection on graphs consists in merging their inputs and merging their outputs. The converse consists simply in Theorem 6. The following properties are equivalent, for all exchanging the input and the output of a graph. ∗ expressions e,f ∈Reg⌣X∩: (i) Rel⊧e≤f, SeeFigure3foragraphicaldescriptionofthisconstruction. (ii) e ⊆⊲ f , Those graphs were introduced independently by Freyd and (iii) G(cid:74) ((cid:75)e)⊆(cid:74)◂G(cid:75)(f). Scedrov [8, page 208], and Andréka and Bredikhin [2]. Proof. We give a detailed proof in Appendix A. The implica- Definition 2 (Graph homomorphism, preorders ◂ and ⊲) tion (ii) ⇒ (i) follows easily from Lemma 5, and (iii) ⇒ (ii) A graph homomorphism from ⟨V1,E1,ι1,o1⟩ to is a matter of unfolding definitions. For (i)⇒(iii), we mainly ⟨V2,E2,ι2,o2⟩ is a map ϕ ∶ V1 → V2 such that ϕ(ι1) = ι2, use [2, Lemma 3]. ϕ(o1) = o2, and (p,x,q) ∈ E1 entails (ϕ(p),x,ϕ(q)) ∈ E2. We denote by ◂ the relation on graphs defined by G◂G′ (The exact characterisation announced in the introduction (7) if there exists a graph homomorphism from G′ to G. This follows: for any sets X,Y, we have ◂X ⊆◂Y iff X ⊆◂Y.) 4 c C a D t2a t4a c d t1c C D t3c C D t5d b B b F t0b B F A b E E b E E A b E a G G G G G G a G Figure 5: An accepting run in the automaton from Figure 4. a b H I Figure 4: A Petri automaton. The initial place is A, and the Inthesequel,weassumeallconsideredPetriautomatatobe final configurations are {I} and {F,G}. safe. (I.e., in Petri nets terminology, such that any reachable marking has at most one token in each place [16]). Formally, with our definitions: a Petri automaton ⟨P,T,ι,F⟩ is safe if Also notice that while G(f) only contains graphs emanat- for all configuration ξ ⊆ P reachable from {ι} by firing any ing from ground terms, this is not the case for its closure number of transitions, if (t,t)∈T is enabled from ξ, p∈ξ, ◂G(f).Forinstance,◂G((a⋅b)∩(c⋅d))containsthefollow- and (x,p)∈t, then p∈t. ing graph, which is not the graph of any ground term. Now we explain how to use Petri automata to define a b languagesofgraphs.Wefirstdefinetherunsofanautomaton. e Definition 9 (Run, accepting run, parallel run) c d A run is a sequence ξ = ⟨(ξk)0⩽k⩽n,(tk)0⩽k<n⟩ of config- urations and transitions, such that ξk ⊆ P, tk ∈ T and Remark 7. The graphs associated to ground terms without in- ∀k < n, ξk —t→k ξk+1. When ξ0 = {ι} and ξn ∈ F, we call tersectionareisomorphictowordsoveraduplicatedalphabet. ξ an accepting run. Agraphhomomorphismbetweentwosuchgraphsisprecisely A parallel run is defined similarly, as a sequence Ξ = wthhuastbÉessikeeentaasl.acgaellnearnalaisdamtiiosnsibolfe[3m,aTph[e3o]r.emTh5eo.3r]e.m 6 can ⟨(Ξk)0⩽k⩽n,(Tk)0⩽k<n⟩, where the Tk ⊆ T are compatible sets of transitions such that Ξk —T→k Ξk+1. ∗ III. PETRIAUTOMATA (Note that a run ξ is uniquely determined by ξ and the X∪W{exe⌣xt∣exnd∈tXhe}s∪et{X1}.oAfvPaertiraibaleustoimntaotoanseistaX¯Poetfrilanbeetlws:Xh¯os∶=e sdeeqteuremncineis(ttikca)l:lya.l)lsubsequentconfigurationscanbe0computed transition’s outputs are labelled by X¯. Consider the following sequence of transitions from the Definition 8 (Petri Automaton) automaton in Figure 4: A Petri automaton A over the alphabet X is a tuple ⟨P,T,ι,F⟩ where: ξ=⟨(ξ0,ξ1,ξ2,ξ3,ξ4,ξ5,ξ6),(t0,t1,t2,t3,t4,t5)⟩, with ● P is a finite set of places, ● T ⊆P(P)×P(X¯ ×P) is a set of transitions, ξ0={A}, t0=({A},{(b,B),(a,G)}), ● ι∈P is the initial place of the automaton, ξ1={B,G}, t1=({B},{(c,C),(b,E)}), ● F ⊆P(P)isasetoffinalconfigurations,aconfiguration ξ2=ξ4={C,E,G}, t2=t4=({C},{(a,D)}), being a set of places. ξ3=ξ5={D,E,G}, t3=({D,E},{(c,C),(b,E)}), For each transition t=(t,t)∈T, t and t are assumed to be ξ6={F,G}. t5=({D,E},{(d,F)}). non-empty;t⊆P istheinputoft;andt⊆X¯×P istheoutput We have of t. ∗ We use the graphical notation from the introduction to {A} t0(cid:47)(cid:47){B,G} t1(cid:47)(cid:47){C,E,G}(cid:111)(cid:111) t2,t4 (cid:47)(cid:47){D,E,G} t5(cid:47)(cid:47){F,G} , represent Petri automata; the Petri automaton from Figure 4 t3 will be used as a running example. andsince{A}istheinitialconfigurationand{F,G}∈F,this From a configuration ξ ⊆ P, a transition t = (t,t) ∈ T sequenceisanacceptingrun.Itcanberepresentedgraphically is enabled if t ⊆ ξ. If so, one may fire t, which produces a as in Figure 5. newconfigurationξ′=ξ∖t∪{p∈P ∣ ∃x∈X¯ ∶(x,p)∈t}.We As for standard finite state automata, we now need to write ξ—→t A ξ′ in this case. specify how to read a graph in an automaton. As explained A set of transitions T ⊆T is statically compatible (or just in the introduction, this is done by linking the intermediate configurations of a run to vertices in the graph, and by compatible)iftheirinputsarepairwisedisjoint.Iffurthermore imposing conditions to match transitions with labelled edges all transitions in T are enabled in a configuration ξ, one can observe that the configuration ξ′ reached after firing them of the graph. successively does not depend on the order in which they are Definition 10 (Reading, parallel reading, language of a run) fired. In that case we write ξ—T→A ξ′. A reading of G = ⟨V,E,ι,o⟩ along a run ξ = 5 c 2 a c 4 a addanedge(k,x,l)wheneverthereissomeplaceq suchthat b 1 3 5 d (x,q)∈tk, and tl is the first transition after tk in the run with 0 b b 6 q among its inputs, or l = n if there is no such transition in a the run. Figure 6: Graph produced by the run depicted in Figure 5. Definition 12 (Trace of a run) Let ξ=⟨(ξk)0⩽k⩽n,(tk,tk)0⩽k<n⟩ be run. For an index k⩽n and a place q, let ν(k,q) be either the smallest index l such f⟨{o(orξ}k,a)la0ln⩽kdk,⩽∀nρk,k(<itskn,a,tkmth)0ae⩽pfko<flrnloo⟩mwisiξnakgsthoeoqlVudes,n:ρc0e((ξρ0)k)=0⩽{kι⩽}n, ρsunc(hξnt)ha=t tEhξaTt∶=hke{⩽t(rkla,caxen,doνf(qξk∈i+stl1t,h,oeqr)g)nra∣pifh(tx(cid:74)h,ξeq(cid:75)r)e∶=∈is⟨t{kn0}o,..s.u.c,hn}in,dEexξ.,0,n⟩wit∗h ● all tokens in the input of the transition are mapped to the same vertex in the graph: ∀p,q∈tk, ρk(p)=ρk(q); Togetthefinalgraph,whichislabelledbyX,oneidentifies ● the images oftokens in ξk that are notin the input of the nodes linked by edges labelled by 1, and one replaces each transition are unchanged: ∀p∈ξk∖tk, ρk(p)=ρk+1(p); edge of the form (i,x⌣,j) by (j,x,i). Formally: ● eachpairintheoutputofthetransitioncanbe“validated” Definition 13 (Graph produced by a run) by the graph: ∀p∈tk,∀(x,q)∈tk, Let ξ = ⟨(ξk)0⩽k⩽n,(tk,tk)0⩽k<n⟩ be run. Let ≡ξ be the x∈X ⇒(ρk(p),x,ρk+1(q))∈E, smallestequivalencerelationon{0,...,n}containingallpairs x=y⌣ and y∈X ⇒(ρk+1(q),y,ρk(p))∈E, (i,j) such that (i,1,j)∈Eξ. The graph produced by ξ, is the graph G (ξ) defined by x=1⇒ρk(p)=ρk+1(q). Similarly, we define a parallel reading ρ along some parallel G (ξ)∶=⟨{[i]ξ ∣ 0⩽i⩽n},Eξ′,[0]ξ,[n]ξ⟩ run Ξ=⟨(Ξk)0⩽k⩽n,(Tk)0⩽k<n⟩ by requiring that: ρ0(Ξ0)= [i]ξ ∶={k∈{0,...,n} ∣ i≡ξ k} {ι}●●●, ρ∀∀∀np(((tt∈,,ΞttΞn)))k∈∈=∖TT{⋃kko,,(∀∀}t,,ppt)a,∈∈nqTdtk∈,t∀∀t,,(kρxρk<k,(+qnp1))(t∈ph=)te,ρ=fko(ρlqlko)(w;p)in;g holds: Eξ′ ∶=⎧⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎩([i]ξ,x,[j]ξ) RRRRRRRRRRRRRRRRRR x∃k∈((∈klX,,[xixa⌣],ξn,l,kd)l)∈∈∈E[Ejξ]ξξor∶ ⎫⎪⎪⎪⎪⎪⎬⎪⎪⎪⎪⎪⎭ ∗ x∈X ⇒(ρk(p),x,ρk+1(q))∈E, WewriteG (A)forthesetofgraphsproducedbyaccepting x=y⌣ and y∈X ⇒(ρk+1(q),y,ρk(p))∈E, runs of a Petri automaton A. To avoid confusions with the x=1⇒ρk(p)=ρk+1(q). Glan∈gGua(gAeL),(reAse)rvoifnAg l,awngeuwagreiteth“eGoriestipcrotedrumciendobloygAy l”ikweh“eGn Thelanguageofarunξ,denotedbyL (ξ)isthesetofgraphs is accepted by A” or “A recognises G” to cases where we that can be read along ξ. ∗ mean G∈L (A). The graph produced by the run presented in Figure 5 The language of a Petri automaton is finally obtained by happens to be equal to its trace, since it is labelled in X only. considering all accepting runs. A more involved example is given in Figures 7 to 9. Notice Definition 11 (Language recognised by a Petri automaton) thatalthoughthetraceofarunisacyclicandcanbeendowed The language recognised by A, written L (A), is the fol- with a partial order structure (simply check that ∀p,ν(_,p) lowing set of graphs: is increasing), it is not necessarily the case for its produced graph. L (A)∶= ⋃ L (ξ) . ∗ ξacceptinginA Lemma 14. For any accepting run ξ, we have G∈L (ξ) if The language of a run ξ can be characterised by using a and only if G◂G (ξ). single graph which we call the graph produced by ξ: graphs Proof. Suppose there exists a graph homomorphism ϕ from areacceptedbyξ exactlywhentheyaresmallerthanthegraph G (ξ) to G. Then we can build a reading by defining ρk(p)= producedbyξaccordingto◂(Lemma14below).Forinstance, ϕ([ν(k,p)]ξ) for 0 ⩽ k ⩽ n and p ∈ ξk. On the other the run presented in Figure 5 produces the graph depicted hand, if we have a reading (ρk)0⩽k⩽n of G, we can build in Figure 6. ahomomorphismϕbylettingϕ([k]ξ)=ρk(p)foranyp∈tk. This graph is obtained in two steps, by first considering a notion of trace, which is a graph labelled with X¯ rather than As (ρk)k is a reading, ϕ is well defined. The details of this proof can be found in Appendix B. X, and which actually corresponds to the notion of pomset- tracefromstandardPetrinets(seeSectionVIIformoredetails As an immediate corollary, we obtain the following charac- on this correspondence). terisation of the language of a Petri automaton. The trace is constructed by creating a vertex k for each transition tk = (tk,tk) of the run, plus a final vertex n. We Corollary 15. L (A)=◂G (A). 6 c configurations of A to the initial place of A , and then b C 2 E 1 2 apply some epsilon-elimination procedure. d⌣ a B 1 3 F Wealsoputthetwoautomatasidebysidefortheintersection, A 0 1 1 D D but we merge their initial places, their initial transitions, and their final configurations: G G G G ● for any pair of initial transitions of the two automata Figure 7: A run ξ. ({ι1},t1),({ι2},t2), we put in the intersection automa- 2 ton the transition ({ι1},t1∪t2); b 2 c b c ● a final configuration of this automaton is the union of a a 1 3 d⌣ 1 final configuration from A1 and a final configuration of 0 1 4 a d A2. 1 0 For the transitive closure (⋅+), we use the ideas for union and composition, adding loops from the final configurations using Figure 8: The trace of ξ. Figure 9: The graph the initial transitions of the automaton. produced by ξ. Definition 16 To each expression e∈Reg⌣X∩, we associate a Petri automaton The left-hand side language is defined through readings A(e) defined inductively as follows: along accepting runs, which is a local and incremental notion ● x∈X¯,A(x)∶=⟨{0,1},{({0},{(x,1)})},0,{{1}}⟩ and which allows us to define simulations in Section V-C. ● A(0)∶=⟨{0},∅,0,∅⟩ By contrast, the right-hand side language is defined globally, whicheasesthefollowingconstructionofanautomatonrecog- ● A(e1∪e2)∶=⟨P1∪P2,T,ι1,F1∪F2⟩ with nising the language of an expression. T ∶=T1∪T2∪{({ι1},t) ∣ ({ι2},t)∈T2}. ● A(e1⋅e2)∶=⟨P1∪P2,T,ι1,F2⟩ with IV. FROMEXPRESSIONSTOAUTOMATA T ∶=T1∪T2∪{(f,t) ∣ f ∈F1 and ({ι2},t)∈T2}. faancWtatuehteonmoawuattooshmnoawAtoh(noeww)etthooabattsarsieonccohigaatnseisateonsaetnvhyeenelxsatpnrrogenusgasgieorenc◂oeGn∈n(Reec)et.gio⌣XI∩nn ●● ATA((∶=ee+11T)∩1∶=e∪2⟨){P(∶1=f,,⟨TPt)1,ι∪∣1f,PF2∈,1FT⟩1w,ιai1tnh,dF(⟩{ιw1}it,ht)∈T1}. wawciecthefipretsi:tngmthoerudngifsryaiptnhhesAeinx(ep)Gre.(sTesio)onmarsaeokeetxhtaahctettlhyceotnohspotesrueracttpoirorond⋅⌣usciimsedopnlbelryy, TF ∶∶=={{f(t1,∪t)f2∣ ∃∣if∈1{∈1F,21},∶f2(t∈,tF)2∈}Tia,ndιi∉t}∪ applied to variables, by using the following rewriting system: {({ι1},t1∪t2) ∣ ∀i∈{1,2}, ({ιi},ti)∈Ti}. (a∪b)⌣→a⌣∪b⌣ 0⌣→0 (a+)⌣→(a⌣)+ (In the inductive cases, we assume A(ei) = ⟨Pi,Ti,ιi,Fi⟩ (a⋅b)⌣→b⌣⋅a⌣ 1⌣→1 a⌣⌣→a for i∈{1,2}, with P1∩P2=∅.) ∗ (a∩b)⌣→a⌣∩b⌣. WeprovebyinductiononethatA(e)isindeedasafePetri automaton;forthesafetyrequirement,weaddtotheinduction (These rules preserve the set of graphs of the expression; also hypothesis the fact that for any configuration ξ accessible recall that e⋆ is a shorthand for e++1, so that we do not need in A(e), if there is a final configuration f ∈ F such that to handle it explicitly.) f ⊆ ξ, then f = ξ. Another invariant is that the initial place The formal construction is inductive; it is given in Defi- never appears in a final configuration, nor in the output of nition 16 below. We describe it first in informal terms. For any transition. Note that the place ι becomes unreachable the case of x ∈ X¯, we simply build an automaton with a by construction in the cases for u2nion, composition and single transition labelled by x, going from the initial place intersection, so that it could safely be removed, together with to a distinct final place2. The union consists in putting both the associated transitions. automata side by side, and merging their initial places. For the composition of A1 and A2 on the other hand we put one Theorem 17 (Correctness). For all expression e ∈ Reg⌣X∩, automaton in front of the other: L (A(e))=◂G (e). ● the initial place of the resulting automaton is that of A1; Proof. We prove a stronger result: G (A(e)) = G(e) (up ● the final configurations are those of A2; to graph isomorphisms—see Appendix C). This allows us to ● for each final configuration f of A1, and for each initial conclude thanks to Corollary 15. transition (ι2,t) coming out of the initial place of A2, we add a transition with input f and output t. This last Corollary 18. The (in)equational theory of Kleene allegories step amounts to adding epsilon transitions from the final is co-recursively enumerable. Proof. Construct Petri automata for the two expressions and 2Notethatthiscoversuniformlythecaseoftheunit,ofvariables,andof conversedvariables. enumerateallpotentialcounter-examples,i.e.,graphs.Agraph 7 is a counter-example if it can be read in one automaton but and the configurations in A , that satisfy some conditions on 2 not in the other, which is a decidable property. theinitialandfinalconfigurations,andsuchthatifξk ≼ξk′ and Remark19. Ifeisanexpressionwithoutintersection,converse ξk —→t A1 ξk+1, then there is a configuration ξk′+1 in A2 such or1,itcanbeshownthatthetransitionsinA(e)areallofthe that ξk+1 ≼ξk′+1, ξk′ —t→′ A2 ξk′+1, and these transition steps are form ({p},{(x,q)}), with only one input, one output and a compatibleinsomesense.However,suchadefinitionwillnot label in X. As a consequence, the accessible configurations giveustheresultwearelookingfor.Considerthesetworuns: are singletons, and the resulting Petri automaton has the a B B structure of a non-deterministic finite-state automaton (NFA). A 1 Actually, in that case, the construction we described above is c just a variation on Thompson’s construction [20], with inlined b C 2 D epsilon transition elimination. c a X 2′ Z V. COMPARINGAUTOMATA W 1′ A. Simple automata b Y Y The above results hold for the whole syntax of regular The graphs produced by the first and the second runs corre- expressions with converse and intersection. However, in the remainder of the paper, we have to focus on expressions spondrespectivelytothegroundtermsa∩(b⋅c)and(a⋅c)∩b. without converse or identity. This is because in combination These two terms are incomparable, but the relation ≼ depicted below satisfies the previously stated conditions. with intersection, these two operations introduce cycles in the graphs associated to ground terms. Consider for instance the 1 2 graphs for a∩1 and a∩b⌣: {A} (cid:47)(cid:47){B,C} (cid:47)(cid:47){B,D} a ≼ ≼ ≼ 1’ 2’ (cid:47)(cid:47) (cid:47)(cid:47) a {W} {X,Y} {Y,Z} G(a∩1)= G(a∩b⌣)= . b The problem here is that in Petri automata, runs are token firing games. To adequately compare two runs, we need to Since reflexive-transitive closure (⋅⋆) implicitly contains an closely track the tokens. For this reason, we will relate a occurrenceoftheidentity,wealsohavetoforbidthisoperator. configuration ξ in A not only to a configuration ξ′ in A , Instead,weaddthetransitiveclosure(⋅+).Wethusworkwith buttoamapη kfromξ1′ toξ .Thiswillenableustoakssociat2e expressions from Reg∩−, defined with the following syntax: k k k X with each token situated on some place in P another token 2 e,f ∈Reg∩X−∶∶=x∈X ∣ e∩f ∣ e∪f ∣ e⋅f ∣ e+ ∣ 0. plaWceedwoanntAt1o.find a reading of G (ξ) in A2, i.e., a run in A2 Accordingly, ground terms are restricted to the following together with a sequence of maps associating places in A 2 syntax: u,v,w∶∶=x∈X ∣ w⋅w ∣ w∩w. to positions in G (ξ). Consider the picture below. Since we Automata built using Definition 16 from expressions with- already have a reading of G (ξ) along ξ (by defining ρk(p)= out converse or unit only have transitions labelled with X. ν(k,p),asintheproofofLemma14),itsufficestofindmaps This corresponds to the notion of simple automata. from the places in A to the places in A (the maps η ): the 2 1 k Definition 20 (Simple Petri automaton) readingofG (ξ)inA2 willbeobtainedbycomposingηk with A Petri automaton A = ⟨P,T,ι,F⟩ is called simple if ρk. ∀(t,t)∈T,∀(x,p)∈t,x∈X. ∗ G (ξ) For all e∈Reg∩X−, A(e) is simple. Moreover for any run ξ (cid:55)(cid:55) (cid:61)(cid:61) (cid:90)(cid:90) (cid:101)(cid:101) ofasimplePetriautomaton, ξ =G (ξ)(uptoisomorphism); ρ0 ρn+1 inparticular,asimpleautoma(cid:74)ton(cid:75) onlyproducesacyclicgraphs. ρ1 ρn (cid:47)(cid:47) (cid:47)(cid:47) (cid:47)(cid:47) (cid:47)(cid:47) B. Intuitions ξ0(cid:79)(cid:79) t0 ξ1(cid:79)(cid:79) t1 ⋯ tn−1 ξn(cid:79)(cid:79) tn ξn(cid:79)(cid:79)+1 In this section, we show how the notion of simulation η0 η1 ηn ηn+1 relation, that allows to compare NFA, can be adapted to (cid:47)(cid:47) (cid:47)(cid:47) (cid:47)(cid:47) (cid:47)(cid:47) handle simple Petri automata. Consider two automata A1 = ξ0′ t′ ξ1′ t′ ⋯ t′ ξn′ t′ ξn′+1 ⟨P1,T1,ι1,F1⟩ and A2 = ⟨P2,T2,ι2,F2⟩, we try to show 0 1 n−1 n that for any graph G accepted by A1, G is recognised by A2. We need to impose some constraints on the maps (ηk) to By Lemma 14, this amounts to proving that for any accepting ensure that (ρk○ηk)0⩽k⩽n is indeed a correct reading in A2. run ξ in A1, G (ξ) is recognised by some accepting run ξ′ in First, we need to ascertain that a transition t′k in A2 may be A2. Leaving non-determinism apart, the first idea that comes fired from the reading state ρk○ηk to reach the reading state to mind is to find a relation between the configurations in A1 ρk+1○ηk+1. Furthermore, as for NFA, we want transitions tk 8 and t′ to be related: specifically, we require t′ to be included k k a a (via the homomorphisms ηk and ηk+1) in the transition tk. c C D c C D d This is meaningful because transition t contains a lot of b B F k informationaboutthevertexkofG (ξ)andaboutρ:thelabels A a G b EG EG b EG EG G of the outgoing edges from k are the labels on the output of c a b tk, and the only places that will ever be mapped to k in the b β δ ζ η η d reading ρ are exactly the places in the input of tk. α b c a κ This already shows an important dif- a B b γ (cid:15) (cid:15) θ ι ferencebetweenthesimulationsforNFA A 0 Figure 10: Embedding of a parallel run into the run from Fig- alantde Paettrrianasuittioomnatpa.—→aForp′NtFoA,awtreanrsei-- b C ure 5. tion q —→a q′ with the same label a. Hξk′er—te→′k Ath2eξtk′r+a1nsmitaioynhsavξke—dt→kiffAer1eξnkt+l1abaenlsd. X 0′ aa YZ ● itfhaξt≼doEma(nηd)ξ∈∈FF2.1, then there must be some η∈E suc∗h Consider the step represented on the We will now prove that the language of A is contained in 1 right, corresponding to a square in the above diagram. The thelanguageofA ifandonlyifthereexistssuchasimulation. 2 output of 0 has a label b that does not appear in 0’ , and We first introduce the following notion of embedding. 0’ has two outputs labelled by a. Nevertheless this satisfies Definition 22 (Embedding) the conditions informally stated above, indeed, a∩b ⩽ a∩a Let ξ = ⟨(ξk)0⩽k⩽n,(tk)0⩽i<n⟩ be a run in A1, and Ξ = holHdos.wever this definition is not yet satisfactory. Consider the ⟨(Ξk)0⩽k⩽n,(Ti)0⩽i<n⟩ a parallel run in A2. An embedding two runs below: of Ξ into ξ is a sequence (ηi)0⩽i⩽n of maps such that for any i<n, we have: a b C ● ηi is a map from Ξi to ξi; A 0 B 1 ● the image of Ti by ηi is included in ti, meaning that c D for any (t,t) ∈ Ti, for any p ∈ t and (x,q) ∈ t, ηi(p) is contained in the input of ti and (x,ηi+1(q)) is in the b output of t ; a Y 1′ T T i ● the image of the tokens in Ξi that do not appear in the X 0′ c input of Ti are preserved (ηi(p) = ηi+1(p)) and their a Z Z 2′ U image is not in the input of t . i Their produced graphs correspond respectively to the ground terms a⋅(b∩c) and (a⋅b)∩(a⋅c). The problem is that ξ(cid:79)(cid:79)i ti (cid:47)(cid:47)ξi+(cid:79)(cid:79) 1 a⋅(b∩c) ⩽ (a⋅b)∩(a⋅c), but with the previous definition, ηi ηi+1 wecannotrelatetheseruns:theydonothavethesamelength. Ξ (cid:47)(cid:47)Ξ i i+1 The solution here consists in grouping the transitions 1’ and Ti ∗ 2’ together, and consider these two steps as a single step Figure 10 illustrates the embedding of some parallel run, in a parallel run. This last modification gives us a notion of producingG(((b⋅c⋅a⋅b)∩(b⋅b⋅c⋅a))⋅d),intotherunpre- simulation that suits our needs. sentedinFigure5.Noticethatisitnecessarytohaveaparallel run instead of a simple one: to find something that matches C. Simulations the second transition in the upper run, we need to fire two Definition 21 (Simulation) transitions in parallel in the lower run. A relation ≼⊆P(P1)×P(P2⇀P1) between the configura- There is a close relationship between simulations and em- tions of A1 and the partial maps from the places of A2 to the beddings: places of A is called a simulation between A and A if: 1 1 2 Lemma 23. Let A and A be two Petri automata, the ● if ξ≼E and η∈E then the range of η must be included following are equival1ent: 2 in ξ; ● {ι1}≼{[ι2↦ι1]}; 12)) tfhoerreaneyxisatcscaepstiimngularutinonξ≼inbeAtwe,enthAer1e aisndanA2a;ccepting (t,t) 1 ● ifξ≼E andξ——→A ξ′,thenξ′≼E′ whereE′ istheset parallel run Ξ in A that can be embedded into ξ. 1 2 of all η′ such that there is some η∈E and a compatible se–t odfotmran(sηi)tio—T→nsAT2 d⊆omT2(ηs′u)c;h that: P⟨th(reξoko)df0.e⩽fiIkfn⩽inti,ow(ntek)o0f⩽hksa<ivnme⟩ulabtaeiona,nsiwmaeuclcacetaipontninfignd≼r,uan lsieentquAenξ1c.e Bo=yf –– ∀∀(pt∈′,dt′o)m∈(Tη,)η,((t∀′)(t⊆′,tt′a)n∈dT∀,(px∉,qt)′)∈⇒t′,(ηx(,pη)′=(qη)′)(p∈)t.; s∀ekts,ξokf ≼maEpsk.(EFku)rt0h⩽ekr⩽mnorseu,chwethactanE0ex=tra{c[tι2fr↦omι1]t}hisanda 9

Description:
Petri automata for Kleene allegories. Paul Brunet and Damien Pous. Plume team – LIP, CNRS, ENS de Lyon, Inria, UCBL, Université de Lyon, UMR
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.