Concurrent Processes and Reaction

Similar documents
An introduction to process calculi: Calculus of Communicating Systems (CCS)

Models of Concurrency

Semantics and Verification

The Calculus of Communicating Systems

Trace Refinement of π-calculus Processes

The π-calculus. From CCS to π-calculus. The π-calculus - Basic Ideas 4/1/2004. Overview Syntax Reaction, actions, and transitions

Communication and Concurrency: CCS

Strong bisimilarity can be opened

Concurrency theory. proof-techniques for syncronous and asynchronous pi-calculus. Francesco Zappa Nardelli. INRIA Rocquencourt, MOSCOVA research team

Using the π-calculus. Evolution. Values As Names 3/24/2004

Formal Techniques for Software Engineering: CCS: A Calculus for Communicating Systems

Communication and Concurrency: CCS. R. Milner, A Calculus of Communicating Systems, 1980

Using the π-calculus. Overview. References

Formalising the π-calculus in Isabelle

Communicating and Mobile Systems

Partial model checking via abstract interpretation

The π-calculus Semantics. Equivalence and Value-Passing. Infinite Sums 4/12/2004

A Weak Bisimulation for Weighted Automata

Complex Systems Design & Distributed Calculus and Coordination

A Graph Rewriting Semantics for the Polyadic π-calculus

Semigroup presentations via boundaries in Cayley graphs 1

Modelling Membranes with Brane Calculi

A Note on Scope and Infinite Behaviour in CCS-like Calculi p.1/32

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

On Compensation Primitives as Adaptable Processes

Conjunctive Normal Form and SAT

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

MAKING THE UNOBSERVABLE, UNOBSERVABLE.

Topics in Concurrency

EMBEDDED SYSTEMS WILLIAM C. ROUNDS AND HOSUNG SONG

A π-calculus with preorders

Conjunctive Normal Form and SAT

Business Process Management

Process Algebras and Concurrent Systems

Information Systems Business Process Modelling I: Models

Information and Computation

Combining Propositional Dynamic Logic with Formal Concept Analysis

Conjunctive Normal Form and SAT

Formal Definition of a Finite Automaton. August 26, 2013

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

FORMALISING THE π-calculus USING NOMINAL LOGIC

Automata and Languages

Review of The π-calculus: A Theory of Mobile Processes

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Linear conjunctive languages are closed under complement

A Tableau Calculus for Minimal Modal Model Generation

The Buffered π-calculus: A Model for Concurrent Languages

A GENERALIZATION OF THE ISOGONAL POINT

CSEP 590 Data Compression Autumn Arithmetic Coding

Chapter XI Novanion rings

Communication Errors in the π-calculus are Undecidable

Introduction to process algebra

Foundations of Mathematics

1 Alphabets and Languages

Examples of Groups

Making the unobservable, unobservable

Recursive equations in higher-order process calculi

Uses of finite automata

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write:

Mathematical Preliminaries. Sipser pages 1-28

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

Linear Forwarders. 1 Introduction. Philippa Gardner 1, Cosimo Laneve 2, and Lucian Wischik 2

The Algebra of Connectors Structuring Interaction in BIP

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

A Behavioral Congruence for Concurrent Constraint Programming with Nondeterministic Choice

Regular expressions and Kleene s theorem

Milford Public Schools Curriculum. Department: Mathematics Course Name: Calculus Course Description:

Inner image-kernel (p, q)-inverses in rings

Spiking Neural P Systems with Anti-Spikes as Transducers

Nominal Completion for Rewrite Systems with Binders

A Language for Task Orchestration and its Semantic Properties

BASIC MATHEMATICAL TECHNIQUES

Hardware Design I Chap. 2 Basis of logical circuit, logical expression, and logical function

TRINITY COLLEGE DUBLIN. First-Order Reasoning for Higher-Order Concurrency

From CCS to Hybrid π via baby steps. Bill Rounds CSE, U of Michigan

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Compositional Asymmetric Cooperations for Process Algebras with Probabilities, Priorities, and Time

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

page 1 Total ( )

Complete Process Semantics for Inhibitor Nets Technical Report

Mobile Processes in Bigraphs. Ole Høgh Jensen. October 2006

Prove proposition 68. It states: Let R be a ring. We have the following

Model Checking. Temporal Logic. Fifth International Symposium in Programming, volume. of concurrent systems in CESAR. In Proceedings of the

Regular expressions and Kleene s theorem

The Join calculus A calculus of mobile agents

Group Theory. PHYS Southern Illinois University. November 15, PHYS Southern Illinois University Group Theory November 15, / 7

Equations, contractions, and unique solutions

