Lecture1: Symbolic Model Checking With Bdds
Lecture1: Symbolic Model Checking With Bdds
Edmund M. Clarke, Jr. Computer Science Department Carnegie Mellon University Pittsburgh, PA 15213
Specication Language: A propositional temporal logic. Verication Procedure: Exhaustive search of the state space of the concurrent system to determine truth of specication.
branching time temporal logic. In Logic of programs: workshop, Yorktown Heights, NY, May 1981, volume 131 of Lecture Notes in Computer Science. Springer-Verlag, 1981.
Advantages:
No proofs!!! Fast Counterexamples No problem with partial specications Logics can easily express many concurrency properties
Main Disadvantage: State Explosion Problem
Temporal Logic
b c
a b
b c
a b
1. Path quantier:
Afor every path Ethere exists a path X holds next time. F holds sometime in the future G holds globally in the future U holds until holds
2. Temporal Operator:
In CTL each temporal operator must be immediately preceeded by a path quantier. The four most widely used CTL operators are illustrated below. Each computation tree has initial state as its root.
g g g . . . . . . g . . . g . . . g g . . . . . . g g . . . . . . g
AG
AF
g g
g . . . . . . . . . . . . . . . . . . . . . . . .
EF
EG
EF
AG AF AGAF
AGEF
computation path.
Let be the statetransition graph obtained from the concurrent system. Let be the specication expressed in temporal logic.
and check if initial states are among these. Efcient model checking algorithms exist for CTL.
Explicit Traversal
Preprocessor
CTL formulas
True or Counterexample
uses boolean encoding for state machine and sets of states. can handle much larger designs hundreds of state variables. BDDs traditionally used to represent boolean functions.
Ken McMillan implemented a version of the CTL model checking algorithm using Binary Decision Diagrams in 1987. Carl Pixley independently developed a similar algorithm, as did the French researchers, Coudert and Madre. BDDs enabled handling much larger concurrent systems. (usually, an order of magnitude increase in hardware latches!)
J. R. Burch, E. M. Clarke, K. L. McMillan, D. L. Dill, and J. Hwang. Symbolic K. L. McMillan. Symbolic Model Checking. Kluwer Academic Publishers, 1993.
model checking: states and beyond. Information and Computation, 98(2):pages 142170, 1992.
Fixpoint Algorithms
EF
EX EF
Key properties of EF : 1. EF 2.
EX EF
EX implies EF
We write EF
Lfp
EX .
How to compute EF :
False EX EX EX . .
EF ?
EF ?
EX
EF ?
EX
EF ?
EX
Ordered Binary Decision Tree for the two-bit comparator, given by the formula
1 1 0
1 1
a aa 2 22 0 1 0
a aa 2 22 1 b 0
a aa 2 22 1 0
a aa 2 22 1
b b 2 1 1 0 0 0 1 0
b b 2 1 1 0 0 0 1 0 0 0
b b 2 1 1 0 0 0 0
b b 2 1 1 0 0 0 1 1
0 1
1 0
0 1
All isomorphic subtrees are combined, and All nodes with isomorphic children are eliminated.
Given a parameter ordering, OBDD is unique up to isomorphism.
a 0
1 1
b 0 a
2 1
0 b 0 1 1 1 b 0
The size of an OBDD depends critically on the variable ordering. If we use the ordering OBDD below: for the comparator function, we get the
a a1 1 0
a 0
2 1 0
a a 22 1
1 1
0 0 1 b 2
b 1
1 1
1 0
b 1
0 b 2 0 1
0 1
Moreover, there are boolean functions that have exponential size OBDDs for any variable ordering. An example is the middle output ( output) of a combinational circuit to multiply two bit integers.
to break problem into two subproblems. Solve subproblems recursively. Always combine isomorphic subtrees and eliminate redundant nodes. Hash table stores previously computed subproblems . Number of subproblems bounded by
Boolean quantication:
By denition,
Using the above operations, we can build up OBDDs for complex boolean functions from simpler ones.
How to represent state-transition graphs with Ordered Binary Decision Diagrams: Assume that system behavior is determined by boolean state variables
The Transition relation will be given as a boolean formula in terms of the state variables:
where
a, b
Consider
EX .
How to evaluate xpoint formulas using OBDDs: EF Introduce state variables: EF Now, compute the sequence
Lfp
EX
Lfp
until convergence. Convergence can be detected since the sets of states are represented as OBDDs.
Notable Examples
The following examples illustrate the power of model checking to handle industrial size problems. They come from many sources, not just my research group.
Edmund M. Clarke, Jeannette M. Wing, et al. Formal methods: State of the art and
future directions. ACM Computing Surveys, 28(4):626643, December 1996.
In 1992 Clarke and his students at CMU used SMV to verify the cache coherence They constructed a precise model of the protocol and attempted to show that it They found a number of previously undetected errors in the design of the protocol. This was the rst time that formal methods have been used to nd errors in an IEEE Although development started in 1988, all previous attempts to validate Futurebus+
were based on informal techniques. standard. satised a formal specication of cache coherence. protocol in the IEEE Futurebus+ Standard.
Notable ExamplesHDLC
A High-level Data Link Controller (HDLC) was being designed at AT&T in Madrid. In 1996 researchers at Bell Labs offered to check some properties of the design. The Within ve hours, six properties were specied and ve were veried, using the The sixth property failed, uncovering a bug that would have reduced throughput or The error was corrected in a few minutes and formally veried.
caused lost transmissions. FormalCheck verier. design was almost nished, so no errors were expected.
Richard Raimi and Jim Lear at Somerset used Motorolas Verdict model checker to Initial silicon of PowerPC 620 microprocessor crashed during boot of an operating With run time in seconds, Verdict produced example of BIU deadlock causing the Paper on this published at 1997 IEEE International Test Conference.
failure. system. debug a hardware laboratory failure.