Concurrency Theory: Lecture 11, 28 February 2017 ------------------------------------------------ Synthesis Given a behavioural description, construct a machine "implementation" ---------------------------------------------------------------------- Behaviour is a regular trace language L over (Act,I) Implementation should "structurally" reflect I -- don't want a trivial sequential implementation: - For instance, (a,b) in I, trace language {ab,ba} should be implemented as a labelled net with two independent transitions labelled a and b, not four labelled transitions corresponding to ab + ba with two copies each of a and b. - Labelled nets: transitions are independent if they have disjoint neighbourhoods. - Better way to think of independence is in terms of "components". System is a set of parallel components that interact. Not easy to impose component structure on nets ---------------------------------------------------------------------- Regular trace languages and minimal DFA - w ~ w' means for all u, wu in L iff w'u in L - w and w' are right-congruent (Myhill Nerode), so minimal DFA reaches same state on w and w' - In particular, if (a,b) in I, wab ~ wba. So, at any state in the minimal DFA, transitions on independent letters form a diamond - This allows us to check if a regular language is trace closed wrt I: check that the minimal DFA has diamonds for every state and every pair of independent letters. ---------------------------------------------------------------------- Distributed alphabets: - (Act_1, Act_2,..., Act_k), Act = Union_i Act_i Independent actions happen at disjoint locations - loc(a) = { i | a in Act_i} - (a,b) in I_loc if loc(a) intersect loc(b) is empty Distributed alphabet induces a trace alphabet (Act,I_loc) Conversely, can "implement" (Act,I) as a distributed alphabet - Recall D, the dependence relation, is the complement of I - For every (a,b) in D, create a component to "witness" dependency - Given dependency graph (Act,D), for each edge e = (a,b) in D, add a component A_e = {a,b} - Check that this induces an independence relation I_loc that is same as the original - Can also cover cliques: if {a,b,c} are all dependent on each other, can have a single component {a,b,c} instead of three components {a,b}, {b,c}, {a,c} covering the three edges - This can save components compared to having one per edge, but maximal cliques can also be exponential in size of alphabet Distributed automata: - A_i = (Q_i, ->_i, Qin^i, F_i) is an automaton on Act_i - A_1 || A_2 || ... || A_k is an automaton on Act = Union_i Act_i - Components should synchronize on shared actions Direct Product A_1 || A_2 || ... || A_k: - A = (Q,->,Qin,F) over Act - Q = Q_1 x Q_2 x ... x Q_k - Qin = Qin^1 x Qin^2 x ... x Qin^k - F = F_1 x F_2 x ... x F_k - (q1,q2,...,qk) --a--> (q'1,q'2,...,q'k) provided - for each j in loc(a), qj --a-->_j q'j is a valid local move in A_j - for each j not in loc(a), qj = q'j, so A_j does not make any move Direct products accept shuffle closed languages - Project(w,Act_i) is projection of w on letters in Act_i - shuffle(L,Act_1,...,Act_k) = { w | for each i, there is some u_i in L such that Project(w,Act_i) = Project(u_i,Act_i) } - A direct product language is the product of its projections ---------------------------------------------------------------------- Checking if a language is a direct product language - Given an automaton A for L, project L onto each Act_i to get A_i - Check that L(A_1 || ... || A_k) = A (product of projections) ---------------------------------------------------------------------- Regular trace languages are closed under boolean operations. Direct product languages are not closed under union. Counterexample: Distributed alphabet = ({a},{b}) - L1 = {ab,ba} and L2 = {aabb, abab, abba, baab, baba, bbaa} are both direct product languages. - L = L1 union L2 cannot be a direct product language because aab not in L, but aab is in shuffle(L, {a}, {b}) since Project(w,{a}) = Project(ab,{a}) and Project(w,{b}) = Project(aabb,{b}). Hence, need to go beyond direct product automata to capture all regular trace languages. ======================================================================