A theory of DbC for multiparty distributed interactions Emilio Tuosto University of Leicester Nobuko Yoshida Imperial College London Kohei Honda Queen.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Design by Contract.
An Abstract Interpretation Framework for Refactoring P. Cousot, NYU, ENS, CNRS, INRIA R. Cousot, ENS, CNRS, INRIA F. Logozzo, M. Barnett, Microsoft Research.
Semantics Static semantics Dynamic semantics attribute grammars
Inference of progress properties for (multi party) sessions Mario Coppo (Universita’ di Torino) joint work with Mariangiola Dezani, Nobuko Yoshida Lisbon,
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
INF 212 ANALYSIS OF PROG. LANGS Type Systems Instructors: Crista Lopes Copyright © Instructors.
The Spin Model Checker Promela Introduction Nguyen Tuan Duc Shogo Sawai.
VIDE als voortzetting van Cocktail SET Seminar 11 september 2008 Dr. ir. Michael Franssen.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
ESC Java. Static Analysis Spectrum Power Cost Type checking Data-flow analysis Model checking Program verification AutomatedManual ESC.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
Software Testing and Quality Assurance
Principles of Object-Oriented Software Development Behavioral refinement.
Axiomatic Semantics Dr. M Al-Mulhem ICS
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
Describing Syntax and Semantics
Programming Languages 2nd edition Tucker and Noonan Chapter 6 Types I was eventually persuaded of the need to design programming notations so as to maximize.
Csci5233 Computer Security1 Bishop: Chapter 10 Key Management: Digital Signature.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
CS 363 Comparative Programming Languages Semantics.
Reasoning about programs March CSE 403, Winter 2011, Brun.
KeyNote Presentation KeyNote. Vishwas Patil, TIFR.2/10 KeyNote: “?”  Aim:- A notation for specifying local security policies and security credentials.
CS 395T Game-Based Verification of Contract Signing Protocols.
Programming Languages 2nd edition Tucker and Noonan Chapter 6 Type Systems I was eventually persuaded of the need to design programming notations so as.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
An Axiomatic Basis for Computer Programming Robert Stewart.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
WS-CDL and a Theoretical Basis for Communication-Centred Programming 5th December 2006 Marco Carbone Imperial College London.
L13: Design by Contract Definition Reliability Correctness Pre- and post-condition Asserts and Exceptions Weak & Strong Conditions Class invariants Conditions.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
Properties as Processes : FORTE slide Properties as Processes: their Specification and Verification Joel Kelso and George Milne School of Computer.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
DBC NOTES. Design By Contract l A contract carries mutual obligations and benefits. l The client should only call a routine when the routine’s pre-condition.
C Part 1 Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens A History Lesson Development of language by Dennis Ritchie at Bell.
Design by Contract. The Goal Ensure the correctness of our software (correctness) Recover when it is not correct anyway (robustness) Correctness: Assertions.
Interface specifications At the core of each Larch interface language is a model of the state manipulated by the associated programming language. Each.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Introduction to Quantum Information Processing CS 467 / CS 667 Phys 467 / Phys 767 C&O 481 / C&O 681 Richard Cleve DC 3524 Course.
Μse: programming multi- party sessions for SOC Joint work with Emilio Tuosto Ivan LaneseRoberto BruniHernán Melgratti.
Decentralized Access Control: Policy Languages and Logics
Compositional Choreographies By Fabrizio Montesi and Nobuko Yoshida
Design by Contract Jim Fawcett CSE784 – Software Studio
Design by Contract Jim Fawcett CSE784 – Software Studio
Important terms Black-box testing White-box testing Regression testing
Important terms Black-box testing White-box testing Regression testing
Stateful Manifest Contracts
Programming Languages 2nd edition Tucker and Noonan
Logic for Computer Security Protocols
Sub-system interfaces
Programming Languages 2nd edition Tucker and Noonan
Synchronizers Outline motivation principles and definitions
Presentation transcript:

A theory of DbC for multiparty distributed interactions Emilio Tuosto University of Leicester Nobuko Yoshida Imperial College London Kohei Honda Queen Mary, University of London Laura Bocchi University of Leicester

Aims & Objectives Support description/engineering of multiparty protocols format of messages discipline interactions in conversations values carried in messages Devise a theoretical framework analyze protocols specify obligations/guarantees of participants

Reading list Assertion methods Design by Contract (DbC) Multiparty Asynchronous Session Types Global assertions K. Honda, N. Yoshida and M. Carbone Multyparty Asynchronous Session Types In POPL B. Meyer Applying “Design by Contract” In Computer (IEEE), 25, C. A. R. Hoare An axiomatic basis of computer programming In CACM, 12, L. Bocchi, K. Honda, E. Tuosto, and N. Yoshida A theory of DbC for multiparty distributed

Outline

