IC3: Where Monolithic and Incremental Meet Fabio Somenzi Aaron R. - - PowerPoint PPT Presentation

ic3 where monolithic and incremental meet
SMART_READER_LITE
LIVE PREVIEW

IC3: Where Monolithic and Incremental Meet Fabio Somenzi Aaron R. - - PowerPoint PPT Presentation

Proving Invariants by Induction IC3 Bibliography IC3: Where Monolithic and Incremental Meet Fabio Somenzi Aaron R. Bradley Department of Electrical, Computer, and Energy Engineering University of Colorado at Boulder FMCAD, 30 October 2011


slide-1
SLIDE 1

Proving Invariants by Induction IC3 Bibliography

IC3: Where Monolithic and Incremental Meet

Fabio Somenzi Aaron R. Bradley

Department of Electrical, Computer, and Energy Engineering University of Colorado at Boulder

FMCAD, 30 October 2011

slide-2
SLIDE 2

Proving Invariants by Induction IC3 Bibliography

Outline

1

Proving Invariants by Induction Induction for Transition Systems Strengthening Relative Induction

2

IC3 Basic Algorithm Examples Efficiency

slide-3
SLIDE 3

Proving Invariants by Induction IC3 Bibliography

Outline

1

Proving Invariants by Induction Induction for Transition Systems Strengthening Relative Induction

2

IC3 Basic Algorithm Examples Efficiency

slide-4
SLIDE 4

Proving Invariants by Induction IC3 Bibliography

Finite-State Transition Systems

IC3 works on a symbolic representation of a system: S : (i, x, I(x), T(i, x, x′)) i: primary inputs x: state variables x′: next state variables I(x): initial states T(i, x, x′): transition relation

slide-5
SLIDE 5

Proving Invariants by Induction IC3 Bibliography

Invariance Properties

IC3 proves (or refutes) invariants Prove that every reachable state satisfies P(x)

P is a propositional formula

Checking safety properties is reduced to checking invariance properties

slide-6
SLIDE 6

Proving Invariants by Induction IC3 Bibliography

Mutual Exclusion for a Simple Arbiter

DFF r1 r2 g1 g2 DFF 00 10 11 01 00 00 01 10 10, 11 00 10, 11 10 01, 11 01, 11 00 01

I(g) = ¬g1 ∧ ¬g2 ∃r1, r2 . T(r, g, g′) = ¬g′

1 ∨ ¬g′ 2

P(g) = ¬g1 ∨ ¬g2

slide-7
SLIDE 7

Proving Invariants by Induction IC3 Bibliography

Inductive Proofs for Transition Systems

Prove initiation (base case)

I(x) ⇒ P(x) All initial states satisfy P (¬g1 ∧ ¬g2) ⇒ (¬g1 ∨ ¬g2)

Prove consecution (inductive step)

P(x) ∧ T(i, x, x′) ⇒ P(x′) All successors of states satisfying P satisfy P (¬g1 ∨ ¬g2) ∧ (¬g ′

1 ∨ ¬g ′ 2) ⇒ (¬g ′ 1 ∨ ¬g ′ 2)

If both pass, all reachable states satisfy the property

S | = P

slide-8
SLIDE 8

Proving Invariants by Induction IC3 Bibliography

Visualizing Inductive Proofs

00 10 11 01

The inductive assertion (∼yellow) contains all initial (blue) states and no arrow leaves it (it is closed under the transition relation)

slide-9
SLIDE 9

Proving Invariants by Induction IC3 Bibliography

Counterexamples to Induction: The Troublemakers

00 01 11 10

slide-10
SLIDE 10

Proving Invariants by Induction IC3 Bibliography

Counterexamples to Induction: The Troublemakers

00 01 11 10 CTI

slide-11
SLIDE 11

Proving Invariants by Induction IC3 Bibliography

Invariant Strengthening

00 01 11 10 CTI

slide-12
SLIDE 12

Proving Invariants by Induction IC3 Bibliography

Invariant Strengthening

00 01 11 10

slide-13
SLIDE 13

Proving Invariants by Induction IC3 Bibliography

Invariant Strengthening

00 01 11 10

slide-14
SLIDE 14

Proving Invariants by Induction IC3 Bibliography

Invariant Strengthening

00 01 11 10

slide-15
SLIDE 15

Proving Invariants by Induction IC3 Bibliography

