Presentation is loading. Please wait.

Presentation is loading. Please wait.

19 Aug 2002EXPRESS 20021 On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA.

Similar presentations


Presentation on theme: "19 Aug 2002EXPRESS 20021 On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA."— Presentation transcript:

1 19 Aug 2002EXPRESS 20021 On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA Frank Valencia, BRICS

2 19 Aug 2002EXPRESS 20022 Plan of the talk Introduction to timed ccp (tcc) Various tcc dialects: iteration / recursion, parameters yes / no, Non local vars yes / no static / dynamic scope Equivalence results Recursion, static scope, no pars Replication Recursion, dynamic scope, no pars Recursion, pars Separation results The first class is strictly less expressive than the second class

3 19 Aug 2002EXPRESS 20023 Timed ccp Ccp [Panangaden, Rinard, Saraswat 1991] processes communicate via a common store of constraints y > x tell(x=1) ask(y>0)

4 19 Aug 2002EXPRESS 20024 Timed ccp tcc [Saraswat, Jagadeesan, Gupta, 1994] variant of ccp to program reactive systems time is divided in discrete intervals (time units) in each time unit a process receives a stimulus (initial store) and it computes till it reaches a resting point. The final store is the response. time unit stimulusresponse

5 19 Aug 2002EXPRESS 20025 Timed ccp Syntax of tcc Finite processes P ::= skip | tell(c) | when c do P | P||Q | (local x) P | next P | unless c next P c represents a constraint when is tcc for ask local x is tcc for the existential next refers to the next time interval

6 19 Aug 2002EXPRESS 20026 Timed ccp Operational semantics of tcc Configuration: ( P, c ) Transition rules (tell(c), d) (skip, c and d) processstore (when c do P, d) (P, d) d |- c ( P||Q, c ) ( P || Q’, d ) ( Q, c ) ( Q’, d ) ( P||Q, c ) ( P’ || Q, d ) ( P, c ) ( P’, d )

7 19 Aug 2002EXPRESS 20027 (unless c next P, d) (skip, d) ( P, c ) (F(Q), d ) Timed ccp Transition rules (cont.ed) d |- c ( P, c ) * ( Q, d ) ( (local x,c) P, d ) ( (local x,c’), d and  x c’ ) ( P, c and  x d) ( P’, c’ and  x d) Future function F(next P) = P F(unless c next P) = P F(when c do P) = skip F(P || Q) = F(P) || F(Q) F((local x) P) = (local x) F(P)

8 19 Aug 2002EXPRESS 20028 Timed ccp Operators for (potentially) infinite behavior Iteration ! P Recursion A(x) = P syntactic restrictions ensure that a process stops after a finite number of steps in each time unit Locality rule for static scope (the standard rule induces dynamic scope) (! P, c) (P || next ! P, c ) (A(y), c) (Q, d ) (P[y/x], c) (Q, d ) ((local x) P, c ) (Q, d ) ( P[y/x], c ) (Q,d ) y fresh

9 19 Aug 2002EXPRESS 20029 Timed ccp Observables and equivalences Stimulus-response relation io(P) = { (c 1.c 2.c 3 …,d 1.d 2.d 3 ….) | (P,c 1 ) (P 1, d 1 ) (P 1,c 2 ) (P 2, d 2 ) (P 2,c 3 ) (P 3, d 3 ) … } Equivalence P eq Q iff io(P) = io(Q) Congruence P cong Q iff C[P] eq C[Q] for every context C[]

10 19 Aug 2002EXPRESS 200210 Variants of tcc Based on finite tcc replicatrecursparamsloc varsscope rep yesno --- rec 0 noyesno - rec p noyes no- rec i noyesidenticalno- rec d noyesnoyesdynamic rec s noyesnoyesstatic

11 19 Aug 2002EXPRESS 200211 The tcc hierarchy rec 0 rec i rep rec s rec p rec d inclusion encoding Undecidable Decidable

12 19 Aug 2002EXPRESS 200212 Undecidability of rec p The equivalence of processes in rec p is undecidable. In fact, it is possible to reduce the Post Correspondence Problem (PCP) to the problem of non-equivalence between rec p processes. Post Correspondence Problem: Given two sets of words V = {v 0, v 1, v 2, … } and W = {w 0, w 1, w 2, … } on a generic alphabet containing at least two symbols, the PCP consists in finding a sequence of indexes i 0,i 1,i 2,… such that v i 0.v i 1.v i 2. …= w i 0.w i 1.w i 2.… Given V, W, we define two processes A and B such that the PCP (V, W) has a solution iff it is not the case that A eq B

