experiences with qbf solvers sharad malik princeton university bmc workshop edinburgh july 11, 2005

107
Experiences with QBF Solvers Sharad Malik Princeton University BMC Workshop Edinburgh July 11, 2005

Post on 22-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Experiences with QBF Solvers

Sharad Malik

Princeton University

BMC Workshop

Edinburgh

July 11, 2005

Acknowledgements

Daijue Tang Yinlei Yu Zhaohui Fu Yogesh Mahajan Darsh Ranjan Lintao Zhang (now at Microsoft Research)

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

Problem Formulation

Quantified Boolean Formula

F: Q1X1 ······ QnXn

where Qi (i=1,···, n) is either or , is a propositional formula

Example:

ue(u+e’)(u’+e)

e4e5u1u2u3e1e2e3 f(e1,e2,e3,e4,e5,u1,u2,u3)

QBF Problem:

Is F satisfiable? P-Space Complete, theoretically harder than NP-Complete problems

such as SAT.

Quantification Level 1

Quantification Level n

Motivations

QBF has practical applications: AI Planning Sequential Circuit Verification

QBF has some similarities with SAT Modern SAT solvers are very efficient and widely used in many fields May be able to leverage SAT techniques

Sharad Malik
add formulation for the diameter problem - new slide

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

Basic QBF Algorithms

Resolution based Plaisted’s Algorithm Search based

a + b + g + h’ + fa + b + g + h’

Resolution

Resolution of a pair of clauses with exactly ONE incompatible variable

