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

sorting parity encodings by reusing variables
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 2

Problem Statement

Suppose we have a permutation σ on [n]. The two xor constraints: x1 ⊕ x2 ⊕ · · · ⊕ xn = 0 ∧ xσ(1) ⊕ xσ(2) ⊕ · · · ⊕ xσ(n) = 1 are a contradiction. Tseitin variables ti and si represent the reordered parity: t1 = x1 ⊕ x2 s1 = xσ(1) ⊕ xσ(2) ti−1 = ti−2 ⊕ xi si−1 = sσ(i−2) ⊕ xσ(i) for i = 3 to n − 2 tn−3 ⊕ xn−1 ⊕ ¯ xn sσ(n−3) ⊕ xσ(n−1) ⊕ xσ(n) We can represent a = b ⊕ c in four clauses. ¯ a ∨ b ∨ c a ∨ ¯ b ∨ c a ∨ b ∨ ¯ c ¯ a ∨ ¯ b ∨ ¯ c

lchew@andrew.cmu.edu

2 / 16

slide-3
SLIDE 3

An Easy Special Case

A special case when the permutation is the identity map: x1 ⊕ x2 ⊕ · · · ⊕ xn = 0 ∧ x1 ⊕ x2 ⊕ · · · ⊕ xn = 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

slide-4
SLIDE 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

slide-5
SLIDE 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

slide-6
SLIDE 6

Generated Proofs

CDCL on reordered parity formulas appear exponential. 34 36 38 40 42 44 46 106 107 n

  • no. of DRAT lines

CaDiCaL

lchew@andrew.cmu.edu

6 / 16

slide-7
SLIDE 7

Solving Unordered Parity by Sorting

We can use swaps to turn xσ(1) ⊕ xσ(2) ⊕ · · · ⊕ xσ(n) = 1 into x1 ⊕ x2 ⊕ · · · ⊕ xn = 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(n2) in the worst case. For a log depth tree this is O(n log n).

lchew@andrew.cmu.edu

7 / 16

slide-8
SLIDE 8

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-9
SLIDE 9

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-10
SLIDE 10

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-11
SLIDE 11

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-12
SLIDE 12

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-13
SLIDE 13

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-14
SLIDE 14

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-15
SLIDE 15

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-16
SLIDE 16

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-17
SLIDE 17

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x2 x3 x4 x5 x6 x7 x8

lchew@andrew.cmu.edu

8 / 16

slide-18
SLIDE 18

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-19
SLIDE 19

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-20
SLIDE 20

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-21
SLIDE 21

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-22
SLIDE 22

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-23
SLIDE 23

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-24
SLIDE 24

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-25
SLIDE 25

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-26
SLIDE 26

Sorting a Log Depth Tree

X X

t7 t4 t3 t2 t1 t5 t6

x1 x7 x3 x4 x5 x6 x2 x8

lchew@andrew.cmu.edu

8 / 16

slide-27
SLIDE 27

Logging Swaps in DRAT

Suppose we have two Tseitin variables p and q, p = a ⊕ b and q = p ⊕ c

q p a b c

lchew@andrew.cmu.edu

9 / 16

slide-28
SLIDE 28

Logging Swaps in DRAT

ATA ¯ q ∨ a ∨ b ∨ c ¯ q ∨ ¯ a ∨ ¯ b ∨ c ¯ q ∨ a ∨ ¯ b ∨ ¯ c ¯ q ∨ ¯ a ∨ b ∨ ¯ c q ∨ ¯ a ∨ b ∨ c q ∨ a ∨ ¯ b ∨ c q ∨ a ∨ b ∨ ¯ c q ∨ ¯ a ∨ ¯ b ∨ ¯ c RATE d ¯ p ∨ a ∨ b d ¯ p ∨ ¯ a ∨ ¯ b d p ∨ a ∨ ¯ b d p ∨ ¯ a ∨ b d ¯ p ∨ q ∨ c d ¯ p ∨ ¯ q ∨ ¯ c d p ∨ q ∨ ¯ c d p ∨ ¯ q ∨ c

q p a b c

q a b c

lchew@andrew.cmu.edu

9 / 16

slide-29
SLIDE 29

Logging Swaps in DRAT

ATA ¯ q ∨ a ∨ b ∨ c ¯ q ∨ ¯ a ∨ ¯ b ∨ c ¯ q ∨ a ∨ ¯ b ∨ ¯ c ¯ q ∨ ¯ a ∨ b ∨ ¯ c q ∨ ¯ a ∨ b ∨ c q ∨ a ∨ ¯ b ∨ c q ∨ a ∨ b ∨ ¯ c q ∨ ¯ a ∨ ¯ b ∨ ¯ c RATE d ¯ p ∨ a ∨ b d ¯ p ∨ ¯ a ∨ ¯ b d p ∨ a ∨ ¯ b d p ∨ ¯ a ∨ b d ¯ p ∨ q ∨ c d ¯ p ∨ ¯ q ∨ ¯ c d p ∨ q ∨ ¯ c d p ∨ ¯ q ∨ c RATA ¯ p ∨ c ∨ b ¯ p ∨ ¯ c ∨ ¯ b p ∨ c ∨ ¯ b p ∨ ¯ c ∨ b ¯ p ∨ q ∨ a ¯ p ∨ ¯ q ∨ ¯ a p ∨ q ∨ ¯ a p ∨ ¯ q ∨ a ATE d ¯ q ∨ a ∨ b ∨ c d ¯ q ∨ ¯ a ∨ ¯ b ∨ c d ¯ q ∨ a ∨ ¯ b ∨ ¯ c d ¯ q ∨ ¯ a ∨ b ∨ ¯ c d q ∨ ¯ a ∨ b ∨ c d q ∨ a ∨ ¯ b ∨ c d q ∨ a ∨ b ∨ ¯ c d q ∨ ¯ a ∨ ¯ b ∨ ¯ c

q p a b c

q a b c

q p c b a

lchew@andrew.cmu.edu

9 / 16

slide-30
SLIDE 30

Rebalancing

t3 t2 t1

x1 x2 x3 x4 x5 x6

t3 t2 t1

x1 x2 x3 x4 x5 x6 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

slide-31
SLIDE 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

slide-32
SLIDE 32

Experimental Setup

We ran a program rParSort that generated a random instance

  • f 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

slide-33
SLIDE 33

Comparisons I

34 36 38 40 42 44 46 104 105 106 107 108 n CaDiCaL EBDDRES rParSort

lchew@andrew.cmu.edu

13 / 16

slide-34
SLIDE 34

Comparisons II (Not in Paper)

500 1,000 1,500 2,000 2,500 3,000 106 107 108 n rParSort EBDDRES quant. elim.

lchew@andrew.cmu.edu

14 / 16

slide-35
SLIDE 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

slide-36
SLIDE 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