Strong and Weak Invariants

000 001 011 010 110 111 100 101

Induction is not restricted to: the strongest inductive invariant (forward-reachable states) . . . or the weakest inductive invariant (complement of the backward-reachable states) ¬x1 is simpler than ¬x1 ∧ (¬x2 ∨ ¬x3) (strongest) and (¬x1 ∨ ¬x3) (weakest)

slide-16
SLIDE 16

Proving Invariants by Induction IC3 Bibliography

Completeness for Finite-State Systems

CTIs are effectively bad states

If a CTI is reachable so is at least one bad state

Remove CTI from P and try again Eventually either:

An inductive strengthening of P results An initial state is removed from P

In the latter case, a counterexample is obtained

slide-17
SLIDE 17

Proving Invariants by Induction IC3 Bibliography

Examples of Strengthening Strategies

Removing one CTI at a time is very inefficient!

Several strategies in use to avoid that

Fixpoint-based invariant checking: if νZ . p ∧ AX Z converges in n > 0 iterations, then

0≤i<n AXi p is an inductive

invariant

In fact, the weakest inductive invariant

k-induction: if all states on length-k paths from the initial states satisfy p, and k distinct consecutive states satisfying p are always followed by a state satisfying p, then all states reachable from the initial states satisfy p. fsis algorithm: try to extract an inductive clause from CTI to exclude multiple CTIs

slide-18
SLIDE 18

Proving Invariants by Induction IC3 Bibliography

Relative Induction

Suppose the assertion ϕ is a conjunction ϕ =

  • 0≤j<n

ϕj Suppose each ϕj is inductive relative to the previous assertions and

  • P. That is, for every 0 ≤ j < n, I ⇒ ϕj and

P ∧

  • 0≤i≤j

ϕi ∧ T ⇒ ϕ′

j

Finally, suppose P is inductive relative to ϕ; that is, I ⇒ P and P ∧

  • 0≤i<n

ϕi ∧ T ⇒ P′ Then P is an invariant of S

slide-19
SLIDE 19

Proving Invariants by Induction IC3 Bibliography

Relative Induction

010 000 001 011 100 101 110 111

ϕ = ¬x1 ∧ (x1 ∨ ¬x2)

slide-20
SLIDE 20

Proving Invariants by Induction IC3 Bibliography

Relative Induction

010 000 001 011 100 101 110 111

¬x1 is not inductive

slide-21
SLIDE 21

Proving Invariants by Induction IC3 Bibliography

Relative Induction

010 000 001 011 100 101 110 111

x1 ∨ ¬x2 is inductive

slide-22
SLIDE 22

Proving Invariants by Induction IC3 Bibliography

Relative Induction

010 000 001 011 100 101 110 111

¬x1 is inductive relative to x1 ∨ ¬x2

slide-23
SLIDE 23

Proving Invariants by Induction IC3 Bibliography

Shortcoming of Relative Induction

010 100 101 011 000 001 110 111

P = (x1 ∨ x2 ∨ x3) ∧ (¬x1 ∨ ¬x2 ∨ x3) ϕ = (x1 ∨ x2) ∧ (¬x1 ∨ ¬x2)

slide-24
SLIDE 24

Proving Invariants by Induction IC3 Bibliography

Shortcoming of Relative Induction

010 100 101 011 000 001 110 111

(x1 ∨ x2) ∧ P ∧ T ⇒ (x′

1 ∨ x′ 2)

slide-25
SLIDE 25

Proving Invariants by Induction IC3 Bibliography

Shortcoming of Relative Induction

010 100 101 011 000 001 110 111

(¬x1 ∨ ¬x2) ∧ P ∧ T ⇒ (¬x′

1 ∨ ¬x′ 2)

slide-26
SLIDE 26

Proving Invariants by Induction IC3 Bibliography

Shortcoming of Relative Induction

010 100 101 011 000 001 110 111

(x1 ∨ x2) ∧ (¬x1 ∨ ¬x2) ∧ P ∧ T ⇒ (x′

1 ∨ x′ 2) ∧ (¬x′ 1 ∨ ¬x′ 2)

slide-27
SLIDE 27

Proving Invariants by Induction IC3 Bibliography

Shortcoming of Relative Induction

010 100 101 011 000 001 110 111

(x1 ∨ x2) and (¬x1 ∨ ¬x2)are mutually inductive