13 19 Aug 2002EXPRESS 200213 Undecidability of rec p wait c do P = when c do P || unless c next wait c do P repeat Q = Q || next repeat Q W i (x) =  k< |wi| next k tell(x =w i [k]) V i (x) =  k< |vi| next k tell(x =v i [k]) A i (b 1,b 2, index,x) = (local a 1,a 2,ichosen) wait b 1 =1 do (W i (x) || next |wi| (tell(b 1 =0) || tell(a 1 =1) ) || wait b 2 =1 do (V i (x) || next |vi| (tell(b 2 =0) || tell(a 2 =1) ) ||  j in I when index=j do (tell(ichosen=1) || Aj(a1,a2,index,x) ) || Abort(ichosen) Abort(ichosen) = unless ichosen=1 next repeat tell(false) || when false do repeat tell(false)

14 19 Aug 2002EXPRESS 200214 Undecidability of rec p index = 3 v0v0 index = 2 index = 1 w0w0 v3v3 v1v1 w1w1 w3w3 b 1 =0 b 2 =0 The sequence 0, 3, 1 is a solution for the PCP for (V,W). The symbols of v i’ s and w j ’s are checked at every time interval, if they do not correspond then we get an inconsistency

15 19 Aug 2002EXPRESS 200215 Undecidability of rec p B i (b 1,b 2, index, x, ok) = (local a 1,a 2,ichosen) wait b 1 =1 do (W i (x) || next |wi| (tell(b 1 =0) || tell(a 1 =1) ) || wait b 2 =1 do (V i (x) || next |vi| (tell(b 2 =0) || tell(a 2 =1) ) ||  j in I when index=j do (tell(ichosen=1)) || Bj(a1,a2,index,x) ) || Abort(ichosen) || wait b1=0 and b2=0 do tell(ok=1) A(index,x) = (local b 1 b 2 ) tell(b 1 =1) || tell(b 2 =1) || A 0 (b 1,b 2,index,x) B(index,x,ok) = (local b 1 b 2 ) tell(b 1 =1) || tell(b 2 =1) || A 0 (b 1,b 2,index,x,ok)

16 19 Aug 2002EXPRESS 200216 Undecidability of rec p A(index,x) eq B(index,x,ok) iff the tell(ok=1) in B i is never executed, namely iff it is never the case that b 1 = 0 and b 2 = 0 at the same time. But this holds iff the answer to the PCP for (V,W) is negative. Since the PCP is undecidable, also the question whether P eq Q is undecidable.

17 19 Aug 2002EXPRESS 200217 Decidability of rep The key idea is to encode the processes of rep in Buchi automata in such a way that the stimulus-response behavior can be retrieved from the language accepted by the automaton Buchi automata are finite automata equipped with an acceptance condition that is appropriate for (  -) infinite sequences: A sequence is accepted by the automaton iff the automaton can read it from left to right while visiting a sequence of states in which some final state occurs infinitely often. a a b b b a a  is not in the language (ab)  and b  are in the language Language equivalence of Buchi Automata is decidable

18 19 Aug 2002EXPRESS 200218 Construction of finite automata for P,Q Derivative of P wrt S : the transitive closure of the set { P’ | (P,c) (P’,c’), c in S }/~, where ~ is the smallest congruence containing P ~ P || P If S is finite, then the derivatives of P wrt S is finite Let S be the (finite) set of relevant constraints for P, Q The automaton for P (for Q is analogous) States: The derivatives of P wrt S Arcs: (c,d) is and arc from P’ to P’’ iff (P’,c) (R,d) and P’’~ R Theorem: P eq Q iff the automaton corresponding to P and Q are language-equivalent Decidability of rep

19 19 Aug 2002EXPRESS 200219 Relevant constraints of P 1,…,P n,  (P 1,…,P n ): all constraints that can be constructed from constraints occurring in P 1,…,P n. Formally: C(skip) = {true} C(tell(c)) = {c} C(when c do P) = C(unless c next P) = {c} U C(P) C(P || Q) = C(P) U C(Q) C(!P) = C(next P) = C(P) C((local x) P) = { Ex c, Ax c) | c in Closure(C(P)) }  (P 1,…,P n ) = And_Closure( Closure(C(P 1 ) ) U … U Closure(C(P n )) ) Theorem: (P,c) (Q,c and d) iff (P,c(  )) (Q,c(  ) and d) where c(  ) = max { d in C(  c |- d } Decidability of rep

20 19 Aug 2002EXPRESS 200220 This separation is rather obvious: in rec 0 a process can be active through infinitely many time units, but eventually it will stop producing information, because recursion contains neither parameters, nor local variables, hence processes cannot communicate with the external world For instance, (true ,(x=1)  ) is not in io(P) for any P in rec 0. In general the max number of steps during which info on x can be produced is not greater than the max number of nested next operators in whose scope x occurs free (not existentially quantified) In rep it is possible to expess such io behavior: ! tell(x=1) Separation between rep and rec 0

21 19 Aug 2002EXPRESS 200221 Encodings rec 0 rec i rep rec s rec p rec d inclusion encoding Undecidable Decidable

22 19 Aug 2002EXPRESS 200222 to be written Encoding of rep in rec s


Download ppt "19 Aug 2002EXPRESS 20021 On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA."

Similar presentations


Ads by Google