SAT by MaxSAT From NP to Beyond NP and Back Again Joao Marques-Silva (joint work with A. Ignatiev and A. Morgado) University of Lisbon, Portugal RTiKC Dagstuhl Seminar Schloss Dagstuhl, Germany September 2017 1 / 33
Why “SAT by MaxSAT”? Knowledge Compilation Horn LUBs Empowerment Non-Clausal Other Primes Problems Maximum Hitting Set Satisfiability Dualization (MaxSAT) MaxHS Horn MaxSAT MaxSAT Resolution SAT to Horn MaxSAT Core- Guided Polynomial Time MaxSAT Refutations for PHP 2 / 33
Outline Maximum Satisfiability Pigeonhole Formulas From SAT to Horn MaxSAT Polynomial Time Refutations of PHP Experimental Results ? 3 / 33
Outline Maximum Satisfiability Pigeonhole Formulas From SAT to Horn MaxSAT Polynomial Time Refutations of PHP Experimental Results ? 4 / 33
What is Maximum Satisfiability (MaxSAT)? ¬ x 1 x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ¬ x 4 ∨ x 5 ¬ x 3 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 5 / 33
What is Maximum Satisfiability (MaxSAT)? ¬ x 1 x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ¬ x 4 ∨ x 5 ¬ x 3 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 • Given unsatisfiable formula 5 / 33
What is Maximum Satisfiability (MaxSAT)? ¬ x 1 x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ¬ x 4 ∨ x 5 ¬ x 3 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 • Given unsatisfiable formula, find largest satisfiable subset of clauses 5 / 33
What is Maximum Satisfiability (MaxSAT)? ¬ x 1 x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ¬ x 4 ∨ x 5 ¬ x 3 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 • Given unsatisfiable formula, find largest satisfiable subset of clauses Hard Clauses? MaxSAT Variants No Yes No Plain Partial Weights? Yes Weighted Weighted Partial • Many practical applications [e.g. SZGN17] 5 / 33
Many algorithms for practical MaxSAT No unit prop; Branch No cl. learning & Bound Relax cls given Model All cls relaxed Iterative models Guided MaxSAT Algorithms Iterative Relax cls given Iterative Core unsat cores MHS & SAT MHS Guided 6 / 33
Many algorithms for practical MaxSAT No unit prop; Branch No cl. learning & Bound Relax cls given Model All cls relaxed Iterative models Guided MaxSAT Algorithms Iterative Relax cls given Iterative Core unsat cores MHS & SAT MHS Guided • Most effective in practice: iterative MHS & core-guided [Many refs...] – Solving formulas with tens/hundreds of thousands of clauses, and more – Instantiations of problem solving with SAT oracles 6 / 33
A core-guided algorithm (MSU3) ¬ x 1 x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ¬ x 4 ∨ x 5 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 ¬ x 3 Example CNF formula 7 / 33
A core-guided algorithm (MSU3) ¬ x 1 x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ¬ x 4 ∨ x 5 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 ¬ x 3 Formula is UNSAT; OPT ≤ | ϕ | − 1; Get unsat core 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 6 i =1 r i ≤ 1 Add relaxation variables and AtMost k , k = 1, constraint 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ¬ x 6 ∨ x 2 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ¬ x 7 ∨ x 5 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 6 i =1 r i ≤ 1 Formula is (again) UNSAT; OPT ≤ | ϕ | − 2; Get unsat core 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ∨ r 7 ¬ x 6 ∨ x 2 ∨ r 8 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ∨ r 9 ¬ x 7 ∨ x 5 ∨ r 10 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 10 i =1 r i ≤ 2 Add new relaxation variables and update AtMost k , k=2, constraint 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ∨ r 7 ¬ x 6 ∨ x 2 ∨ r 8 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ∨ r 9 ¬ x 7 ∨ x 5 ∨ r 10 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 10 i =1 r i ≤ 2 Instance is now SAT 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ∨ r 7 ¬ x 6 ∨ x 2 ∨ r 8 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ∨ r 9 ¬ x 7 ∨ x 5 ∨ r 10 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 10 i =1 r i ≤ 2 MaxSAT solution is | ϕ | − I = 12 − 2 = 10 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ∨ r 7 ¬ x 6 ∨ x 2 ∨ r 8 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ∨ r 9 ¬ x 7 ∨ x 5 ∨ r 10 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 10 i =1 r i ≤ 2 MaxSAT solution is | ϕ | − I = 12 − 2 = 10 Relaxed soft clauses AtMost k /PB constraints used become hard 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ∨ r 7 ¬ x 6 ∨ x 2 ∨ r 8 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ∨ r 9 ¬ x 7 ∨ x 5 ∨ r 10 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 � 10 i =1 r i ≤ 2 MaxSAT solution is | ϕ | − I = 12 − 2 = 10 Some clauses Relaxed soft clauses AtMost k /PB constraints used not relaxed become hard 7 / 33
A core-guided algorithm (MSU3) x 6 ∨ x 2 ∨ r 7 ¬ x 6 ∨ x 2 ∨ r 8 ¬ x 2 ∨ x 1 ∨ r 1 ¬ x 1 ∨ r 2 ¬ x 6 ∨ x 8 x 6 ∨ ¬ x 8 x 2 ∨ x 4 ∨ r 3 ¬ x 4 ∨ x 5 ∨ r 4 x 7 ∨ x 5 ∨ r 9 Note: # of SAT oracle calls ¬ x 7 ∨ x 5 ∨ r 10 ¬ x 5 ∨ x 3 ∨ r 5 ¬ x 3 ∨ r 6 grows linear with solution cost! � 10 i =1 r i ≤ 2 MaxSAT solution is | ϕ | − I = 12 − 2 = 10 Some clauses Relaxed soft clauses AtMost k /PB constraints used not relaxed become hard 7 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = ∅ • Find MHS of K : 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = ∅ • Find MHS of K : ∅ 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = ∅ • Find MHS of K : ∅ • SAT( F \ ∅ )? 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = ∅ • Find MHS of K : ∅ • SAT( F \ ∅ )? No 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = ∅ • Find MHS of K : ∅ • SAT( F \ ∅ )? No • Core of F : { c 1 , c 2 , c 3 , c 4 } 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = {{ c 1 , c 2 , c 3 , c 4 }} • Find MHS of K : ∅ • SAT( F \ ∅ )? No • Core of F : { c 1 , c 2 , c 3 , c 4 } . Update K 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = {{ c 1 , c 2 , c 3 , c 4 }} • Find MHS of K : 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = {{ c 1 , c 2 , c 3 , c 4 }} • Find MHS of K : E.g. { c 1 } 8 / 33
MaxSAT with Minimum Hitting Sets (MHS) c 1 = x 6 ∨ x 2 c 2 = ¬ x 6 ∨ x 2 c 3 = ¬ x 2 ∨ x 1 c 4 = ¬ x 1 c 5 = ¬ x 6 ∨ x 8 c 6 = x 6 ∨ ¬ x 8 c 7 = x 2 ∨ x 4 c 8 = ¬ x 4 ∨ x 5 c 12 = ¬ x 3 c 9 = x 7 ∨ x 5 c 10 = ¬ x 7 ∨ x 5 c 11 = ¬ x 5 ∨ x 3 K = {{ c 1 , c 2 , c 3 , c 4 }} • Find MHS of K : E.g. { c 1 } • SAT( F \ { c 1 } )? 8 / 33
Recommend
More recommend