Combinatorial search
== proof construction?

Jo Devriendt
jodevriendt.com
 


Acknowledgment:

MIAO group headed by Jakob Nordström

 


slides: slides.com/jod/proofsearch

Search constructs a solution by trial and error

  • Depth-first search for a solution to a set of constraints
  • Local search to improve the solution under some objective
  • Calculate the value of a definition, query, DMN table, ...

Classic view:
Combinatorial solvers are
search engines

  • Derive that no (more) solution(s) exists
  • Construct an explanation for a propagation
  • Prove that a solution is optimal
  • Derive that a formula is implied by some theory
  • ...

But what do you do if there is no solution?

In the classic view, one uses a completeness argument:
all possible solutions have been investigated by the search tree

  • Exponentially many solutions
  • Maybe even infinite

Complete search

x=1

y=1

x \vee y \vee z\\ \overline{x} \vee y \vee z\\ y \vee \overline{z}\\ \overline{y} \vee z\\ \overline{y} \vee \overline{z}\\

z=1

z=0

x=1

y=1

y=0

x \vee y \vee z\\ \overline{x} \vee y \vee z\\ y \vee \overline{z}\\ \overline{y} \vee z\\ \overline{y} \vee \overline{z}\\

z=1

z=0

z=0

x=0

Complete search

x=1

x=0

y=1

y=0

y=1

y=0

x \vee y \vee z\\ \overline{x} \vee y \vee z\\ y \vee \overline{z}\\ \overline{y} \vee z\\ \overline{y} \vee \overline{z}\\

z=1

z=0

z=0

x=0

Complete search

Answer: proof construction

Combinatorial solvers also construct a (partial) proof during search
 

  • Proof is a syntactical derivation tree
  • Leafs are a set of "formula" constraints
  • Each parent node is a new implied constraint derived by some sound syntactical rule
  • The root is a trivial inconsistency, implying unsatisfiability of the formula constraints

Resolution proof

  • Propositional clauses

     
  • Resolution rule


     
  • E.g.
\frac{C \vee x \;\;\;\; D \vee \overline{x}}{C \vee D}
a \vee \overline{b} \vee c
\frac{a \vee b \vee c\;\;\;\; a \vee \overline{c} \vee \overline{d}}{a \vee b \vee \overline{d}}

Conflict-driven clause learning
constructs resolution proofs

x=1

y=1

x \vee y \vee z\\ \overline{x} \vee y \vee z\\ y \vee \overline{z}\\ \overline{y} \vee z\\ \overline{y} \vee \overline{z}\\

z=1

z=0

\frac{C \vee x ~~~~~ D \vee \overline{x} }{C \vee D}

Resolution:

\textcolor{red}{\overline{y}}

Resolution:

x \vee y \vee z\\ \overline{x} \vee y \vee z\\ y \vee \overline{z}\\ \overline{y} \vee z\\ \overline{y} \vee \overline{z}\\

y=0

z=0

x=1

x=0

\overline{y}
y
y \vee z
\emptyset
\frac{C \vee x ~~~~~ D \vee \overline{x} }{C \vee D}

Conflict-driven clause learning
constructs resolution proofs

Cool, let's try CDCL!

  • IDP-Z3 uses CDCL
    • constructs resolution proofs
  • IDP-Z3 cannot find a short proof for PHP?
  • Short resolution proof for PHP does not exist! [H85]

Cutting-plane proof system

  • Input: 0-1 linear constraints, e.g.,

     
  • Rules:
    • Boolean axiom
       
    • Addition

       
    • Multiplication

       
    • Division
       
  • Trivial inconsistency:
\sum_i a_i x_i \geq b \;\;\; a_i,b \in \mathbb{Z}, x_i \mapsto \mathbb{B}\equiv\{0,1\}
\frac{}{1 \geq x} \;\;\;\; \frac{}{x \geq 0}
\frac{ \sum_i a_i x_i \geq b \;\;\;\; c \in \mathbb{N}^+ } { \sum_i ca_i x_i \geq cb }
\frac{ \sum_i a_i x_i \geq b \;\;\;\; \sum_i c_i x_i \geq d } { \sum_i (a_i+c_i) x_i \geq b+d }
\frac{ \sum_i ca_i x_i \geq b \;\;\;\; c \in \mathbb{N}^+ } { \sum_i a_i x_i \geq \lceil b/c \rceil }
0 \geq 1
  • Input: 0-1 linear constraints (+ linear objective)
  • Output: either
    • (optimal) solution
    • proof that no solution exists
  • Search state:
    • set of constraints φ
    • partial assignment α
  • Initial state:
    • φ = input
    • α = {}
  • Depth-first search loop
    • learning an implied cutting plane from failure

