Concurrency 5 The theory of CCS Specifications and Verification Expressive Power Catuscia Palamidessi

Slides:



Advertisements
Similar presentations
Substitution & Evaluation Order cos 441 David Walker.
Advertisements

1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
Process Algebra (2IF45) Abstraction in Process Algebra Suzana Andova.
1.6 Behavioral Equivalence. 2 Two very important concepts in the study and analysis of programs –Equivalence between programs –Congruence between statements.
1 Partial Order Reduction. 2 Basic idea P1P1 P2P2 P3P3 a1a1 a2a2 a3a3 a1a1 a1a1 a2a2 a2a2 a2a2 a2a2 a3a3 a3a3 a3a3 a3a3 a1a1 a1a1 3 independent processes.
Programming Paradigms for Concurrency Lecture 11 Part III – Message Passing Concurrency TexPoint fonts used in EMF. Read the TexPoint manual before you.
Behavioral Equivalence Hossein Hojjat Formal Lab University of Tehran.
ISBN Chapter 3 Describing Syntax and Semantics.
Course on Probabilistic Methods in Concurrency (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 The pi-calculus and the asynchronous.
Catriel Beeri Pls/Winter 2004/5 functional-language 1 Substitution Semantics of FL – a simple functional language FL is EL + (non-recursive) function creation.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Introduction to Computability Theory
10. Petri Nets Prof. O. Nierstrasz. Roadmap  Definition: —places, transitions, inputs, outputs —firing enabled transitions  Modelling: —concurrency.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
Correctness. Until now We’ve seen how to define dataflow analyses How do we know our analyses are correct? We could reason about each individual analysis.
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Describing Syntax and Semantics
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Remaining Topics Decidability Concept 4.1 The Halting Problem 4.2
Towers of Hanoi. Introduction This problem is discussed in many maths texts, And in computer science an AI as an illustration of recursion and problem.
MATH 224 – Discrete Mathematics
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
SDS Foil no 1 Process Algebra Process Algebra – calculating with behaviours.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 3 (26/01/2006) Instructor: Haifeng YU.
PROVE STATEMENTS ABOUT SEGMENTS & ANGLES. EXAMPLE 1 Write a two-column proof Write a two-column proof for the situation in Example 4 on page 107. GIVEN:
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Operational Semantics And Process Algebra Mads Dam Reading: Peled 8.3, 8.4, 8.6 – rest of ch. 8.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Epistemic Strategies and Games on Concurrent Processes Prakash Panangaden: Oxford University (on leave from McGill University). Joint work with Sophia.
19 Aug 2002EXPRESS On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA.
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
11/19/20151 Metodi formali nello sviluppo software a.a.2013/2014 Prof.Anna Labella.
CS 5204 Spring 99 1 A Simple Agent A CCS agent is described both by a structural diagram and one or more algebraic equations. The diagram is for readability.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
LDK R Logics for Data and Knowledge Representation ClassL (part 2): Reasoning with a TBox 1.
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Processes and Equivalences Mads Dam Reading: Peled 8.5.
2G1516/2G1521 Formal Methods2004 Mads Dam IMIT, KTH 1 CCS: Processes and Equivalences Mads Dam Reading: Peled 8.1, 8.2, 8.5.
Use right angle congruence
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
CS104:Discrete Structures Chapter 2: Proof Techniques.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova.
Agenda  Quick Review  Finish Introduction  Java Threads.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
1 Sections 6.4 – 6.5 Methods and Variables Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Proving Properties of Recursive List Functions CS 270 Math Foundations of CS Jeremy Johnson.
7/7/20161 Formal Methods in software development a.a.2015/2016 Prof.Anna Labella.
Formal Methods in software development
CS 326 Programming Languages, Concepts and Implementation
Theory of Computation Lecture 22: Turing Machines III
NPDAs Accept Context-Free Languages
Proving Properties of Recursive List Functions
Other Models of Computation
2. Definition of congruent segments AB = CD 2.
Objective of This Course
Over-Approximating Boolean Programs with Unbounded Thread Creation
Formal Methods in software development
Formal Methods in software development
L Calculus.
… NPDAs continued.
Expressive Power of CCS
Presentation transcript:

Concurrency 5 The theory of CCS Specifications and Verification Expressive Power Catuscia Palamidessi

30 Octobre 2003Concurrency 52 Definitions with parameters CCS originally had dynamic scope. This is problematic for various reasons, for instance alpha conversion does not hold. –Static scope (with constant definitions) is not an option, because it would diminish the expressive power –The modern version of CCS [Milner’99] has parametric definitions and no free variables in the body. So the scope is not an issue anymore a.0 | b.A(b)) Example of parameric definition: A(a)  a.( b)(a.0 | b.A(b)) In the following, I will consider CCS with parametric definitions.In the following, I will consider CCS with parametric definitions. Note: I will use  for definitions and a for the output action on a. Sometime I will omit parameters when they are implicit. Example: A = a.A instead of A(a) = a.A(a)

