adaptive interpolation-based model checkingaspdac.com/aspdac2014/technical_program/pdf/8b-3.pdf ·...

38
Adaptive Interpolation-Based Model Checking Chien-Yu (Leo) Lai, Cheng-Yin Wu, Chun-Yang (Ric) Huang 2014.1.23

Upload: others

Post on 12-Aug-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Adaptive Interpolation-Based Model Checking

Chien-Yu (Leo) Lai, Cheng-Yin Wu,

Chun-Yang (Ric) Huang

2014.1.23

Page 2: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Outline

• Introduction

• Adaptive IMC Framework

• Flexible Interpolation

• Experimental Results

• Conclusion

Page 3: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

INTRODUCTION

Page 4: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Interpolation-Based Model Checking (IMC)1

I0^Tk^!P ? Increase k

I0, T, !P, k=0

UNSAFE

UNSAT SAT

R = over-approximation within one more step

I0^Tk^R ? SAT

UNSAT

Fixed point?

SAFE

No

Yes

1K. L. McMillan, Interpolation and SAT-based model checking (CAV 2003)

Page 5: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Interpolation-Based Model Checking (IMC)

BMC Phase: I0^Tk^!P ?

ITP Phase: Iteratively compute over-

approximation step by step

Spurious counter-example

inconsistent

SAFE

UNSAFE

Real counter-example

Fixed point?

Refinement: increase k

Page 6: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Interpolation-Based Model Checking (IMC)

I0^Tk^!P ? Increase k

I0, T, !P, k=0

UNSAFE

UNSAT SAT

R = over-approximation within one more step

I0^Tk^R ? SAT

UNSAT

Fixed point?

SAFE

Yes

No

Adequte?

Fast?

Fast?

Page 7: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Too fine-grained

I0^Tk^!P ? Increase k

I0, T, !P, k=0

UNSAFE

UNSAT SAT

R = over-approximation within one more step

I0^Tk^R ? SAT

UNSAT

Fixed point?

SAFE

Yes

No

Requires several iterations to jump out

Page 8: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Too Coarse

I0^Tk^!P ? Increase k

I0, T, !P, k=0

UNSAFE

UNSAT SAT

R = over-approximation within one more step

I0^Tk^R ? SAT

UNSAT

Fixed point?

SAFE

Yes

No

Hardly reach fixed point before spurious counter-exmples

Need frequent refinement

Page 9: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Two examples

!P

I0

R1

R2

!P

I0

Rn

Need for finer-grained abstraction Need for coarser abstraction

Abstract reachability

Bad states

Spurious counter-example

?

Page 10: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Previous Works – Single, Blind Granularities

• McMillan’s IMC1

– Depends only on the refutation proof

• NewITP2

– Depends only on the strength of SAT/UNSAT generalizations

2C.Y. Wu, A counterexample-guided interpolant generation algorithm for SAT-based model checking (DAC’13) 1K. L. McMillan, Interpolation and SAT-based model checking (CAV 2003)

Page 11: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Two examples (review)

!P

I0

R1

R2

!P

I0

Rn

Need for finer-grained abstraction Need for coarser abstraction

Abstract reachability

Bad states

With single granularity, IMC hardly solves both of them

Spurious counter-example

?

Page 12: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

ADAPTIVE IMC FRAMEWORK

Page 13: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Adaptive IMC Framework

I0^Tk^!P ? Increase k

I0, T, !P, k=0

UNSAFE

UNSAT SAT

Flexible interpolation

I0^Tk^R ? SAT

UNSAT

Fixed point?

SAFE

No

Yes

Tends to contain counter-examples Finer

Adaptivity

Adaptivity

Hard to Converge Coarser

Page 14: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

FLEXIBLE INTERPOLATION BY REACHABILITY PARTITIONING

Page 15: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Reachability v.s. Granularity

• When I0^Tk-1^T^R is UNSAT, not all clauses get involved with UNSAT proof

I0^Tk-1

R

Concrete transitions

Transitions by freed constrains

Page 16: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Reachability v.s. Granularity

