incremental encoding of pseudo boolean goal functions
play

Incremental Encoding of Pseudo-Boolean Goal Functions based on - PowerPoint PPT Presentation

Incremental Encoding of Pseudo-Boolean Goal Functions based on Comparator Networks Micha l Karpi nski , Marek Piotr ow Institute of Computer Science University of Wroc law Poland 6 July 2020 Outline 1 Definitions and motivation 2


  1. Incremental Encoding of Pseudo-Boolean Goal Functions based on Comparator Networks Micha� l Karpi´ nski , Marek Piotr´ ow Institute of Computer Science University of Wroc� law Poland 6 July 2020

  2. Outline 1 Definitions and motivation 2 New encoding and analysis 3 Experimental evaluation 4 Conclusions Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  3. Definitions and motivation Pseudo-Boolean Optimization Problem: minimize a 1 x 1 + a 2 x 2 + · · · + a n x n s.t. b 1 , 1 x 1 + b 1 , 2 x 2 + · · · + b 1 , n x n ≤ k 1 , b 2 , 1 x 1 + b 2 , 2 x 2 + · · · + b 2 , n x n ≤ k 2 , . . . b m , 1 x 1 + b m , 2 x 2 + · · · + b m , n x n ≤ k m , where x i − literals , a i , b i , j , k i ∈ Z , i = 1 , . . . , n , j = 1 , . . . , m Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  4. Definitions and motivation Applications: cumulative scheduling logic synthesis logic verification Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  5. Definitions and motivation Incremental algorithm: 1 Guess the initial bound on the goal function, 2 Translate an input instance into a Boolean formula, 3 Use a SAT-solver to check if the formula is satisfiable, 4 Strengthen (or relax) the constraint depending on SAT-solver output, 5 Translate the goal function into a Boolean formula for the new bound, 6 Repeat from Step 3 until the optimum is found. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  6. Definitions and motivation Our contribution: Eliminate Step 5: Translate the goal function into a Boolean formula for the new bound. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  7. Definitions and motivation Bather’s odd-even sorting network (1968) Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  8. Definitions and motivation a c = max(a,b) b d = min(a,b) Bather’s odd-even sorting network (1968) Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  9. Definitions and motivation c = a ∨ b a d = a ∧ b b Bather’s odd-even sorting network (1968) Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  10. Definitions and motivation c = a ∨ b a d = a ∧ b b a ⇒ c , b ⇒ c , Bather’s odd-even a ∧ b ⇒ d , sorting network (1968) c ⇒ a ∨ b , d ⇒ a , d ⇒ b . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  11. Definitions and motivation x 1 + x 2 + 2 x 3 + 4 x 4 < 3 c = a ∨ b a d = a ∧ b b a ⇒ c , b ⇒ c , Bather’s odd-even a ∧ b ⇒ d , sorting network (1968) c ⇒ a ∨ b , d ⇒ a , d ⇒ b . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  12. Definitions and motivation x 1 + x 2 + x 3 + x 3 + x 4 + x 4 + x 4 + x 4 < 3 c = a ∨ b a d = a ∧ b b a ⇒ c , b ⇒ c , Bather’s odd-even a ∧ b ⇒ d , sorting network (1968) c ⇒ a ∨ b , d ⇒ a , d ⇒ b . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  13. Definitions and motivation x 1 + x 2 + x 3 + x 3 + x 4 + x 4 + x 4 + x 4 < 3 c = a ∨ b a x y 1 1 x y 2 2 x y =0 3 3 x y 3 4 d = a ∧ b x y b 4 5 x y 4 6 x y 4 7 x y a ⇒ c , b ⇒ c , 4 8 Bather’s odd-even a ∧ b ⇒ d , sorting network (1968) c ⇒ a ∨ b , d ⇒ a , d ⇒ b . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  14. Definitions and motivation x 1 + x 2 + x 3 + x 3 + x 4 + x 4 + x 4 + x 4 < 3 c = a ∨ b a x y 1 1 x y 2 2 x y =0 3 3 x y 3 4 d = a ∧ b x y b 4 5 x y 4 6 x y 4 7 x y a ⇒ c , b ⇒ c , 4 8 Bather’s odd-even a ∧ b ⇒ d . sorting network (1968) Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  15. Definitions and motivation 3 x 1 + 2 x 2 + 4 x 3 ≤ 5 , 30001 x 1 + 19999 x 2 + 39998 x 3 ≤ 50007 Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  16. Definitions and motivation 3 x 1 + 2 x 2 + 4 x 3 ≤ 5 , 30001 x 1 + 19999 x 2 + 39998 x 3 ≤ 50007 (¯ x 1 ∨ ¯ x 3 ) ∧ (¯ x 2 ∨ ¯ x 3 ) Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  17. Mixed Radix Base Technique Mixed Radix Base Technique by Niklas E´ en and Niklas S¨ orensson (2006) – authors of MiniSat+ . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  18. Mixed Radix Base Technique Mixed Radix Base Technique by Niklas E´ en and Niklas S¨ orensson (2006) – authors of MiniSat+ . Positive integer d = � d 0 , . . . , d m − 1 � . Base B is a sequence of positive integers � r 0 , . . . , r m − 1 � . The value of d is v = d 0 w 0 + d 1 w 1 + d 2 w 2 + · · · + d m − 1 w m − 1 where w 0 = 1 and for i ≥ 0, w i +1 = w i r i . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  19. Mixed Radix Base Technique Mixed Radix Base Technique by Niklas E´ en and Niklas S¨ orensson (2006) – authors of MiniSat+ . Positive integer d = � d 0 , . . . , d m − 1 � . Base B is a sequence of positive integers � r 0 , . . . , r m − 1 � . The value of d is v = d 0 w 0 + d 1 w 1 + d 2 w 2 + · · · + d m − 1 w m − 1 where w 0 = 1 and for i ≥ 0, w i +1 = w i r i . Example: The number � 2 , 4 , 10 � B in base B = � 3 , 5 � is interpreted as: 2 × 1 + 4 × 3 + 10 × 15 = 164 (values of w i ’s in boldface). Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  20. Mixed Radix Base Technique For PB-constraint with coefficients { a 1 , . . . , a n } do: 1 Find a ”suitable” finite base B for the set of coefficients. 2 For each element w i (computed from B ) construct a sorting network where the inputs to i -th sorter will be those digits d (from the coefficients) where d i is non-zero, plus the potential carry bits from the ( i − 1)-th sorter. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  21. Mixed Radix Base Technique 2 x 1 + 2 x 2 + 2 x 3 + 2 x 4 + 5 x 5 + 18 x 6 ≤ 22, B = � 2 , 3 , 3 � 1 · ( x 5 ) + 2 · ( x 1 + x 2 + x 3 + x 4 + 2 x 5 ) + 6 · (0) + 18 · ( x 6 ) y 6 x 1 1 2 6 18 x 2 y 5 3 D x 3 y 4 O M x 4 y 3 y 6 x 5 y 2 x 5 x 5 y 1 y 3 x 6 2 l 2 6 l 2 1 2 6 18 l 1 l 1 l 1 l 1 22 = � 0 , 2 , 0 , 1 � B Enforce a constraint ≤ 22: ( l 18 ⇒ ¬ l 6 1 ) ∧ ( l 18 ⇒ ¬ ( l 2 2 ∧ l 1 1 )). 1 1 Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  22. Mixed Radix Base Technique Simplification of the inequality ( NaPS ): Add 13 = � 1 , 0 , 2 , 0 � B to both sides: 2 x 1 + 2 x 2 + 2 x 3 + 2 x 4 + 5 x 5 + 18 x 6 + 13 < 36, B = � 2 , 3 , 3 � 36 = � 0 , 0 , 0 , 2 � B 1 · (1 + x 5 ) + 2 · ( x 1 + x 2 + x 3 + x 4 + 2 x 5 ) + 6 · (1 + 1) + 18 · ( x 6 ) Enforce a constraint < 36: ¬ l 18 2 . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  23. New encoding and analysis Our improvement: use assumptions rather than constant 1’s. Assumptions is a mechanism, which allows to accumulate and reuse knowledge from one iteration to the next and, in consequence, the provided input formula need not to be rebuilt during computation. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  24. New encoding and analysis 2 x 1 + 2 x 2 + 2 x 3 + 2 x 4 + 5 x 5 + 18 x 6 ≤ 22, B = � 2 , 3 , 3 � Idea: create assumption variables z 1 1 , z 2 1 , z 2 2 , z 6 1 , z 6 2 . 1 · ( z 1 1 + x 5 )+ 2 · ( z 2 1 + z 2 2 + x 1 + x 2 + x 3 + x 4 +2 x 5 )+ 6 · ( z 6 1 + z 6 2 )+ 18 · ( x 6 ) 1 2 z 2 2 6 z 2 6 z 1 z 1 z 1 x 1 1 2 6 18 x 2 x 3 x 4 x 5 x 5 x 6 x 5 18 18 l 2 l 1 Enforce < 36: set z 1 1 = 1, z 2 1 = z 2 2 = 0, z 6 1 = z 6 2 = 1, and add ¬ l 18 2 . Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  25. Experimental evaluation KP-MiniSat+ (https://github.com/karpiu/kp-minisatp). SAT-solver used is COMiniSatPS by Chanseok Oh. Three variants: KP-MSP++ – new algorithm with assumptions processing improvement due to Hickey and Bacchus (2019), KP-MSP+- – new algorithm but without the improvement, KP-MSP– – without new algorithm and improvement. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  26. Experimental evaluation Solvers: PBLib - ver. 1.2.1, by Tobias Philipp and Peter Steinke, NaPS - ver. 1.02b by Masahiko Sakai and Hidetomo Nabeshima, MS+ - original MiniSat+ by E´ en and S¨ orensson, MS+COM - MiniSat+ with COMiniSatPS as an underlying SAT-solver. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

  27. Experimental evaluation Machines: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz. Timeout limit: 1800 seconds. Memory limit: 15 GB. Micha� l Karpi´ nski, Marek Piotr´ ow Incr. Enc. of PB Goal Fun. based on Comparator Networks

Recommend


More recommend