Solving and Verifying The Boolean Pythagorean Triples Problem Via Cube-and-Conquer
Solving and Verifying The Boolean Pythagorean Triples Problem Via Cube-and-Conquer
Solving and Verifying The Boolean Pythagorean Triples Problem Via Cube-and-Conquer
1/40
Introduction
Results
2/40
Introduction
3/40
Schur’s Theorem [Schur 1917]
Can the set of natural numbers {1, 2, . . . } be partitioned into
k parts with no part containing a, b, and c such that a+b = c?
Otherwise, what is the smallest finite counter-example?
4/40
Schur’s Theorem [Schur 1917]
Can the set of natural numbers {1, 2, . . . } be partitioned into
k parts with no part containing a, b, and c such that a+b = c?
Otherwise, what is the smallest finite counter-example?
{1} {1} {1, 4} {1, 4}
→ → → → ×
{} {2} {2} {2, 3}
1+4 = 5
init 1+1 = 2 2+2 = 4 1+3 = 4
2+3 = 5
4/40
Schur’s Theorem [Schur 1917]
Can the set of natural numbers {1, 2, . . . } be partitioned into
k parts with no part containing a, b, and c such that a+b = c?
Otherwise, what is the smallest finite counter-example?
{1} {1} {1, 4} {1, 4}
→ → → → ×
{} {2} {2} {2, 3}
1+4 = 5
init 1+1 = 2 2+2 = 4 1+3 = 4
2+3 = 5
Theorem (Schur’s Theorem)
For each k > 0, there exists a number S(k), known as Schur
number k, such that [1, S(k)] can be partitioned into k parts
with no part containing a, b, and c such that a + b = c, while
this is impossible for [1, S(k)+1].
S(1) = 1, S(2) = 4, S(3) = 13, S(4) = 44 [Baumert 1965],
160 ≤ S(5) ≤ 315 [Exoo 1994, Fredricksen 1979].
4/40
Schur’s Theorem on Squares
5/40
Schur’s Theorem on Squares
5/40
Schur’s Theorem on Squares
5/40
Pythagorean Triples Problem [Erdős and Graham 1980]
The Boolean Pythagorean Triples problem is a reformulation
of Schur’s theorem on squares restricted to two parts:
7/40
Main Contribution
8/40
Solving Framework for
Hard-Combinatorial Problems
9/40
Overview of Solving Framework
transformed
encoder
formula
cubes
1: encode 2: transform 3: split 4: solve
5: validate
10/40
Overview of Solving Framework: Phase 1
transformed
encoder
formula
cubes
1: encode 2: transform 3: split 4: solve
5: validate
11/40
Phase 1: Encode
12/40
Overview of Solving Framework: Phase 2
transformed
encoder
formula
cubes
1: encode 2: transform 3: split 4: solve
5: validate
13/40
Phase 2: Transform
14/40
Phase 2: Blocked Clauses [Kullmann’99]
Definition (Blocking literal)
A literal l in a clause C of a CNF F blocks C w.r.t. F if
¯
for every clause D ∈ Fl¯, the resolvent (C \ {l}) ∪ (D \ {l})
obtained from resolving C and D on l is a tautology.
With respect to a fixed CNF and its clauses we have:
Definition (Blocked clause)
A clause is blocked if it contains a literal that blocks it.
15/40
Phase 2: Blocked Clauses [Kullmann’99]
Definition (Blocking literal)
A literal l in a clause C of a CNF F blocks C w.r.t. F if
¯
for every clause D ∈ Fl¯, the resolvent (C \ {l}) ∪ (D \ {l})
obtained from resolving C and D on l is a tautology.
With respect to a fixed CNF and its clauses we have:
Definition (Blocked clause)
A clause is blocked if it contains a literal that blocks it.
Example (Blocking literals and blocked clauses)
Consider the formula (a ∨ b) ∧ (a ∨ b̄ ∨ c̄) ∧ (ā ∨ c).
First clause is not blocked.
Second clause is blocked by both a and c̄.
Third clause is blocked by c.
15/40
Phase 2: Blocked Clauses [Kullmann’99]
Definition (Blocking literal)
A literal l in a clause C of a CNF F blocks C w.r.t. F if
¯
for every clause D ∈ Fl¯, the resolvent (C \ {l}) ∪ (D \ {l})
obtained from resolving C and D on l is a tautology.
With respect to a fixed CNF and its clauses we have:
Definition (Blocked clause)
A clause is blocked if it contains a literal that blocks it.
Example (Blocking literals and blocked clauses)
Consider the formula (a ∨ b) ∧ (a ∨ b̄ ∨ c̄) ∧ (ā ∨ c).
First clause is not blocked.
Second clause is blocked by both a and c̄.
Third clause is blocked by c.
Proposition
Removal of an arbitrary blocked clause preserves satisfiability.
15/40
Phase 2: Blocked Clause Elimination (BCE)
Definition (BCE)
While a clause C in a formula F is blocked, remove C from F .
Example (BCE)
Consider (a ∨ b) ∧ (a ∨ b̄ ∨ c̄) ∧ (ā ∨ c).
After removing either (a ∨ b̄ ∨ c̄) or (ā ∨ c), the clause
(a ∨ b) becomes blocked (no clause with either b̄ or ā).
An extreme case in which BCE removes all clauses!
Example (Pythagorean Triples)
The clauses (x3 ∨ x4 ∨ x5 ) and (x̄3 ∨ x̄4 ∨ x̄5 ) are blocked in
F7824 and F7825 (actually in any Fn ).
BCE (F7824 ) has 3740 variables and 14652 clauses, and
BCE (F7825 ) has 3745 variables and 14672 clauses.
BCE can simulate many high-level reasoning techniques.
[Järvisalo, Biere, and Heule 2010]
16/40
Overview of Solving Framework: Phase 3
transformed
encoder
formula
cubes
1: encode 2: transform 3: split 4: solve
5: validate
17/40
Phase 3: Split
Input: transformed formula t
x5
f
Output: cubes and tautology proof x3 x2
f t t f
Goal: partition input in as x7 x3
many subproblems such that t f t f
total wallclock time is minimal x6
f t
Two layers of splitting F7824 :
I The top level split partitions
18/40
Cube-and-Conquer [Heule, Kullmann, Wieringa, and Biere 2011]
There exists two main SAT solving paradigms:
I Look-ahead aims to construct a small binary search-tree
19/40
Cube-and-Conquer [Heule, Kullmann, Wieringa, and Biere 2011]
There exists two main SAT solving paradigms:
I Look-ahead aims to construct a small binary search-tree
20/40
Details regarding the splitting heuristics
Splitting based on look-aheads:
I Count the number of assigned variables (large formulas)
transformed
encoder
formula
cubes
1: encode 2: transform 3: split 4: solve
5: validate
21/40
Phase 4: Solve
Input: transformed formula and cubes
Output: cube proofs (or satisfying assignment)
Goal: solve (with proof logging) all cubes as fast as possible
22/40
Phase 4: Short history of CDCL improvements
Conflict-driven clause learning (CDCL) has been the dominant
SAT solving paradigm and improved significantly in 20 years.
I Invented by Marques-Silva and Sakallah [1997];
transformed
encoder
formula
cubes
1: encode 2: transform 3: split 4: solve
5: validate
24/40
Phase 5: Motivation for validating unsatisfiability proofs
Satisfiability solvers are used in amazing ways...
I Hardware and software verification (Intel and Microsoft)
I Hard-Combinatorial problems:
I van der Waerden numbers
[Dransfield, Marek, and Truszczynski, 2004; Kouril and Paul, 2008]
I Gardens of Eden in Conway’s Game of Life
[Hartman, Heule, Kwekkeboom, and Noels, 2013]
I Erdős Discrepancy Problem [Konev and Lisitsa, 2014]
..., but satisfiability solvers have errors and only return yes/no.
I Documented bugs in SAT, SMT, and QBF solvers
25/40
Clausal Proof System [Järvisalo, Heule, and Biere 2012]
Unsatisfiable
* Learn empty clause
init
F
Satisfiable
* Forget last clause
26/40
Ideal Properties of a Proof System for SAT Solvers
Resolution Proofs
Zhang and Malik, 2003
Van Gelder, 2008; Biere, 2008
27/40
Ideal Properties of a Proof System for SAT Solvers
Resolution Proofs
Zhang and Malik, 2003
Van Gelder, 2008; Biere, 2008
Easy to Emit
Clausal Proofs
Goldberg and Novikov, 2003
Van Gelder, 2008
Compact
Clausal proofs + clause deletion
Heule, Hunt, Jr., and Wetzler [STVR 2014]
Checked Efficiently
Optimized clausal proof checker
Heule, Hunt, Jr., and Wetzler [FMCAD 2013]
Expressive
Clausal RAT proofs
Heule, Hunt, Jr., and Wetzler [CADE 2013]
Verified
DRAT proofs (RAT + deletion)
Wetzler, Heule, and Hunt, Jr. [SAT 2014]
27/40
Phase 5: Validate Pythagorean Triples Proofs.
5: validate
The size of the merged proof is almost 200 terabyte and has
been validated in 16,000 CPU hours.
28/40
Results
on the million subproblems
29/40
Histogram of Frequency of Cube Sizes
30/40
Runtime of Cube and Conquer Averaged per Cube Size
31/40
Scatterplot: Cube versus Conquer Runtimes
32/40
Scatterplot: Validation versus Conquer Runtimes
33/40
Scatterplot: CDCL versus Cube-and-Conquer Runtimes
34/40
Scatterplot: Look-ahead versus Cube-and-Conquer
Runtimes
35/40
Conclusions and Future Work
36/40
An Extreme Solution (a valid partition of [1, 7824])
37/40
Conclusions
38/40
Heule’s Contributions to Solving Framework
39/40
Future Directions
Apply our solving framework to other challenges in Ramsey
Theory and elsewhere:
I Existing results for which no proof was produced, for
40/40
Future Directions
Apply our solving framework to other challenges in Ramsey
Theory and elsewhere:
I Existing results for which no proof was produced, for
Thanks!
40/40