slide-28
SLIDE 28

Proving Invariants by Induction IC3 Bibliography

Outline

1

Proving Invariants by Induction Induction for Transition Systems Strengthening Relative Induction

2

IC3 Basic Algorithm Examples Efficiency

slide-29
SLIDE 29

Proving Invariants by Induction IC3 Bibliography

What Does IC3 Stand for?

Incremental Construction of Inductive Clauses for Indubitable Correctness

slide-30
SLIDE 30

Proving Invariants by Induction IC3 Bibliography

Basic Tenets

Approximate reachability assumptions

Fi: contains at least all the states reachable in i steps or less If S | = P, Fi eventually becomes inductive for some i Approximation is desirable: IC3 does not attempt to get the most precise Fi’s

Stepwise relative induction

Learn useful facts via induction relative to reachability assumptions

Clausal representation

Learn clauses from CTIs A form of abstract interpretation

slide-31
SLIDE 31

Proving Invariants by Induction IC3 Bibliography

IC3 Invariants

The four main invariants of IC3. I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k Established if there are no counterexamples of length 0 or 1 The implicit invariant of the outer loop: no counterexamples

  • f length k.
slide-32
SLIDE 32

Proving Invariants by Induction IC3 Bibliography

Pseudo-Pseudocode

bool IC3 { if (I ⇒ P or I ∧ T ⇒ P′) return ⊥; F0 = I; F1 = P; k = 1 repeat { while (there are CTIs in Fk) { either find a counterexample and return ⊥

  • r refine F1, . . . , Fk

} k ++; set Fk = P and propagate clauses if (Fi = Fi+1 for some 0 < i < k) return ⊤ } }

slide-33
SLIDE 33

Proving Invariants by Induction IC3 Bibliography

Passing Property

No counterexamples of length 0 or 1

00 01 11 10

I = ¬x1 ∧ ¬x2 P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-34
SLIDE 34

Proving Invariants by Induction IC3 Bibliography

Passing Property

Does F1 ∧ T ⇒ P′?

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-35
SLIDE 35

Proving Invariants by Induction IC3 Bibliography

Passing Property

Found CTI s = x1 ∧ x2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-36
SLIDE 36

Proving Invariants by Induction IC3 Bibliography

Passing Property

Is ¬s inductive relative to F1?

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-37
SLIDE 37

Proving Invariants by Induction IC3 Bibliography

Passing Property

  • No. Is ¬s inductive relative to F0?

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-38
SLIDE 38

Proving Invariants by Induction IC3 Bibliography

Passing Property

  • Yes. Generalize ¬s at level 0 (in one of the two possible ways)

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-39
SLIDE 39

Proving Invariants by Induction IC3 Bibliography

Passing Property

Update F1

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-40
SLIDE 40

Proving Invariants by Induction IC3 Bibliography

Passing Property

No more CTIs in F1. No counterexamples of length 2. Instantiate F2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x2 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-41
SLIDE 41

Proving Invariants by Induction IC3 Bibliography

Passing Property

Propagate clauses from F1 to F2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x2 F2 = (¬x1 ∨ x2) ∧ ¬x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-42
SLIDE 42

Proving Invariants by Induction IC3 Bibliography

Passing Property

F1 and F2 are identical. Property proved

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x2 F2 = (¬x1 ∨ x2) ∧ ¬x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-43
SLIDE 43

Proving Invariants by Induction IC3 Bibliography

Passing Property

What happens if we generalize ¬s at level 0 in the other way?

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-44
SLIDE 44

Proving Invariants by Induction IC3 Bibliography

Passing Property

Update F1

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x1

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-45
SLIDE 45

Proving Invariants by Induction IC3 Bibliography

Passing Property

No more CTIs in F1. No counterexamples of length 2. Instantiate F2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-46
SLIDE 46

Proving Invariants by Induction IC3 Bibliography

Passing Property

No clauses propagate from F1 to F2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = (¬x1 ∨ x2) ∧ ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-47
SLIDE 47

Proving Invariants by Induction IC3 Bibliography

Passing Property

Remove subsumed clauses

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-48
SLIDE 48

Proving Invariants by Induction IC3 Bibliography

Passing Property

Does F2 ∧ T ⇒ P′?

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-49
SLIDE 49

Proving Invariants by Induction IC3 Bibliography

