11 Counter-Example Based Predicate Discovery in Predicate Abstraction Satyaki Das and David L. Dill Computer Systems Lab Stanford University

Slides:



Advertisements
Similar presentations
Demand-driven inference of loop invariants in a theorem prover
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Mahadevan Subramaniam and Bo Guo University of Nebraska at Omaha An Approach for Selecting Tests with Provable Guarantees.
Inferring Disjunctive Postconditions Corneliu Popeea and Wei-Ngan Chin School of Computing National University of Singapore - ASIAN
Bebop: A Symbolic Model Checker for Boolean Programs Thomas Ball Sriram K. Rajamani
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Efficient Reachability Analysis for Verification of Asynchronous Systems Nishant Sinha.
Symmetry-Aware Predicate Abstraction for Shared-Variable Concurrent Programs Alastair Donaldson, Alexander Kaiser, Daniel Kroening, and Thomas Wahl Computer.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Software Verification via Refinement Checking Sagar Chaki, Edmund Clarke, Alex Groce, CMU Somesh Jha, Wisconsin.
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar Shaz Qadeer.
Termination Proofs for Systems Code Andrey Rybalchenko, EPFL/MPI joint work with Byron Cook, MSR and Andreas Podelski, MPI PLDI’2006, Ottawa.
Small-world Overlay P2P Network
Using Statically Computed Invariants Inside the Predicate Abstraction and Refinement Loop Himanshu Jain Franjo Ivančić Aarti Gupta Ilya Shlyakhter Chao.
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #4 Mobile Ad-Hoc Networks AODV Routing.
Ordering and Consistent Cuts Presented By Biswanath Panda.
Lazy Abstraction Thomas A. Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre UC Berkeley.
Interpolants [Craig 1957] G(y,z) F(x,y)
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar [UC Berkeley] Shaz Qadeer [Microsoft Research]
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
Temporal-Safety Proofs for Systems Code Thomas A. Henzinger Ranjit Jhala Rupak Majumdar George Necula Westley Weimer Grégoire Sutre UC Berkeley.
Carnegie Mellon University Symbolic Approaches to Invariant Checking and Automatic Predicate Abstraction Randal E. Bryant.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
Efficient Software Model Checking of Data Structure Properties Paul T. Darga Chandrasekhar Boyapati The University of Michigan.
Word Level Predicate Abstraction and Refinement for Verifying RTL Verilog Himanshu Jain Daniel Kroening Natasha Sharygina Edmund Clarke Carnegie Mellon.
Counterexample Guided Invariant Discovery for Parameterized Cache Coherence Verification Sudhindra Pandav Konrad Slind Ganesh Gopalakrishnan.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Invisible Invariants: Underapproximating to Overapproximate Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Lazy Abstraction Tom Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
Thread-modular Abstraction Refinement Thomas A. Henzinger, et al. CAV 2003 Seonggun Kim KAIST CS750b.
Ad-hoc On-Demand Distance Vector Routing (AODV) and simulation in network simulator.
Verification of Java Programs using Symbolic Execution and Loop Invariant Generation Corina Pasareanu (Kestrel Technology LLC) Willem Visser (RIACS/USRA)
Lazy Abstraction Jinseong Jeon ARCS, KAIST CS750b, KAIST2/26 References Lazy Abstraction –Thomas A. Henzinger et al., POPL ’02 Software verification.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Localization and Register Sharing for Predicate Abstraction Himanshu Jain Franjo Ivančić Aarti Gupta Malay Ganai.
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Concrete Model Checking with Abstract Matching and Refinement Corina Păsăreanu QSS, NASA Ames Research Center Radek Pelánek Masaryk University, Brno, Czech.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Verifying Component Substitutability Nishant Sinha Sagar Chaki Edmund Clarke Natasha Sharygina Carnegie Mellon University.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
Formal verification of distance vector routing protocols.
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Basic concepts of Model Checking
Hybrid BDD and All-SAT Method for Model Checking
Property Directed Reachability with Word-Level Abstraction
Over-Approximating Boolean Programs with Unbounded Thread Creation
Mutual Exclusion CS p0 CS p1 p2 CS CS p3.
CSCI1600: Embedded and Real Time Software
An explicit state model checker
Predicate Abstraction
Presentation transcript:

11 Counter-Example Based Predicate Discovery in Predicate Abstraction Satyaki Das and David L. Dill Computer Systems Lab Stanford University

22 Outline Motivation Predicate Abstraction Predicate Discovery Application to AODV Conclusion

33 Motivation Easy verification of infinite state systems

44 Simple Mutual Exclusion Protocol A trivial example to illustrate concepts Clients communicate with server via asynchronous messages Three kinds of messages: –REQUEST –GRANT –RELEASE Infinite state Unbounded message queue Any number of clients

