QBF with Soft Variables AVoCS 2014
Albert-Ludwigs-Universität Freiburg
Sven Reimer, Matthias Sauer, Paolo Marin, Bernd Becker Departure of computer architecture September 24, 2014
Symbolic Circuit Represenation
c0
s
b a
September 24, 2014
c1
Sven Reimer – QBF with Soft Variables
2 / 15
Symbolic Circuit Represenation
c0 b
s t0 t2 t1
a
c1
Tseitin encoding [Tseitin ’68] for transformation into CNF
September 24, 2014
Sven Reimer – QBF with Soft Variables
2 / 15
Symbolic Circuit Represenation
c0
s
(¬a ∨ ¬b ∨ ¬t0 ) ∧ (¬a ∨ b ∨ t0 ) ∧(a ∨ ¬b ∨ t0 ) ∧ (a ∨ b ∨ ¬t0 )
b
t0 t2 t1
a
c1
Tseitin encoding [Tseitin ’68] for transformation into CNF
September 24, 2014
Sven Reimer – QBF with Soft Variables
2 / 15
Symbolic Circuit Represenation (¬c0 ∨ ¬t0 ∨ ¬s) ∧ (¬c0 ∨ t0 ∨ s) ∧(c0 ∨ ¬t0 ∨ s) ∧ (c0 ∨ t0 ∨ ¬s)
c0
(¬a ∨ ¬b ∨ ¬t0 ) ∧ (¬a ∨ b ∨ t0 ) ∧(a ∨ ¬b ∨ t0 ) ∧ (a ∨ b ∨ ¬t0 )
t0
b
(a ∨ ¬t1 ) ∧ (b ∨ ¬t1 ) ∧(¬a ∨ ¬b ∨ t1 )
s
(c0 ∨ ¬t2 ) ∧ (t0 ∨ ¬t2 ) ∧(¬c0 ∨ ¬t0 ∨ t2 )
t2 t1
a
c1 (¬t1 ∨ c1 ) ∧ (¬t2 ∨ c1 ) ∧(t1 ∨ t2 ∨ ¬c1 )
ϕ =(a ∨ ¬t1 ) ∧ (b ∨ ¬t1 ) ∧ (¬a ∨ ¬b ∨ t1 )∧
(¬a ∨ ¬b¬t0 ) ∧ (¬a ∨ b ∨ t0 ) ∧ (a ∨ ¬b ∨ t0 ) ∧ (a ∨ b ∨ ¬t0 )∧ (c0 ∨ ¬t2 ) ∧ (t0 ∨ ¬t2 ) ∧ (¬c0 ∨ ¬t0 ∨ t2 )∧
(¬c0 ∨ ¬t0 ¬s) ∧ (¬c0 ∨ t0 ∨ s) ∧ (c0 ∨ ¬t0 ∨ s) ∧ (c0 ∨ t0 ∨ ¬s)∧ (¬t1 ∨ c1 ) ∧ (¬t2 ∨ c1 ) ∧ (t1 ∨ t2 ∨ ¬c1 )
Tseitin encoding [Tseitin ’68] for transformation into CNF ⇒ Complete symbolic description of circuit behavior September 24, 2014
Sven Reimer – QBF with Soft Variables
2 / 15
Symbolic Circuit Represenation (¬c0 ∨ ¬t0 ∨ ¬s) ∧ (¬c0 ∨ t0 ∨ s) ∧(c0 ∨ ¬t0 ∨ s) ∧ (c0 ∨ t0 ∨ ¬s)
c0
(¬a ∨ ¬b ∨ ¬t0 ) ∧ (¬a ∨ b ∨ t0 ) ∧(a ∨ ¬b ∨ t0 ) ∧ (a ∨ b ∨ ¬t0 )
t0
b
(a ∨ ¬t1 ) ∧ (b ∨ ¬t1 ) ∧(¬a ∨ ¬b ∨ t1 )
s
(c0 ∨ ¬t2 ) ∧ (t0 ∨ ¬t2 ) ∧(¬c0 ∨ ¬t0 ∨ t2 )
t2 t1
a
c1 (¬t1 ∨ c1 ) ∧ (¬t2 ∨ c1 ) ∧(t1 ∨ t2 ∨ ¬c1 )
ϕ =(a ∨ ¬t1 ) ∧ (b ∨ ¬t1 ) ∧ (¬a ∨ ¬b ∨ t1 )∧
(¬a ∨ ¬b¬t0 ) ∧ (¬a ∨ b ∨ t0 ) ∧ (a ∨ ¬b ∨ t0 ) ∧ (a ∨ b ∨ ¬t0 )∧ (c0 ∨ ¬t2 ) ∧ (t0 ∨ ¬t2 ) ∧ (¬c0 ∨ ¬t0 ∨ t2 )∧
(¬c0 ∨ ¬t0 ¬s) ∧ (¬c0 ∨ t0 ∨ s) ∧ (c0 ∨ ¬t0 ∨ s) ∧ (c0 ∨ t0 ∨ ¬s)∧ (¬t1 ∨ c1 ) ∧ (¬t2 ∨ c1 ) ∧ (t1 ∨ t2 ∨ ¬c1 ) ∧ (c1 )
Tseitin encoding [Tseitin ’68] for transformation into CNF ⇒ Complete symbolic description of circuit behavior Use SAT Solver to check properties September 24, 2014
Sven Reimer – QBF with Soft Variables
2 / 15
Unknowns
Applications with unknown values, e. g. Black Box Model Checking (unknown parts within circuit) Test cubes (partially unknown inputs) Planning (unknown enviroment)
September 24, 2014
Sven Reimer – QBF with Soft Variables
3 / 15
Unknowns (a ∨ ¬c) ∧ (b ∨ ¬c) ∧(¬a ∨ ¬b ∨ c)
a b
c
(a1 ∨ ¬c1 ) ∧ (b1 ∨ ¬c1 ) ∧(¬a1 ∨ ¬b1 ∨ c1 )
a1 b1 a2 b2
c1 c2
(¬a2 ∨ c2 ) ∧ (¬b2 ∨ c2 ) ∧(a2 ∨ b2 ∨ ¬c2 )
Applications with unknown values, e. g. Black Box Model Checking (unknown parts within circuit) Test cubes (partially unknown inputs) Planning (unknown enviroment)
Classically modelled using 01X encoding [Jain et al. 2000]: Three logic values: 0, 1 and X Use two Boolean variables for representation in SAT: 0 = (0, 1), 1 = (1, 0) and X = (0, 0) ⇒ Doubles size of CNF September 24, 2014
Sven Reimer – QBF with Soft Variables
3 / 15
Optimization with Unknowns
Optimization in presence of unknown values, e. g. System with abstraction (black boxes) Minimal counterexamples Minimal test cubes Preference planning
September 24, 2014
Sven Reimer – QBF with Soft Variables
4 / 15
Optimization with Unknowns 0? a b
c 1?
(a ∨ ¬c) ∧ (b ∨ ¬c) ∧ (¬a ∨ ¬b ∨ c) ∧ (¬a) ∧ (c) Optimization in presence of unknown values, e. g. System with abstraction (black boxes) Minimal counterexamples Minimal test cubes Preference planning
⇒ MaxSAT formulation (optimization extension of SAT) Soft clauses: Clauses which may be satisfied
MaxSAT seeks for the maximum number of satisfied soft clauses September 24, 2014
Sven Reimer – QBF with Soft Variables
4 / 15
Inaccuracy of 01X 1 c0 X b
sX X t0 t2X t1X
1 a
September 24, 2014
c1X
Sven Reimer – QBF with Soft Variables
5 / 15
Inaccuracy of 01X b=0 b=1
1 c0 0 1
b
1 a
s 01 1 0 t0
t1 01
t2 10 c1 1 1
01X logic too coarse for XOR and reconverging paths
September 24, 2014
Sven Reimer – QBF with Soft Variables
5 / 15
Inaccuracy of 01X ∃ c0 ∀ b ∃ a
∃ t0 t1 ∃
s∃ t2 ∃
c1 ∃
01X logic too coarse for XOR and reconverging paths Solution: exact formulation using QBF Unknowns are modelled as universally quantified variables, e. g. ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) is satisfiable
September 24, 2014
Sven Reimer – QBF with Soft Variables
5 / 15
Inaccuracy of 01X ∃ c0 ∀ b ∃ a
∃ t0 t1 ∃
s∃ t2 ∃
c1 ∃
01X logic too coarse for XOR and reconverging paths Solution: exact formulation using QBF Unknowns are modelled as universally quantified variables, e. g. ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) is satisfiable QBF resolves XORs and reconvergences implicitly Note: needs only standard Tseitin encoding But also more complex (PSPACE-complete) than SAT (NP-complete) September 24, 2014
Sven Reimer – QBF with Soft Variables
5 / 15
Optimization with Unknowns using QBF
1 c0 1 b
s t0 t2 t1
1 a
c1 1
Search for minimal assignment for ϕ ∧ (c1 ):
September 24, 2014
Sven Reimer – QBF with Soft Variables
6 / 15
Optimization with Unknowns using QBF
1 c0 1 b
s t0 t2 t1
1 a
c1 1
Search for minimal assignment for ϕ ∧ (c1 ): 01X with MaxSAT: maximum number of non-X inputs
September 24, 2014
Sven Reimer – QBF with Soft Variables
6 / 15
Optimization with Unknowns using QBF
1 c0 1 b
s t0 t2 t1
1 a
c1 1
Search for minimal assignment for ϕ ∧ (c1 ): 01X with MaxSAT: maximum number of non-X inputs QBF: ?
September 24, 2014
Sven Reimer – QBF with Soft Variables
6 / 15
Optimization with Unknowns using QBF
1 c0 1 b
s t0 t2 t1
1 a
c1 1
Search for minimal assignment for ϕ ∧ (c1 ): 01X with MaxSAT: maximum number of non-X inputs QBF: ? Input unspecified: quantify universally ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
September 24, 2014
Sven Reimer – QBF with Soft Variables
6 / 15
Optimization with Unknowns using QBF
1 c0 1 b
s t0 t2 t1
1 a
c1 1
Search for minimal assignment for ϕ ∧ (c1 ): 01X with MaxSAT: maximum number of non-X inputs QBF: ? Input unspecified: quantify universally ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) Input specified: quantify existentially ∃{a, c0 } ∃{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) ⇒ Change quantifier level and type September 24, 2014
Sven Reimer – QBF with Soft Variables
6 / 15
Optimization with Unknowns using QBF
1 c0 1 b
s t0 t2 t1
1 a
c1 1
Search for minimal assignment for ϕ ∧ (c1 ): 01X with MaxSAT: maximum number of non-X inputs QBF: ? Input unspecified: quantify universally ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) Input specified: quantify existentially ∃{a, c0 } ∃{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) ⇒ Change quantifier level and type
⇒ Our new formalism for QBF with soft Variables September 24, 2014
Sven Reimer – QBF with Soft Variables
6 / 15
QBF with Soft Variables
Quantification level: ∃{a, c0 } ∀{b} ∃ {t0 , t1 , t2 , s, c1 } | {z } | {z } | {z } level 1
September 24, 2014
level 2
Sven Reimer – QBF with Soft Variables
level 3
7 / 15
QBF with Soft Variables
Quantification level: ∃{a, c0 } ∀{b} ∃ {t0 , t1 , t2 , s, c1 } | {z } | {z } | {z } level 2
level 3
Formalism allows to change the level for a variable s:
September 24, 2014
Sven Reimer – QBF with Soft Variables
Æ
level 1
s
7 / 15
QBF with Soft Variables Æ
{1,2} c0
∃ t0
Æ
{1,2} b
Æ
Æ
{1,2} b,
Æ
Æ
{1,2} a,
t2 ∃
t1 ∃
{1,2} a
ψ(
s∃
{1,2} c0 )
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Quantification level: ∃{a, c0 } ∀{b} ∃ {t0 , t1 , t2 , s, c1 } | {z } | {z } | {z } level 2
level 3
Formalism allows to change the level for a variable s:
September 24, 2014
s
Æ
Set of allowed levels L:
Æ
level 1
Ls
Sven Reimer – QBF with Soft Variables
7 / 15
QBF with Soft Variables Æ
{1,2} c0
∃ t0
Æ
{1,2} b
Æ
Æ
{1,2} b,
{1,2} c0 )
Æ
Æ
Æ
{1,2} a,
Æ
ψ(
{1,2} b,
Æ
{1,2} a,
t2 ∃
t1 ∃
{1,2} a
ψ(
s∃
{1,2} c0 )Λ
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
= ∃{a, c0 }∀{b}∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Quantification level: ∃{a, c0 } ∀{b} ∃ {t0 , t1 , t2 , s, c1 } | {z } | {z } | {z } level 2
level 3
Formalism allows to change the level for a variable s:
s
Æ
Set of allowed levels L:
Æ
level 1
Ls
Level function Λ, e. g. Λ(a) = Λ(c0 ) = 1 and Λ(b) = 2 September 24, 2014
Sven Reimer – QBF with Soft Variables
7 / 15
Semantics of QBF with Soft Variables
For each variable s ∈ S and possible level l ∈ N, define a score σ : (S × N) → N
September 24, 2014
Sven Reimer – QBF with Soft Variables
8 / 15
Semantics of QBF with Soft Variables Æ
Æ
Æ
ψ( {1,2} a, {1,2} b, {1,2} c0 )Λ = ∃{a, c0 }∀{b}∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
For each variable s ∈ S and possible level l ∈ N, define a score σ : (S × N) → N
Meaningful score function for our example: σ (a, 1) = 0 ; σ (b, 1) = 0 ; σ (c0 , 1) = 0 σ (a, 2) = 1 ; σ (b, 2) = 1 ; σ (c0 , 2) = 1
September 24, 2014
Sven Reimer – QBF with Soft Variables
8 / 15
Semantics of QBF with Soft Variables Æ
Æ
Æ
ψ( {1,2} a, {1,2} b, {1,2} c0 )Λ = ∃{a, c0 }∀{b}∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
For each variable s ∈ S and possible level l ∈ N, define a score σ : (S × N) → N
Meaningful score function for our example: σ (a, 1) = 0 ; σ (b, 1) = 0 ; σ (c0 , 1) = 0 σ (a, 2) = 1 ; σ (b, 2) = 1 ; σ (c0 , 2) = 1
Overall score χ of Λ: χΛ = ∑ σ (si , l), with Λ(si ) = l If ψΛ is unsatisfiable, χΛ = 0 Given: a QBF with soft variables ψ Maximization problem: Ω(ψ) = max χΛ Λ
PSPACE-complete like pure QBF September 24, 2014
Sven Reimer – QBF with Soft Variables
8 / 15
Example Æ
{1,2} c0
Æ
{1,2} b
t1 ∃
Æ
{1,2} a
Æ
September 24, 2014
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
s∃
∃ t0
{1,2} c0 )
t2 ∃
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Sven Reimer – QBF with Soft Variables
9 / 15
Example Æ
{1,2} c0
Æ
{1,2} b
t1 ∃
Æ
{1,2} a
Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
s∃
∃ t0
{1,2} c0 )
t2 ∃
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Three possible minimal assignments: 1
Λ1 (a) = Λ1 (b) = 1, Λ1 (c0 ) = 2 ⇒ χΛ1 = 1 ψΛ1 = ∃{a, b} ∀{c0 } ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
September 24, 2014
Sven Reimer – QBF with Soft Variables
9 / 15
Example Æ
{1,2} c0
Æ
{1,2} b
t1 ∃
Æ
{1,2} a
Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
s∃
∃ t0
{1,2} c0 )
t2 ∃
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Three possible minimal assignments: 1
2
Λ1 (a) = Λ1 (b) = 1, Λ1 (c0 ) = 2 ⇒ χΛ1 = 1 ψΛ1 = ∃{a, b} ∀{c0 } ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) Λ2 (a) = Λ2 (c0 ) = 1, Λ2 (b) = 2 ⇒ χΛ2 = 1 ψΛ2 = ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
September 24, 2014
Sven Reimer – QBF with Soft Variables
9 / 15
Example Æ
{1,2} c0
Æ
{1,2} b
t1 ∃
Æ
{1,2} a
Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
s∃
∃ t0
{1,2} c0 )
t2 ∃
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Three possible minimal assignments: 1
2
3
Λ1 (a) = Λ1 (b) = 1, Λ1 (c0 ) = 2 ⇒ χΛ1 = 1 ψΛ1 = ∃{a, b} ∀{c0 } ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) Λ2 (a) = Λ2 (c0 ) = 1, Λ2 (b) = 2 ⇒ χΛ2 = 1 ψΛ2 = ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Λ3 (b) = Λ3 (c0 ) = 1, Λ3 (a) = 2 ⇒ χΛ3 = 1 ψΛ3 = ∃{b, c0 } ∀{a} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
September 24, 2014
Sven Reimer – QBF with Soft Variables
9 / 15
Example Æ
{1,2} c0
Æ
{1,2} b
t1 ∃
Æ
{1,2} a
Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
s∃
∃ t0
{1,2} c0 )
t2 ∃
c1 ∃
= ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Three possible minimal assignments: 1
2
3
Λ1 (a) = Λ1 (b) = 1, Λ1 (c0 ) = 2 ⇒ χΛ1 = 1 ψΛ1 = ∃{a, b} ∀{c0 } ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 ) Λ2 (a) = Λ2 (c0 ) = 1, Λ2 (b) = 2 ⇒ χΛ2 = 1 ψΛ2 = ∃{a, c0 } ∀{b} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
Λ3 (b) = Λ3 (c0 ) = 1, Λ3 (a) = 2 ⇒ χΛ3 = 1 ψΛ3 = ∃{b, c0 } ∀{a} ∃{t0 , t1 , t2 , s, c1 } . ϕ ∧ (c1 )
01X formulation only finds solution 1 (set c0 as X ) September 24, 2014
Sven Reimer – QBF with Soft Variables
9 / 15
Algorithm for the Maximization Problem Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
∃{t0 , t1 , t2 , s, c1 }
September 24, 2014
Sven Reimer – QBF with Soft Variables
. ϕ ∧ (c1 )
10 / 15
Algorithm for the Maximization Problem Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
∃{t0 , t1 , t2 , s, c1 }
. ϕ ∧ (c1 )
Introduce for each soft variable s ∈ S:
September 24, 2014
Sven Reimer – QBF with Soft Variables
10 / 15
Algorithm for the Maximization Problem Æ
Æ
{1,2} a,
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
∃{t0 , t1 , t2 , s, c1 } ∃{a, b, c0 } . ϕ ∧ (c1 )
Introduce for each soft variable s ∈ S:
One new existential variable s on inner-most level
September 24, 2014
Sven Reimer – QBF with Soft Variables
10 / 15
Algorithm for the Maximization Problem Æ
{1,2} a,
∃{a , b
1
Æ
1
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
, c01 } ∀{a2 , b2 , c02 } ∃{t0 , t1 , t2 , s, c1 } ∃{a, b, c0 } . ϕ ∧ (c1 )
Introduce for each soft variable s ∈ S:
One new existential variable s on inner-most level For each level l ∈ L: A new variable sl
September 24, 2014
Sven Reimer – QBF with Soft Variables
10 / 15
Algorithm for the Maximization Problem Æ
{1,2} a, 1
Æ
1
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
∃{a , b , c01 } ∀{a2 , b2 , c02 } ∃{t0 , t1 , t2 , s, c1 } ∃{a, b, c0 } . ϕ ∧ (c1 ) ∧ fa1 ⇒ (a ≡ a1 ) ∧ fb1 ⇒ (b ≡ b1 ) ∧ fc10 ⇒ (c0 ≡ c01 ) ∧ fa2 ⇒ (a ≡ a2 ) ∧ fb2 ⇒ (b ≡ b2 ) ∧ fc20 ⇒ (c0 ≡ c02 )
Introduce for each soft variable s ∈ S:
One new existential variable s on inner-most level For each level l ∈ L: A new variable sl A free (i. e. not quantified) variable fsl A new constraint: fs ⇒ (s ≡ sl )
September 24, 2014
Sven Reimer – QBF with Soft Variables
10 / 15
Algorithm for the Maximization Problem Æ
{1,2} a, 1
Æ
1
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
∃{a , b , c01 } ∀{a2 , b2 , c02 } ∃{t0 , t1 , t2 , s, c1 } ∃{a, b, c0 } . ϕ ∧ (c1 ) ∧ fa1 ⇒ (a ≡ a1 ) ∧ fb1 ⇒ (b ≡ b1 ) ∧ fc10 ⇒ (c0 ≡ c01 ) ∧ fa2 ⇒ (a ≡ a2 ) ∧ fb2 ⇒ (b ≡ b2 ) ∧ fc20 ⇒ (c0 ≡ c02 ) ∧ (fa1 ⊕ fa2 ≡ 1) ∧ (fb1 ⊕ fb2 ≡ 1) ∧ (fc10 ⊕ fc20 ≡ 1)
Introduce for each soft variable s ∈ S:
One new existential variable s on inner-most level For each level l ∈ L: A new variable sl A free (i. e. not quantified) variable fsl A new constraint: fs ⇒ (s ≡ sl )
Exactly-one constraint, i. e. only one level is allowed
September 24, 2014
Sven Reimer – QBF with Soft Variables
10 / 15
Algorithm for the Maximization Problem Æ
{1,2} a, 1
Æ
1
{1,2} b,
Æ
ψ(
{1,2} c0 )
=
∃{a , b , c01 } ∀{a2 , b2 , c02 } ∃{t0 , t1 , t2 , s, c1 } ∃{a, b, c0 } . ϕ ∧ (c1 ) ∧ fa1 ⇒ (a ≡ a1 ) ∧ fb1 ⇒ (b ≡ b1 ) ∧ fc10 ⇒ (c0 ≡ c01 ) ∧ fa2 ⇒ (a ≡ a2 ) ∧ fb2 ⇒ (b ≡ b2 ) ∧ fc20 ⇒ (c0 ≡ c02 ) ∧ (fa1 ⊕ fa2 ≡ 1) ∧ (fb1 ⊕ fb2 ≡ 1) ∧ (fc10 ⊕ fc20 ≡ 1) ∧ (fa1 ) ∧ (fa2 ) ∧ (fb1 ) ∧ (fb2 ) ∧ (fc10 ) ∧ (fc20 )
Introduce for each soft variable s ∈ S:
One new existential variable s on inner-most level For each level l ∈ L: A new variable sl A free (i. e. not quantified) variable fsl A new constraint: fs ⇒ (s ≡ sl )
Exactly-one constraint, i. e. only one level is allowed
Using MaxQBF Soft clauses has to be satisfied for all universal branches Introduce a soft clause for each free variable fsl September 24, 2014
Sven Reimer – QBF with Soft Variables
10 / 15
Using QBF with Soft Variables
Optimization in presence of unknowns
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables x11
I0
x1n
T1
P1 ϕ = I0 ∧ T 1 ∧ P 1
Optimization in presence of unknowns Minimal counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables x11
I0
x1n x21
T1
x2n
T2
P2 ϕ = I0 ∧ T1 ∧ T2 ∧ P2
Optimization in presence of unknowns Minimal counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables x11
I0
x1n x21
T1
x2n
T2
xk1
xkn
Tk
Pk ϕ = I0 ∧ T1 ∧ T2 . . . ∧ Tk ∧ Pk
Optimization in presence of unknowns Minimal counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables 0 1 1 0 1 0 1 1 0 0 0 0 x11 x1n x21 x2n
I0
T1
T2
0 0 1 1 1 1 xk1 xkn
Tk
Pk ϕ = I0 ∧ T1 ∧ T2 . . . ∧ Tk ∧ Pk
Optimization in presence of unknowns Minimal counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables 0 1 1X1X 1X0X0 0 x11 x1n x21 x2n
I0
T1
T2
X0 1 1 1 1 xk1 xkn
Tk
Pk ϕ = I0 ∧ T1 ∧ T2 . . . ∧ Tk ∧ Pk
Optimization in presence of unknowns Minimal counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables x11
x1n x21
x2n
Z11 I0
BB
xk1
Z12
BB 1 Zm
xkn Z1k
BB 2 Zm
1 } ∃{I0 , x11 , . . . , x2n }∀{Z11 , . . . , Zm 2 }... ∃{x21 , . . . , x2n }∀{Z12 , . . . , Zm
k Zm
Pk
}
∃{xk1 , . . . , xkn }∀{Z1k , . . . , Zm .ϕ ∧ Pk
Optimization in presence of unknowns Minimal counterexamples Uniform counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables x11
x1n x21
x2n
Z11 I0
BB
xk1
Z12
BB 1 Zm
xkn Z1k
BB 2 Zm
1 } ∃{I0 , x11 , . . . , x2n }∀{Z11 , . . . , Zm 2 }... ∃{x21 , . . . , x2n }∀{Z12 , . . . , Zm
k Zm
Pk
}
∃{xk1 , . . . , xkn }∀{Z1k , . . . , Zm .ϕ ∧ Pk
Optimization in presence of unknowns Minimal counterexamples Uniform counterexamples
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables x11 1 X 0 X X 1
x1n x21
T1
x2n
T2
xk1
xkn
Tk
Pk Pk := circuit fully initialized
Optimization in presence of unknowns Minimal counterexamples Uniform counterexamples Circuit initialization
September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables XX 1 X 0 1 x11 x1n
I0
T1
P1 P1 := fault visible at primary output
Optimization in presence of unknowns Minimal counterexamples Uniform counterexamples Circuit initialization Test pattern relaxation September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Using QBF with Soft Variables
ψ = ∃{x1 }∀{y1 }∃{x2 , x3 }∀{y2 , y3 , y4 } . . . ∃{xn }.ϕ ?
?
Optimization in presence of unknowns Minimal counterexamples Uniform counterexamples Circuit initialization Test pattern relaxation
Dependency schemes September 24, 2014
Sven Reimer – QBF with Soft Variables
11 / 15
Experimental Setup
Extend in-house QBF-solver quantom to MaxQBF . . . . . . and QBF with soft variables
September 24, 2014
Sven Reimer – QBF with Soft Variables
12 / 15
Experimental Setup
Extend in-house QBF-solver quantom to MaxQBF . . . . . . and QBF with soft variables Minimal counterexamples Compare instances from hardware model checker competition (HWMCC) with: Lifting
September 24, 2014
Sven Reimer – QBF with Soft Variables
12 / 15
Experimental Setup
Extend in-house QBF-solver quantom to MaxQBF . . . . . . and QBF with soft variables Minimal counterexamples Compare instances from hardware model checker competition (HWMCC) with: Lifting
Test pattern relaxation Compare small delay fault (SDF) model with: Simulation Lifting 01X optimal approach
September 24, 2014
Sven Reimer – QBF with Soft Variables
12 / 15
Minimal Counterexamples 40
QBF Lifting
35
40 35
30
30
25
25
20
20
15
15
10
10
5
5
0
X-inputs in [%]
time in [s]
0
90 instances, on average 288.32 inputs September 24, 2014
Sven Reimer – QBF with Soft Variables
13 / 15
Test pattern relaxation
25% 20% 15% 10% 5% 0%
s38417
s35932
s13207
s05378
s01494
s01488
s01423
s01238
b15
Lifting
s01196
b13
b12
b10
b11
b09
b08
b07
b06
01X
Simulation
X-inputs compared to QBF Benchmarks from ISCAS 89 (s*) and ITC 99 (b*)
September 24, 2014
Sven Reimer – QBF with Soft Variables
14 / 15
Conclusion
QBF with soft variables: New formalism allowing flexible quantifier positions in QBF ⇒ (Compact) Representation of applications with unknowns More accurate than classical 01X encodings
Sound and complete algorithm solving QBF with soft variables using MaxQBF Future work: Scalability Extend to Dependency QBF (DQBF)
September 24, 2014
Sven Reimer – QBF with Soft Variables
15 / 15