Concurrency Theory: Lecture 2, 04 January 2018 ---------------------------------------------- Petri Nets: - Net N = (P,T,F) - P : Places = "local" states - T : Transitions - F : Flow relation - subset of (P x T) U (T x P) - Firing - Marking M : P -> {0,1,2,...} - Pre(t) = { p | (p,t) in F }, Post(t) = { p | (t,p) in F } - t is enabled if M(p) >= 1 for each p in Pre(t) - If t fires at M, the new marking M' is given by - For p in Pre(t) \ Post(t): M'(p) = M(p) - 1 - For p in Post(t) \ Pre(t): M'(p) = M(p) + 1 - For all other p in P, M'(p) = M(p) Examples: Mutual-exclusion Reachable markings (marking graph) - Define inductively, from initial marking - Reachable markings generate transition system TS = (S,->,s_in) - In general, this is not a finite-state system even if P is finite - Bounded nets - k-safe: no place ever has more than k tokens, 1-safe is a common case - With more than one token, can express 2-out-of-3 mutual exclusion etc Elementary net systems - Restrict markings to single token: M subset of P, or M : P -> {0,1} - Modify firing rule: t is enabled at M if - Pre(t) is a subset of M: i.e., M(p) = 1 for all p in Pre(t) - Post(t) intersect M = empty: i.e., M(p) = 0 for all p in Post(t) - Notice that a transition connected to a place by a self-loop can never fire - An elementary net system is always finite-state Fundamental relationships between transitions - Concurrency M enables t and t', and neighbourhoods of t, t' are disjoint - Conflict M enables t and t', and neighbourhoods of t, t' overlap - Causality M -t-> M' -t-> M'' and Post(t) overlaps with Pre(t') Contact - Transition disable because output place is marked - Add complementary places (arrows reversed, initial marking inverted) to get contact-free elementary net system with isomorphic marking graph Concurrency and diamonds in TS - Independent transitions generate forward and sideways diamonds - In elementary net system, every diamond represents concurrency - Not so in general for 1-safe nets Confusion - Was a conflict resolved? Occurrence of an independent transition creates/removes a conflict. Conflict(t,M) = { t' | M--t--> and M--t'--> and t,t' in conflict} Confusion occurs when M --t'-->M' and for some t independent of t', Conflict(t,M) =/= Conflict(t,M'). - Conflict set can either grow or shrink - Two fundamental types of confusion, symmetric and asymmetric - Confusion reflects interaction between concurrency and conflict (choice) and is one of the reasons why analysis of concurrent systems is harder than sequential systems Free choice nets - Avoid confusion by restricting net structure - Can derive stronger decidability/algorithmic results for free choice nets: empirical evidence that lack of confusion simplifies analysis. ----------------------------------------------------------------------