Passing Property

Found CTI s = x1 ∧ x2 (same as before)

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-50
SLIDE 50

Proving Invariants by Induction IC3 Bibliography

Passing Property

Is ¬s inductive relative to F1?

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-51
SLIDE 51

Proving Invariants by Induction IC3 Bibliography

Passing Property

  • No. We know it is inductive at level 0.

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-52
SLIDE 52

Proving Invariants by Induction IC3 Bibliography

Passing Property

If generalization produces ¬x1 again, the CTI is not eliminated

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-53
SLIDE 53

Proving Invariants by Induction IC3 Bibliography

Passing Property

Find predecessor t of CTI in F1 \ F0

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-54
SLIDE 54

Proving Invariants by Induction IC3 Bibliography

Passing Property

Found t = ¬x1 ∧ x2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-55
SLIDE 55

Proving Invariants by Induction IC3 Bibliography

Passing Property

The clause ¬t is inductive at all levels

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-56
SLIDE 56

Proving Invariants by Induction IC3 Bibliography

Passing Property

Generalization of ¬t produces ¬x2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 F2 = P = ¬x1 ∨ x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-57
SLIDE 57

Proving Invariants by Induction IC3 Bibliography

Passing Property

Update F1 and F2

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 ∧ ¬x2 F2 = (¬x1 ∨ x2) ∧ ¬x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-58
SLIDE 58

Proving Invariants by Induction IC3 Bibliography

Passing Property

F1 and F2 are equivalent. Property (almost) proved

00 01 11 10

F0 = I = ¬x1 ∧ ¬x2 F1 = ¬x1 ∧ ¬x2 F2 = (¬x1 ∨ x2) ∧ ¬x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-59
SLIDE 59

Proving Invariants by Induction IC3 Bibliography

Failing Property

No counterexamples of length 0 or 1

000 001 100 101 110 111 011 010

I = ¬x1 ∧ ¬x3 ∧ ¬x3 P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-60
SLIDE 60

Proving Invariants by Induction IC3 Bibliography

Failing Property

Does F1 ∧ T ⇒ P′?

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-61
SLIDE 61

Proving Invariants by Induction IC3 Bibliography

Failing Property

Found CTI s = ¬x1 ∧ x2 ∧ x3

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-62
SLIDE 62

Proving Invariants by Induction IC3 Bibliography

Failing Property

The clause ¬s generalizes to ¬x2 at level 0

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = (¬x1 ∨ ¬x2 ∨ ¬x3) ∧ ¬x2

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-63
SLIDE 63

Proving Invariants by Induction IC3 Bibliography

Failing Property

No CTI left: no counterexample of length 2. F2 instantiated, but no clause propagated

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 F2 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-64
SLIDE 64

Proving Invariants by Induction IC3 Bibliography

Failing Property

The clause ¬s generalizes again to ¬x2 at level 0

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 F2 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-65
SLIDE 65

Proving Invariants by Induction IC3 Bibliography

Failing Property

Suppose IC3 recurs on t = ¬x1 ∧ ¬x2 ∧ x3 in F1 \ F0

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 F2 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-66
SLIDE 66

Proving Invariants by Induction IC3 Bibliography

Failing Property

Clause ¬t is not inductive at level 0: the property fails

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 F2 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-67
SLIDE 67

Proving Invariants by Induction IC3 Bibliography

Failing Property

Suppose now IC3 recurs on t = x1 ∧ ¬x2 ∧ x3 in F1 \ F0

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 F2 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-68
SLIDE 68

Proving Invariants by Induction IC3 Bibliography

Failing Property

Clause ¬t is inductive at level 1

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 F2 = P = ¬x1 ∨ ¬x2 ∨ ¬x3

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-69
SLIDE 69

Proving Invariants by Induction IC3 Bibliography

Failing Property

Generalization of ¬t adds ¬x1 to F1 and F2

000 001 100 101 110 111 011 010

F0 = I = ¬x1 ∧ ¬x3 ∧ ¬x3 F1 = ¬x2 ∧ ¬x1 F2 = (¬x1 ∨ ¬x2 ∨ ¬x3) ∧ ¬x1

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-70
SLIDE 70

Proving Invariants by Induction IC3 Bibliography

Failing Property

Only t = ¬x1 ∧ ¬x2 ∧ x3 remains in F1 \ F0

