1 Completeness and Complexity of Bounded Model Checking Ed Clarke Daniel Kroening Joel Ouaknine Carnegie Mellon University, Pittsburgh, USA Ofer Strichman.

Slides:



Advertisements
Similar presentations
The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Advertisements

Exploiting SAT solvers in unbounded model checking
Exploiting SAT solvers in unbounded model checking K. L. McMillan Cadence Berkeley Labs.
Model Checking Lecture 3. Specification Automata Syntax, given a set A of atomic observations: Sfinite set of states S 0 Sset of initial states S S transition.
SAT-based Bounded and Unbounded Model Checking Edmund M. Clarke Carnegie Mellon University Joint research with C. Bartzis, A. Biere, P. Chauhan, A. Cimatti,
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
A Survey of Runtime Verification Jonathan Amir 2004.
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.
Lecture 24 MAS 714 Hartmut Klauck
SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
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.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
© Anvesh Komuravelli IC3/PDR Overview of IC3/PDR Anvesh Komuravelli Carnegie Mellon University.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
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:
Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Strichman Carnegie Mellon University.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
Weizmann Institute Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Shtrichman Weizmann Institute & IBM (HRL)
SAT-based Bounded Model Checking
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
On the Use of Automata Techniques to Decide Satisfiability Mia Minnes May 3, 2005.
Beyond Vacuity: Towards the Strongest Passing Formula Hana ChocklerArie Gurfinkel Ofer Strichman Technion - Israel Institute of Technology IBM Research.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
Bounded Model Checking EECS 290A Sequential Logic Synthesis and Verification.
Witness and Counterexample Li Tan Oct. 15, 2002.
Analysis of Algorithms CS 477/677
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
Efficient Reachability Checking using Sequential SAT G. Parthasarathy, M. K. Iyer, K.-T.Cheng, Li. C. Wang Department of ECE University of California –
Review of the automata-theoretic approach to model-checking.
Weizmann Institute Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Shtrichman Weizmann Institute & IBM-HRL.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Completeness and Complexity of Bounded Model Checking.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
Witness and Counterexample Li Tan Oct. 15, 2002.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Flavio Lerda 1 LTL Model Checking Flavio Lerda. 2 LTL Model Checking LTL –Subset of CTL* of the form: A f where f is a path formula LTL model checking.
Model Checking for Embedded Systems Edmund Clarke, CMU High-Confidence Embedded Systems Workshop, May 1 st.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
15-820A 1 LTL to Büchi Automata Flavio Lerda A 2 LTL to Büchi Automata LTL Formulas Subset of CTL* –Distinct from CTL AFG p  LTL  f  CTL. f.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
7/13/2003BMC A SAT-Based Approach to Abstraction Refinement in Model Checking Bing Li, Chao Wang and Fabio Somenzi University of Colorado at Boulder.
Binary Decision Diagrams (BDDs)
1 Completeness and Complexity of Bounded Model Checking.
Model Checking Lecture 3 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Lecture 3: Uninformed Search
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Variants of LTL Query Checking Hana ChocklerArie Gurfinkel Ofer Strichman IBM Research SEI Technion Technion - Israel Institute of Technology.
Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable Software.
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
Symbolic model checking with SAT/SMT
Hybrid BDD and All-SAT Method for Model Checking
SS 2017 Software Verification Bounded Model Checking, Outlook
Inference and search for the propositional satisfiability problem
Introduction to Software Verification
Over-Approximating Boolean Programs with Unbounded Thread Creation
Scalability in Model Checking
SAT Based Abstraction/Refinement in Model-Checking
Presentation transcript:

1 Completeness and Complexity of Bounded Model Checking Ed Clarke Daniel Kroening Joel Ouaknine Carnegie Mellon University, Pittsburgh, USA Ofer Strichman Technion, Haifa, Israel

2 Overview  Bounded Model Checking of LTL: the (traditional) syntactic translation scheme  The semantic translation scheme  The Completeness Threshold problem  A solution to the Completeness Threshold problem  The complexity of Bounded Model Checking (2exp)  The complexity gap and how it can be closed

3 Bounded Model Checking ( Biere, Cimatti, Clarke, Zhu, 1999 )  Model checking: is M a model of  (M ²  )?  Bounded Model Checking (BMC): is there a counterexample to M ²  up to a given depth k ?  BMC is widely accepted as a complementary to Model- Checking.

4 Bounded Model Checking ( Biere, Cimatti, Clarke, Zhu, 1999 )  BMC can be performed with SAT (no need to detect fixpoints).  SAT formulation of BMC: Keep k copies of each variable Check if [ M ] k Æ [ :  ] k is satisfiable, where: [ M ] k represents all traces of M up to length k [ :  ] k represents all traces of length up to k that satisfy :  [ :  ] k = (… formulation in next few slides)