Full abstraction for nominal exceptions and general references

Summary Slides for MATH 342 June 25, 2018

Decentralized Control of Discrete Event Systems with Multiple Local Specializations 1

UNIT-I. Strings, Alphabets, Language and Operations

Automata Theory and Formal Grammars: Lecture 1

Requirements-based Test Generation for Predicate Testing

Research Article A Polyadic pi-calculus Approach for the Formal Specification of UML-RT

Automata-based Verification - III

1 Reductions from Maximum Matchings to Perfect Matchings

MATH 25 CLASS 21 NOTES, NOV Contents. 2. Subgroups 2 3. Isomorphisms 4

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Trace and Testing Equivalence on Asynchronous Processes 1

Transcription:

Concurrent Processes and Reaction Overview External and internal actions Observations Concurrent process expressions Structural congruence Reaction References Robin Milner, Communication and Concurrency Robin Milner, Communicating and Mobil Systems 68

Black Boxes a A b The black box A has two ports labeled a and b. A complementary pair (b,b) of labels of Σ represents a means of interaction between black boxes. 69

Flow Graphs a A b b B c This a simple example of a flow graph that depicts the structure of a system composed of two sub-systems A and B. A flow graph depicts the linkage among its components. System A and B are connected by the complementary pair (b,b). The resulting system has two open ports a and c through which the system can interact with its environment. A flow graph does not cover any dynamic property of a system. 70

Synchronized Actions A complementary pair (b,b) denotes a synchronized action, or handshake. That is, systems can interact if they share a complementary pair of labels. A complementary pair of labels does not represent a buffer or channel having some capacity. A system A in state S A can interact with a system B in state S B if there exists a complementary pair of labels that enables both systems to perform a synchronous interaction. 7

A Concurrent System a A b b B c The composite system consists of the following sequential processes: A = a.a' A' = b.a B = b.b' B' = c.b Internal concurrency: The sub-systems A and B are running concurrently with no interdependency except that any action b by A must be synchronized with an action b by B and conversely. 7

Representing Shared Transitions a A A The bar represents the shared transition. B B c 73

System Behavior a A b b B c System behavior: The system starts with the two sequential processes simultaneously in their initial states A and B. The transition a occurs, leading to the states A and B simultaneously. The shared transition occurs, leading to the states A and B. The transition a and c occur in either order, or simultaneously, leading to the states A and B again. 74

Observable Actions The labels b and b represent observable actions, or observations. We observe b by interacting with it, that is, by performing its complement b, and conversely. We equate the concepts of interaction and observation. 75

Unobservable Actions Shared transactions cannot be observed. We can think of shared transactions as internal actions, or reactions, which is the interaction (that is, mutual observation) between two components within the system. Internal actions will be denoted by τ. Since τ is not observable, it does not have a complement. The full class of actions, both observable and internal, consists of Σ = L {τ}. 76

Concurrent Process Expressions Concurrent process expressions are defined by adding two new constructs to sequential process expression: Composition P Q to run P and Q concurrently, and Restriction new a P to restrict the scope of a name to a process. The set P of concurrent process expressions is defined by the following syntax: P ::= A a,,a n Σ i I α i.p i P P new a P where I is any finite indexing set. We use P, Q, P i, to stand for concurrent process expressions. 77

Notations We use M, N to stand for summations. The order of terms in a summation is insignificant. Prefix operations (α. and new a) bind more tightly than summation and composition. For example, new a P Q means (new a P) Q, not new a (P Q). If a summation with more than one term occurs inside a restriction or composition, we need to use parentheses to group term: (a.p b.q) c.r. We usually omit.0. Instead of a.b.0, we write simply a.b. Also, we write new a,b P or new ab P for new a new b P. 78

First Example a A b b B c The composite system consists of the following concurrent processes: A = a.b.a B = new b (A B) b.c.b The name b occurs restricted in A B. This way, the system new b (A B) can only interact with a. Once this interaction has been consumed the system evolves silently into a state where it can interact with a or c. 79

Bound Names In a restriction new a P we say that the name a is bound. We denote by fn(p) the set of all names occurring free, that is not bound, in P. Changing a bound name into a fresh name is called alphaconversion. We treat two terms as structurally congruent if one is derived from the other by alpha-conversion. For example, (new b)a.b (new b )a.b If P (new b)a.b, then{b/a}p (new b )b.b. 80

