Symbolic model checking with SAT/SMT

Slides:



Advertisements
Similar presentations
Model Checking Base on Interoplation
Advertisements

The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Exploiting SAT solvers in unbounded model checking
Exploiting SAT solvers in unbounded model checking K. L. McMillan Cadence Berkeley Labs.
SAT-based Bounded and Unbounded Model Checking Edmund M. Clarke Carnegie Mellon University Joint research with C. Bartzis, A. Biere, P. Chauhan, A. Cimatti,
Automatic Verification Book: Chapter 6. How can we check the model? The model is a graph. The specification should refer the the graph representation.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
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.
François Fages MPRI Bio-info 2006 Formal Biology of the Cell Modeling, Computing and Reasoning with Constraints François Fages, Constraints Group, INRIA.
UPPAAL Introduction Chien-Liang Chen.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
1 Temporal Claims A temporal claim is defined in Promela by the syntax: never { … body … } never is a keyword, like proctype. The body is the same as for.
SYMBOLIC MODEL CHECKING: STATES AND BEYOND J.R. Burch E.M. Clarke K.L. McMillan D. L. Dill L. J. Hwang Presented by Rehana Begam.
CS 267: Automated Verification Lecture 7: SMV Symbolic Model Checker, Partitioned Transition Systems, Counter-example Generation in Symbolic Model Checking.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: Property checking Property checking.
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.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
1 Completeness and Complexity of Bounded Model Checking Ed Clarke Daniel Kroening Joel Ouaknine Carnegie Mellon University, Pittsburgh, USA Ofer Strichman.
Temporal Logic and Model Checking. Reactive Systems We often classify systems into two types: Transformational: functions from inputs available at the.
Witness and Counterexample Li Tan Oct. 15, 2002.
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
Review of the automata-theoretic approach to model-checking.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Completeness and Complexity of Bounded Model Checking.
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.
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.
Model Checking Lecture 4 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
1 Completeness and Complexity of Bounded Model Checking.
Verification & Validation By: Amir Masoud Gharehbaghi
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
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.
Model Checking Lecture 1. Model checking, narrowly interpreted: Decision procedures for checking if a given Kripke structure is a model for a given formula.
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.
Bernd Fischer RW714: SAT/SMT-Based Bounded Model Checking of Software.
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
Model Checking Lecture 2 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
15-820A 1 LTL Model Checking A Flavio Lerda.
The Theory of NP-Completeness
The NP class. NP-completeness
Basic concepts of Model Checking
SS 2017 Software Verification Timed Automata
Introduction to Software Verification
SS 2017 Software Verification Bounded Model Checking, Outlook
CTL model checking algorithms
Formal verification in SPIN
Automatic Verification
Introduction to Software Verification
Over-Approximating Boolean Programs with Unbounded Thread Creation
Binary Decision Diagrams
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
Artificial Intelligence
Scalability in Model Checking
The Theory of NP-Completeness
Predicate Abstraction
Formal Methods in software development
Model Checking CS 680 Formal Methods Jeremy Johnson.
Instructor: Aaron Roth
Model Checking Graph Grammars
Presentation transcript:

Symbolic model checking with SAT/SMT Fu Song

Fixpoint Computation The fixpoint formulation for EG p: nu Z. p ∧ EXZ (greatest fixpoint) Z0(v) = True Zk(v) = p(v) ∧ Ǝv' [ R(v, v') ∧ Zk-1(v)], for all k>0 Stop when Zk = Zk−1

Counterexample and Witness Witness: an execution path that demonstrates satisfaction of the property φ by model M EF p: s0s1…sn with p(sn) EG p: s0s1…sns0 with p(si) for 0<=i<=n Counterexample: an execution path that demonstrates violation of the property φ by model M AG p: s0s1…sn with ! p(sn) AF p: s0s1…sns0 with ! p(si) for 0<=i<=n

until si+1 equals to some sj with 0<=j<=i Witness Computation The fixpoint formulation for EG p: nu Z. p ∧ EXZ (greatest fixpoint) Z0(v) = True Zk(v) = p(v) ∧ Ǝv' [ R(v, v') ∧ Zk-1(v)], for all k>0 Stop when Zk = Zk−1 Fact: Z0>=Z1>=…>= Zk−1 =Zk If S0 cap Zk = \emptyset, then not hold Else, select one initial state s0 from Zk For each i>=0, choose si+1 such that si+1 in Zk and R(si,si+1) until si+1 equals to some sj with 0<=j<=i

