Concurrency Theory: Lecture 5, 17 January 2017 ---------------------------------------------- Petri Net Extensions: Inhibitor arcs ------------------------------------ - Simulate a two counter machine: - Counters c and d - Instructions l1,l2,...lk - Instructions c++, d++, c--, d--, if c==0 goto lj, if d==0 goto lj - Subtraction operation blocks if counter is 0 - Use one place for c, one for d - Each instruction li corresponds to a transition ti - c++/d++, tj feeds a token into place c/d - c--/d--, tj consumes a token from place c/d - if c==0 goto lj - transition with inhibitor arc from c takes control to lj - transition with self loop from c takes control to l{i+1} - Reachability of marking where l{k+1} is marked is undecidable "Inverse" Coverability ---------------------- Coverability: Given M, is there M' reachable from M_in such that M' >= M? This can be solved using the coverability tree Inverse Coverability: Given M, is there M' reachable from M_in such that M' <= M? Claim 1: Reachability reduces to checking reachability of the empty marking. Proof: Suppose the target marking M is (n1,n2,...,nk) where P = {p1,p2,...,pk}. Add a transition t with input weights (n1,n2,...,nk) from places in P and no output place. In the new net, the empty marking is reachable iff in the original net M is reachable. Claim 2: For the empty marking, inverse coverability is the same as reachability. Proof: The only marking M' <= the empty marking is the empty marking. From these results, it follows that if we had a "simple" way to sole inverse coverability, we would also have a "simple" way to solve reachability. Since reachability is believed to be complicated, this suggests inverse coverability does not have a simple algorithm. Petri Net Languages ------------------- - A bounded net generates a regular language over T - Prefix closed, no final markings - Can add a labelling function l: T -> Sigma - Petri net language is now a language over Sigma - Again bounded nets generate regular languages - Converse? - From DFA/NFA to labelled net is trivial: for each edge s-a->s', add a transition labelled a between places s and s' - What if we interpret DFA/NFA as the language of an unlabelled net? Not so simple! A single word language is trivially regular. If L = {w}, then the DFA for L is a straight line and the corresponding net will have reachable markings with the same structure. This amounts to asking a stronger question: whether there is a net whose reachable markings are isomorphic to a straight line DFA. There is a well-developed theory of "regions" that characterizes whena a given transition system can be isomorphic to the reachable markings of a net. Using the theory of regions, it can be shown that the word "abbaa" cannot be the language of any unlabelled net. Such a word is called "Petri net unsolvable". Recently (2015 and later) there has been some work on characterizing solvable and unsolvable words. However, it still seems to be open to characterize when a non-trivial regular language is "solvable". - Petri nets can recognize some context-free languages - Producer-consumer language = { w | every prefix of w has more send actions than receive actions} - This language is a variant of a^n b^n - Can use labels to actually program a^n b^n - Petri nets cannot recognize all context-free languages - The language of palindromes is not PN recognizable - Requires a combinatorial argument about number of reachable markings - Petri nets can recognize some context-sensitive languages - Add a third component to producer-consumer: consumer passes a message to third component - Language is a variant of a^n b^n c^n, which is not context-free but is context-sensitive. - Petri net languages are orthogonal to normal Chomsky hierarchy of regular, CFL, CSL, ... Alphabets with independence --------------------------- - Sequential languages do not accurately capture concurrent behaviour - Cannot distinguish independent a,b from ab+ba (both a and b are enabled but sequentialized by a shared place connected by self-loop) - Augment alphabet with an independence relation Mazurkiewicz trace theory - (Sigma,I) - I is an independence relation on Sigma: binary relation that is symmetric and irreflexive - Two adjacent independent letters can be permuted without affecting the computation - If (a,b) in I, uabv is equivalent to ubav (write uabv <-> ubav) - In general, two words are trace-equivalent if they can be obtained from one another through a sequence of swaps. (a,b) in I: aabb is equivalent to bbaa aabb <-> abab <-> baab <-> baba <-> bbaa Write aabb <=> bbaa - A trace is an equivalence class of equivalent words - A trace language is a collection of traces - PN with a and b independent has a single behaviour, the trace {ab,ba} - PN with ab + ba has two behaviours, the traces {ab} and {ba}