• If the reachability is smaller, more clauses are absent in UNSAT proof

I0^Tk-1

Rs

Concrete transitions

Transitions by freed constrains

Page 17: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Make Abstraction Coarse

• By just partitioning R into 2 slices

I0^Tk-1

R0 R1

Concrete transitions

Transitions by freed constrains

Page 18: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Make Abstraction Coarse

• Constrains restricting the transitions from R1 is missing

I0^Tk-1

R0

Transitions by freed constrains

Page 19: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Make Abstraction Coarse

• Likewise

I0^Tk-1

R1

Transitions by freed constrains

Page 20: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Make Abstraction Coarse

• The disjunction of the reachability becomes coarse than computing R’s directly

I0^Tk-1

Transitions by freed constrains

Page 21: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Flexible Interpolation by Reachability Partitioning

Reachability partitioner

ITPn

R1 R1

R1 ITP1

Final ITP

R

rn

R1 R1

R1 r1

n = #slices

Disjoint

Page 22: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

ATR&R INTERPOLATION

Page 23: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

2-Step Interpolation

1. Transition Relation Abstraction

2. Reachability Construction

Page 24: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

ATR to ATR Circuit

• Extract UNSAT core on the last time-frame

T T T … I0 T R

Extract this part k-1

Page 25: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

ATR Circuit

• Record the presence of clauses in proof

(abc)

(ca)

(cb) c

a

b

Page 26: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Ternary Simulation

• Finds don’t-care state variables

1010110

0100110 101

X01011X

01XX11X 101

Find inputs For x0xx11x X

X X

X

X X X

PPI PI

PPO

Page 27: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

ATR Circuit Simulation

• Similar to ternary simulation

• Consider constrains absent in abstract transition relation

(abc)

(ca)

(cb) c

a

b 1

1

X

c doesn’t imply b anymore

Page 28: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Interpolant Construction

• Iteratively Solve the previous states

I0^Tk-1

R

T^R

After ATR circuit simulation

Minterms

Page 29: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Adaptive IMC Framework (review)

I0^Tk^!P ? Increase k

I0, T, !P, k=0

UNSAFE

UNSAT SAT

FIRP

I0^Tk^R ? SAT

UNSAT

Fixed point?

SAFE

No

Yes Adaptivity

Adaptivity

ATR&R Interpolation

Tends to contain counter-examples Decrease #slices Hard to Converge

Increase #slices

Page 30: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

What We Refine

• BMC step

• Interpolation Algorithm

Page 31: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

EXPERIMENTAL RESULTS

Page 32: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Experiment Setup

• Intel(R) Xeon(R) CPU E5405, 2.00GHz

• 7GB memory, 15 minutes time-out

• hwmcc11nointel.7z

– Downloaded from HWMCC website

• Initial number of slice: 1

– Same as the McMillan’s IMC

Page 33: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Comparison in total cases

255

244217

0

52

104

156

208

260

1 101 201 301 401 501 601 701 801 901

#so

lve

d in

stan

ces

time-out (sec)

AIMC

NewItp

McMillan

Page 34: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Statistics in Detail

405 cases in total

AIMC NewITP McMillan

All Solved 179

Solved only 20 14 7

Unsolved only 13 18 38

All Unsolved 116

100 cases unsolved by PDR

AIMC NewITP McMillan

Solved 15 7 12

Page 35: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

CONCLUSION

Page 36: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Contribution

• Adaptive interpolation framework

• Abstraction degree manipulation

• Enhancement of IMC

– Solve the most instances in total

– Solve the most instances hard for PDR

Page 37: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Novelty

• Flexible interpolation by reachability partitioning

• 2-phase interpolation

• 1-way SAT/UNSAT generalization by only one-time simulation

Page 38: Adaptive Interpolation-Based Model Checkingaspdac.com/aspdac2014/technical_program/pdf/8B-3.pdf · Interpolation-Based Model Checking (IMC)1 I 0 ^Tk^!P ? Increase k I 0, T, !P, k=0

Thanks for Your Attention!