Concurrency Theory: Lecture 6, 30 August 2019 --------------------------------------------- Theory of regions ----------------- - Consider an elementary net system EN = (P,T,F,M_in) - t is enabled at M if every p in pre(t) is marked at M and no p in post(t) is marked at M - Let RG = (RM,->,M_in) be its reachability graph, a transition system whose states are the reachable markings - For each p in P, define r(p) = {M in RM | M(p) = 1}. - Consider any transtion t in T - Recall that elementary net systems cannot have a place connected to a transition via a self-loop; firing rule would block this transition from ever occurring - if p is in pre(t), every occurrence of t in RG starts inside r(p) and ends outside r(p), because t removes a token from p - if p is in post(t), every occurrence of t in RG starts outside r(p) and ends inside r(p), because t adds a token from p - if p is not connected to t, every occurrence of t in RG either starts and ends inside r(p) or starts and ends outside r(p), because t does not affect the marking of p - Given TS = (Q,->,q_in), define a "region" r to be a subset of Q that satisfies the properties above: For every action a, one of the following holds: - all occurrences of a start inside r and end outside r - all occurrences of a start outside r and end inside r - all occurrences of a lie entirely within or entirely outside r Intuitively, r represents the "extent" of a state --- all reachable markings where a place is marked. We say that - r is in pre(a) if all occurrences of a start inside r and end outside r - r is in post(a) if all occurrences of a start outside r and end inside r Note that there are 2^|Q| possible subsets of Q, but not every subset is a region. We can check each of these subsets and arrive at a set of regions R(TS) = {r1,r2,...,rk} - For TS to be isomorphic to the reachability graph of an elementary net system, we require regions to satisfy some constraints 1. state-state separation: - In the reachability graph, if M =/= M', then the marking of some place p changes between M and M'. If r(p) is the region corresponding to this place, M in r(p) and M' not in r(p), or vice versa. - If we start from TS = (Q,->,q_in), for every distinct pair of states q,q' in Q, there must be some region r in R(TS) such that q in r and q' not in r, or vice versa. 2. event-state separation: - Given a transition t and a reachable marking M, if t is not enabled at M there must be some input place of t that is not marked at M, preventing t from occurring, or some output place of t is marked at M, blocking to from occurring - In TS = (Q,->,q_in), if a is not enabled a q, then there must be a region r such that (i) r in pre(a) and q not in r or (ii) r in post(a) and q in r Theorem: Given TS = (Q,->,q_in), if the regions R(TS) satisfy the state-state separation and event-state separation constraints, we can construct an elementary net system EN = (P,T,F,M_in) whose reachability graph is isomorphic to TS. Proof of the theorem is not very difficult, but we won't go into the details. Assuming the theorem, the construction is clear: - P = R(TS) : each region is a place - T = A: - F = { (r,a) | r in pre(a) } union { (a,r) | r in post(a) } - M_in = {r | q_in in r} Examples: Consider TS as below: a ---> q_a --- b ---> q_ab / q0 \ b ---> q_b --- a ---> q_ba {q0,q_a} is a region which is in pre(b) {q_ab,q_b,q_ba} is a region which is in post(b) {q0,q_b} is a region which is in pre(a) {q_a,q_ab,q_ba} is a region which is in post(a) No other subset is a region. The resulting net has 4 reachable markings. There is no region that separates q_ab and q_ba. Consider TS as below: a ---> q_a --- b ---> q_ab / q0 \ b ---> q_b {q0,q_a} is a region which is in pre(b) {q_ab,q_b} is a region which is in post(b) {q_0,q_b} is a region which is in pre(a) {q_a,q_ab} is a region which is in post(a) No other subset is a region. There is no region that explains with an a-transition is not enabled at q_b. Unsolvable words ---------------- 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". Sometimes, a word may not have an elementary net system / 1-safe net implementation but may have a k-bounded implementation. For instance, "abb" can be implemented with a 2-safe net. 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 net languages and the language hierarchy ---------------------------------------------- - 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, ... Traces ------ Independence alphabet: (Sigma, I): I irreflexive and symmetric Dependence relation: complement of I, reflexive and symmetric One step equivalence: uabv <-> ubav for (a,b) in I Trace equivalence: transitive closure of one step equivalence w <=> w' if w = w1 <-> w2 <-> ... <-> wk = w' Example: (a,b) in I: aabb <=> bbaa because aabb <-> abab <-> baab <-> baba <-> bbaa - A trace is an equivalence class with respect to <=> - [w] is the trace containing w: [w] = { w' | w <=> w' } - L is trace consistent if w in L implies [w] subset of L - Every trace is either completely in L or completely out of L - A trace consistent language L is called a "trace language" - A regular trace language is a trace language who underlying word language is regular in the usual sense Traces as labelled partial orders: - Better way of thinking of a trace - (E,<=,l) where - (E,<=) is a partial order, E is a finite set of events - l: E -> Sigma is the labelling function - (l(e),l(e')) in D implies e <= e' or e' <= e - e immediately less than e' implies (l(e),l(e')) in D - The words in [w] are all the valid linearizations of the partial order corresponding to [w] - Building a labelled partial order (E,<=,l) from w E = { (a,j) | j^th letter in w is a } <= is reflexive transitive closure of {((a,i),(b,j)) | not(aIb), i < j} l((a,j)) = a ======================================================================