Illustrating Reaction Let P = A B with A' b.a and B b.b'. Thus a reaction between b and b can occur: P A B P b.a b.b', that is, Let P = new a ((a.q b.q ) a.0) (b.r a.r ). Then a reaction can occur either between a.q and a.0, or between b.q and b.r. In each case, alternative choices in a summation are discarded: P new a Q 0 (b.r a.r ) and P new a (Q a.0) R Note that a.r is not in the scope of the restriction new a, so the a s in a.q and a.r are different, and these two cannot react: P / new a (Q a.0) R 8

Process Context Since we have extended our process language, we need to revise our definition of structural congruence. A process context C is a process expression containing a hole, represented by [ ]. Formally, process contexts are defined as follows: C ::= [ ] α.c M C P P C new a C C[Q] denotes the result (that is, a process expression) of replacing the hole in the process context C with the process Q. The elementary process context are α.[ ] M, [ ] P, P [ ], and new a [ ]. Note, C[Q] = Q, that is, [ ] is the identity context. 8

Process Congruence Let be an equivalence relation over P, that is, is reflexive (P P), symmetric (if P Q then Q P), and transitive (if P Q and Q R then P R). Then is said to be a process congruence if it is preserved by all elementary contexts, that is, if P Q then a.p M a.q M new a P new a Q P R Q R R P R Q 83

Equivalence and Congruence An arbitrary equivalence relation is a process congruence if and only if, for all contexts C, P Q, implies C[P] C[Q]. Question: Is ~ a process congruence? We need to verify that P ~ Q implies C[P] ~ C[Q]. That is, we need to show that S = { (C[P], C[Q]) P ~ Q } is a bisimulation. 84

Structural Congruence Structural congruence, written, is the process congruence over P determined by the following equations:. Change of bound names (alpha-conversion). Reordering of terms in a summation 3. P 0 P, P Q Q P, P (Q R) (P Q) R 4. new a (P Q) new a P Q if a fn(q) 5. new a 0 0, new ab P new ba P ~ ~ A b {b/a}p ~ A if A( a) = PA 85

Example P = new new new new a ((a.q a' ((a'.q a' (((a'.q a' ((a'.q b.q b.q b.q b.q ) a.0) (b.r ) a'.0) (b.r ) a'.0) (b.r ) a'.0 (b.r a.r a.r a.r ) a.r ) )) )) () (4) (3) Involves the application of P 0 P. 86

Standard Form A process expression new ~ a (M... M ), where each M i is a n non-empty summation, is said to be in standard form. (If n = 0 ~ we take M M n to mean 0. If a is empty then there is no restriction.) Theorem: Every process is structurally congruent to a standard form. Proof: For any restriction new a inside a summation, we can bring it to the outermost by using alpha-conversion (if necessary) followed by the rule new a P Q new a (P Q) in conjunction with some of the laws of structural congruence (3). 87

Process Linking Consider a process P with two ports labeled a and b. a P b We often want to create a chain of such processed, linking the right port of one with the left of the next: a P P P n b For this purpose, we can define a binary linking operator P ) Q = new m ({m/b}p {m/a}q) where m does not occur free in P or Q. 88

Reaction Reaction rules, with the help of structural congruence, define how different concurrent components of a process expression can react one with another. The REACT rule allows reaction to occur between an action and its complement: (a.p M) (a.q N) P Q The TAU rule allows the internal τ-action to occur: τ.p M P In each case, zero or more alternatives represented by M and N are discarded. 89

When Is Reaction Possible? The REACT and TAU rule cannot be applied just anywhere in a process. In fact, a reaction cannot occur underneath a prefix. For example, in P a.(b.q b.r) the interaction between b.q and b.r cannot occur until the action a has been observed. However, this reaction can occur in the context C = a.a [ ] : C[P] = a.a a.(b.q b.r) A (b.q b.r) A Q R Finally, reaction can occur inside a composition and restriction. 90

Reaction Rules The reaction relation over P contains exactly those transition that can be inferred from the rules in the following table: TAU: τ.p M P REACT: (a.p M) (a.q N) P Q P PAR: P Q P' P' Q P P' RES: new a P new a P' P Q STRUCT: P P' Q Q' P' Q' 9

Reaction Example P = new a ((a.q b.q ) a.0) (b.r a.r ) new new (a.q (a.q a ((a.q b.q ) a b.q ) a Q Q 0 b.q ) a) REACT STRUCT (P 0 P) new a Q RES a ((a.q b.q ) a.0) (b.r a.r ) new a Q (b.r a.r ) PAR 9

Summary We have introduced concurrent processes, which can be built using: Summation (or choice) Parallel composition (concurrency) Restriction Process Definitions Complementary pairs of names represent a means of interaction between two processes. Reactions P P represent the process interactions occurring internally within the process P. Reaction does not define, how a process P can interact with the environment or other processes. 93