Design by Contract Type signatures to constraint computation the method m of an object of class C should be invoked with a string and an integer; m will return (if ever) a string DbC = Types + Assertions if m is invoked with a string representing a date 2007 ≤ d ≤ 2008 and an integer n ≤ 1000 then it will (if ever) return the date n days after d In a distributed setting each party has guarantees (e.g., on the content of the received messages) obligations (e.g., on the content of the sent messages)

A simple global type µ t(p_o : int) 〈  〉. Buyer → Seller : ChSeller (o : int). Seller → Buyer : ChBuyer { ok: Buyer → Bank : ChBank (p : int). Bank → Seller : ChSeller(a : bool), hag: t 〈 o 〉 }

Outline

Syntax for Global Assertions What is A?

Logical Language The investigation of the most suitable logic is left as a future work The logical language is likely to be application dependent good candidates are first-order decidable logics (e.g. Presburger arithmetic)

A global assertion G hag = μ t(o : Seller}) 〈 10 〉 {o≥10}. Buyer → Seller: ChSeller (p : int) {p≥10}. Seller → Buyer: ChBuyer{ {true} ok: Buyer → Bank: ChBank (c : int) {c=p}. Bank → Seller: ChSeller (a : bool) {true}, {p>o} hag: t 〈 p 〉 }

Correctness of Global Assertions Global assertions must respect 3 principles History sensitivity Locality Temporal satisfiability

History sensitivity principle Alice → Bob : ChB (u:int) {true}. Bob → Carol : ChC (v:int) {true}. Carol → Alice : ChA (z:int) {z<u} Alice → Bob : ChB (u:int) {true}. Bob → Carol : ChC (v:int) {v<u}. Carol → Alice : ChA (z:int) {z<v} z indirectly depends on u... An interaction predicate can only constraint variables known by the sender Carol cannot guarantee z<u as she doesn’t know u...but Carol can choose the right value since she knows v and the predicates ensure that the dependencies are respected

Locality principle Predicates can only constraint variables which they introduce Alice → Bob : ChB (u:int) {u>0}. Bob → Carol : ChC (v:int) {true}. Carol → Alice : ChA (z:int) {z≥v  v>1} Carol strengthens the constraints on v withough being entitled Alice → Bob : ChB (u:int) {u>0}. Bob → Carol : ChC (v:int) {true}. Carol → Alice : ChA (z:int) {z≥v  z>1}

Temporal-satisfiability principle Alice → Bob : ChB (u:int) {u 6} had Alice sent 6 or 7, Bob couldn’t meet his obbligation! For each value satisfying a predicate A there is always a branch enabled for each subsequent predicate A’, it is always possible to find values that satisfy A’

Being true to our principles HSP can be statically checked

Being true to our principles TSP implies LP, and we give a checker GSat(G,A)

Well-assertedness A global assertion G is well-asserted when G is history-sensitive and GSat(G,true) = true

Outline

End-point assertions Endpoint assertions specify the behaviour of processes involved in a session.

Projections & “third parties” Seller → Buyer : ChBuyer(p : int) {p > 10}. Buyer → Bank : ChBank (c : int) {c ≥ p} A too naive projection wrt Bank would give ChBank?(c:Int) {c ≥ p} which is meaningless because Bank ignores the value of p so it cannot check if Buyer meets its obbligation.

Projecting global assertions Seller → Buyer : ChBuyer(p : int) {p > 10}. Buyer → Bank : ChBank (c : int) {c ≥ p} ChBank?(c:Int) { ∃ p. p≥10  c ≥ p} projected wrt Bank

Projection in action T hag = μ t(o : int) 〈 10 〉 {o≥10}. ChSeller?(p : int) {p≥10  o≥10}; ChBuyer ⊕ { {true} ok: ChSeller?(a : bool) { ∃ c. p≥10  o≥10  c=p} {p>o} hag: t 〈 o 〉  } G hag = μ t(o : Seller}) 〈 10 〉 {o≥10}. Buyer → Seller: ChSeller (p : int) {p≥10}. Seller → Buyer: ChBuyer{ {true} ok: Buyer → Bank: ChBank (c : int) {c=p}. Bank → Seller: ChSeller (a : bool) {true}, {p>o} hag: t 〈 p 〉 }

Well-assertedness for endpoint assertions Similarly to global assertions, we define LSat(T,A) to check if T is satisfiable under assertion A Notice that for endpoint assertions only TSP is important as TSP implies LP HSP is vacuously guaranteed Proj(G,true,p) preserves well-assertedness

Asserted processes

Semantics

Outline

Validating asserted processes under the assertion environment C and the sorting Γ, P is validated w.r.t. the assertion assignment Δ

Main Results Validated processes can be “simulated” by their end-point assertions End-point assertions do not yield errors (by construction) A validated process never reaches errors Validation is decidable

Main results 2 In a trusted environment, all assertions of validate processes can be turned into true A monitor can be automatically deduced from validated processes (it has to check sent/selection messages) In an untrusted environment, the monitor may guard processes and help in debugging

Future work Study properties of suitable logics for global assertions tractability/decidability complexity Play with implementations Apply this context to financial protocols

Thank you...