Monitoring Partial Order Snapshots Doron Peled Bar Ilan University, Israel & University of Warwick, UK Joint work with Peter Niebert.

Slides:



Advertisements
Similar presentations
Model checking with Message Sequence Charts Doron Peled Collaborators: R. Alur, E. Gunter, G. Holzmann, A. Muscholl, Z. Su Department of Computer Science.
Advertisements

Modeling Software Systems Lecture 2 Book: Chapter 4.
DCSP-12 Jianfeng Feng Department of Computer Science Warwick Univ., UK
From Local Patterns to Global Models: Towards Domain Driven Educational Process Mining Nikola Trčka Mykola Pechenizkiy.
Applications of Synchronization Coverage A.Bron,E.Farchi, Y.Magid,Y.Nir,S.Ur Tehila Mayzels 1.
CHAPTER3 Higher-Level Synchronization and Communication
Partial Order Reduction: Main Idea
Knowledge Based Synthesis of Control for Distributed Systems Doron Peled.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
Distributed Markov Chains P S Thiagarajan School of Computing, National University of Singapore Joint work with Madhavan Mukund, Sumit K Jha and Ratul.
CIS 720 Lecture 2. Concurrency …shared variable declaration…. …shared variable initialization… co P 1 // P 2 // P 3 // P 4 oc Execution of P 1 … P 4 starts.
Enforcing Concurrent Temporal Behaviors Doron Peled, Dept. of CS University of Warwick.
Methods for Knowledge Based Controlling of Distributed Systems Saddek Bensalem, Marius Bozga, Susanne Graf, Doron Peled, Sophie Quinton.
1 1 Regression Verification for Multi-Threaded Programs Sagar Chaki, SEI-Pittsburgh Arie Gurfinkel, SEI-Pittsburgh Ofer Strichman, Technion-Haifa Originally.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
Digital System Design Verilog ® HDL Behavioral Modeling (3) Maziar Goudarzi.
1/25 Concurrency and asynchronous computing How do we deal with evaluation when we have a bunch of processors involved?
/ PSWLAB Atomizer: A Dynamic Atomicity Checker For Multithreaded Programs By Cormac Flanagan, Stephen N. Freund 24 th April, 2008 Hong,Shin.
Overview This project applies the tagged-signal model to explain the semantics of piecewise continuous signals. Then it illustrates an operational way.
Progress Guarantee for Parallel Programs via Bounded Lock-Freedom Erez Petrank – Technion Madanlal Musuvathi- Microsoft Bjarne Steensgaard - Microsoft.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
State Diagram. What is State Diagram?  State diagram is used to show the state space of a given class, the events that cause a transition from one state.
Modeling Software Systems Lecture 2 Book: Chapter 4.
1 ACID Properties of Transactions Chapter Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
Models of Computation for Embedded System Design Alvise Bonivento.
1 Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy.
1 © Wolfgang Pelz UML2 UML Part 3. 2 © Wolfgang Pelz UML2 Chapter Ten State Machine Diagrams.
Efficient Hybrid Reachability Analysis for Asynchronous Concurrent Systems E. Pastor and M.A. Peña Department of Computer Architecture Technical University.
Planning in the Real World Time and Resources Hierarchical Task Network Conditional Planning Execution Monitoring and Replanning Continuous Planning MultiAgent.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
Lecture 6 Template Semantics CS6133 Fall 2011 Software Specification and Verification.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
100 Addition Facts DIRECTIONS:  Watch the screen.  Say the answer to each addition fact when it appears.  You have 3 seconds to say each answer.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 3 (26/01/2006) Instructor: Haifeng YU.
Problems with Send and Receive Low level –programmer is engaged in I/O –server often not modular –takes 2 calls to get what you want (send, followed by.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Amending Choreographies Joint work with Fabrizio Montesi and Gianluigi Zavattaro.
Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK.
Mahapatra-A&M-Fall'001 Co-design Finite State Machines Many slides of this lecture are borrowed from Margarida Jacome.
1 Advanced Behavioral Model Part 1: Processes and Threads Part 2: Time and Space Chapter22~23 Speaker: 陳 奕 全 Real-time and Embedded System Lab 10 Oct.
Internal Talk, Oct Executable Specifications using Message Sequence Charts Abhik Roychoudhury School of Computing National University of Singapore.
Platform Abstraction Group 3. Question How to deal with different types hardware and software platforms? What detail to expose to the programmer? What.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Winter 2007SEG2101 Chapter 121 Chapter 12 Verification and Validation.
Multithreaded Programming in Java David Meredith Aalborg University.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Agenda  Quick Review  Finish Introduction  Java Threads.
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.

Tips Need to Consider When Organizing a College Event
Threads and Memory Models Hal Perkins Autumn 2011
COT 5611 Operating Systems Design Principles Spring 2012
Process Modeling: Activity/Swimlane Diagrams
Chapter 1: Introduction to Real-Time Systems
ماجستير إدارة المعارض من بريطانيا
CSE 486/586 Distributed Systems Consistency --- 1
Threads and Memory Models Hal Perkins Autumn 2009
Time And Global Clocks CMPT 431.
Reachability testing for concurrent programs
100 Addition Facts DIRECTIONS: Watch the screen.
Verification and transformation of
Consistency and Replication
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

Monitoring Partial Order Snapshots Doron Peled Bar Ilan University, Israel & University of Warwick, UK Joint work with Peter Niebert

Monitoring an interleaving sequence Assume a model of execution with local events and synchronous communication. Concurrent events are monitored according to some (arbitrary) order. What are global states? What global states appear on an execution (an execution sequence)?

Bank Example Two branches, initially $1M each. In one branch: deposit, $2M. In another branch: robbery. How to model the system?

Global state space $1M, $1M $3M, $0M $1M, $0M$3M, $1M deposit robbery

Should we invest in this bank? $1M, $1M $3M, $0M $1M, $0M$3M, $1M deposit robbery Invest! Do not Invest! Invest!

Two interleavings $3M, $0M $1M, $0M$3M, $1M deposit robbery Invest! Do not Invest! $1M, $1M $3M, $0M

Partial Order Semantics Sometimes called “ real concurrency ”. There is no total order between events. More intuitive. Closer to the actual behavior of the system. More difficult to analyze. Less verification results. Natural transformation between models. Partial order: (S, <), where < is Transitive: x<y /\ y<z  x<z. Antisymmetric: for no x, y, x x. Antireflexive: for no x, x<x.

Partial Order Description $1M $3M$0M $1M depositrobbery

Constructing global snapshots $1M $3M$0M $1M depositrobbery We can define global states or snapshots after a history- closed set of events S, i.e., if e  S and f <e in the partial order, then f  S.

Modeling with partial orders m0:x:=x+1 m1:ch!xn1:y:=y+z n0:ch?z P1P2 m0 n0 m0 n1 m0 m1 pc1=m0,x=0 pc1=m0,x=2 pc1=m0,x=1 pc1=m1,x=1 pc1=m1,x=2 pc2=n0,y=0,z=0 pc2=n0,y=1,z=1 pc2=n1,y=0,z=1 pc2=n1,y=1,z=2

Linearizations: containing part of the snapshots as global states m0 n0 m0n1 m0 m1 pc1=m0,x=0 pc1=m0,x=2 pc1=m0,x=1 pc1=m1,x=1 pc1=m1,x=2 pc2=n0,y=0,z=0 pc2=n0,y=1,z=1 pc2=n1,y=0,z=1 pc2=n1,y=1,z=2 pc1=m0,x=0,pc2=n0,y=0,z=0 pc1=m1,x=2,pc2=n0,y=1,z=1 pc1=m1,x=2,pc2=n1,y=0,z=1 pc1=m0,x=1,pc2=n1,y=0,z=1 pc1=m1,x=1,pc2=n0,y=0,z=0 pc1=m0,x=2,pc2=n1,y=1,z=2

Linearizations: containing part of the snapshots as global states m0 n0 m0 n1 m0 m1 pc1=m0,x=0 pc1=m0,x=2 pc1=m0,x=1 pc1=m1,x=1 pc1=m1,x=2 pc2=n0,y=0,z=0 pc2=n0,y=1,z=1 pc2=n1,y=0,z=1 pc2=n1,y=1,z=2 pc1=m0,x=0,pc2=n0,y=0,z=0 pc1=m1,x=2,pc2=n0,y=1,z=1 pc1=m0,x=1,pc2=n0,y=1,z=1 pc1=m0,x=1,pc2=n1,y=0,z=1 pc1=m1,x=1,pc2=n0,y=0,z=0 pc1=m0,x=2,pc2=n1,y=1,z=2 But in some sense we also have pc1=m1,x=2,pc2=n1,y=0,z=1

Nondeterminism is different from concurrency: Bank with one teller $1M $3M $0M $1M deposit robbery deposit $1.1M $3.1M deposit

Partial order execution 1 $1M $3M $0M $1M deposit robbery $3.1M deposit

Partial order execution 2 $1M $0M $1M robbery deposit $1.1M $3.1M deposit

Traces An equivalence relation among sequences. Symmetric and antireflexive independence relation I  × . Example: aIb, aIc (but not bIc). Then we have [abac ]=[baac,abac,aabc,baca,abca,bcaa ]. Snapshots of execution [abac ] are states after [a ], [b ], [ab ], [aa ], [bc ], [aab ], [abc ]. State after trace equivalent sequences, e.g., aab, aba, baa, are the same, so we can talk about the state s [aab ] after a trace [aab ].

In our examples: Bank: deposit I robbery Program: m 0 I n 1 Definitions of global states using history- closed sets of events and using trace semantics are equivalent.

Extended LTL: with snapshots The logic SLTL Basic syntax as LTL. In addition, the “ snapshot ” operator [p], where p is a conjunction of positive and negative atomic propositions. Semantics of new operator: (u,v)|=[p] iff there exists finite sequences u 1, u 2 such that [u]=[u 1 ][u 2 ] and (u 1,u 2 v)|=p.

How to monitor executions and find snapshots? A deterministic automaton that keeps all the global states that are subsumed on the way.

Automaton for prefixes of [aabc].,,,, a a b b,, a,,, a,, c,,,,,, c c a a b

How to construct this automaton? Each node consists of a set of pairs, where s is a (subsumed) state and A is a subset of actions. It denotes that s is a subsumed state, and it takes the actions A (with possible repetitions) in some order to reach the current state.

How to update nodes? If is in node X, then is in Y. If is in node X and b is independent of all of A, then is in Y. …,, ……, ?, … b XY s b(s)b(s)b(t)b(t) t b b A A Size: 2 |S|x2 |  |

We make a restriction: Each process P i will have its own set of propositions, related to the local states of P i. We can write in [ … ] only a conjunction of local properties q 1 /\q 2 /\.../\q n. Freeze set: a subset of processes that satisfy the corresponding part of local properties. (We can also keep the actual local states with the processes.(

Grow up freeze sets Case 1: cannot increase freeze set further Existing freeze set Execution of joint action kills freeze set P1P1 P4P4 P3P3 P2P2

The red events do not form a history closed set of events. Thus, do not form a partial global state. Existing subset But it is possible to grow a new subset (surrounded) including {P 1,P 2 }

Grow up freeze sets Case 2: independent event. Existing subset Execution of joint action extends subset

Grow up freeze sets Case 3: events of subsumed set of processes Execution of joint action maintains subset Existing subset

Can be formulated as follows: proc(a) – the set of processes where action a participates. addproc(s, a) – when executing action a from state s, these are the local states from proc(a) that satisfy the local propositions that we check. Extension: Let F 1  addproc(s,a) and F 2 existing subset such that F 2  proc(a)= . Then extend F 1 into F 1  F 2. Propagation: For existing subset F such that proc(a)  F, we maintain F.

Propagation of “ freeze sets ”

Success!!

How to store efficiently? Freeze sets T closed under union and intersection. Need to store only a basis B of T, where unions are not included. In this case, size of basis is not larger than number of elements. Update of basis is polynomial.

Another example. We do not keep sets that are unions of others

Another example

We ignore some additional subsets: {P 1, P 2, P 3 }, etc.

How to perform model checking? Construct an automaton for A ¬  as usual. Construct an automaton for each conjunction that appears inside the […] operator to run in parallel. Binary search is still polynomial in number of processes and size of formula!

Conclusions Added capability of partial orders into LTL specification. Freeze sets construction for detecting global states that are subsumed during execution. Model checking is basically same complexity as for normal LTL!