handling pseudo boolean constraints in a cdcl solver a
play

Handling Pseudo-Boolean constraints in a CDCL solver a practical - PowerPoint PPT Presentation

Handling Pseudo-Boolean constraints in a CDCL solver a practical survey Daniel Le Berre CNRS, Universit e dArtois, FRANCE { leberre } @cril.univ-artois.fr Dagstuhl seminar 15171 - April 20, 2015 1/44 Motivation CDCL proof system is


  1. Handling Pseudo-Boolean constraints in a CDCL solver a practical survey Daniel Le Berre CNRS, Universit´ e d’Artois, FRANCE { leberre } @cril.univ-artois.fr Dagstuhl seminar 15171 - April 20, 2015 1/44

  2. Motivation ◮ CDCL proof system is resolution [PD11, AFT11] ◮ Resolution in CDCL is used during conflict analysis ◮ Can we change the conflict analysis procedure to use another proof system ? ◮ Let’s try “cutting planes” to generate linear pseudo boolean constraints 2/44

  3. Outline of the talk Definitions and properties Handling Pseudo-Boolean constraints instead of clauses Conflict Driven “generalized resolution” reasoning PB Solvers on PHP formulas 3/44

  4. Outline Definitions and properties Handling Pseudo-Boolean constraints instead of clauses Conflict Driven “generalized resolution” reasoning PB Solvers on PHP formulas 4/44

  5. Linear Pseudo-Boolean constraints (LPB) n � a i x i ⊗ k i =1 ◮ boolean variables x i are integers taking their value in { 0 , 1 } ( x i ≥ 0 and x i ≤ 1) ◮ x i = 1 − x i ◮ coefficients a i and degree/threshold k are integer-valued constants ◮ ⊗ ∈ { <, ≤ , = , ≥ , > } with ( < k ↔≤ k − 1 and = k ↔≤ k ∧ ≥ k ) Pseudo-Boolean decision problem : satisfying a set of LPB is NP-complete  ( a 1 ) 5 x 1 + 3 x 2 + 2 x 3 + 2 x 4 + x 5 ≥ 8  ( a 2 ) 5 x 1 + 3 x 2 + 2 x 3 + 2 x 4 + x 5 ≥ 5 ( b ) x 1 + x 3 + x 4 ≥ 2  5/44

  6. LPB = Concise boolean function representation ◮ clauses are specific LPB : n n n � � � ≡ l i ≥ 1 ≡ l i ≤ n − 1 l i i =1 i =1 i =1 x 1 ∨ x 2 ∨ x 3 translates into x 1 + x 2 + x 3 ≥ 1 or x 1 + x 2 + x 3 ≤ 2 ◮ cardinality constraints at least/at most 2 out of { x 1 , x 2 , x 3 } translate into x 1 + x 2 + x 3 ≥ 2 x 1 + x 2 + x 3 ≤ 2 ◮ Knapsack constraint : � w i . x i ≤ W ◮ Subset sum constraint : � a i . x i = k

  7. Linear Pseudo Boolean constraints normalization Representation used when designing a solver ◮ remember that x = 1 − x ◮ usual form : ≥ inequality and positive constants − 3 x 1 + 4 x 2 − 7 x 3 + x 4 ≤ − 5 ≡ 3 x 1 − 4 x 2 + 7 x 3 − x 4 ≥ 5 ≡ 3 x 1 + − 4(1 − x 2 ) + 7 x 3 + − (1 − x 4 ) ≥ 5 ≡ 3 x 1 + 4 x 2 + 7 x 3 + x 4 ≥ 10 ◮ note that x 1 + x 2 + x 3 + x 4 + x 5 ≤ 1 is represented x 1 + x 2 + x 3 + x 4 + x 5 ≥ 4 7/44

  8. Open question #1 : is that normalization the best option ? ◮ At-Least normalization allows a generalization of clause ◮ At-Least representation used in theory (e.g proof complexity) ◮ At-Most constraints often used in practice : knapsack constraints, optimization ◮ � n i =1 l i ≤ 1 normalized to � n i =1 l i ≥ n − 1 Tip used when translating cardinality constraints into CNF Make sure that the threshold k is never greater than n 2 by switching between ≤ and ≥ representations. 8/44

  9. Basic operations on Linear inequalities � i a i . x i ≥ k i a ′ i . x i ≥ k ′ addition: � i ( a i + a ′ i ) . x i ≥ k + k ′ � � i a i . x i ≥ k i a ′ i . x i ≥ k ′ � linear combination: i ( α. a i + α ′ . a ′ i ) . x i ≥ α. k + α ′ . k ′ � with α > 0 and α ′ > 0 � i a i . x i ≥ k α > 0 division: a i . x i ≥ k � i α α 9/44

  10. TCS division � i α. a i . x i ≥ k α > 0 TCS division: i a i . x i ≥ ⌈ k � α ⌉ 2 x 2 + 2 x 3 + 2 x 4 ≥ 3 x 2 + x 3 + x 4 ≥ ⌈ 3 / 2 ⌉ tcs division: x 2 + x 3 + x 4 ≥ 2 10/44

  11. ILP division (Chv´ atal-Gomory cut) ◮ When the variables x i and degree k are integer ◮ Removes some non integral part of the cut � i a i . x i ≥ k α > 0 ILP division: i ⌈ a i α ⌉ . x i ≥ ⌈ k � α ⌉ 5 x 3 + 3 x 4 ≥ 5 ⌈ 5 / 5 ⌉ x 3 + ⌈ 3 / 5 ⌉ x 4 ≥ ⌈ 5 / 5 ⌉ x 3 + x 4 ≥ 1 One can always reduce a LPB constraint to a clause ! 11/44

  12. Clashing linear combination Also called Gaussian or Fourier–Motzkin elimination ◮ Apply linear combination between LPB constraints with at least one opposite literal. ◮ Generalization of resolution [Hoo88] i a i . x i + α ′ � m � j =1 y j ≥ k i . x i + α � m i a ′ j =1 y j ≥ k ′ � clashing combination: i ) . x i ≥ α. k + α ′ . k ′ − α.α ′ . m i ( α. a i + α ′ . a ′ � with α > 0 and α ′ > 0 x 1 + x 2 + 3 x 3 + x 4 ≥ 3 2 x 1 + 2 x 2 + x 4 ≥ 3 2 x 1 + 2 x 2 + 6 x 3 + 2 x 4 + 2 x 1 + 2 x 2 + x 4 ≥ 2 × 3 + 3 2 x 1 + 2 x 2 + 6 x 3 + 2 x 4 + 2 − 2 x 1 + 2 − 2 x 2 + x 4 ≥ 9 6 x 3 + 3 x 4 ≥ 5 Note that 2 x + 2 x = 2, not 0 ! Note that the coefficients are growing ! 12/44

  13. Some remarks about clashing combination ◮ Clashing combination looks like resolution ? x 1 + x 3 + x 4 ≥ 1 x 1 + x 2 + x 5 ≥ 1 x 2 + x 3 + x 4 + x 5 ≥ 1 ◮ What about common literals ? x 1 + x 2 + x 3 + x 4 ≥ 1 x 1 + x 2 + x 4 ≥ 1 2 x 2 + x 3 + 2 x 4 ≥ 1 ◮ With more than one variable ? x 1 + x 2 + x 3 + x 4 ≥ 1 x 1 + x 2 + x 4 ≥ 1 x 3 + 2 x 4 ≥ 0 clashing combination on clauses is equivalent to resolution ! 13/44

  14. Saturation coefficients can be trimmed to the value of the degree � i a i . x i + � j b j . y j ≥ k b j > k saturation: � i a i . x i + � j k . y j ≥ k 6 x 3 + 3 x 4 ≥ 5 5 x 3 + 3 x 4 ≥ 5 2 x 2 + x 3 + 2 x 4 ≥ 1 x 2 + x 3 + x 4 ≥ 1 [iterated application of ILP division rule with k +1 k ≤ α < k − 1 ] k 14/44

  15. Weakening We can reduce the degree of the constraint by “satisfying” any of its literals � i � = j a i . x i + a j . x j ≥ k � i � = j a i . x i ≥ k − a j weakening: 5 x 1 + 3 x 2 + 2 x 3 + 2 x 4 + x 5 ≥ 8 3 x 2 + 2 x 3 + 2 x 4 + x 5 ≥ 3 Useful for reducing the value of the degree ! [Apply linear combination rule with x j ≥ 0] 15/44

  16. Reduction to cardinality Extract a cardinality constraint from a LPB constraint � n i =1 a i . x i ≥ k a 1 ≥ a 2 ≥ ... a n reduce to card: � n i =1 x i ≥ k ′ with � k ′ − 1 i =1 a i < k ≤ � k ′ i =1 a i 5 x 1 + 3 x 2 + 2 x 3 + 2 x 4 + x 5 ≥ 8 x 1 + x 2 + x 3 + x 4 + x 5 ≥ 2 16/44

  17. The various Cutting Planes ◮ Linear combination + ILP division = Chv´ atal-Gomory ILP cutting planes ◮ Addition + TCS division = Proof complexity cutting planes ◮ Linear clashing combination + saturation = Hooker’s generalized resolution cutting planes Integrating Cutting Planes in a CDCL solver : replace Resolution during Conflict Analysis by Hooker’s Cutting Planes 17/44

  18. Outline Definitions and properties Handling Pseudo-Boolean constraints instead of clauses Conflict Driven “generalized resolution” reasoning PB Solvers on PHP formulas 18/44

  19. Requirements for constraints in a CDCL solver ◮ Detect falsified state ◮ Detect propagation of literals ◮ Provide a “reason” during conflict analysis 19/44

  20. Some remarks about clauses l 1 ∨ l 2 ∨ ... ∨ l n ◮ Falsified when all its literals are falsified l 1 ∨ l 2 ∨ ... ∨ l n ◮ Propagates when all but one literals are falsified l 1 ∨ l 2 ∨ ... ∨ l n ◮ Propagates one literal ◮ Appears at most once as a reason for an assignment Chaff : 2 watched literals per clause 20/44

  21. Some remarks about cardinality constraints l 1 + l 2 + ... + l n ≥ k ◮ Falsified when at least n − k + 1 literals are falsified l 1 + l 2 + l 3 + l 4 + l 5 + l 6 ≥ 4 Note unassigned literals ! ◮ Propagates when exactly n − k literals are falsified l 1 + l 2 + l 3 + l 4 + l 5 + l 6 ≥ 4 ◮ Propagates k literals ◮ Appears at most once as a reason for at most k consecutive assignments. Extended k + 1 watched literals per cardinality 21/44

  22. Some remarks about LBP constraints a 1 . l 1 + a 2 . l 2 + ... + a n . l n ≥ k � A = a i i Slack s : A − k − � l i falsified a i ◮ Falsified when s < 0 (depends on falsified literals) 5 l 1 + 3 l 2 + 2 l 3 + l 4 + l 5 + l 6 ≥ 6 ◮ Propagates remaining literals when s = 0 (*) 5 l 1 + 3 l 2 + 2 l 3 + l 4 + l 5 + l 6 ≥ 6 ◮ Propagates literals x i for which s < a i ◮ (*) May appear several times as a reason for non consecutive assignments Extended watched literals based on coefficients !

  23. Watched Literals for LPB constraints Described in Galena [CK03] and PBChaff [Par04], may have already existed in PBS or Satzoo. ◮ General case : Let M = max ( a i ) NbWatch = minimal number of literals x i such that � a i ≥ k + M . ◮ Cardinality constraints : M = 1 NbWatch = k + 1 ◮ Clauses : M = 1 k = 1 NbWatch = 2 23/44

  24. Watched literals : consequences ◮ In LPB constraints, the number of WL is varying during the search. ◮ In cardinality constraints, the greater the degree, the greater the number of WL. ◮ Clauses are the best case ! ◮ Big difference for LPB constraint learning Can we do better using a ≤ representation ? 24/44

  25. Forced truth values : Implicative and Assertive constraints ◮ unit clause : a clause that propagates one truth value to be satisfiable ◮ implicative constraint : a constraint which propagates at least one truth value to be satisfiable. ◮ a LPB constraint C is implicative iff ∃ a i x i ∈ C such that j � = i a j < k or � a j − k < a i . �

Recommend


More recommend