Docsity

Introduction to Model Checking - Outline | EECS 755, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Introduction to Model Checking - Outline | EECS 755 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Introduction to Model Checking

Ken McMillan

Cadence Berkeley Labs

[email protected]

Outline

 Model checking

  • Temporal logic
  • Model checking algorithms
  • Expressiveness and complexity

 Symbolic model checking

  • The “state explosion” problem
  • Binary Decision Diagrams
  • Computing fixed points with BDD’s
  • Application

Temporal operators...

  • “Future”: F p at t iff p for some t’ ≥ t.

p p p p p p

F p...

  • “Until”: p U q at t iff
    • q for some t’ ≥ t and
    • p in the range [ t, t’ )

p p p p p p

p U q...

p p p q

  • “Next-time”: X p at t iff p at t+

Examples

 Liveness: “if input, then eventually output”

G (input ⇒ F output)

 Strong fairness: “infinitely send implies infinitely recv.”

GF send ⇒ GF recv

 Weak until: “no output before input”

¬output W input

atomic props infinitely often

p W q ≡

p U q ∨ G p

PLTL semantics

 Given an infinite sequence

  • if φ is true in state si of σ.
  • if φ is true in state s 0 of σ.
  • if φ is valid.

 A formula is an atomic proposition , or...

true, p ∨ q, ¬p, p U q, X p

PLTL semantics...

 Definition of satisfaction

iff iff iff iff iff Derived operators...

Kripke models

 A Kripke model ( S,R,L ) consists of

  • set of states S
  • set of transitions R ⊆ S × S
  • labeling L ⊆ S × AP

 Kripke models from programs

¬ p p

repeat p := true; p := false; end

Mutual exclusion example

 - N1,N - turn= - T1,N 
  • turn= - T1,T - turn=
  • C1,N
  • turn= - C1,T
    • turn= - N1,T - turn= - T1,T - turn= - N1,C - turn= - T1,C - turn=

Branching time

 Model of time is a tree, not a sequence

 Path quantifiers

AF p p p p

Computation Tree Logic

 Every operator F, G, X, U preceded by A or E

 Universal modalities...

p p p

........................ AG p p p p p p p p AF p

CTL, cont

 Other modalities

AX p, EX p, A ( p U q ), E ( p U q )

 Some dualities...

 Examples: mutual exclusion specs...

AG ¬ ( C 1 ∧ C 2 ) mutual exclusion AG ( T 1 ⇒ AF C 1 ) liveness AG ( N 1 ⇒ EX T 1 ) non-blocking

CTL model checking

 Model checking problem:

  • Determine for given M , s 0 and f , whether

 Simple algorithm:

  • Inductive over structure of formula
  • Backward propagation of formula labels
  • O( f V ( V + E ))

CES algorithm

 Need only modalities EX, EU, EG.

  • e.g .,
  • Checking E ( p U q ) by backward BFS
  • Checking EG p q p BFS p SCC SCC SCC EG p Complexity = O ( f ( V + E ))

CTL*

 Contains both CTL and LTL

  • path formulas p U q , G p , Fp , Xp , ¬ p , p ∧ q
  • state formulas A p, E p

 p in LTL → A p in CTL*

 Framework for comparing expressiveness

  • Existential properties not expressible in PLTL e.g ., AG EF p
  • Fairness assumptions not expressible in CTL e.g ., A ( GF p → GF q )