Fundamental Algorithms For System Modeling, Analysis, and Optimization
Fundamental Algorithms For System Modeling, Analysis, and Optimization
Model Checking
G(p X q) Yes, property satisfied
Model Checker
no q p p q
Outline
Computation Tree Logic and why it is useful for model checking Model Checking with BDDs Bounded Model Checking with SAT
qr qr r pq r
Kripke structure
. . .
Infinite Computation Tree
4
Temporal Logic
Linear Temporal Logic (LTL) Properties expressed over a single time-line Computation Tree Logic (CTL, CTL*) Properties expressed over a tree of all possible executions CTL* gives more expressiveness than LTL CTL is a subset of CTL* that is easier to verify than arbitrary CTL*
A G ( E F reset )
CTL: Every F, G, X, U must be preceded by either an A or aE
E.g., Cant write A (FG p)
Why CTL?
Verifying LTL properties turns out to be computationally harder than CTL Exponential in the size of the LTL expression
linear for CTL
AF AG p is stronger than F G p
So, weve decided to do CTL model checking. What are the algorithms?
10
11
Verification of G p
12
13
Definition of Check:
Input: A CTL property (and implicitly, ) Output: A Boolean formula B representing the set of states satisfying
14
15
CheckEX
CheckEX(p) returns a set of states such that p is true in their next states How to write this?
16
CheckEU
CheckEU(p, q) returns a set of states, each of which is such that Either q is true in that state Or p is true in that state and you can get from it to a state in which p U q is true Seems like circular reasoning! But it works out: using an recursive computation like in reachability analysis
We compute a series of approximations leading to the right answer
17
CheckEU
CheckEU(p, q) returns a set of states, each of which is such that Either q is true in that state Or p is true in that state and you can get from it to a state in which p U q is true Let Z0 be our initial approximation to the answer to CheckEU(p, q) Zk(s) = { q(s) + [ p(s) . x,s+ { (s, x, s+) . Zk-1(s+) } ] } Whats a good choice for Z0? Why will this terminate?
18
Summary
EGp computed similarly Definition of Check:
Input: A CTL property (and implicitly, ) Output: A Boolean formula B representing the set of states satisfying
19
A finite state machine M (transition system) A property p Determine Does M allow a counterexample to p of k transitions or fewer? This problem can be translated to a SAT problem
20
Models
Transition system described by a set of constraints g=ab g a b Model: c' = p p c } C={ g = a b, p = g c, c' = p
p=gc
Properties
A counterexample is a path from a state satisfying R0 to state satisfying E, where every transition satisfies C.
22
Unfolding
Unfold the model k times: Uk = C0 C1 ... Ck-1 R0
a b g p c a b g p c
...
a b
g p c
Ek
BMC applications
Debugging:
Can find counterexamples using a SAT solver
Proving properties:
Only possible if a bound on the length of the shortest counterexample is known. I.e., we need a diameter bound. The diameter is the maximum length of the shortest path between any two states. Worst case is exponential. Obtaining better bounds is sometimes possible, but generally intractable.
24