000 001 100 101 110 111 011 010

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-71
SLIDE 71

Proving Invariants by Induction IC3 Bibliography

Failing Property

The same counterexample as before is found

000 001 100 101 110 111 011 010

I ⇒ F0 Fi ⇒ Fi+1 0 ≤ i < k Fi ⇒ P 0 ≤ i ≤ k Fi ∧ T ⇒ F ′

i+1

0 ≤ i < k

slide-72
SLIDE 72

Proving Invariants by Induction IC3 Bibliography

Reverse IC3

000 100 011 111 001 101 010 110

Build reachability assumptions around the target

slide-73
SLIDE 73

Proving Invariants by Induction IC3 Bibliography

Reverse IC3

000 100 011 111 001 101 010 110

Equivalent to reversing all transitions

slide-74
SLIDE 74

Proving Invariants by Induction IC3 Bibliography

Clause Generalization

A CTI is a cube

e.g., s = x1 ∧ ¬x2 ∧ x3

The negation of a CTI is a clause

e.g., ¬s = ¬x1 ∨ x2 ∨ ¬x3

Conjoining ¬s to a reachability assumption Fi excludes the CTI from it Generalization extracts a subclause from ¬s that excludes more states that are “like the CTI”

e.g., ¬x3 may be a subclause of ¬s that excludes states that, like the CTI, are not reachable in i steps Every literal dropped doubles the number of states excluded by a clause Generalization is time-consuming, but critical to performance

slide-75
SLIDE 75

Proving Invariants by Induction IC3 Bibliography

Generalization

Crucial for efficiency Generalization in IC3 produces a minimal inductive clause (MIC) The MIC algorithm is based on DOWN and UP. DOWN extracts the (unique) maximal subclause UP finds a small, but not necessarily minimal subclause MIC recurs on subclauses of the result of UP

slide-76
SLIDE 76

Proving Invariants by Induction IC3 Bibliography

Minimal Inductive Clause

234 1234 123 124 13 14 23 24 4 ⊥ 1 2 3 34 12 134

slide-77
SLIDE 77

Proving Invariants by Induction IC3 Bibliography

Minimal Inductive Clause

234 1234 123 124 13 14 23 24 4 ⊥ 1 2 3 34 12 134

slide-78
SLIDE 78

Proving Invariants by Induction IC3 Bibliography

Minimal Inductive Clause

234 1234 123 124 13 14 23 24 4 ⊥ 1 2 3 34 12 134

slide-79
SLIDE 79

Proving Invariants by Induction IC3 Bibliography

Minimal Inductive Clause

234 1234 123 124 13 14 23 24 4 ⊥ 1 2 3 34 12 134

slide-80
SLIDE 80

Proving Invariants by Induction IC3 Bibliography

Minimal Inductive Clause

234 1234 123 124 13 14 23 24 4 ⊥ 1 2 3 34 12 134

slide-81
SLIDE 81

Proving Invariants by Induction IC3 Bibliography

Maximal Inductive Subclause (DOWN)

000 101 ¬x1 ∨ x2 ∨ ¬x3

slide-82
SLIDE 82

Proving Invariants by Induction IC3 Bibliography

Maximal Inductive Subclause (DOWN)

000 101 ¬x1 ∨ x2 ∨ ¬x3 001

slide-83
SLIDE 83

Proving Invariants by Induction IC3 Bibliography

Maximal Inductive Subclause (DOWN)

000 101 x2 ∨ ¬x3 001

slide-84
SLIDE 84

Proving Invariants by Induction IC3 Bibliography

Maximal Inductive Subclause (DOWN)

000 101 x2 ∨ ¬x3 001 100

slide-85
SLIDE 85

Proving Invariants by Induction IC3 Bibliography

Maximal Inductive Subclause (DOWN)

000 101 x2 001 100

slide-86
SLIDE 86

Proving Invariants by Induction IC3 Bibliography

Use of UNSAT Cores

¬s ∧ Fi ∧ T ⇒ ¬s′ if and only if ¬s ∧ Fi ∧ T ∧ s′ is unsatisfiable The literals of s′ are (unit) clauses in the SAT query If the implication holds, the SAT solver returns an unsatisfiable core Any literal of s′ not in the core can be removed from s′ because it does not contribute to the implication . . . and from ¬s because strengthening the antecedent preserves the implication

