sorting parity encodings by reusing variables
play

Sorting Parity Encodings by Reusing Variables Leroy Chew and Marijn - PowerPoint PPT Presentation

Sorting Parity Encodings by Reusing Variables Leroy Chew and Marijn J.H. Heule 23rd International Conference on Theory and Applications of Satisfiability Testing July 7, 2020 lchew@andrew.cmu.edu 1 / 16 Problem Statement Suppose we have a


  1. Sorting Parity Encodings by Reusing Variables Leroy Chew and Marijn J.H. Heule 23rd International Conference on Theory and Applications of Satisfiability Testing July 7, 2020 lchew@andrew.cmu.edu 1 / 16

  2. Problem Statement Suppose we have a permutation σ on [ n ] . The two xor constraints: x 1 ⊕ x 2 ⊕ · · · ⊕ x n = 0 x σ ( 1 ) ⊕ x σ ( 2 ) ⊕ · · · ⊕ x σ ( n ) = 1 ∧ are a contradiction. Tseitin variables t i and s i represent the reordered parity: t 1 = x 1 ⊕ x 2 s 1 = x σ ( 1 ) ⊕ x σ ( 2 ) t i − 1 = t i − 2 ⊕ x i s i − 1 = s σ ( i − 2 ) ⊕ x σ ( i ) for i = 3 to n − 2 t n − 3 ⊕ x n − 1 ⊕ ¯ x n s σ ( n − 3 ) ⊕ x σ ( n − 1 ) ⊕ x σ ( n ) We can represent a = b ⊕ c in four clauses. a ∨ ¯ a ∨ ¯ a ∨ b ∨ c ¯ b ∨ c a ∨ b ∨ ¯ c ¯ b ∨ ¯ c lchew@andrew.cmu.edu 2 / 16

  3. An Easy Special Case A special case when the permutation is the identity map: x 1 ⊕ x 2 ⊕ · · · ⊕ x n = 0 x 1 ⊕ x 2 ⊕ · · · ⊕ x n = 1. ∧ These formulas are instances of the Dubois family and have short linear resolution proofs. However when the reordered parity is done randomly, we do not know if there are short proofs for resolution. lchew@andrew.cmu.edu 3 / 16

  4. SAT Solvers and Gaussian Elimination Appear to show exponential running times on CDCL algorithm. However there is at least one method that deals with reordered parity quickly: Gaussian elimination. Gaussian elimination requires the detection of xor constraints and then adds them together to create more xor constraints until an inconsistent constraint is found. However solvers that support Gaussian elimination cannot produce proofs. lchew@andrew.cmu.edu 4 / 16

  5. The DRAT proof system Powerful proof system, simulates strong systems like Frege, Extended resolution (ER) and Propagation Redundancy (PR). Standard proof format in SAT solving. Every ER proof is automatically a DRAT proof. DRAT − is without new variables [Buss, Thapen 2019] DRAT Rules: Logical implication rules (ATA, ATE) Satisfiability preserving rules (RATA, RATE) lchew@andrew.cmu.edu 5 / 16

  6. Generated Proofs CDCL on reordered parity formulas appear exponential. no. of DRAT lines 10 7 CaDiCaL 10 6 34 36 38 40 42 44 46 n lchew@andrew.cmu.edu 6 / 16

  7. Solving Unordered Parity by Sorting We can use swaps to turn x σ ( 1 ) ⊕ x σ ( 2 ) ⊕ · · · ⊕ x σ ( n ) = 1 into x 1 ⊕ x 2 ⊕ · · · ⊕ x n = 1 (in Tseitinised form). Swaps must have short DRAT proofs. We limit swaps to adjacent variables, those used in the next Tseitin variable. The Tseitin variables are in a linear depth tree: hence O ( n 2 ) in the worst case. For a log depth tree this is O ( n log n ) . lchew@andrew.cmu.edu 7 / 16

  8. Sorting a Log Depth Tree t 7 t 3 t 4 t 1 t 2 t 5 t 6 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  9. Sorting a Log Depth Tree t 7 t 3 t 4 t 1 t 2 t 5 t 6 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  10. Sorting a Log Depth Tree t 7 t 3 t 4 x 2 t 1 t 5 t 6 x 1 x 5 x 6 x 7 x 8 t 2 x 3 x 4 X X lchew@andrew.cmu.edu 8 / 16

  11. Sorting a Log Depth Tree t 7 t 3 t 4 x 2 t 1 t 5 t 6 x 1 x 5 x 6 x 7 x 8 t 2 x 3 x 4 X X lchew@andrew.cmu.edu 8 / 16

  12. Sorting a Log Depth Tree t 7 x 2 t 3 t 1 t 4 x 1 t 2 t 5 t 6 x 3 x 4 x 5 x 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  13. Sorting a Log Depth Tree t 7 x 2 t 3 t 1 t 4 x 1 t 2 t 5 t 6 x 3 x 4 x 5 x 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  14. Sorting a Log Depth Tree t 7 t 3 t 1 x 2 x 1 t 4 t 2 x 3 x 4 t 5 t 6 x 5 x 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  15. Sorting a Log Depth Tree t 7 t 3 t 1 x 2 x 1 t 4 t 2 x 3 x 4 t 5 t 6 x 5 x 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  16. Sorting a Log Depth Tree t 7 t 3 t 1 x 1 t 5 t 4 t 2 x 5 x 6 x 2 x 3 x 4 t 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  17. Sorting a Log Depth Tree t 7 t 3 t 1 x 1 t 5 t 4 t 2 x 5 x 6 x 2 x 3 x 4 t 6 x 7 x 8 X X lchew@andrew.cmu.edu 8 / 16

  18. Sorting a Log Depth Tree t 7 t 3 t 1 x 1 t 5 t 4 t 2 x 5 x 6 x 7 x 3 x 4 t 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  19. Sorting a Log Depth Tree t 7 t 3 t 1 x 1 t 5 t 4 t 2 x 5 x 6 x 7 x 3 x 4 t 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  20. Sorting a Log Depth Tree t 7 t 3 t 1 x 7 x 1 t 4 t 2 x 3 x 4 t 5 t 6 x 5 x 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  21. Sorting a Log Depth Tree t 7 t 3 t 1 x 7 x 1 t 4 t 2 x 3 x 4 t 5 t 6 x 5 x 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  22. Sorting a Log Depth Tree t 7 x 7 t 3 t 1 t 4 x 1 t 2 t 5 t 6 x 3 x 4 x 5 x 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  23. Sorting a Log Depth Tree t 7 x 7 t 3 t 1 t 4 x 1 t 2 t 5 t 6 x 3 x 4 x 5 x 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  24. Sorting a Log Depth Tree t 7 t 3 t 4 x 7 t 1 t 5 t 6 x 1 x 5 x 6 x 2 x 8 t 2 x 3 x 4 X X lchew@andrew.cmu.edu 8 / 16

  25. Sorting a Log Depth Tree t 7 t 3 t 4 x 7 t 1 t 5 t 6 x 1 x 5 x 6 x 2 x 8 t 2 x 3 x 4 X X lchew@andrew.cmu.edu 8 / 16

  26. Sorting a Log Depth Tree t 7 t 3 t 4 t 1 t 2 t 5 t 6 x 1 x 7 x 3 x 4 x 5 x 6 x 2 x 8 X X lchew@andrew.cmu.edu 8 / 16

  27. Logging Swaps in DRAT Suppose we have two Tseitin variables p and q , p = a ⊕ b and q = p ⊕ c q p c a b lchew@andrew.cmu.edu 9 / 16

  28. Logging Swaps in DRAT ATA RATE q ∨ a ∨ b ∨ c ¯ p ∨ a ∨ b ¯ d a ∨ ¯ a ∨ ¯ q ∨ ¯ ¯ b ∨ c p ∨ ¯ ¯ b d q ∨ a ∨ ¯ p ∨ a ∨ ¯ ¯ b ∨ ¯ c b d q ∨ ¯ ¯ a ∨ b ∨ ¯ c p ∨ ¯ a ∨ b d q ∨ ¯ a ∨ b ∨ c p ∨ q ∨ c ¯ d q ∨ a ∨ ¯ p ∨ ¯ ¯ q ∨ ¯ b ∨ c c d q ∨ a ∨ b ∨ ¯ c p ∨ q ∨ ¯ c d a ∨ ¯ q ∨ ¯ b ∨ ¯ c p ∨ ¯ q ∨ c d q q p c → a a c b b lchew@andrew.cmu.edu 9 / 16

  29. Logging Swaps in DRAT ATA RATE RATA ATE q ∨ a ∨ b ∨ c ¯ p ∨ a ∨ b ¯ p ∨ c ∨ b ¯ q ∨ a ∨ b ∨ c ¯ d d a ∨ ¯ a ∨ ¯ c ∨ ¯ a ∨ ¯ q ∨ ¯ ¯ b ∨ c p ∨ ¯ ¯ b p ∨ ¯ ¯ b q ∨ ¯ ¯ b ∨ c d d q ∨ a ∨ ¯ p ∨ a ∨ ¯ p ∨ c ∨ ¯ q ∨ a ∨ ¯ ¯ b ∨ ¯ c b b ¯ b ∨ ¯ c d d q ∨ ¯ ¯ a ∨ b ∨ ¯ c p ∨ ¯ a ∨ b p ∨ ¯ c ∨ b q ∨ ¯ ¯ a ∨ b ∨ ¯ c d d q ∨ ¯ a ∨ b ∨ c p ∨ q ∨ c ¯ p ∨ q ∨ a ¯ q ∨ ¯ a ∨ b ∨ c d d q ∨ a ∨ ¯ q ∨ a ∨ ¯ p ∨ ¯ ¯ q ∨ ¯ p ∨ ¯ ¯ q ∨ ¯ b ∨ c c a b ∨ c d d q ∨ a ∨ b ∨ ¯ c p ∨ q ∨ ¯ c p ∨ q ∨ ¯ a q ∨ a ∨ b ∨ ¯ c d d a ∨ ¯ a ∨ ¯ q ∨ ¯ b ∨ ¯ c p ∨ ¯ q ∨ c p ∨ ¯ q ∨ a q ∨ ¯ b ∨ ¯ c d d q q q p p c a → → a a c c b b b lchew@andrew.cmu.edu 9 / 16

  30. Rebalancing x 6 x 6 t 3 x 5 t 3 t 2 x 5 x 4 t 1 t 2 t 1 x 3 x 1 x 2 x 4 x 3 x 1 x 2 Internal nodes can be swapped to balance the tree. By divide and conquer this is O ( n log n ) to make a linear tree log depth. lchew@andrew.cmu.edu 10 / 16

  31. Complexity Rebalancing the tree is O ( n log n ) because each level needs up to n / 2 swaps. And there will be log n levels. Every transposition swap between two leaves, takes at most 4 log n . There is a maximum of n transpositions. The rebalancing needs to be undone which takes O ( n log n ) The formulas are now in the Dubois family and can be refuted by an O ( n ) size resolution proof. O ( n log n ) + n · 4 log n + O ( n log n ) + O ( n ) = O ( n log n ) lchew@andrew.cmu.edu 11 / 16

  32. Experimental Setup We ran a program rParSort that generated a random instance of reordered parity and also generated a DRAT proof based on the aforementioned O ( n log n ) technique. rParSort proofs were very compact- 150MB for n = 1000. We compare the size of our proofs by ones produced by the state-of-the-art SAT solver CaDiCaL Another technique EBDDRES, solves the instance using binary decision diagrams and turns the construction into an ER proof. CaDiCaL and EBDDRES could manage up to n = 45, but started reaching > 5000 seconds time-outs, afterwards. lchew@andrew.cmu.edu 12 / 16

  33. Comparisons I 10 8 10 7 CaDiCaL 10 6 EBDDRES rParSort 10 5 10 4 34 36 38 40 42 44 46 n lchew@andrew.cmu.edu 13 / 16

  34. Comparisons II (Not in Paper) 10 8 10 7 rParSort EBDDRES quant. elim. 10 6 500 1,000 1,500 2,000 2,500 3,000 n lchew@andrew.cmu.edu 14 / 16

  35. Summary Reordered parity constraints are hard for CDCL without Gaussian elimination Sorting the leaves can give an O ( n log n ) short proofs. The DRAT proof we have create no new variables, instead re-use existing ones. We have a working algorithm generating these short proofs, and these are outperforming all other existing tools. lchew@andrew.cmu.edu 15 / 16

  36. Further Work The current algorithm assumes the structure of the tree, this can be made automatic. Reordered parity formulas are special cases of Tseitin graphs [Tseitin 1968]. We plan to generalise our technique for refutations of Tseitin formulas. The original problem was because Gaussian elimination does not support proofs. With adaptation we can use this sorting tool to help resolve two xor-constraints and simulate Gaussian elimination. lchew@andrew.cmu.edu 16 / 16

Recommend


More recommend