7 October 2002PPDP 20021 On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA.

Slides:



Advertisements
Similar presentations
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
1 Temporal Claims A temporal claim is defined in Promela by the syntax: never { … body … } never is a keyword, like proctype. The body is the same as for.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
February 6, 2015CS21 Lecture 141 CS21 Decidability and Tractability Lecture 14 February 6, 2015.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
1 Conditional XPath, the first order complete XPath dialect Maarten Marx Presented by: Einav Bar-Ner.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
CHAPTER 4 Decidability Contents Decidable Languages
Specification Formalisms Book: Chapter 5. Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct.
Review of the automata-theoretic approach to model-checking.
Normal forms for Context-Free Grammars
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Regular Expressions and Automata Chapter 2. Regular Expressions Standard notation for characterizing text sequences Used in all kinds of text processing.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
CSCI 2670 Introduction to Theory of Computing September 21, 2005.
Languages of nested trees Swarat Chaudhuri University of Pennsylvania (with Rajeev Alur and P. Madhusudan)
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Grammars CPSC 5135.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
Managing XML and Semistructured Data Lecture 13: XDuce and Regular Tree Languages Prof. Dan Suciu Spring 2001.
19 Aug 2002EXPRESS On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
An Introduction to Rabin Automata Presented By: Tamar Aizikowitz Spring 2007 Automata Seminar.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
Quantified Data Automata on Skinny Trees: an Abstract Domain for Lists Pranav Garg 1, P. Madhusudan 1 and Gennaro Parlato 2 1 University of Illinois at.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Formal Methods in software development
Copyright © Cengage Learning. All rights reserved.
LIMITS OF ALGORITHMIC COMPUTATION
CSE 105 theory of computation
Introduction to Finite Automata
Formal Methods in software development
Instructor: Aaron Roth
CSE 105 theory of computation
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
CSE 105 theory of computation
Presentation transcript:

7 October 2002PPDP On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA Frank Valencia, BRICS

7 October 2002PPDP 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

7 October 2002PPDP Timed ccp Ccp [Panangaden, Rinard, Saraswat 1991] processes communicate via a common store of constraints y > x tell(x=1) ask(y>0)

7 October 2002PPDP response Timed ccp tcc [Saraswat, Jagadeesan, Gupta, 1994] variant of deterministic 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 stimulus

7 October 2002PPDP 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

7 October 2002PPDP 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 October 2002PPDP ( (local x,c) P, d ) ( (local x,c’) P’, d and  x c’ ) (unless c next P, d) (skip, d) ( P, c ) (F(Q), d ) Timed ccp Transition rules (cont.ed) d |- c ( P, c ) * ( Q, d ) ( 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)

7 October 2002PPDP Timed ccp Operators for 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 ccp rule (shown before) induces dynamic scope (! P, c) (P || next ! P, c ) (A(y), c) (Q, d ) (P[y/x], c) (Q, d ) ((local x) P, c ) ( P[y/x], d ) y fresh

7 October 2002PPDP Timed ccp Dynamic scope vs Static scope Example: Let A be defined as A == tell(x=1) || P Consider the process (local x) A Classic rule: The x in A’s def is captured by the scope of (local x) ((local x) A,true) ((local x) tell(x=1) || P, true) ((local x, x=1) P, true) New rule: The first step eliminates (local x) ((local x) A,true) ( A, true) (tell(x=1) || P, true) ( P, x=1 )

7 October 2002PPDP Timed ccp Example A ==tell(light = off) || unless (toggle_switch) next A || when (toggle_switch) do next B B ==tell(light = on) || unless(toggle_switch) next B || when(toggle_switch) do next A ttptoff on off

7 October 2002PPDP Observables and equivalences Stimulus-response (or input-output) 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) Timed ccp c1c1 c5c5 c4c4 d1d1 d2d2 d4d4 d3d3 d5d5 c2c2 c3c3

7 October 2002PPDP 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

7 October 2002PPDP rec i rec 0 The tcc hierarchy rep rec s rec p rec d inclusion encoding Undecidable Decidable

7 October 2002PPDP 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

7 October 2002PPDP 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, ind,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)

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

7 October 2002PPDP

