Simplifying Pseudo-Boolean Constraints in Residual Number Systems - - PowerPoint PPT Presentation

simplifying pseudo boolean constraints
SMART_READER_LITE
LIVE PREVIEW

Simplifying Pseudo-Boolean Constraints in Residual Number Systems - - PowerPoint PPT Presentation

Simplifying Pseudo-Boolean Constraints in Residual Number Systems Michael Codish Department of Computer Science Ben Gurion University Beer-Sheva , Israel Joint work: Yoav Fekete SAT 2014 Chinese Remainder Theorem Chinese Remainder Theorem


slide-1
SLIDE 1

Simplifying Pseudo-Boolean Constraints in Residual Number Systems

Michael Codish

Department of Computer Science Ben Gurion University Beer-Sheva , Israel Joint work: Yoav Fekete

SAT 2014

slide-2
SLIDE 2

Chinese Remainder Theorem

slide-3
SLIDE 3

Chinese Remainder Theorem

All integers are uniquely represented:

Residual Number Systems (RNS)

slide-4
SLIDE 4

Chinese Remainder Theorem

Simplify Constraints

slide-5
SLIDE 5

Chinese Remainder Theorem

Simplify Constraints

slide-6
SLIDE 6

Example: Pythagorean triples

slide-7
SLIDE 7

Example: Pythagorean triples

slide-8
SLIDE 8

Example: Pythagorean triples

slide-9
SLIDE 9

Example: Pythagorean triples

Breaks the search into smaller (almost independent) parts Failure (unsat) in one part implies failure of the original constraint Enhanced propagation (wrt congruences)

slide-10
SLIDE 10

Apply the Chinese Remainder Theorem to Simplify Pseudo-Boolean Constraints

Boolean Variables Equality (*)

slide-11
SLIDE 11

Example I

Solving this pb constraint is the same as solving these pb mod constraints:

slide-12
SLIDE 12

Example I

Solving this pb constraint is the same as solving these pb mod constraints: note that base smaller coefficients

slide-13
SLIDE 13

Example I

1 2 Solving these is “easy”:

slide-14
SLIDE 14

Example I

1 3 4 2 Solving these is “easy”:

slide-15
SLIDE 15

Example II

Solving this pb constraint is the same as solving these pb mod constraints:

slide-16
SLIDE 16

Example II

Solving this pb constraint is the same as solving these pb mod constraints: unsat

slide-17
SLIDE 17

Outline of the (rest of the) Talk

PB Constraint PB mod Constraints

RNS Base

1 previous work: encode to SAT

  • ur approach: encode to PB constraints

Theme A: bit-blasting (modulo arithmetic) (wrt which number representation?)

How to solve them?

slide-18
SLIDE 18

Outline of the (rest of the) Talk

PB Constraint PB mod Constraints

RNS Base

2 Theme B: optimal base problems

How to select the base?

slide-19
SLIDE 19

Outline of the (rest of the) Talk

PB Constraint PB mod Constraints

RNS Base

2 Theme B: optimal base problems

How to select the base?

3

Experimental evaluation

4

Conclusion

slide-20
SLIDE 20

PB Constraint PB mod Constraints

RNS Base

1

How to solve them?

slide-21
SLIDE 21

Encoding PB Constraints – Phase 1

smaller coefficients

slide-22
SLIDE 22

Example: Phase 1

smaller coefficients

slide-23
SLIDE 23

Encoding PB Constraints – Phase 2

integer variables

slide-24
SLIDE 24

Encoding PB Constraints – Phase 2

integer variables but not yet pb constraints

slide-25
SLIDE 25

Encoding PB Constraints – Phase 3

bit blast (binary)

pb constraints

slide-26
SLIDE 26

Encoding PB Constraints – Phase 3

bit blast (binary)

but ?

slide-27
SLIDE 27

Bit Blasting the modulo

bit blast (binary)

slide-28
SLIDE 28
slide-29
SLIDE 29

Example: Phase 3

slide-30
SLIDE 30
slide-31
SLIDE 31

same pb constraint, different base, unary bit-blast

slide-32
SLIDE 32

PB Constraint PB mod Constraints

RNS Base

2

How to select the base?

For a multiset of integers S choose an RNS base B to represent (all) sums of elements from S.

slide-33
SLIDE 33

k is the smallest number such that

Naive RNS Bases (from previous work)

first k primes

Prime base: Prime powers base:

slide-34
SLIDE 34

Naive RNS Bases are determined by and completely ignore the actual elements We seek an RNS base that “nullifies” as many as possible elements from S

how many elements of S are “nullified” by p how many elements of S are “nullified” by

slide-35
SLIDE 35
slide-36
SLIDE 36

Prime base: Prime powers base

  • ptV base

select primes to maximize this sequence (lex order) primes smaller than max(S); and is not “too big”

keeps the search space finite

slide-37
SLIDE 37

Prime bas: Prime powers base

  • ptC base

select primes to minimize the number of clauses in the CNF encoding

primes smaller than max(S); and …

  • ptV base

parameterized by the various encoding choices

slide-38
SLIDE 38

3

Experimental evaluation

pb solvers (x4): Sat4J (resolution) add (MiniSAT+) bdd (MiniSAT+) sort (MiniSAT++)

Four underlying pb constraint solvers (and a few more) (and the solver for pb mod constraints from)

infused with use of

  • ptimal mixed-radix

base

slide-39
SLIDE 39

3

Experimental evaluation base selection (x4) prime, optV, optC, prime-power bit-blast (x3) unary, binary, mixed-radix

benchmarks

PB12 (DEC-INT-LIN) RNP (random number partions)

Decompose PB constraints to “smaller” PB constraints Two sets of benchmarks

largest constraint has 106 coefficients & largest coefficient is 106,925,262

slide-40
SLIDE 40

PB12: Best solving times (sec) – without and with RNS

slide-41
SLIDE 41

PB12: Best solving times (sec) – without and with RNS solver base bit-blast

slide-42
SLIDE 42

RNPa: Best solving times (sec) – without and with RNS when bdd fits in memory it rules

25 coefficients; 25 bit (random number)

slide-43
SLIDE 43

RNPb: Best solving times (sec) – without and with RNS When bdd is too big, RNS decomposition kicks in (decomposed bdd is smaller)

slide-44
SLIDE 44

RNPc: Best solving times (sec) – without and with RNS

slide-45
SLIDE 45

4

Conclusions

RNS Decomposition has previously been applied to solve PB constraints (a starting point for our work). They provide a direct encoding of PB Mod constraints to CNF and apply a SAT solver. We do it differently: Bit-blast the modulo arithmetic encoding to PB

  • constraints. Then, any PB constraint solver can be

applied. This leads to two themes:

slide-46
SLIDE 46

4

Conclusions

Theme A: Bit-blasting. It is not a “technique”; it is a whole range of techniques: unary, binary, mixed-radix. Theme B: Optimal Base Problems. Which base gives a better encoding for a particular instance. We have seen this type of problem before in the context of mixed radix bases.