55 Protocol Steps cs[i]=false cs[i]:=true cs[i]:=false granted=false granted:=true current:=i granted:=false REQUEST(i) GRANT(i) RELEASE(i) Client Variables cs:array of boolean Server Variables granted:boolean; current:integer; Queue Variables Q.type:array of enum; Q.node:array of integer;

66 Verification Condition For distinct nodes, a and b prove that,  cs[a] /\ cs[b] )

77 Outline Motivation Predicate Abstraction Predicate Discovery Application to AODV Conclusion

88 Abstraction A finite set of predicates defines the abstraction Abstraction is conservative Concrete Abstract   Predicates: bit 1 : cs[a] bit 2 : cs[b] [00] cs = x. false Q.type = x. EMPTY granted = true cs = x. false Q.type = x. EMPTY granted = false

99 Abstraction (contd) Abstract transition relation is conservative Abstract next states must contain all concrete successors And possibly more states RARA Abstract Concrete RCRC s t x y   Example Let s=[10] and t=[11]  (s) contains a state where a GRANT(b) message is in queue So we have abstract transition from s to t! Predicates: bit 1 : cs[a] bit 2 : cs[b]

1010 Abstract Counter-Example If model checking fails an abstract counter-example produced Concrete transitions are present for each pair of consecutive abstract states But concrete counter-example may not be present! x y’ z y’’    Abstract Concrete Real Trace Spurious Trace

1111 Tool Block Diagram Abstraction Module Model Checker CVC BDD System Predicates Property Predicate Generator Trace Checker CVC Proved!!! Abstract counter-example Concrete counter-example

1212 History of Predicate Abstraction Graf and Saidi CAV 97 Colon and Uribe CAV 98 Shankar and Saidi CAV 99 Das,Dill and Park CAV 99 Saidi and Lessens ENTCS 97 Das and Dill LICS 2001 SLAM Ball, Rajamani et al 2000-present Henzinger et al POPL 02 InVeSt CAV 98 Bensalem et al TACAS 01 Tiwari et al TACAS 01 Invariant Generation Software Model Checking And many more… Flanagan et al POPL 2002

1313 Outline Motivation Predicate Abstraction Predicate Discovery Application to AODV Conclusion

1414 Predicate Discovery Example Rejoin action after the first iteration Current predicates are: “a in critical section” cs[a] “b in critical section” cs[b] “At least one GRANT message”  x. Q.type[x] = GRANT xxx init Send GRANT Rec GRANT Is abstract trace spurious? Predicates: bit 1 : cs[a] bit 2 : cs[b] bit 3 :  x. Q.type[x] = GRANT

1515 Predicate Discovery Example (contd) xxx Rec GRANT Send GRANT init Minimal spurious trace found! Predicates: bit 1 : cs[a] bit 2 : cs[b] bit 3 :  x. Q.type[x] = GRANT

1616 Predicate Discovery Example (contd) Rec GRANT  cs[a]  cs[b] Q.type[m 1 ] = GRANT Q.type[m 2 ] = GRANT Q.node[m 2 ] = b m 1  m 2 These are the candidate predicates! Predicates: bit 1 : cs[a] bit 2 : cs[b] bit 3 :  x. Q.type[x] = GRANT 000

1717 Predicate Discovery Example (contd) Send GRANT  cs[a]  cs[b] Q.type[m 1 ] = GRANT Q.type[m 2 ] = GRANT Q.node[m 2 ] = b m 1  m 2 Predicate added:  m 1,m 2. Q.type[m 1 ]=GRANT /\ Q.type[m 2 ]=GRANT /\ m 1  m Predicates: bit 1 : cs[a] bit 2 : cs[b] bit 3 :  x. Q.type[x] = GRANT

1818 Predicate Discovery Algorithm Step 1. Check if abstract counter-example is spurious Step 2. If not spurious, concrete error trace has been found. Otherwise find a minimal spurious trace Step 3. Solve non-spurious tail to find candidate predicates that characterize the second state of the minimal spurious trace Step 4. Find a minimal set from these predicates to construct new predicates

1919 Outline Motivation Predicate Abstraction Predicate Discovery Application to AODV Conclusion

2020 AODV Example Ad-hoc On-demand Distance Vector (AODV) routing protocol. Nodes can dynamically enter or leave the system. Routes are maintained so that the nodes can communicate. Important that routing table does not have loops. The method automatically proves the loop-freeness of a simplified version of the protocol. Protocol was simplified by not modeling timeouts Protocol highlights: Routes are found by broadcasting request to neighbors Sequence number tracks route age Hop count tracks number of hops to destination