slide-87
SLIDE 87

Proving Invariants by Induction IC3 Bibliography

Use of UNSAT Core Example

¬s ∧ F0 ∧ T ⇒ ¬s′ with ¬s = ¬x1 ∨ ¬x2 F0 = ¬x1 ∧ ¬x2 T = (¬x1 ∧ ¬x2 ∧ ¬x′

1 ∧ ¬x′ 2) ∨ · · ·

The SAT query, after some simplification, is ¬x1 ∧ ¬x2 ∧ ¬x′

1 ∧ ¬x′ 2 ∧ x′ 1 ∧ x′ 2

Two UNSAT cores are ¬x′

1 ∧ x′ 1

¬x′

2 ∧ x′ 2

from which the two generalizations we saw before follow

slide-88
SLIDE 88

Proving Invariants by Induction IC3 Bibliography

Clause Clean-Up

As IC3 proceeds, clauses may be added to some Fis that subsume other clauses The weaker, subsumed clauses no longer contribute to the definition of Fi However, a weaker clause may propagate to Fi+1 when the stronger clause does not Weak clauses are eliminated by subsumption only between major iterations and after propagation

slide-89
SLIDE 89

Proving Invariants by Induction IC3 Bibliography

More Efficiency-Related Issues

State encoding determines what clauses are derived Incremental vs. monolithic

Reachability assumptions carry global information . . . but are built incrementally

Semantic vs. syntactic approach

Generalization “jumps over large distances”

Long counterexamples at low k

Typically more efficient than increasing k

Consequences of no unrolling

Many cheap (incremental) SAT calls

Ability to parallelize

Clauses are easy to exchange

slide-90
SLIDE 90

Proving Invariants by Induction IC3 Bibliography

IC3 and Interpolation

An interesting analysis to be presented on Tuesday by Een, Mishchenko, and Brayton In the tutorial paper:

Both methods address the failure of consecution from an

  • ver-approximating i-step set.

Interpolation unrolls to produce an (interpolant-based) abstract post operator. When consecution fails, a greater unrolling refines the abstract post operator, yielding more refined over-approximating stepwise sets. IC3 uses the CTI from the failure to direct the refinement of Fi (and F1, . . . , Fi−1). In other words, they focus on refining different parts of consecution. IC3 is more incremental and does not require unrolling the transition relation.

slide-91
SLIDE 91

Proving Invariants by Induction IC3 Bibliography

Applications

Checking all ω-regular properties Cycle detection reduced to several reachability queries Inductive proofs of unreachability refine partition of state space into SCC-closed regions Incremental verification A proof from one revision of a circuit provides a starting point for the proof of the next revision Same for counterexample Some “patching” may be needed More coming

slide-92
SLIDE 92

Proving Invariants by Induction IC3 Bibliography

Bibliography I

  • A. R. Bradley, k-step relative inductive generalization,” CU

Boulder, Tech. Rep., March 2010, http://arxiv.org/abs/1003.3649.

  • A. R. Bradley, “SAT-based model checking without unrolling,”

in Verification, Model Checking, and Abstract Interpretation (VMCAI’11), Austin, TX, 2011, pp. 70–87, LNCS 6538.

  • Z. Manna and A. Pnueli, Temporal Verification of Reactive

Systems: Safety. Springer-Verlag, 1995.

  • A. R. Bradley and Z. Manna, “Checking safety by inductive

generalization of counterexamples to induction,” in Formal Methods in Computer Aided Design (FMCAD’07), Austin, TX, 2007, pp. 173–180.

slide-93
SLIDE 93

Proving Invariants by Induction IC3 Bibliography

Bibliography II (Fresh from the Oven)

  • N. Een, A. Mishchenko, and R. K. Brayton, “Efficient

Implementation of Property Directed Reachability,” in Formal Methods in Computer Aided Design (FMCAD’11), Austin, TX, 2011.

  • H. Chockler, A. Ivrii, A. Matsliah, S. Moran, and Z. Nevo,

“Incremental Formal Verification of Hardware,” in Formal Methods in Computer Aided Design (FMCAD’11), Austin, TX, 2011.

  • A. R. Bradley, F. Somenzi, Z. Hassan, and Y. Zhang, “An

incremental approach to model checking progress properties,” in Formal Methods in Computer Aided Design (FMCAD’11), Austin, TX, 2011.