Top Banner
Incremental, Inductive Model Checking Aaron Bradley June 27, 2013
38

Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

May 08, 2019

Download

Documents

duongdat
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Incremental, Inductive Model Checking

Aaron Bradley

June 27, 2013

Page 2: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Notation

S : (x , i , I (x), T (x , i , x ′)) Invariant property : P

I x : State variables

I i : Inputs

I I (x): Initial condition

I T (x , i , x ′): Transition relation

I P(x): Invariant property (“good states”)

Problem: Show all reachable states satisfy P

Page 3: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

SAT-Based Model Checking:Just Unroll

Page 4: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Bounded Model Checking (BMC)

For k = 0, 1, 2, . . ., SAT query:

I (x0) ∧k∧

j=1

T (x j−1, i j−1, x j) ∧ ¬P(xk)

until an error is found or the diameter is reached.

Page 5: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 6: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Induction

Mathematical induction over S :

I I (x)⇒ P(x) (initiation)

I P(x) ∧ T (x , i , x ′)⇒ P(x ′) (consecution)

Failure does not imply that P does not hold.

Inductive strengthening: F such that F ∧ P is inductive

Page 7: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 8: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

k-Induction

Initiation: (BMC)

I (x0) ∧k∧

j=1

T (x j−1, i j−1, x j) ⇒ P(xk)

Consecution:

LoopFree ∧k∧

j=1

(P(x j−1) ∧ T (x j−1, i j−1, x j)

)⇒ P(xk)

Page 9: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 10: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Interpolant-based Model Checking (ITP)

Post-condition operator:

post(F )(x) = ∃x0, i0. F (x0) ∧ T (x0, i0, x)

Abstract post-condition operator:

post(F )(x)⇒ post(F )(x)

Page 11: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Interpolant-based Model Checking (ITP)

If this query is UNSAT

F (x0) ∧k∧

j=1

T (x j−1, i j−1, x j) ⇒ P(xk)

then extract G such that

F (x0) ∧ T (x0, i0, x1) ⇒ G (x1)

and

G (x1) ∧k∧

j=2

T (x j−1, i j−1, x j) ⇒ P(xk)

Thenpost(F )(x) := G (x)

Page 12: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 13: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

SAT-Based Model Checking:Don’t Unroll!

Page 14: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 15: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 16: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 17: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 18: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Inductive Generalization

Given: cube s (usually based on backward-reachable state)

Find: c ⊆ ¬s such that

I Initiation:I (x)⇒ c(x)

I Consecution (relative to information G ):

G (x) ∧ c(x) ∧ T (x , i , x ′)⇒ c(x ′)

I Minimality: No strict subclause of c is inductive relative to G

Page 19: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 20: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 21: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

IC31

Use inductive generalization to incrementally constructover-approximating sets.

Fi : over-approximates set of states reachable in at most i steps

Four invariants:

1. I (x)⇒ F0(x)

2. ∀i . Fi (x)⇒ Fi+1(x)

3. ∀i . Fi (x) ∧ T (x , i , x ′)⇒ Fi+1(x ′)

4. ∀i ≤ k . Fi (x)⇒ P(x)

1Incremental Construction of Inductive Clauses for Indubitable CorrectnessSometimes called Property Directed Reachability (PDR)

Page 22: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 23: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

IC3

Refinement: In response to proof obligation 〈s, j〉,I Attempt inductive generalization relative to Fj : c ⊆ ¬sI Success: Conjoin c to F1, . . . ,Fj+1

I Failure:I Predecessor tI Enqueue new obligation 〈t, j − 1〉

Page 24: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 25: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

IC3

WhenFk ∧ T (x , i , x ′)⇒ P(x ′)

I Propagate clauses forward with relative induction

I Increment k (unless converged)

Page 26: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 27: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

IC3

Converges when ∃j ≤ k . Fj = Fj+1. Then:

1. I (x)⇒ Fj(x)

2. Fj(x) ∧ T (x , i , x ′)⇒ Fj(x′)

3. Fj(x)⇒ P(x)

∴ Fj is an inductive strengthening of P.

Page 28: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Research Inspired by IC3:Incremental, Inductive Model Checking

Page 29: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Improvements/Extensions to IC3

I Lift predecessor state s to set of predecessors s:I with kCOI, statically (original paper)I with ternary simulation [Een et al. ’11]I with SAT [Chockler et al. ’11]

I Improve proofs [Bradley et al. ’11]I Strengthen, weaken, shrinkI Used in FAIR, IICTL

I Apply IC3 in design/verify cycle [Chockler et al. ’11]I Extract inductive core from previous runI Accelerate analysis of mutated design or similar property

I Improve generalization [Hassan et al. ’13]I Apply inductive generalization to counterexamples to

generalization (CTGs)I Not just explicitly discovered backward reachable statesI Essentially uniform improvement ∴ better

Page 30: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Localization Reduction

I Extract information from incomplete concrete run to guiderefinements [Baumgartner et al. ’12]

I Level at which variable is first usedI Reduction in abstract model size in practice

I Lazy abstraction [Vizel et al. ’12]I Visible variables abstraction U0 ⊆ U1 ⊆ · · · ⊆ Uk

I Refinement: run IC3 on concrete model at kI Then use unsat core of Fi ∧ T ⇒ F ′

i+1 to derive new Ui

Page 31: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)
Page 32: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

LTL (ω-regular) Model Checking [Bradley et al. ’11]

I Search for lasso as usualI Top-level SAT query:

I Find set of states in one “arena” that satisfy all Buchiconditions

I If UNSAT, property holds

I Reachability queries to connect states:I Stem: From initial state to one of statesI Cycle: From state to state

I Refinement from inductive strengthenings:I Stem: Global reachabilityI Cycle: Transection of state space—loop must be on one side

Page 33: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

CTL Model Checking [Hassan et al. ’12]

I “Local” method + generalization

I Incrementally refine lower/upper bounds on subformulasI Generalize from queries involving explicit states:

I EXψ: SAT (unsat core)I EFψ: reachability, e.g., IC3 (inductive strengthening)I EGψ: constrained cycle, e.g., FAIR (inductive strengthening)

I Generalize traces with aggressive lifting

Page 34: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Other decidable domains

I Timed systems [Hoder et al. ’12, Kindermann et al. ’12]

I Petri nets (and more general) [Kloos et al. ’13]

I Finite-state safety games [Morgenstern ’13]

Page 35: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

IC3 with SMT

I Combination with lazy abstraction [Cimatti et al. ’12]

I Constrained Horn Clauses [Hoder et al. ’12]

I Polyhedra [Welp et al. ’13]

Page 36: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Combination with ITP

Use inductive generalization to locally construct interpolant[Vizel et al. ’13]

Page 37: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Conclusion

Main ideas:

I Induction as a mechanism for generalization

I Incremental, local (state-triggered) reasoning

Complements monolithic reasoning, which sometimes wins

Page 38: Incremental, Inductive Model Checking - theory.stanford.edutheory.stanford.edu/~arbrad/slides/IST13.pdfInduction Mathematical induction over S: I I(x) )P(x)(initiation) I P(x) ^T(x;i;x0)

Thanks! Questions?