a + b + c’ + f g + h’ + c + f

)'( 2121 uuuu

)')('')(')('( 311323111133121 eeeuueeueueueuu

)')()('')('')('( 312113232111323121 eeeeeuueeueueeueuu

Resolution Based QBF Algorithm

)')(')('( 121111121 eueueueuu

false

)'')(')('( 13211113121 euueueuueuu

[BKF95] Hans Kleine Buning, Marek Karpinski, and Andreas Flogel. Resolution for Quantified Boolean Formulas. Information and Computation 117(1): 12-18 (1995).[Biere05]A. Biere. Resolve and Expand. In Proc. 7th Intl. Conf. on Theory and Applications of Satisfiability Testing (SAT'04), Lecture Notes in Computer Science (LNCS), Springer 2005.

Sharad Malik
illustrate this - pure text slide is hard to read and understand (and explain)

)'')(')('( 13211113121 euueueuueuu

)')()('')('')('( 312113232111323121 eeeeeuueeueueeueuu

Plaisted’s Algorithm

cut: e2 e3 enumerate conflict assignments of

u1 e1 through DPLL search

SATeu

UNSATeu

SATeu

SATeu

1,1

0,1

1,0

0,0

11

11

11

11

)'( 11 eu

[PBZ03] David A. Plaisted, Armin Biere, Yunshan Zhu, A satisfiability procedure for quantified Boolean formulae, Discrete Applied Mathematics 130 (2003) 291-328.

Sharad Malik
illustrate this - pure text slide is hard to read and understand (and explain)

Search Based QBF Algorithms

Work by gradually assigning variables A partial assignment

[KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)

Search Based QBF Algorithms

Work by gradually assigning variables A partial assignment

Undetermined Continue search

[KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)

Search Based QBF Algorithms

Work by gradually assigning variables A partial assignment

Undetermined Conflict

Backtrack Record the reason

[KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)

Search Based QBF Algorithms

Work by gradually assigning variables A partial assignment

Undetermined Conflict Satisfied

Backtrack Determine the covered satisfying space

[KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)

Search Based QBF Algorithms

Work by gradually assigning variables A partial assignment

Undetermined Conflict Satisfied

The majority of QBF solvers are search based, the DPLL algorithm is an example of this

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

Unknown

True (1)

False(0)

Conflicting Node

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

Unknown

True (1)

False(0)

Backtrack

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

e = 0

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

e = 0

u = 1

Unknown

True (1)

False(0)

Satisfying Node

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

e = 0

u = 1

Unknown

True (1)

False(0)

Backtrack

Basic DPLL Flow for QBF

ey (e + y)(e’ + y’)

e = 1

u = 1

e = 0

u = 1 u = 0

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

e = 0

u = 1 u = 0

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

eu (e + u)(e’ + u’)

e = 1

u = 1

e = 0

u = 1 u = 0

False

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

u = 1

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

u = 1

e = 1

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

u = 1

e = 1 e = 0

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

u = 1

e = 1 e = 0

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

u = 1

e = 1 e = 0

u = 0

e = 1

Basic DPLL Flow for QBF

ue (u + e)(u’ + e’)

Unknown

True (1)

False(0)

u = 1

e = 1 e = 0

u = 0

e = 1

True

Naïve DPLL Based Approach

Works on a CNF database Backtracking is chronological No learning is possible

In contrast, learning is critical for efficient SAT

Quaffle’s Approach

A new data structure for the database New deduction rules for this data structure Conflict driven learning and satisfaction driven learning Non-chronological backtracking by assertion

Outline

QBF QBF algorithms Satisfiability driven learning [ZM02] Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

[ZM02] L. Zhang and S. Malik. Towards Symmetric Treatment of Conflicts And Satisfaction in Quantified Boolean Satisfiability Solver. In Proc. of 8th International Conference on Principles and Practice of Constraint Programming (CP2002).

CNF/DNF/ACNF/ADNF

Let = C1 C2…Cm = S1 + S2 +…+ Sn

Then:

= (C1 C2…Cm + S1 + S2 +…+ Sn )

= C1 C2…Cm (S1 + S2 +…+ Sn)

= (C1 C2…Cm + AnySubset{ S1, S2,…,Sn})

= (AnySubset{ C1,C2,…,Cm})(S1+ S2 +…+ Sn)

ACNF

Definition: A Propositional formula is said to be in Augmented CNF (ACNF) if = C1 C2…Cm+ S1 + S2 +……+ Sk

Where Ci’s are clauses, and Sj ’s are cubes. Each Sj is contained in the clause term C1 C2…Cm.

i.e.i{1,2…k}, Si C1 C2…Cm

In ACNF, cubes are redundant Example:

f = a’b’c’+a’bc+ab’c+abc’ [DNF]

= (a’+b’+c’)(a’+b+c)(a+b’+c)(a+b+c’) [CNF]

= (a’+b’+c’)(a’+b+c)(a+b’+c)(a+b+c’) + a’b’c’+ ab’c [ACNF]

Clause Deduction Example

F = (…)(…)(e1+e2’+u1+u2’)(…)

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

free literal

true literal

false literal

Clause Deduction Example

F = (…)(…)(e1+e2’+u1+u2’)(…)free literal

true literal

false literal

Free literals are all univeral,

conflicting clause!

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

Clause Deduction Example

F = (…)(…)(e1+e2’+u1+u2’)(…)free literal

true literal

false literal

If u1 and u2 have higher quantification

level than e2,unit clause!

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

Clause Deduction Example

free literal

true literal

false literal Implication!

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

F = (…)(…)(e1+e2’+u1+u2’)(…)

If u1 and u2 have higher quantification

level than e2,unit clause!

Deduction and Search Space Pruning

Unknown

True (1)

False(0)

Deduction and Search Space Pruning

Unknown

True (1)

False(0)

Deduction and Search Space Pruning

Unknown

True (1)

False(0)

Conflict

Unit Clause

Cube Deduction Example

F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +…free literal

true literal

false literal

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

Cube Deduction Example

free literal

true literal

false literal

Free literals are all existential,

satisfying cube!

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +…

Cube Deduction Example

free literal

true literal

false literal

If e3 has higher quantification level than u3, unit cube!

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +…

Cube Deduction Example

free literal

true literal

false literal

If e3 has higher quantification level than u3, unit cube!

Implication!

e1, e2, e3…… existential literals•Try to satisfy the formula

u1, u2, u3…… universal literals•Try to falsify the formula

F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +…

Asymmetry between conflict and satisfaction

Conflict occurs when A clause has all existential literals evaluate to false, and no universal

literal evaluates to true Satisfaction occurs when

A cube has all universal literals evaluate to true and no existential literal evaluate to false

All clauses are satisfied Asymmetry exists because in ACNF, the clause term contains all the

information about the propositional formula while the cubes may not.

Satisfiability Induced Cubes

(a + b + x)(c + y’)(a + b’ + y’)(a + x’ + y’) + xy’

free literal

true literal

false literal

Satisfiability Induced Cubes

(a + b + x)(c + y’)(a + b’ + y’)(a + x’ + y’) + xy’

free literal

true literal

false literal

Satisfying assignment : {a=1, b=0, c=X, x=0, y=0}

Satisfiability Induced Cubes

(a + b + x)(c + y’)(a + b’ + y’)(a + x’ + y’) + xy’

free literal

true literal

false literal

Satisfying assignment : {a=1, b=0, c=X, x=0, y=0}

Cover Set: {a, y’}

Satisfiability Induced Cubes

(a + b + x)(c + y’)(a + b’ + y’)(a + x’ + y’) + xy’

free literal

true literal

false literal

Satisfying assignment : {a=1, b=0, c=X, x=0, y=0}

Cover Set: {a, y’}

+ ay’

Satisfaction Driven Learning and Backtracking

Stop?

Satisfying CubeConsensus

Choose aliteral, get its antecedent

Add the resulting cube to database, backtrack

Exist Satisfying Cube?

Satisfaction Induced Cube

Y

N

Y

N

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution [ZM02] Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

[ZM02] L. Zhang and S. Malik. Conflict Driven Learning in a Quantified Boolean Satisfiability Solver. In Proc. of International Conference on Computer Aided Design. (ICCAD2002)

Conflict Driven Learning and Backtracking

1:

2:

3:

4:

5:

6:

7:

Quantification Level...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Conflict Driven Learning and Backtracking

1: ... ... ...

2:

3:

4:

5:

6:

7:

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Conflict Driven Learning and Backtracking

1: ... ... ...

2: ... ... ...

3:

4:

5:

6:

7:

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Conflict Driven Learning and Backtracking: An Example

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6:

7:

Conflict Driven Learning and Backtracking: An Example

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6:

7:

Conflict Driven Learning and Backtracking: An Example

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6: e1

7:

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Unit Clausee2 is implied

Conflict Driven Learning and Backtracking: An Example

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Conflicting

e1(1)+e3(5) +u1’(4)+e4(5)

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6: e1e2

7:

Conflict Driven Learning and Backtracking: An Example

Asserte1 =1@3

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6:

7:

...

...

e1(1)+e2(3)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

e1(1)+e3(5) +u1’(4)+e4(5)

Complications: Tautology Clause

1:

2:

3:

4:

5:

6:

7:

...

...

e1(1)+e2(3)+u1(4)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Complications: Tautology Clause

Conflicting

e1(1)+e3(5) +u1(4)+u1’(4)+e4(5)

Tautology

Distance > 1!!!

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6: e1e2

7:

...

...

e1(1)+e2(3)+u1(4)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

Conflict Driven Learning with Tautology Clause

Asserte1 =1@3

...

...

e1(1)+e2(3)+u1(4)+e3(5)

e1(1)+e2’(3)+u1’(4)+e4(5)

...

...

e1(1)+e3(5) +u1(4)+u1’(4)+e4(5)

1: ... ... ...

2: ... ... ...

3: ... e3 ... e4 ...

4: ... ... ...

5: ... ... ...

6:

7:

Quaffle Run Time

Num. Vars Num. Cls Naïve BJ CDL Full

TOILET06.1.iv.12 294 1046 734.51 7.4 18.23 74.16

TOILET06.1.iv.11 321 1144 1576.36 5.52 39.51 221.45

CHAIN15v.16 1425 7483 * 3.19 3.15 142.21

CHAIN16v.17 1617 8638 * 6.9 6.82 472.38

CHAIN17v.18 1820 9892 * 14.99 14.85 1794.35

impl16 66 130 182.66 136.47 0.97 0.02

impl18 74 146 1349.03 1445.76 3.88 0.02

impl20 82 162 * * 15.51 0.02

R3…3…50_8.F 150 375 * 1.31 0.29 0.05

R3…3...50_9.T 150 375 41.48 1.02 0.87 0.02

logn…A2 1370 65592 * * 125.85 193.88

logn…B1 1871 178750 * 342.95 8.26 8.18

BLOCKS4ii.6.3 838 15061 * * 367.54 591.95

*Experiments are conducted on a Dell PowerEdge 1600sc PIII 1133Mhz machine with 1 G memory running Linux.

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers [YM05]

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

[YM05] Yinlei Yu and Sharad Malik, "Validating the result of a Quantified Boolean Formula(QBF) solver: Theory and practice", Proc. Asian and South Pacific Design Automation Conference, pp. 1047-1051, January 18-21, 2005.

Motivation

SAT solver results can be checked either by satisfying assignment or by an independent resolution based verifier [ZM03] Produces unsatisfiable core as a byproduct Several applications for the unsatisfiable core

Abstraction refinement, FPGA routing, extracting interpolants… Need corresponding certification for QBF solvers Extraction of unsatisfiable cores for QBF

[ZM03] L. Zhang and S. Malik, Validating SAT Solvers Using an Independent Resolution-Based Checker: Practical Implementations and Other Applications, Proc. DATE2003.

QBF Solving Algorithm

Universal cube (1)

QBF instance is SATISFIABLE

T

u1

u2

F T

u2

1

F T

0 1

0

u1u2 e1 (u1 + u2 + e1’) (u1 + u2’ + e1) (u1’ + u2+ e1) (u1’ + e1)

(u1’*u2’) + (u1’*u2) + (u1)

(u1’) + (u1)

(1)

e1 e1 e1

Verifying Satisfiable QBF Results

(u1’*u2’) + (u1’*u2) + (u1)

(u1’) + (u1)

(1)

e1

T

u1

u2

e1

T

u2

1

e1

T

• Verifier checks all the related satisfying assignments in the solution trace.

• Rebuilds the consensus tree to generate the final universal cube.

u1u2 e1 (u1 + u2 + e1’) (u1 + u2’ + e1) (u1’ + u2+ e1) (u1’ + e1)

QBF Solving Algorithm (Cont’d)

0u1

e2

e1

F

1

0

0

F

1

e2

0

e1

F

0

T

1Pure universal clause

QBF instance is UNSATISFIABLE

u1 e1e2 (u1’ + e1 + e2’) (u1’ + e1 + e2) (u1’ + e1’) (u1 + e2)

(u1+ e2)(u1’+e1+e2)(u1’+e1+e2’)(u1’+e1’)

(u1’+e1) (u1’+e1’)

(u1’)

QBF Solving Algorithm (Cont’d)

(u1+ e2)(u1’+e1+e2)(u1’+e1+e2’)(u1’+e1’)

(u1’+e1) (u1’+e1’)

(u1’)

0u1

e2

e1

F

1

0

0

F

1

e2

0

e1

F

0

T

1•Verification by rebuilding the clause resolution tree based on the solution trace.

u1 e1e2 (u1’ + e1 + e2’) (u1’ + e1 + e2) (u1’ + e1’) (u1 + e2)

Unsatisfiable QBF Core

• Only some of the clauses are used in the proof.• This part is the unsatisfiable core of the QBF

problem.

Core: u1 e1 e2 (u1’ + e1 + e2’) (u1’ + e1 + e2) (u1’ + e1’)

u1 e1e2 (u1’ + e1 + e2’) (u1’ + e1 + e2) (u1’ + e1’) (u1 + e2)

(u1’ + e1) (u1’ + e1’)

(u1’)

Results

Instance Name

Orig. Clause #

Core Clause #

Core Size as % of total

#Iterations

Blocks3i.4.4 2,928 125 4.27 3

Blocks3i.5.3 2,892 406 14.04 13

Blocks3ii.4.3 2,533 107 4.22 2

Blocks3ii.5.2 2,707 161 5.95 7

Blocks3iii.4 1,433 46 3.21 3

Blocks4ii.6.3 15,061 340 2.26 11

Blocks4ii.7.2 15,047 1,664 11.06 30*

Blocks4iii.6 9,661 203 2.10 4

lognBwLargeA1

62,820 77 0.12 1

lognBwLargeB1

178,750 120 0.06 1

Toilet2.1.iv.3 70 20 28.57 1

Toilet6.1.iv.11 1,046 626 59.85 5

Toilet7.1.iv.13 1,491 929 62.31 2

Average: 22,803 371.1 15.23 6.4

Block4ii.7.2

# Iterations0 5 10 15 20 25

0

4000

8000

12000

16000

30

# Cla

uses

Instance Group (#)

Ave. Orig. Run

Time(s)

Ave. Instr. Run

Time(s)

Ave. Trace

Log Size

Ave. Verify

Time(s)

Blocks(11) 37.28 37.63 3.1MB 1.24 Chain(7) 147.02 182.86 0.86GB 464.53 Impl(10) 0.01 0.01 198B 0.01 Bwlarge(4) 0.02 0.025 35KB 0.02 Toilet(6) 12.11 13.41 14MB 4.22 The run time and trace sizes for verifying QBF instance

The core size of Block4ii.7.2.qdimacsWith iterations of core extraction

Final core size for many QBF cases

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

Circuit Based Quantification Basic idea Ordering Node resynthesis

Future Work

Motivation: 2QBF

2QBF: QBF with two levels of quantification u1u2…um e1e2…en CNF (u1…ume1…en)

QBF solvers cannot handle practical sized problem as of now SAT is NP-complete, QBF is PSPACE-complete, and 2QBF is NPNP-

complete 2QBF may be simpler than QBF 2QBF may be better able toleverage SAT search techniques

U

2m Universal Assignments

11 1

…1

u1,u2,…,um

e1,e2,…,en

0 0…

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis

The State Space Diameter Problem

S0

S2S1

S3

S5 S4 diameter = 3

Start from the initial states, the minimum number of steps needed to visit every reachable state

S0

initial state: S0S2S1

step 1: S1, S2

S4

S3step 2: S3, S4

S5

step 3: S5

Sharad Malik
Show a figure of the state space, the diameter on the figure and then a text statement of the problem, that will be helpful.A bullet in the end that states that this can be naturally stated as a QBF instance.

S2S1

Why Bother with the State Space Diameter Problem Bounded model checking (BMC)

Circuit state space diameter completes BMC Can be formulated as QBF instances Provides insights to sequential verification problems in general

SjSiSi, Sj: sets of states

state transition relation T

S0S0

S0: the set of initial states Does property P hold for the system?

S2S1 S3S3

useful for falsification, but incomplete for verification

QBF Formulation: Huffman Model

Inputs

Combinational Logic

OutputsS

tate

Sequential Feedback Loop

QBF Formulation: Time Frame Expansion

Inputs

Combinational Logic

Outputs

State

Inputs

Combinational Logic

Outputs

State

Inputs

Combinational Logic

Outputs

State

State

Behavior over 3 cycles

Circuit Constructed for the Diameter Problem

CombinationalLogic

I1

O1

1s0s CombinationalLogic

In

On

ns1ns CombinationalLogic

In+1

On+1

1ns

CombinationalLogic

I1’

O1’

'1s'0s CombinationalLogic

In’

On’

'ns'1ns

Some Terminology for the Formulations

CombinationalLogic

I1

O1

1s0s CombinationalLogic

In

On

ns1ns CombinationalLogic

In+1

On+1

1ns

CombinationalLogic

I1’

O1’

'1s'0s CombinationalLogic

In’

On’

'ns'1nsVariables: V1

Circuit consistency condition: C(V1)

Some Terminology for the Formulations

CombinationalLogic

I1

O1

1s0s CombinationalLogic

In

On

ns1ns CombinationalLogic

In+1

On+1

1ns

CombinationalLogic

I1’

O1’

'1s'0s CombinationalLogic

In’

On’

'ns'1ns

Variables: V2

Circuit consistency condition: C(V2)

2QBF Formulation

CombinationalLogic

I1

O1

1s0s CombinationalLogic

In

On

ns1ns CombinationalLogic

In+1

On+1

1ns

CombinationalLogic

I1’

O1’

'1s'0s CombinationalLogic

In’

On’

'ns'1ns

C(V1)

C(V2)

)1()()()()\( '10212

111121 i

SSVCVCVIVIII nnini

in

)1()()()()\( '10212

111121 i

SSVCVCVIVIII nnini

in

Other Formulations

)2())()(()( '102121 inni SSVCVCVV

)3())()(()( '102121 inni SSVCVCVV

)4())()(()()( '102121 innijiji SSVCSSVCVV

)5())()(()()( '12121 nnjiji SSVCSSVCVV

)1()()()()\( '10212

111121 i

SSVCVCVIVIII nnini

in

State space diameter: dn<d: (1) and (2) are false; (3) (4) and (5) are true;

nd: (1) and (2) are true; (3) (4) and (5) are false.

Why bother with different formulations? Different formulations might have different impact on the performance of

an algorithm

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms [RTM04] Analysis

[RTM04] Darsh P. Ranjan, Daijue Tang, Sharad Malik: A Comparative Study of 2QBF Algorithms. SAT 2004

2QBF Algorithms Studied [RTM04]

DPLL search based, utilize the zchaff SAT solver Algorithm I: Quaffle like, assign universal variables first Algorithm II: no restriction in decision order w.r.t. variable quantification

order

Resolution based No simplification, just Q-resolution With complete two-level minimization (using ESPRESSO) at each

resolution step

Coverage Cubes and Blocking Clauses

(u1 + u2 + e1) (u3 + e2’) (u1+e1’+e2’)(u1’+u2’+e2)(u1 + u2 + e1) (u3 + e2’) (u1+e1’+e2’)(u1’+u2’+e2)

satisfying assignment :

{u1=1, u2=0, u3=X, e1=0, e2=0}

satisfying cube:

{u1=1, u2=0, e2=0}

select a set of literals

that satisfy all clauses

coverage cube for the universal Boolean space:

u1 u2’

blocking clause:

u1’ + u2

prevents revisiting the already searched space

Example for Algorithm I

)')('')('')('')(( 2121222111112121 eeeeueuueueueeuu

universal assignment: u1=0, u2=0

SAT assignment: u1=0, u2=0, e1=1, e2=1

satisfying cube (cover set): u1=0, e1=1, e2=1

coverage cube: u1=0

universal assignment: u1=1, u2=0

SAT assignment: u1=1, u2=0, e1=0, e2=0

satisfying cube (cover set): u1=1, e1=0, e2=0

coverage cube: u1=1

no more universal assignment left, instance is true

Algorithm I

universal variable space(u1,u2,…,um)

SAT assignmentuniversal assignment

coverage cube

all variable space(u1,u2,…,um,e1,e2,…,en)

1 2 satisfying cube

(cover set)

3

4

5

U

1…

u1,u2,…,um

e1,e2,…,en

Example for Algorithm II

)')('')('')('')(( 2121222111112121 eeeeueuueueueeuu

SAT assignment: u1=0, e1=1, e2=1, u2=0

blocking clause: (u1 + e1’ + e2’)

coverage cube: u1=0

SAT assignment: u1=1, e1=0, e2=0 , u2=0

coverage cube: u1=1

blocking clause: (u1 + e1’ + e2’)

The entire universal space is covered, instance is true

Algorithm II

universal variable space(u1,u2,…,um)

SAT assignment, no need to respect quantification order to get that

1

blocking clause

2

3

all variable space(u1,u2,…,um,e1,e2,…,en)

coverage cube

4

Resolution Based Algorithm

First resolve out existential variables After resolving out all existential variables

An empty clause (a clause with no literal or consisting only of universal variables) false

An empty set of clauses true

Has the memory blowup problem Alleviate by simplifying the propositional part after each resolution

step

Example for Resolution Based Algorithm

)')('')('')('')(( 2121222111112121 eeeeueuueueueeuu

)'')('')('( 22121221221 euueueuueuu

resolve out e1

empty set of clause

instance is true

simplify

)'')('( 21221221 eueuueuu resolve out e2

Experimental Results

>400

>400

>400

>400

>400

>400

Res w/o simp

>400

>400

4.29

208.6

25.04

2.19

Res w/ simp

>400>400>400298.8634**

>400>400>4002.55

30.7518.23294.270.803

Depth

s1423

s1488

>400

0.22

0.27

Quaffle

>400>4002.1115

0.24>4000.151

0.250.260.151

SempropAlg. IIAlg. ICircuit

0.36(10)

0.01(100)

Res w/o simp

169.09(6)

0.25(100)

Res w/ simp

200 (10 instances)

100 (100 instances)

0.01(100)>400(0)16.22(98)0(100)

>400(0)

Quaffle

23.99(10)>400(0)160(6)

SempropAlg. IIAlg. I# of clauses (100 vars, 5 lits/clause)

* The tests were done on an Intel Pentium III 933 MHz machine with 1GB of RAM running linux.

** Improves on previous diameter lower bound of 26

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis [TYRM04]

[TYRM04] Daijue Tang, Yinlei Yu, Darsh Ranjan, Sharad Malik: Analysis of Search Based Algorithms for Satisfiability of Quantified Boolean Formulas Arising from Circuit State Space Diameter Problems . SAT 2004

Analysis of Search Based QBF Evaluation

)1()()()()\( '10212

111121 i

SSVCVCVIVIII nnini

in

)( '10 i

SSnni true

any satisfying partial assignment

p

Sn+1

… …

… …

S0’

Sn’

=1

1

1

1

every bit in Sn+1 must be

assigned complete assignment for the state variables of Sn+1

Analysis of Search Based QBF Evaluation

any satisfying partial assignment

reachable state space of Sn+1

minterm

Boolean space of I1I2· · ·In

cube cubecube

)1()()()()\( '10212

1121 i

SSVCVCVIVIII nnini

in

complete assignment for the state variables of Sn+1

Analysis of Search Based QBF Evaluation

)1()()()()\( '10212

1121 i

SSVCVCVIVIII nnini

in

reachable state space of Sn+1

minterm

Boolean space of I1I2· · ·In

cube cubecube

mintermcube cube

distinct states

non-overlapping sets of cubes

Analysis of Search Based QBF Evaluation

)1()()()()\( '10212

1121 i

SSVCVCVIVIII nnini

in

reachable state space of Sn+1

minterm

Boolean space of I1I2· · ·In

mintermminterm

CombinationalLogic

I1

O1

1s0s CombinationalLogic

In

On

ns1ns CombinationalLogic

In+1

On+1

1ns

Impossible!

Analysis of Search Based QBF Evaluation

)1()()()()\( '10212

1121 i

SSVCVCVIVIII nnini

in

reachable state space of Sn+1

minterm

Boolean space of I1I2· · ·In

cube cubecube

mintermcube cube

need to cover the

entire universal space

Need to enumerate every Sn+1

(1) is true

Purely SAT based

CombinationalLogic

I1

O1

1s0s CombinationalLogic

In

On

ns1ns CombinationalLogic

In+1

On+1

1ns

CombinationalLogic

I1’

O1’

'1s'0s CombinationalLogic

In’

On’

'ns'1ns

Simple path from S0 to

Sn+1

Enumerate states here using SAT

?'10 trueSS inni

?'1 trueSS nn

With certain circuit modification:

Outline

QBF QBF algorithms Satisfiability driven learning Long distance resolution Validating QBF solvers

2QBF Sequential circuit state space diameter problem 2QBF algorithms Analysis