5 Generating [  ] k is based on expansion formulas for LTL (Manna & Pnueli): BMC (syntactic) translation ( Biere, Cimatti, Clarke, Zhu, 1999 )

6 The no-loop case (finite traces) Expansion rule BMC translation Base case: k

7 BMC (syntactic) translation ( Biere, Cimatti, Clarke, Zhu, 1999 ) The loop case (infinite traces) Expansion rule BMC translation Base case: l s( i ) = i + 1 if i < k, and l otherwise k =

8 LTL model checking (Vardi-Wolper)  Given M, , construct a Buchi automaton B   LTL model checking: is  : M £ B   empty?  Emptiness checking: is there a path to a loop with an accepting state ? s0s0

9  “Unroll”  k times  Find a witness to Gtrue with the fairness constraint s0s0 A semantic BMC translation (Based on Vardi-Wolper) (Was mentioned by [De-Moura, Rushby, Sorea, 2002] in the context of infinite systems)

10 Advantages of the semantic translation Syntactic TranslationSemantic Translation Size of formula O( k ¢ | M | + k 2 ¢ |  |)O ( k ¢ | M | + k ¢ |  |) Optimizations w.r.t. LTL formulas NoneEfficient Buchi construction from LTL Computing CTOnly for Gp and FpFull LTL

11 Advantages of the semantic translation Syntactic TranslationSemantic Translation Size of formula O( k ¢ | M | + k 2 ¢ |  |)O ( k ¢ | M | + k ¢ |  |) Optimizations w.r.t. LTL formulas NoneEfficient Buchi construction from LTL Computing CTOnly for Gp and FpFull LTL

12 The no-loop case (finite traces) For i  k: For i > k: BMC syntactic translation (Biere, Cimatti, Clarke, Zhu, 1999)

13 Bounded Model Checking k = 0 BMC(M, ,k) yes k++ k ¸ ?k ¸ ? no

14 How big should k be?  For every model M and LTL property  there exists k s.t.  We call the minimal such k the Completeness Threshold ( CT )  Clearly if M ²  then CT = 0  Conclusion: computing CT is at least as hard as model checking

15 The Completeness Threshold  Computing CT is as hard as model checking  The value of CT depends on the model M, the property  and the translation scheme.  Strategy: find over-approximations to CT based on graph theoretic properties of M

16  Diameter d(M) = longest shortest path between any two reachable states.  Recurrence Diameter rd(M) = longest loop-free path between any two reachable states. d(M) = 2 rd(M) = 3  Initialized Diameter d I (M)  Initialized Recurrence Diameter rd I (M) Basic notions…

17 The Completeness Threshold  Theorem: for Gp properties CT = d I (M) ( Biere, Cimatti, Clarke, Zhu, 1999 ) s0s0 pp Arbitrary path  Theorem: for Fp properties CT= rd I (M)+1 (Kroening, Strichman, 2003) s0s0 pp pp pp pp pp  Theorem: for an LTL property  CT = ?

18 Advantages of the semantic translation Syntactic TranslationSemantic Translation Size of formula O( k ¢ | M | + k 2 ¢ |  |)O ( k ¢ | M | + k ¢ |  |) Optimizations w.r.t. LTL formulas NoneEfficient Buchi construction from LTL Computing CTOnly for Gp and FpFull LTL

19 Completeness threshold for LTL  It cannot be longer than rd I (  )+1  It cannot be longer than d I (  ) + d(  )  Result: min(rd I (  )+1, d I (  ) + d(  )) s0s0

20 CT: examples d I (  ) + d(  ) = 6 rd I (  ) + 1= 4 d I (  ) + d(  ) = 2 rd I (  ) + 1= 4 s0s0 s0s0

21 Completeness Threshold for CTL  CTL is modular. It can be analyzed one temporal operator at a time. s0s0 p p EGEFp CT(EG) CT(EF)

22 Completeness Threshold for CTL A tight (?) bound on CT:

23 Computing CT (diameter)  Computing d(  ) symbolically with QBF: find minimal k s.t. for all i,j, if j is reachable from i, it is reachable in k or less steps. k-long path s 0 -- s k+1  Complexity: 2-exp k+1-long path s 0 -- s k+1

24 Computing CT (diameter)  Computing d(  ) explicitly: Generate the graph  Apply Floyd-Warshall (O|  | 3 ) to find shortest paths Find longest among all shortest paths  O(|  | 3 )  exp 3 in the size of the representation of   Why is there a complexity gap (2-exp Vs. exp 3 )? QBF tries in the worst case all paths between every two states. Unlike Floyd-Warshall, QBF does not use transitivity information like:

25 Computing CT (recurrence diameter)  Finding the longest loop-free path in a graph is NP- complete in the size of the graph.  The graph can be exponential in the number of variables.  Conclusion: in practice computing the recurrence diameter is 2-exp in the no. of variables.  Computing rd(y) symbolically with SAT. Find largest k that satisfies: With Sorting Networks: O(n log n)

26 Complexity of BMC CT · (min(rd I (  )+1, d I (  ) + d(  )))  The value of CT can be exponential in the # of state variables.  BMC SAT formula grows linearly with k Conclusion: standard SAT based BMC is worst-case 2-exp

27 The complexity GAP  SAT based BMC is 2-exp in the # state variables.  LTL model checking is 1-exp in the # state variables.  So why use BMC ? Finding bugs when k is small In many cases rd(y) and d(y) are not exponential and are even rather small. SAT, in practice, is very efficient.

28 Closing the complexity gap  Why is there a complexity gap ?  LTL-MC with 2-dfs : dfs1 dfs2  Every state is visited not more than twice

29 Closing the complexity gap  2-dfs Each state is visited not more than twice  SAT Each state can potentially be visited an exponential no. of times, because all paths are explored.

30 Closing the complexity gap (for G p)  Force a static order, following a forward traversal  Each time a state i is fully evaluated (assigned): Prevent the search from revisiting it through deeper paths (by adding conflict clauses) When backtracking from state i, prevent the search from revisiting it in step i If : p i holds stop and return “Counterexample found”

31 Work in progress  Challenges: Formally prove that the restricted version is 1-exp. Remove requirement of static order, and stay 1-exp. Extend to full LTL How to combine logic minimization and template clauses Implementation & experiments

32 Closing the complexity gap  Restricted SAT-BMC for LTL (/symbolic 2-dfs) Force a static order, following a forward traversal Each time a state i is fully evaluated (assigned): Prevent the search from revisiting it through deeper paths, e.g. If (x i Æ : y i ) is a visited state, then for i < j · CT add the following state clause: ( : x j Ç y j ). We denote this clause by Sc i j When backtracking, from state i, prevent the search from revisiting it in step i (add ( : x i Ç y i )). Let last-accepting[i] = index of the last accepting state · i If a conflict arises in step j due to a state-clause SC i j s.t. i · last-accepting[j-1] and SC i i is satisfied, Return (“counterexample found”)

33 Closing the complexity gap  Is ‘1-exp SAT’ better or worse than BMC ?  Bad news: We gave up the main power of SAT: dynamic splitting heuristics. We may generate an exponential no. of added constraints  Good news Single exp. instead of double exp. No need to compute CT. (Instead of pre-computing CT we can maintain a list of states and add their negation ‘when needed’).

34 Closing the complexity gap  Is restricted SAT better or worse than explicit LTL-MC ?  Not clear ! Unlike dfs, SAT has heuristics for progressing. SAT has pruning ability of sets of states

35 Comparing the algorithms… 2-dfs LTL MCRestricted-SAT BMC SAT - BMC TimeEXPEXP 2 2-EXP Memory*EXPEXP 2 EXP GuidanceNoneRestrictedFull PruningStatesSets of states * Assuming the SAT solver restricts the size of its added clauses

36 LTL-MC vs. restricted SAT BMC 2-dfs LTL MCRestricted-SAT BMC SAT - BMC TimeEXPEXP 2 2-EXP MemoryEXP P Shortest CE ‘from below’ Yes Requires CTNo Yes (2-EXP) GuidanceNoneRestrictedFull PruningStatesSets of states

37 LTL-MC vs. restricted SAT BMC 2-dfs LTL MCRestricted-SAT BMC SAT - BMC TimeEXPEXP 2 2-EXP MemoryEXP P Shortest CE ‘from below’ Yes Requires CTNo Yes (2-EXP) GuidanceNoneRestrictedFull PruningStatesSets of states

38 LTL-MC vs. restricted SAT BMC 2-dfs LTL MCRestricted-SAT BMC SAT - BMC TimeEXPEXP 2 2-EXP MemoryEXP P Shortest CE ‘from below’ Yes Requires CTNo Yes (2-EXP) GuidanceNoneRestrictedFull PruningStatesSets of states

39 lk The loop case (infinite traces) i+1 i < k li = k succ(i) = BMC syntactic translation (Biere, Cimatti, Clarke, Zhu, 1999)

40 A semantic translation (Based on the Vardi-Wolper algorithm)  Buchi automata B: h S,S 0, ,F,L i  Let inf(W) be the set of states visited infinite no. of times by a run W  B accepts W iff there exists f 2 F s.t. inf(W) Å f  ;