x2 - KIT

Bernd Finkbeiner
Leander Tentrup
Reactive Systems Group
Saarland University
July 16th, 2014
Fast DQBF Refutation
17th International Conference on Theory and
Applications of Satisfiability Testing (SAT)
DQBF
Dependency Quantified Boolean Formula
∀x1 , x2 , x3 . . . ∃H1 y1 . ∃H2 y2 . ∃H3 y3 . . . ϕ
B. Finkbeiner, L. Tentrup, Saarland University
2
SAT 2014, Vienna
DQBF
Dependency Quantified Boolean Formula
∀x1 , x2 , x3 . . . ∃H1 y1 . ∃H2 y2 . ∃H3 y3 . . . ϕ
Example
x1
∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
B. Finkbeiner, L. Tentrup, Saarland University
. x
1
f y1 (x1 ) f y1 (x1 )
2
x2
. x
2
f y2 (x2 ) f y2 (x2 )
SAT 2014, Vienna
Partial Equivalence Checking (PEC)¹
Partial
Circuit
x.1
x2
y1
y2
Specification
?
≡1
¹Christoph Scholl and Bernd Becker. “Checking Equivalence for Partial
Implementations”. In: DAC ’01. New York, NY, USA: ACM, 2001, pp. 238–243
B. Finkbeiner, L. Tentrup, Saarland University
3
SAT 2014, Vienna
Encoding of PEC in DQBF
x.1
x2
y1
y2
⇔
∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 .
(y1 ∨ y2 ) ↔ (x1 ⊗ x2 )
?
≡1
B. Finkbeiner, L. Tentrup, Saarland University
4
SAT 2014, Vienna
Encoding of PEC in DQBF
x.1
x2
y1
y2
⇔
∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 .
(y1 ∨ y2 ) ↔ (x1 ⊗ x2 )
?
≡1
This paper: Focus on refutation ⇒ Detect errors in PEC instances
B. Finkbeiner, L. Tentrup, Saarland University
4
SAT 2014, Vienna
Models of DQBF
A candidate model is a composition of Skolem functions
Example (∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ)
x1
f y1 (x1 ) f y1 (x1 )
x2
.
. x
1
. x
2
x1
⇒
x2
f y1 (x1 )
f y2 (x2 )
f y2 (x2 ) f y2 (x2 )
x2
f y1 (x1 )
f y2 (x2 )
x1
x2
f y1 (x1 )
f y2 (x2 )
x2
f y1 (x1 )
f y2 (x2 )
Definition (Model M)
A model is a candidate model where all paths satisfy ϕ.
B. Finkbeiner, L. Tentrup, Saarland University
5
SAT 2014, Vienna
DQBF Solving
.
DQBF
QBF Abstraction
Exact methods
■
Fröhlich et al.: A DPLL
Algorithm for Solving DQBF
■
Gitina et al.: non-public
expansion-based solver
■
Fröhlich et al.: iDQ,
instantiation-based DQBF
solver
B. Finkbeiner, L. Tentrup, Saarland University
Gitina et al.: Equivalence
checking of partial designs using
DQBF
6
SAT 2014, Vienna
Expansion-Based Solving
Idea: Expand the whole BDT
∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
Eliminate quantifier x1 :
′
′
∀x2 . ∃{x2 } y2 . ∃∅ y1 , y1 . ϕ∣ x1 =0 ∧ ϕ ∣ x1 =1
Exponential blow-up
B. Finkbeiner, L. Tentrup, Saarland University
7
SAT 2014, Vienna
QBF Abstraction
Idea: Linearize the Quantification
∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
3 possible linearizations:
∀x1 , x2 . ∃y1 , y2 .
∀x1 . ∃y1 . ∀x2 . ∃y2 .
∀x2 . ∃y2 . ∀x1 . ∃y1 .
}
weakest
strongest
Too coarse: All QBF abstractions of
∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . (y1 ∨ y2 ) ↔ (x1 ⊗ x2 ) are satisfiable
B. Finkbeiner, L. Tentrup, Saarland University
8
SAT 2014, Vienna
Consistency
■
■
Another characterization of Skolem functions
Property between paths
Different assignments of y on two paths P1 and P2 are consistent if the
assignments of H y on P1 and P2 are different
.
x1
x2
x1
x2
x2
x2
y1
y1
y1
y1
y2
y2
y2
y2
B. Finkbeiner, L. Tentrup, Saarland University
9
SAT 2014, Vienna
Bounded Unsatisfiability
Unsatisifability can be usually shown without expanding the whole BDT
A set of paths P can already rule out any satisfying assignment:
If there is no consistent satisfying assignment on P, then there is no
consistent satisfying assignment for the original formula
.
x1
x2
x1
x2
x2
y1
y1
y2
y2
B. Finkbeiner, L. Tentrup, Saarland University
10
x2
SAT 2014, Vienna
Bounded Unsatisfiability
Definition (k-bounded unsatisfiable)
For a k ≥ 1, a DQBF formula Φ is k-bounded unsatisfiable if there
exists a set of paths P with ∣P∣ ≤ k such that there does not exist a
consistent satisfying assignment over P.
B. Finkbeiner, L. Tentrup, Saarland University
11
SAT 2014, Vienna
Bounded Unsatisfiability
Definition (k-bounded unsatisfiable)
For a k ≥ 1, a DQBF formula Φ is k-bounded unsatisfiable if there
exists a set of paths P with ∣P∣ ≤ k such that there does not exist a
consistent satisfying assignment over P.
Theorem
A DQBF formula Φ is unsatisfiable iff it is k-bounded unsatisfiable for
some k ≥ 1.
B. Finkbeiner, L. Tentrup, Saarland University
11
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
■ at least one path violates the matrix
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
■ at least one path violates the matrix
Φ = ∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
bunsat(Φ, k = 2) =
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
■ at least one path violates the matrix
Φ = ∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
1
2
1
2
bunsat(Φ, k = 2) = ∃x1 , x1 , x2 , x2 .
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
■ at least one path violates the matrix
Φ = ∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
1
2
1
2
1
2
1
2
bunsat(Φ, k = 2) = ∃x1 , x1 , x2 , x2 . ∀y1 , y1 , y2 , y2 .
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
■ at least one path violates the matrix
Φ = ∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
1
2
1
2
1
2
1
2
bunsat(Φ, k = 2) = ∃x1 , x1 , x2 , x2 . ∀y1 , y1 , y2 , y2 .
1
2
1
2
⋀ ((y i ↔ y i ) ∨ (x i ↮ x i )) →
i∈{1,2}
B. Finkbeiner, L. Tentrup, Saarland University
12
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Given a bound k ≥ 1. Encode a QBF query that
■ asserts that there exists k paths
■ such that for every consistent assignment of the existential
variables
■ at least one path violates the matrix
Φ = ∀x1 , x2 . ∃{x1 } y1 . ∃{x2 } y2 . ϕ
1
2
1
2
1
2
1
2
bunsat(Φ, k = 2) = ∃x1 , x1 , x2 , x2 . ∀y1 , y1 , y2 , y2 .
1
2
1
2
⋀ ((y i ↔ y i ) ∨ (x i ↮ x i )) →
i∈{1,2}
1
¬ϕ ∨ ¬ϕ
B. Finkbeiner, L. Tentrup, Saarland University
12
2
SAT 2014, Vienna
Encoding of Bounded Unsat. in QBF
Φ ≔ ∀x1 , x2 , . . . x m . ∃H1 y1 . ∃H2 y2 . . . ∃H n y n . ϕ
1
1
2
2
1
1
2
2
k
bunsat(Φ, k) ≔ ∃x1 , . . . , x m , x1 , . . . , x m , . . . , x m .
k
∀y1 , . . . , y n , y1 , . . . , y n , . . . , y n .
consistent({y1 , . . . , y n }, k) → ⋁ ¬ϕ
consistent(Y , k) ≔ ⋀
i
⋀
j
1≤i≤k
i
k
j
((y ↔ y ) ∨ ( ⋁ x ↮ x ))
y∈Y (i, j)∈{1,...,k}2
x∈H y
Size of bunsat(Φ, k)
′
∣X ∣ = k ⋅ ∣X∣
′
∣Y ∣ = k ⋅ ∣Y ∣
′
2
∣ϕ ∣ = O(∣Y ∣ ⋅ k ⋅ max y∈Y ∣H y ∣ + k ⋅ ∣ϕ∣)
B. Finkbeiner, L. Tentrup, Saarland University
13
SAT 2014, Vienna
Experimental Results
PEC Benchmarks
■
ä
There were no publicly available benchmarks for DQBF
Build PEC examples²
□ Base: arithmetic circuit
□ One copy as specification
□ Introduce faults and black boxes randomly
BB1
BB2
copy of c
(specification)
. c
circuit
²Karina Gitina et al. “Equivalence checking of partial designs using dependency
quantified Boolean formulae”. In: ICCD. IEEE, 2013, pp. 396–403
B. Finkbeiner, L. Tentrup, Saarland University
14
SAT 2014, Vienna
Experimental Results
Solvers
■
Bounded Unsatisfiability:
□ Prototype implementing the transformation
□ Optimization: Combine with QBF abstraction
□ QBF queries: Bloqqer 031 and DepQBF 2.0
■
Solvers:
□ There were no publicly available DQBF solver
ä Build an expansion-based solver on top of CUDD
All sources are available at
http://react.uni-saarland.de/tools/bunsat/
B. Finkbeiner, L. Tentrup, Saarland University
15
SAT 2014, Vienna
Number of Solved Instances
80
4-bit multiplier
Solved UNSAT instances in %
100
60
40
20
0.
.
.
2
4
6
# black boxes
.
QBF abstr. (bound
k = 1) .
B. Finkbeiner, L. Tentrup, Saarland University
16
8
bound. k = 2
SAT 2014, Vienna
Precision
share of UNSAT instances in %
100
80
31.6
60
40
2
7.6
64.3
x.1
x2
BB1
BB2
87.9
68.4
f
20
27.6
0.
.
2
10
4
3
# black boxes
. QBF abstr. (bound
.
k = 1) . bound. k = 2 . bound. k = 3
B. Finkbeiner, L. Tentrup, Saarland University
17
SAT 2014, Vienna
Performance
. expansion-based
.
solver
.
.
bunsat (iterative)
3
32-bit multiplexer
average running time in s
4
2
1
0
.
.
1
2
3
B. Finkbeiner, L. Tentrup, Saarland University
4
5
6
7
# black boxes
18
8
9
10
SAT 2014, Vienna
Conclusion
■
Fast DQBF refutation
■
Improvement over
□ QBF abstraction (approximation quality)
□ expansion based methods (better scaling with respect to
number of black boxes)
B. Finkbeiner, L. Tentrup, Saarland University
19
SAT 2014, Vienna
Conclusion
■
Fast DQBF refutation
■
Improvement over
□ QBF abstraction (approximation quality)
□ expansion based methods (better scaling with respect to
number of black boxes)
Thank You!
B. Finkbeiner, L. Tentrup, Saarland University
19
SAT 2014, Vienna