UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine1 CSE 503 – Software Engineering Lecture 7: Process calculi and refinement Rob DeLine 19 Apr.

Slides:



Advertisements
Similar presentations
1 Reasoning with Promela Safety properties bad things do not happen can check by inspecting finite behaviours Liveness properties good things do eventually.
Advertisements

CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Formal Semantics of Programming Languages 虞慧群 Topic 6: Advanced Issues.
Formal verification in SPIN Karthikeyan Bhargavan, Davor Obradovic CIS573, Fall 1999.
Programming Paradigms for Concurrency Lecture 11 Part III – Message Passing Concurrency TexPoint fonts used in EMF. Read the TexPoint manual before you.
Software Engineering, COMP 201 Slide 1 Automata and Formal Languages Moore and Mealy Automata Ralf Möller Hamburg Univ. of Technology based on slides by.
ZEIT2301 Design of Information Systems Behavioural Design: State Machines School of Engineering and Information Technology Dr Kathryn Merrick.
Behavioral Equivalence Hossein Hojjat Formal Lab University of Tehran.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 11: An introduction to CSP.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Course on Probabilistic Methods in Concurrency (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 The pi-calculus and the asynchronous.
Dependable Composition of Web Services and Process Calculi Manuel Mazzara Newcastle University.
1 Ivan Lanese Computer Science Department University of Bologna Roberto Bruni Computer Science Department University of Pisa A mobile calculus with parametric.
07/06/98 知的インタフェース特論 1 Operational Semantics Again, the question? Operational Model = Labeled Transition System If P and Q yields a same LTS. How to define.
Models of Computation for Embedded System Design Alvise Bonivento.
Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan.
1 Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy.
C SC 520 Principles of Programming Languages 1 C SC 520: Principles of Programming Languages Peter J. Downey Department of Computer Science Spring 2006.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 11: An introduction to CSP.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
A Formal Model of Modularity in Aspect-Oriented Programming Jonathan Aldrich : Objects and Aspects Carnegie Mellon University.
Lecture 6 Template Semantics CS6133 Fall 2011 Software Specification and Verification.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 10 Techniques for Requirements Definition and Specification II.
Coalgebraic Symbolic Semantics Filippo Bonchi Ugo Montanari.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
CSE S. Tanimoto Lambda Calculus 1 Lambda Calculus What is the simplest functional language that is still Turing complete? Where do functional languages.
SDS Foil no 1 Process Algebra Process Algebra – calculating with behaviours.
Advanced Topics in SE Spring Process Algebra Hossein Hojjat Formal Methods Lab University of Tehran.
Model Based Testing Group 7  Nishanth Chandradas ( )  George Stavrinides ( )  Jeyhan Hizli ( )  Talvinder Judge ( )  Saajan.
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.
Microsoft Research, Foundations of Software EngineeringW. Grieskamp et. al: Behavioral Compositions in Symbolic Domains Behavioral Composition in Symbolic.
Characterizing Progress Properties of Concurrent Objects via Contextual Refinements Hongjin Liang Univ. of Science and Technology of China (USTC) Joint.
Introduction to CSP Alexandre Mota
CSP: Communicating Sequential Processes. Overview Computation model and CSP primitives Refinement and trace semantics Automaton view Refinement checking.
Internet Security CSCE 813 Communicating Sequential Processes.
11/19/20151 Metodi formali nello sviluppo software a.a.2013/2014 Prof.Anna Labella.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
Laws of concurrent design Tony Hoare Microsoft ResearchCambridge FMCAD October.
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.
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
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.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine1 CSE 503 – Software Engineering Lecture 3: An introduction to Alloy Rob DeLine 5 Apr 2004.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Writing, Verifying and Exploiting Formal Specifications for Hardware Designs Chapter 3: Verifying a Specification Presenter: Scott Crosby.
Types and Programming Languages Lecture 16 Simon Gay Department of Computing Science University of Glasgow 2006/07.
Software Engineering Algorithms, Compilers, & Lifecycle.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VII. System Specification (I)
Formal verification in SPIN
CSE 503 – Software Engineering
ISA 763 Security Protocol Verification
Testing the Software with Blinders on
Assembler, Compiler, Interpreter
Threads and Memory Models Hal Perkins Autumn 2011
Problem Solving Techniques
CS 154, Lecture 6: Communication Complexity
Instructor: Alexander Stoytchev
Hoare-style program verification
Threads and Memory Models Hal Perkins Autumn 2009
Assembler, Compiler, Interpreter
Guest Lecture by David Johnston
A Refinement Calculus for Promela
CSE 503 – Software Engineering
Presentation transcript:

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine1 CSE 503 – Software Engineering Lecture 7: Process calculi and refinement Rob DeLine 19 Apr 2004

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine2 From model checking to math Promela describes concurrent, communicating processes  we use it to describe whole (closed) systems  no support for compositional reasoning Spin checks properties encoded in LTL  very rich properties, but hard for non-experts to understand  for example (from Dwyer et al): “S precedes P after Q” □  Q  ◊ (Q  (  P U (S  □  P))) Process calculi can address both these shortcomings  provide a way to reason about processes in isolation  check whether a process “behaves like” another (simpler) process also  provide a foundational computing model like Turning machines  form a huge intellectual field, which we will sample

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine3 Reasoning about processes We want a conformance relation ≤ that supports...  Substitutability Impl ≤ Spec  Spec|P is “safe”  Impl|P is “safe” (any P)  Modular reasoning Impl 1 ≤ Spec 1  Impl 2 ≤ Spec 2  (Impl 1 |Impl 2 ) ≤ (Spec 1 |Spec 2 ) Substitutability  Reasoning about Spec is easier than reasoning about Impl  Spec can be treated as a contract by anyone implementing P Modular reasoning  The process Impl 1 |Impl 2 can be too large for model checking  If Spec 1 |Spec 2 is “safe” then so is Impl 1 |Impl 2 We define conformance precisely in a process calculus

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine4 Process calculi: a healthy competition CSP Communicating Sequential Processes Invented by Tony Hoare Semantics based on traces Has many applications in the SE research community CCS Calculus of Communicating Systems Invented by Robin Milner Semantics based on transition rules Famously led to the π calculus Precisely capturing the differences between them is still an open problem!

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine5 Biggest difference: nondeterminism Do these two machines “behave” the same? a a a a b c a c b Do they have the same traces? the same refusals? (refusals are the actions the machine will not take in a given state) Does the difference matter?

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine6 The difference might matter if the machine is Milner’s drink machine CCS distinguishes these machines, CSP does not We’ll study CCS in order to use Zing’s conformance 2p tea coffee 2p coffee tea

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine7 CCS processes P ::= 0 A α.P α.P P|Q new a P with equations A(a 1,...,a n ) = P and labels L = {a,b,c,...,a,b,c,...} α in L + {τ} (similar Promela definition) proctype Zero () { } proctype Call () { run A(a1,...,an); } proctype Choice () { if ::... :: fi } proctype Para () { run P(); run Q(); } proctype Hide () { chan c = [n]of{t}; run P(c); }

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine8 Label decorations Labels a and a are flip sides of the same action  This is the single form of process coordination in CCS  E.g. a = read and a = write, a = send and a = receive Picture the button on our drink machine pushing the button is one action seen from two perspectives

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine9 Internal vs external choice Who determines what a process does next?  The process itself? P = τ.Q + τ.R + τ.S P = Q # R # S (in paper)  Or the environment? P = a.Q + b.R + c.S CSP also makes this distinction: P □ Q vs P ┌┐ Q proctype P () { if :: run Q(); :: run R(); :: run S(); fi } proctype P () { int x; if :: a?x -> run Q(); :: b?x -> run R(); :: c?x -> run S(); fi }

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine10 Example: drink machines A = 2p.B B = tea.A + 2p.C C = coffee.A W = τ.W1 + τ.W2 W1 = 2p.X W2 = 2p.Y X = 2p.Z Y = tea.W Z = coffee.W 2p tea coffee A B C 2p coffee tea W X Y Z 2p coffee tea W2 X Y Z W W1 τ τ A(2p,tea,coffee) = 2p.B B(2p,tea,coffee) = tea.A + 2p.C C(2p,tea,coffee) = coffee.A

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine11 CCS definition 1/2 The syntax distinguishes processes that are really “the same” Structural congruence (  ) defines that “sameness”  new a P  new b (P[b/a]) (alpha conversion, a free in P)  P + Q  Q + P(reorder terms in sum)  P|0  P  P|Q  Q|P  P|(Q|R)  (P|Q)|R  new a (P|Q)  P|(new a Q)(a not free in P)  new a 0  0  new a new b P  new b new a P

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine12 CCS definition 2/2 Labeled transition system defines operational semantics

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine13 Processes shouldn’t get “stuck” Informally, a process is stuck if  It wants to do an input and no other process can do the dual output  It wants to do an output and no other process can do the dual input  (The latter is particularly interesting for error codes.) Formally, process P stuck on ã if  new a P is an end-state (no applicable transition rules)  exists label λ and process P’ such that P  P’ and λ or λ in ã  where ã is a sequence of labels Stuck-free is our “safe” condition for conformance Impl ≤ Spec  Spec|P is stuck-free  Impl|P is stuck-free (any P) λ

UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine14 Definition of conformance P ≤ Q is the largest relation such that  If P  P’, then exists Q’ such that Q  Q’ and P’ ≤ Q’  If P can refuse X while ready on Y, then Q can refuse X while ready on Y where P refuses X  L iff  P is stable (no P’ such that P  P’   {a | P  P’ for some P’ } & { a | a  X } =  P can refuse X iff  exists P’ s.t. P  P’ and P’ refuses X P ready on Y (for singleton or empty Y) iff  P is stable  exists P’ such that P  P’ for λ in Y a τ* λ τ* τ τ* λ λ