Tutorial on Test Model-checking Ganesh Gopalakrishnan Ratan Nalumasu Rajnish Ghughal Mike Jones Ritwik Bhattacharya Ali Sezgin Prosenjit Chatterjee.

Slides:



Advertisements
Similar presentations
Tintu David Joy. Agenda Motivation Better Verification Through Symmetry-basic idea Structural Symmetry and Multiprocessor Systems Mur ϕ verification system.
Advertisements

Substitution & Evaluation Order cos 441 David Walker.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Translation-Based Compositional Reasoning for Software Systems Fei Xie and James C. Browne Robert P. Kurshan Cadence Design Systems.
Memory Consistency Models Kevin Boos. Two Papers Shared Memory Consistency Models: A Tutorial – Sarita V. Adve & Kourosh Gharachorloo – September 1995.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Hierarchical Cache Coherence Protocol Verification One Level at a Time through Assume Guarantee Xiaofang Chen, Yu Yang, Michael Delisi, Ganesh Gopalakrishnan.
Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services Authored by: Seth Gilbert and Nancy Lynch Presented by:
Transaction Based Modeling and Verification of Hardware Protocols Xiaofang Chen, Steven M. German and Ganesh Gopalakrishnan Supported in part by SRC Contract.
Transaction Based Modeling and Verification of Hardware Protocols Xiaofang Chen, Steven M. German and Ganesh Gopalakrishnan Supported in part by Intel.
CS492B Analysis of Concurrent Programs Consistency Jaehyuk Huh Computer Science, KAIST Part of slides are based on CS:App from CMU.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
The Design and Implementation of a Certifying Compiler [Necula, Lee] A Certifying Compiler for Java [Necula, Lee et al] David W. Hill CSCI
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
Spin Tutorial (some verification options). Assertion is always executable and has no other effect on the state of the system than to change the local.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
Verification of Hierarchical Cache Coherence Protocols for Future Processors Student: Xiaofang Chen Advisor: Ganesh Gopalakrishnan.
Transaction Ordering Verification using Trace Inclusion Refinement Mike Jones 11 January 2000.
Ganesh Gopalakrishnan Associate Professor Computer Science University of Utah * Verification of Coherence Protocols against Shared.
Computer Architecture II 1 Computer architecture II Lecture 9.
Transaction Ordering Verification using Trace Inclusion Refinement Mike Jones 11 January 2000.
Formal Design and Verification Methods for Shared Memory Systems Ratan Nalumasu Dissertation Defense September 10, 1998.
Verifying Conformance to Memory Models: the Test Model-checking Approach Ganesh Gopalakrishnan (funded by NSF) presenting work done by Ratan Nalumasu.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Meenaktchi Venkatachalam.
Formal Verification of Shared Memory Systems During their Design Ganesh Gopalakrishnan Department of Computer Science University of Utah
Transaction Based Modeling and Verification of Hardware Protocols Xiaofang Chen, Steven M. German and Ganesh Gopalakrishnan Supported in part by SRC Contract.
The Parallel PV Model-checker Robert Palmer and Ganesh Gopalakrishnan School of Computing University of Utah.
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
S/W Project Management Software Process Models. Objectives To understand  Software process and process models, including the main characteristics of.
ECE 720T5 Winter 2014 Cyber-Physical Systems Rodolfo Pellizzoni.
Scientific Computing By: Fatima Hallak To: Dr. Guy Tel-Zur.
Shared Memory Consistency Models: A Tutorial Sarita V. Adve Kouroush Ghrachorloo Western Research Laboratory September 1995.
Transactions Sylvia Huang CS 157B. Transaction A transaction is a unit of program execution that accesses and possibly updates various data items. A transaction.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
Shared Memory Consistency Models. Quiz (1)  Let’s define shared memory.
Transaction Lectured by, Jesmin Akhter, Assistant professor, IIT, JU.
Securing Class Initialization in Java-like Languages.
CIS 842: Specification and Verification of Reactive Systems Lecture 1: Course Overview Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
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.
Concurrency Properties. Correctness In sequential programs, rerunning a program with the same input will always give the same result, so it makes sense.
ICFEM 2002, Shanghai Reasoning about Hardware and Software Memory Models Abhik Roychoudhury School of Computing National University of Singapore.
Compositionality Entails Sequentializability Pranav Garg, P. Madhusudan University of Illinois at Urbana-Champaign.
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Quality Assurance in the Presence of Variability Kim Lauenroth, Andreas Metzger, Klaus Pohl Institute for Computer Science and Business Information Systems.
Atom-Aid: Detecting and Surviving Atomicity Violations Brandon Lucia, Joseph Devietti, Karin Strauss and Luis Ceze LBA Reading Group 7/3/08 Slides by Michelle.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
Whole Test Suite Generation. Abstract Not all bugs lead to program crashes, and not always is there a formal specification to check the correctness of.
Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University.
Fundamentals of Memory Consistency Smruti R. Sarangi Prereq: Slides for Chapter 11 (Multiprocessor Systems), Computer Organisation and Architecture, Smruti.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Copyright 1999 G.v. Bochmann ELG 7186C ch.1 1 Course Notes ELG 7186C Formal Methods for the Development of Real-Time System Applications Gregor v. Bochmann.
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Michael D. Jones, Ganesh Gopalakrishnan
Specifying Multithreaded Java semantics for Program Verification
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Logical architecture refinement
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Relaxed Consistency Finale
Presentation transcript:

Tutorial on Test Model-checking Ganesh Gopalakrishnan Ratan Nalumasu Rajnish Ghughal Mike Jones Ritwik Bhattacharya Ali Sezgin Prosenjit Chatterjee

October 31, 2000School of Computing, University of Utah2 Overview of talk Advantages of the approach An example Avenues of work –Formal specification of memory models –Characterization of violations –Obtaining finite-state abstractions –Obtaining finite-state models of memory systems –Combating state explosion and reporting errors –Conjectures Conclusions

October 31, 2000School of Computing, University of Utah3 Advantages of the approach Test automata inspired by proven architectural testing methods (lifting architectural testing techniques to the realm of model-checking) Can formally study properties of memory models as well as their sub- ordering rules (e.g. read orderings w/o write ordering) Can use test model-checking without knowing the internal details of the memory system (rapid verification regressions) Can use pure tests as putative queries to help understand the memory model Can define a variety of memory models in a uniform framework (weak as well as strong models) – hence not “hard wired” for particular models

October 31, 2000School of Computing, University of Utah4 From Archtest to Test Automata P1 A:=1 A:=2.. A:=k P2 X[1]:=A X[2]:=A.. X[k]:=A Condition : ALL X[i] values are monotonically increasing Archtest recommends running for “large” values of k to capture all possible interleavings Archtest Test for (CMP, RO, WO)

October 31, 2000School of Computing, University of Utah5 Why this tests for (CMP,RO,WO) Consider a violation: P1 P2 A := 1 X[ 1 ] := A A := 2 X[ 2 ] := A …… A := p X[ i ] := A ==> q… A := q X[ j ] := A ==> p …… A := k X[ k ] := A We check for all k for all interleavings through an abstraction that capitalizes on data independence

October 31, 2000School of Computing, University of Utah6 Example test automata that drive test model-checking for (CMP,RO,WO) s0 s1 A := 0 A := 1 s0 s1 read(A) s2 X2 :=read(A) X1 := read(A) read(A) P2 P1 Safety Property to be established: P2 in final state => X2 >= X1 Non-deterministic switches

October 31, 2000School of Computing, University of Utah7 Another example: A pure test for (CMP,RO) P1 A:=1 A:=2.. A:=k P2 X[1]:=A X[2]:=A.. X[k]:=A RO met when for all p, q, r : p < q < r : X[p] = X[r] => X[p] = X[q] = X[r] - Obtain execution scenario capturing ordering rule - Create finite-state abstraction of violating executions