30 Octobre 2003Concurrency 53 The theory of CCS An equational theory, correct wrt observational congruence, which can be used to show that two processes are observationally congruent. Equational means that we have the usual laws of equality: –Reflexivity P = P –Symmetry P = Q  Q = P –Transitivity P = Q and Q = R  P = R –Congruence P = Q  C[Q] = C[P] for every context C[ ] Correct wrt Observational Congruence means that if we can derive P = Q, then P  Q

30 Octobre 2003Concurrency 54 Proper axioms of the theory The dynamic laws –The dynamic laws involve the dynamic operators (i.e. those operator which are not static in transtions). In CCS these are the + and the process names Monoid laws 1.P + Q = Q + P 2.P + (Q + R) = (P + Q) + R 3.P + P = P 4.P + 0 = P  laws . .P = .P 2.P + .P = .P .(P + .Q) + .Q = .(P + .Q)

30 Octobre 2003Concurrency 55 Proper Axioms of the theory The dynamic laws (cont.ed) Process definitions 1.If A  P, then A = P 2.If the “hole” in P is “guarded” then if P = C[P], and Q = C[Q], then P = Q “Guarded” means that the hole appears only after a visible action The second law is very useful for proving equality of processes defined recursively and for finding solutions of recursive definitions. Example: Assume A  a.A and B  a.a.B. It’s easy to prove that A = B. In fact, A = a.A = a.a.A by congruence and then we can apply the above axiom Note that the condition about guarded is essential for the unicity of solutions Exercise 1: Assume A  a.A + .A. Show that any process of the form  ( .P + a.0) is a solution

30 Octobre 2003Concurrency 56 Proper Axioms of the theory The static laws Parallel Composition laws 1.P | Q = Q | P 2.P | (Q | R) = (P | Q) | R 3.P | 0 = P Restriction laws 1.( a) P = P if a is not free in P 2.( a) ( b) P = ( b) ( a) P 3.( a) (P | Q) = ( a) P | ( a) Q 4.( a) P = ( b) P{b/a} alpha conversion

30 Octobre 2003Concurrency 57 Proper Axioms of the theory Expansion law P|Q =  { a.(P’ | Q) | P  P’ for some a, P’} +  { b.(P | Q’) | Q  Q’ for some b, Q’} +  { .(P’ | Q’) | P  P’ and Q  Q’ for some a, P’, Q’ } The expansion law expresses the parallel operator in terms of nondeterminism and sequentiality (parallelism as interleaving) Exercise 2: Assume A  a.A and B  a.B | a.0. Prove that A=B using the axioms. aa a b

30 Octobre 2003Concurrency 58 Example: A distributed scheduler 1,...,n are tasks identifiers. Tasks have to be executed repeatedly,in a cyclic order. There can be more than one task executed at the same time, but the next instance of Task i cannot start before previous instance has finished. Specification: We use: –a k as the signal start to Taks k and –b k as the signal that Task k has terminated Assume: –X  {1,...,n } are the tasks in progress –Task i is next ScSpec(i,X) =  { b k. ScSpec(i,X-{k}) | k  X} if i  X ScSpec(i,X) = a i.ScSpec(i+1,X  {i}) +  { b k. ScSpec(i,X-{k}) | k  X} if i  X

30 Octobre 2003Concurrency 59 Example: A distributed scheduler Implementation: We build the scheduler, Sched, as a ring of n cells each linked to one task Cell: A = a.C C = c.EE = b.D + d.B B = b.AD = d.A Note: A stands for A(a,b,c,d), B stands for B(a,b,c,d), etc. Sched = ( c 1 )...( c n ) (A(a 1,b 1,c 1,c n ) |  {D(a k,b k,c k,c k-1 ) | k  1}) Proposition (Correctness of the implementation wrt the specification): Sched = ScSpec(1,  ) Exercise 3: Prove it.

30 Octobre 2003Concurrency 510 Example: Unbounded Buffers It is possible in CCS to create structures which grow and shrink dynamically. Examples include unbounded queues and stacks. Exercise 4: specify an unbounded stack, and then provide an implementation and the proof of correctness as in previous example. You can ignore the actual data, and assume that they are just tokens, so the only relevant info is how many items are in the stack. This is equivalent to a counter. Exercise 5: Same thing, with an unbounded queue. Hint: Follow the intuition of the 2-position buffer seen in previous class, built by concatenating two 1-position buffers.

30 Octobre 2003Concurrency 511 Expressive power of CCS CCS is a Turing-complete formalism, i.e. it is able to express all computable functions. To prove this, it is sufficient to show that it is possible to simulate the behavior of Turing machines. Assuming that we know already how to implement an unbounded queue, it is convenient to consider the variant definition of Turing machines which use an unbounded queue instead of a tape. There is also a variant definition which uses two stacks instead of a tape. Exercise 6: Show how to simulate a Turing Machine