2121 AODV Example Proof obligation: If a’s next hop in route to c is b then either a’s sequence number is lower than that of b or the sequence numbers of a and b are the same but the hop count of a is higher than that of b Find predicates about messages present in the queue 20 predicates were found in 14 iterations before the proof was successfully completed a b c Message Queue

2222 Outline Motivation Predicate Abstraction Predicate Discovery Application to AODV Conclusion

2323 Weakest pre-condition based abstraction refinement is useful Future Work: Easily usable concrete error traces would aid debugging Better quantifier support would be nice Integration with other predicate generation schemes

2424 End

2525 Predicate Discovery (contd) Generalize abstract transition relation to test for spurious counter-example trace. Let counter-example trace be: s 1, s 2, … s M Concrete counter-example exists if, R C (x 1,x 2 ) /\ R C (x 2,x 3 ) /\ … /\ R C (x M-1,x M ) /\  (x 1 )=s 1 /\  (x 2 )=s 2 /\ … /\  (x M )=s M is satisfiable for some concrete states x 1, x 2, … x M Notice that checking for spuriousness turns into a validity check that we use CVC to carry out!

2626 Predicate Discovery (contd) Real Trace! s2s2 s4s4 s5s5 s3s3 Remove first state if the remainder is spurious Repeat till removing first state makes the remainder a real trace Do similar shortening at end of trace

2727 Predicate Discovery (contd) Solve for conditions that must hold for the partial trace corresponding to s 2, s 3, s 4, s 5. The conditions on the concrete state x 2 can be derived by finding a satisfying assignment for:  (x 2 )=s 2 /\  (x 3 )=s 3 /\  (x 4 )=s 4 /\  (x 5 )=s 5 /\ R C (x 2,x 3 ) /\ R C (x 3,x 4 ) /\ R C (x 4,x 5 ) Let the solution be the conjunction of predicates,    x 2 ),    x 2 ), …,  L (x 2 ) These are our candidate predicates!

2828 Predicate Discovery (contd) For the candidate predicates it must be the case,  1 (x 2 ) /\  2 (x 2 ) … /\  L (x 2 ) /\ R C (x 1,x 2 ) /\  (x 1 )=s 1 Is unsatisfiable for all x 1 and x 2. Find a minimal subset of predicates (say  1 and  2 in this case) such that,  1 (x 2 ) /\  2 (x 2 ) /\ R C (x 1,x 2 ) /\  (x 1 )=s 1 Is still unsatisfiable. Use  1 and  2 as predicates to refine the abstraction

2929 Related Work Predicate Abstraction Graf and Saidi in CAV 1997 Colon and Uribe in CAV 1998 Flanagan and Qadeer in POPL 2002 Counter-example guided refinement Alur et al in CAV 95 Bensalem et al in CAV 98 Lakhnech et al in TACAS 2001 Tiwari et al in TACAS 2001 Clark, Grumberg et al CAV 2000 SLAM Project at MSR (POPL 2002) BLAST project at Berkeley (POPL 2002)

3030 Implementation Binary Decision Diagrams (BDD) are used to represent abstract system and for model checking Cooperating Validity Checker (CVC) is used to check satisfiability CVC is a decision procedure for quantifier free first order logic Supported types in CVC include booleans, rationals, stores (unbounded arrays) and records Quantifier support Heuristics were used for quantifier instantiation

3131 Verification Scheme Abstract and Model Check Check Counter-example and Discover Predicates Initial Predicates Safety Property Concrete SystemProperty Verified! Abstract Counter-example Concrete Counter-example New predicates

3232 Predicate Discovery Intuition A spurious trace is an abstract trace with no concrete counterpart Real trace is one which has a concrete counterpart Predicates are added to remove spurious traces New Predicate Spurious counter-example is avoided in refined abstraction! x1x1 x2x2 x’ 2 x3x3

3333 Protocol Description Ruleset (cell,msg): “Send REQUEST”  cs[cell] /\ Q.type[msg]=EMPTY  Q.type[msg]:=REQUEST; Q.node[msg]:=cell “Receive GRANT”  cs[cell] /\ Q.type[msg]=GRANT /\ Q.node[msg]=cell  Q.type[msg]:=EMPTY; cs[cell]:=true “Send RELEASE” cs[cell] /\ Q.type[msg]=EMPTY  Q.type[msg] := RELEASE; Q.node[msg] := cell; cs[cell] := false Client Rules Ruleset (msg): “Receive REQUEST”  granted /\ Q.type[msg]=REQUEST  Q.type[msg] := GRANT; granted := true; current := Q.node[msg] “Receive RELEASE” granted /\ Q.type[msg]=RELEASE /\ Q.node[msg]=current  Q.type[msg] := EMPTY; granted := false Server Rules Rule true  Q.type := x. EMPTY; cs := x. false; granted := false Initialization Rule