October 31, 2000School of Computing, University of Utah8 Test Automata for (CMP, RO) for the same operand s0 s1 A := 0 A := 1 s0 s1 read(A) s2 X2 :=read(A) X1 := read(A) read(A) P2 P1 Safety Property : Finally, X1 = X3 => X1 = X2 = X3 Non-deterministic switches read(A) s2 X3 :=read(A) read(A)

October 31, 2000School of Computing, University of Utah9 Variant of previous test: Test Automata for (CMP, MB-RR) assuming that the # of MB-RRs don’t matter s0 s1 A := 0 A := 1 s0 s1 read(A) s2 X2 :=read(A) ; MB-RR X1 := read(A) ; MB-RR read(A) P2 P1 Safety Property : Finally, X1 = X3 => X1 = X2 = X3 Non-deterministic switch read(A) s2 X3 :=read(A) ; MB-RR read(A)

October 31, 2000School of Computing, University of Utah10 Specification of memory models via architectural rules CMP (Rule of Computation) : –A Basic rule specifying how operand values are computed from other operand values. RO (Read Order) : –Reads in a single process are completed in program order WO (Write Order) / PO (Program Order): –Writes / reads and writes in a single process are completed in program order WOS, POS - our defn (we denote Collier’s definitions by WOS_c, POS_c, etc.) –Writes posted in program order in remote stores also

October 31, 2000School of Computing, University of Utah11 Specifying Weaker memory models relaxations of orderings Partial-PO Relaxation : –Relaxes PO partially - WR is always relaxed –May relax WA in various orders –examples : SPARC V9 TSO, PSO, Intel Pentium Pro, Processor consistency etc. Complete-PO relaxation : –Relaxes PO completely –typically does not relax WA –examples : SPARC V9 RMO, Alpha, PowerPC, Release Consistency

October 31, 2000School of Computing, University of Utah12 WA relaxation via rule WA-S WA : –a write becomes visible to all processors “instantly” –atomic set of events - all write events WA-S : –a write becomes visible to all other processors “instantly” –atomic set of events - all write events in stores of other processors

October 31, 2000School of Computing, University of Utah13 Some examples (informal proofs in Ghughal’s MS) TSO = A (CMP, UPO, RO, WO, RW, WA-S, MB-WR) PSO = A (CMP, UPO,RO, RW, WA-S, MB-WR, MB-WW) IBM 370 = A(CMP, UPO, RO, WO, RW, WA, MB-WR) Alpha subset = A(CMP, UPO, ROO, WA-S, MB, MB-WW)

October 31, 2000School of Computing, University of Utah14 Anticipated Path towards Completeness Take memory model in question - e.g. (CMP,RO,WOS) Prove limited address theorem – e.g. two addresses suffice for (CMP,RO,WOS) – called “max # of addresses” below Obtain single partial order “<c” that simulates CMP (I.e. any admissible CMP respects the <c order) in the context of RO,WOS Assume address projectability (single partial order <c (as opposed to CMP) allows violating cycles to be projected onto the max # of addresses in violating cycles) Enumerate all possible violations over max # of addresses Capitalize on data independence to build test automata that incorporate the violations

October 31, 2000School of Computing, University of Utah15 Anticipated Path towards Completeness Currently we have that –(CMP,RO,WOS) can be verified in 2 addresses –PRAM=(CMP,POS) and SC=(CMP,POS,WA) have N-address violations for N processors –We have complete characterization of SC violations for 2 processors and addresses assuming PRAM

October 31, 2000School of Computing, University of Utah16 Identifying Violation Classes: some of the POS violations (1-3 of 5) v is not the initial value T of a, and a is not written anywhere (1) P_i... rd(a, v) … P_ j... …... (2) P_i... rd(a,v1) … rd(a,v2)... P_ j … wr(a,v2) … wr(a,v1)... P_ i and P_ j could be the same process (3) P_i... rd(a,v) … rd(a,T)... P_ j … wr(a,v) … P_ i and P_ j could be the same process

October 31, 2000School of Computing, University of Utah17...one-address PO violations (4-5 of 5) v is not the initial value T of a, and a is not written before being read (4) P_i... rd(a,v) … wr(a,v)... (5) P_i... wr(a,v) … rd(a,T)... The formal status of these violations is under study (believed to be exhaustive for one address)