Example:
Pseudo-Boolean learning

Unit propagation

\alpha=\{\}
  • Under α, if a constraint c ∈ φ would be falsified by assuming x=0 (resp. x=1), extend α with x=1 (resp. x=0)
  • Propagate until fixpoint

Pseudo-Boolean learning

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1

Unit propagation

Conflict?

  • Conflict: some c ∈ φ falsified by α
\alpha=\{\}

Pseudo-Boolean learning

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

  • Only if unit propagation did not lead to a conflict
  • If no unassigned variable left, return solution
  • Resume unit propagation
\alpha=\{\}

Pseudo-Boolean learning

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

  • Only if unit propagation did not lead to a conflict
  • If no unassigned variable left, return solution
  • Resume unit propagation
\alpha=\{z=0\}

Pseudo-Boolean learning

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

\alpha=\{z=0\}

Pseudo-Boolean learning

+x+y-0 \geq 0 \\ -2y+0-v \geq 0 \\ -0+2v-w \geq 0 \\ -x+y+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

\alpha=\{z=0,\\y=0,v=0\}

Pseudo-Boolean learning

+x+y-0 \geq 0 \\ -2y+0-v \geq 0 \\ -0+2v-w \geq 0 \\ -x+y+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

\alpha=\{z=0,\\y=0,v=0\}

Pseudo-Boolean learning

+x+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -0+0-w \geq 0 \\ -x+0+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

\alpha=\{z=0,\\y=0,v=0,\\w=0\}

Pseudo-Boolean learning

+x+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -0+0-w \geq 0 \\ -x+0+w \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

\alpha=\{z=0,\\y=0,v=0,\\w=0\}

Pseudo-Boolean learning

+x+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -x+0+0 \geq 1

Unit propagation

Conflict?

Decide unassigned variable

no

\alpha=\{z=0,\\y=0,v=0,\\w=0\}

Pseudo-Boolean learning

+x+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -x+0+0 \geq 1
  • Conflict: some c ∈ φ falsified by α

Unit propagation

Conflict?

Learn constraint

Decide unassigned variable

yes

no

  • From falsified constraint and reasons, construct learned constraint
    • implied by φ, should prevent conflict
  • Add learned constraint to φ
    • learned constraint database
\alpha=\{z=0,\\y=0,v=0,\\w=0\}

Pseudo-Boolean learning

+x+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -0+0-0 \geq 0 \\ -x+0+0 \geq 1

Unit propagation

Conflict?

Learn constraint

Decide unassigned variable

yes

no

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1
\alpha=\{z=0,\\y=0,v=0,\\w=0\}

Pseudo-Boolean learning