Bounded model checking Given: A kripke structure M, an LTL property φ, and an integer bound k. Question: Is there an execution of M of length at most k that violates φ? We can write this: M |=k φ.

Semantics of LTL

Bounded semantics of LTL without a Loop K is bound i is the current position Pi is a path without any loops

Bounded semantics of LTL with (k,l)-loop pi= s0s1s2…slsl+1….skslsl+1…sk…

Bounded model checking Simple idea: “Unroll” description, use SAT/SMT to find a property violation. State description: I(s) – initial state R(s,t) – t is a successor of s P(s) – property of all states k-step violation of the property would satisfy: G p: I(s0)R(s0,s1)R(s1,s2)...R(sk-1,sk)P(sk) F p: I(s0)R(s0,s1)R(s1,s2)...R(sk-1,sk) P(s0) …,  P(sk) R(sk,s0)\/…\/R(sk,sk) Use SAT to check this for k = 0, 1, ... until it gets too big G p

Example A three bit shift register: should be empty (all bits set to zero) after three consecutive shifts (F x= 0). R(x,x’)= (x’[0] = x[1])∧(x’[1] = x[2])∧(x’[2] = 1) k=2: I(x0)R(x0,x1)R(x1,x2), I(x0)= True R(x0,x1): R(x1,x2): R(x2,xi): (loop) Check G x!= 0 xi!=0 xi[0]=1 or xi[1]=1 or xi[2]=1 This formula is satisfiable iff there is a counterexample of length 2 for the original formula F(x = 0). In our example we find a satisfying assignment for (1) by setting xi[ j] := 1 for all i, j = 0,1,2.

Bounded LTL model checking Unfolding the Transition Relation Translation of an LTL Formula without a Loop

Bounded LTL model checking Translation of an LTL Formula for a (k,l)-loop

Bounded LTL model checking Loop Condition General Translation

Verification with BMC

Verification with BMC Bounded model checking is a good way to search for counterexamples (up to some depth). How does one know that the k value is good enough? k=0,1,2,3,4,5,6…. If we find no bugs with k but increase the bound to k + 1, we might find a bug.

Verification with BMC For proving “always properties” Define “depth” of a state as the length of the shortest path from a start state to the state. Searching all k up to the maximum-depth state is sufficient to prove property P. If there are |V| Boolean state variables, there is a bound of 2|V| on this path length. The maximum depth is usually much less than this. This is impractically large in most cases. It’s not helpful for infinite-state systems (e.g., unbounded integers).

Liveness properties Reminder: Properties like “eventually P” are liveness properties. They don’t have finite-length counterexamples. But, for finite-state systems, there is a counterexample that is a single infinite path with a loop. The following says that there exists a loop where P is always false (a violation of “AF P”) I(s0)N(s0,s1)...N(si,si+1)P(si+1)...P(sk-1) N(sk-1,si)P(si)

Boundedness Trivial: the bound is |M| But it is still too larger in practice Diameter: the longest shortest path between two nodes resp. states, i.e., maximum distance If a bad state is reachable, then it is reachable in a shortest path from an initial state, <=diameter Computing diameters directly is quite hard, as hard as model checking (QBF) Reoccurrence diameter: the length of the longest simple path in, >= diameter simple path:  a path which contains no repeated

Example A fully connected graph with n nodes Diameter ? Reoccurrence diameter ? 1, 7

Complexity of BMC Original translation O(k|M|+k2|φ|) Automata based translation (Buchi Automata) O(k|M|2|φ|) Fixpoint based translation O(k|M|+|φ|) Diameter: exponential of the number of variables SAT solver is also exponential time BMC is doubly-exponential time But: LTL model checking is singly-exponential time 1, 7

Fixpoint based translation loop selector variables l0,…,lk At most one is true 1, 7

Fixpoint based translation 1, 7

SAT-based MC vs. BDD-based MC LTL and ACTL Do not canonical form Shortest counterexample Efficient SAT solvers exist Diameter is small in many cases BDD CTL and mu-calculus Canonical representation Variable ordering sensitive Often tool larger Cannot handle more than a couple of hundred latches 1, 7