Client0Client1 baba Host Broadcast Verification of Program Ordering for all one-address programs Error states: E1, E2  x  means Write(A,x) Read(A,-)

October 31, 2000School of Computing, University of Utah19 Experimental result A model of the MIT HCN protocol was created in Murphi by Mike Jones (details in the next presentation) He applied his parameterized verification technique to identify network classes in which to verify The PRAM test on the previous page was applied Subtle coding error revealed pretty quickly Message: Often cheaper to verify sub-ordering rules than the whole (in this case SC)

October 31, 2000School of Computing, University of Utah20 Pure Test for RO - different operands - WO not assumed P1 B:=1 P2 X := A; Y := B; C := Y; P3 U := C; A := U; Initially all vars == 0 Finally all vars == 1 => In P2, B must have been read before A Creating a test automaton based on violation scenarios

October 31, 2000School of Computing, University of Utah21 Pure Test for RO - different operands - WO not assumed P1 B:=1 B:=2.. B:=k P2 Y[0] := 0; X[1] := A; Y[1] := B; C := Y[i]; X[2] := A; Y[2] := B; C := Y[2]; … X[k] := A; Y[k] := B; C := Y[k]; Condition : Exists i:1<= i<= k Forall j:0<= j < i: X[i] != Y[j] P3 U[1] := C; A := U[1]; U[2] := C; A := U[2];... U[k] := C; A := U[k]; “X is getting ahead of all the Y’s so far” -- need to examine a history of values... Turn into OR accumulator via data-independence!

October 31, 2000School of Computing, University of Utah22 Safety Property : (P2 in S1 /\ y==0) => x==0 Test Automata for RO (diff opnds) s0 B:=0 s0 s1 read(A); t := read(B); C := t; y := y \/ t; P2 P1 B:=1 s0 P3 u := read(C); A := u; read(A); t := read(B); C := t; x := read(A); t := read(B); C := t;

October 31, 2000School of Computing, University of Utah23 Characterization of violations: a summary Test model-checking allows different violation classes to be studied and reused Abstract interpretation can help derive sound abstractions systematically

October 31, 2000School of Computing, University of Utah24 Modeling memory systems Good modeling languages will allow succinct specifications to be written They may even help meet certain assumptions automatically for verification (e.g. address projectability and data independence) Explicit or implicit state? None seem to have an edge (see next slides) Reductions appear to be quintessential (tried Partial Order Reductions so far)

Formal Specification of Memory Systems Runout Runin Cache lines Noncoh Client0Client1 baba Host Broadcast Coh_chans

October 31, 2000School of Computing, University of Utah26 Experimental Results (VIS)

October 31, 2000School of Computing, University of Utah27 SC verification of the HP/Runway model Promela, with SPIN and PV (#states)

October 31, 2000School of Computing, University of Utah28 Some results as well as conjectures (CMP,UPO,WO,RO,RW) => (CMP,POS_c) Assuming CON to be part of WA-S, Ghughal has shown that (CMP,WOS_c,WA-S) = (CMP,WO,WA-S) It has been shown that (CMP,UPO,CON) => (CMP,UPO,CON,WA-Si) where WA-Si is the “intra” component of WA-S (CMP,RO,…) =?= (CMP-SRW,RO,RW,…) Is (CMP,UPO,WO,RO,RW) the same as PRAM or (CMP,POS)? –Reason to think so: PRAM tests don’t fail on TSO –We define TSO as (CMP,UPO,RO,WO,RW,WA-S,MB-WB)

October 31, 2000School of Computing, University of Utah29 Concluding Remarks RAPA provided us a solid start in this area Many formal proofs remain to be tightened (PVS encoding contemplated) An experimental test model-checking framework will be built Some questions : –Future trends in memory model selection? –How to cut needless variety in protocol design (that may not have a significant performance benefit)? –Can test model-checking be used in other situations (e.g. JVM validation)?