-x+y-z+2v \geq 1 \\
\textcolor{red}{+}
-x-3y+3z \geq 1
\textcolor{red}{+}
\textcolor{red}{+2\times}
-x-3y+3z \geq 1

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1
\alpha=\{z=0,\\y=0,v=0,\\w=0\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1
\alpha=\{\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

  • Backjump based on learned constraint
  • Resume unit propagation

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1
\alpha=\{\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1
\alpha=\{y=0,z=1\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+x+0-1 \geq 0 \\ -0+2-v \geq 0 \\ -1+2v-w \geq 0 \\ -x+0+w \geq 1
\alpha=\{y=0,z=1\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+x+0-1 \geq 0 \\ -0+2-v \geq 0 \\ -1+2v-w \geq 0 \\ -x+0+w \geq 1
\alpha=\{y=0,z=1,\\x=1\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+1+0-1 \geq 0 \\ -0+2-v \geq 0 \\ -1+2v-w \geq 0 \\ -1+0+w \geq 1
\alpha=\{y=0,z=1,\\x=1\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

+1+0-1 \geq 0 \\ -0+2-v \geq 0 \\ -1+2v-w \geq 0 \\ -1+0+w \geq 1
\alpha=\{y=0,z=1,\\x=1\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

Unit propagation

Conflict?

Decide unassigned variable

yes

no

\alpha=\{y=0,z=1,\\x=1\}

Pseudo-Boolean learning

-x-3y+3z \geq 1

Backjump

Learn constraint

+x+y-z \geq 0 \\ -2y+2z-v \geq 0 \\ -z+2v-w \geq 0 \\ -x+y+w \geq 1
\textcolor{red}{+}
+2y-z+w \geq 1
+ ~~x \geq 0
-3y+3z \geq 1
-y+z \geq 1
\div 3
\textcolor{red}{+}
+y+w \geq 2
\textcolor{red}{+}
+z+w \geq 3

Unsatisfiable!

+ 1 \geq z \;\; + 1 \geq w
0 \geq 1

Unit propagation

Conflict?

Learn constraint

Backjump

Decide unassigned variable

yes

no

  • Learning constraints pushes search forward
  • Thousands of conflicts per second
  • Originates from Boolean satisfiability (SAT) [MS96,BS97,MMZZM01]
  • Generalized to pseudo-Boolean (PB) solving [CK05,SS06,LP10,EN18]
    • many variations possible

here be dragons

Pseudo-Boolean learning

Learn constraint

here be dragons

Conflict analysis according to [EN18]

  • Pop last variable from assignment stack
    • if it exists, add reason constraint for last variable to conflict,
      scaled such that variable fully cancels
    • if no reason, just continue
  • Always maintain "conflictingness"
    • when needed, divide reason constraint or add axioms
  • Stop when propagating at some earlier search node
    • guaranteed to eventually stop
  • Generalization of conflict-driven clause learning (CDCL) from SAT

Pseudo-Boolean learning

Pseudo-Boolean learning

+2y+\overline{z}+w \geq 2 \\ \text{slack} = -1
+ ~~x \geq 0
+\overline{x}+3\overline{y}+3z \geq 5 \\ \text{slack} =1
+3\overline{y}+3z \geq 4 \\ \text{slack}=2
+\overline{y}+z \geq 2 \\ \text{slack}=0
\textcolor{red}{+}
+y+w \geq 2 \\ \text{slack}= -1

"RoundToOne" method

  • PB normal form: only positive coefficients
  • Slack: best-case evaluation of constraint
  • Slack is subadditive: sum of two constraints can not have more slack than sum of slacks of both constraints
  • Conflict side conflicting: slack < 0
  • Ensure reason has 0 slack
  • Ensure latest propagated variable is cancelled after addition
  • Result is new conflict, but without resolved variable
\alpha=\{y=0,\\z=1,x=1\}
\div 3 \text{, round up}

So far:

  • Combinatorial solvers build proofs to avoid enumerating all potential solutions of unsatisfiable instances
  • CDCL-based solvers build resolution proofs
    • Smallest PHP resolution proof is exponential
  • RoundingSat and [CK05, SS06,LP10] PB solvers build cutting-plane proofs

Question break

Cutting-planes p-simulates resolution

x \vee y \vee \overline{z} \leftrightarrow x + y + (1-z) \geq 1

Any resolution proof can be converted into a cutting planes proof with polynomial overhead

(1-x) + \sum_{j \in J} l_j \geq 1
x+\sum_{i\in I} l_i \geq 1
\textcolor{red}{+}
\sum_{i \in I \setminus J} l_{i} + \sum_{j\in J \setminus I} l_{j} + 2\sum_{k \in I \cap J} l_k \geq 1+1-1
\text{add axioms } l_{i}\geq 0 \text{ and }l_{j} \geq 0
\div 2

Resolution:

\frac{C \vee x ~~~~~ D \vee \overline{x} }{C \vee D}
2\sum_{i \in I \setminus J} l_{i} + 2\sum_{j\in J \setminus I} l_{j} + 2\sum_{k \in I \cap J} l_k \geq 1
\sum_{i \in I \setminus J} l_{i} + \sum_{j\in J \setminus I} l_{j} + \sum_{k \in I \cap J} l_k \geq 1

Do polynomial cutting-plane proofs for PHP exist?

Simple cardinality case:

\forall p \colon \sum_h x_{ph} \geq 1\\ \forall h \colon \sum_p x_{ph} \leq 1\\

Do polynomial cutting-plane proofs for PHP exist?

  • Linear number of rule applications
  • RoundingSat can find this proof

Simple cardinality case:

\forall p \colon \sum_h x_{ph} \geq 1\\ \forall h \colon \sum_p -x_{ph} \geq -1\\
0 \geq \#p-\#h

Sum up each forall

\sum_{p,h} x_{ph} \geq \#p\\ \sum_{p,h} -x_{ph} \geq -\#h\\

Add together

Do polynomial cutting-plane proofs for PHP exist?

Complex clausal case:

\forall p \colon \sum_h x_{ph} \geq 1\\ \forall p_1\neq p_2,h \colon (1-x_{p_1h}) + (1-x_{p_2h}) \geq 1\\
  • Yes! [CCT87]
  • So cutting-planes > resolution
  • RoundingSat can not find this proof
    • Only "canceling" application of the addition rule
    • On CNFs, "conflict-driven cutting planes" degenerates to CDCL
    • Don't encode a strong 0-1 linear inequalities as clauses

CDCL on the cardinality encoding for PHP?

  • Clasp or IDP3: timeout
    • "lazy clause generation" eventually encodes the at-most-1 constraints to clauses
  • IDP-Z3: complicated
    • With the right input, Z3's LP solver is triggered

Simple cardinality case:

\forall p \colon \sum_h x_{ph} \geq 1\\ \forall h \colon \sum_p x_{ph} \leq 1\\
  • Currently the fastest PB solver
    • though MIP solvers probably are faster on many MIPLIB / optimization benchmarks
  • Returns machine-verifiable proof of unsatisfiability / optimality
  • Integration with SoPlex [ZIB] LP solver [DGN20]
    • fully sound, bypasses floating point issues
  • Arbitrarily large coefficient constraints without efficiency loss on small coefficient constraints
  • Recent: core-guided optimization
    • MaxSAT technique

RoundingSat

gitlab.com/miao_research/roundingsat

RoundingSat

By Romain Wallon (CRIL, Univ Artois & CNRS)
instances taken from [PBCOMP]

RoundingSat

[LBDEN20]

  • Verification of various bit-level multiplier circuits
  • All instances are unsatisfiable

RoundingSat

[SDNS20]

  • Planning problems with classic state-transition system
  • Transition function is learned with a binarized neural network (BNN)
  • Resulting planning problem has particular structure with bad linear relaxation and large SAT encoding
  • Perfect for PB :)

RoundingSat

[P04]

  • Knapsack instances seem hard for clause learning
  • SCIP uses dynamic programming approach
  • Latest version of RoundingSat can handle most with PB constraint learning
    + LP solving

RoundingSat

Conclusion

  • Combinatorial solvers build proofs
    • To prove unsatisfiability, optimality, logical implication
  • CDCL-based solvers build resolution proofs
    • Smallest PHP proof is exponential
  • Cutting-planes is strictly stronger than resolution
  • RoundingSat and other PB solvers build cutting-planes proofs
    • But limited to "canceling addition"
      • No advantage on CNF
  • But most combinatorial solvers rely on CDCL, and hence, resolution

Epilogue: potential use cases for RoundingSat in Eavise

  • Solving timetabling problems
  • Proving equivalence of formal contracts (EuroClear)
  • Proving completeness of DMN tables (Televic)
  • Backcalculation of game of life patterns
  • ...

Anything where proofs need to be generated or search performance limits applicability.

Thanks for your attention!

[H85] The intractibility of resolution - Haken

[CCT87] On the complexity of cutting-plane proofs - Cook, Coullard, Turán

[MS96] GRASP - a new search algorithm for satisfiability - Marques-Silva, Sakallah

[BS97] Using CSP lookback techniques to solve real-world SAT instances - Bayardo, Schrag

[MMZZM01] Chaff: Engineering an efficient SAT solver - Moskewicz, Madigan, Zhao, Zhang, Malik

[P04] Where are the hard knapsack problems? - Pisinger

[CK05] A fast pseudo-Boolean constraint solver - Chai, Kuehlmann

[SS06] Pueblo: A hybrid pseudo-Boolean SAT solver - Sheini, Sakallah

[LP10] The Sat4j library, release 2.2 - Le Berre, Parrain

[EN18] Divide and conquer: Towards faster pseudo-boolean solving - Elffers, Nordström

[EGNV18] Using Combinatorial Benchmarks to Probe the Reasoning Power of pseudo-Boolean Solvers - Elffers, Giráldez-Cru, Nordström, Vinyals

[D20] Watched Propagation for 0-1 Integer Linear Constraints - Devriendt

[DGN20] Learn to Relax: Integrating 0-1 Integer Linear Programming with Pseudo-Boolean Conflict-Driven Search - Devriendt, Gleixner, Nordström

[EGMN20] Justifying All Differences Using Pseudo-Boolean Reasoning - Elffers, Gocht, McCreesh, Nordström

[SDNS20] Theoretical and Experimental Results for Planning with Learned Binarized NeuralNetwork Transition Models - Say, Devriendt, Nordström, Stuckey

[LBDEN20] Verifying Properties of Bit-vector Multiplication Using Cutting Planes Reasoning - Liew, Beame, Devriendt, Elffers, Nordström

[ZIB] SoPlex - soplex.zib.de

[PBCOMP] Latest PB competition - www.cril.univ-artois.fr/PB16/

References

Made with Slides.com