7 October 2002PPDP Undecidability of rec p B i (b 1,b 2, ind, 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(ind,x) == (local b 1 b 2 ) tell(b 1 =1) || tell(b 2 =1) || A 0 (b 1,b 2,ind,x) B(ind,x,ok) == (local b 1 b 2 ) tell(b 1 =1) || tell(b 2 =1) || B 0 (b 1,b 2,ind,x,ok)

7 October 2002PPDP 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.

7 October 2002PPDP 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

7 October 2002PPDP Relevant constraints of  = {P 1,…,P n }: all constraints that can be constructed from constraints in P 1,…,P n. Formally: RC(skip) = {true} RC(tell(c)) = {c} RC(when c do P) = RC(unless c next P) = {c} U RC(P) RC(P || Q) = RC(P) U RC(Q) RC(!P) = RC(next P) = RC(P) RC((local x) P) = { Ex c, Ax c) | c in Closure(RC(P)) } RC  = And_Closure( Closure(RC(P 1 ) ) U … U Closure(RC(P n )) ) Lemma 1: RC(  ) is finite Lemma 2: For P in , (P,c) (P’,c and d) iff (P,c(  )) (P’,c(  ) and d) where c(  ) = max { d in C(  ) |  c |- d } (it always exists because RC(  ) is and-closed) RC(  ) c(  ) Construction of the finite automata for P,Q c

7 October 2002PPDP Let S be the set of relevant constraints for  = { P, Q } Derivatives of P wrt S = { P’ | (P,c) * (P’,c’), c in S }/~, where ~ is the smallest congruence containing P ~ P || P Lemma: There are finitely many derivatives of P wrt S The automaton for P (the one for Q is analogous) States: The derivatives of P wrt S Arcs: (c,d) in S x S 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 Construction of the finite automata for P, Q

7 October 2002PPDP 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

7 October 2002PPDP rec i rec 0 Expressiveness Equivalences rep rec s rec p rec d inclusion encoding Undecidable Decidable

7 October 2002PPDP [[ ! P ]] = R P (x) with procedure definition R P (x) == P || next R P (x) and x = fv(P) [[ ]] is homomorphic in all other operators Example: [[ ! tell(x=1) ]] = R(x) with R(x) == tell(x=1) || next R(x) Encoding rep in rec i

7 October 2002PPDP [[ P]] = (local z A1 … z An ) ( [[P]]’ ||  i [[ A i = P i ]]’ ) [[ A i == P i ]]’ = ! when call(z Ai ) do [[P]]’ [[ A i ]]’ = tell( call(z Ai ) ) [[ (local x) P ]]’ = (local y) ( [[P]]’ [y/x] ) with y fresh The other operators are translated homomorphically Example: A == tell(x=1) || A [[A]] = (local z) (tell(call(z A ))) || ! when call(z A ) do ( tell(x=1) || tell(call(z A )) ) Encoding rec s in rep

7 October 2002PPDP This encoding uses the representation of rep processes as Buchi Automata Let P be in rep and let A be the Buchi automaton associated to it (considering the relevant constraints of P only): Given a state Q of A, define A Q ==  (Q  c  =>(Q,d) when c do ( (tell(d) || unless e next A R ) ) where e = V { c’ | c’ =/= c, c’ |- c and (Q  c  =>(Q,d) } Encoding rep in rec s

7 October 2002PPDP [[ A == P ]] = A(x) == [[ P ]] where x = fv(P) [[ A ]] = A(x) All the other operators are homomorphic Encoding rec d in rec p

7 October 2002PPDP [[ A(x) == P ]] = A == [[ P ]] [[ A(y) ]] = (local x) (A || repeat tell(x=y)) All the other operators are homomorphic Encoding rec p in rec d

7 October 2002PPDP Various expressiveness results (positive and negative) for various tcc dialects The fact that we are in a timed framework does not seem to play a crucial role. Do the results hold also in (deterministic) ccp? The equivalence between rec d and rec p holds also in det ccp We don’t know about the separation results (although we feel they still hold) The other results involve rep and we should first define ! P in a non-timed context ( ! P = P || ! P is not interesting in deterministic ccp) Does static vs dynamic scope make a difference also in other concurrent languages, for instance ccs? And how about replication vs recursion? Conclusion and future work