Introduction Optimally propagating encodings Framework Conclusion Optimally Propagating SAT Encodings Martin Brain, Liana Hadarean , Ruben Martins and Daniel Kroening Oxford University July 18, 2015 1 / 29
Introduction Optimally propagating encodings Framework Conclusion A COMMON PICTURE Verification Tool Program CBMC KLEE Proof + C/E ... Spec Boogie GPUVerify SAT Solver 2 / 29
Introduction Optimally propagating encodings Framework Conclusion A COMMON PICTURE Verification Tool Program CBMC KLEE Proof + C/E ... Spec Boogie GPUVerify Encoding SAT Solver 2 / 29
Introduction Optimally propagating encodings Framework Conclusion A COMMON PICTURE Verification Tool Program CBMC KLEE Proof + C/E ... Spec Boogie GPUVerify SMT Solver Encoding SAT Solver 2 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance 3 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance ◮ reverse engineer bad encodings within the SAT solver! [ biere2014 ] 3 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance ◮ reverse engineer bad encodings within the SAT solver! [ biere2014 ] How to design good encodings? 3 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance ◮ reverse engineer bad encodings within the SAT solver! [ biere2014 ] How to design good encodings? ◮ a bit of a “dark” art 3 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance ◮ reverse engineer bad encodings within the SAT solver! [ biere2014 ] How to design good encodings? ◮ a bit of a “dark” art ◮ smaller is better 3 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance ◮ reverse engineer bad encodings within the SAT solver! [ biere2014 ] How to design good encodings? ◮ a bit of a “dark” art ◮ smaller is better ◮ but not always 3 / 29
Introduction Optimally propagating encodings Framework Conclusion SAT E NCODINGS Modular - optimize encoding offline and reuse template. Essential for SAT solver performance ◮ reverse engineer bad encodings within the SAT solver! [ biere2014 ] How to design good encodings? ◮ a bit of a “dark” art ◮ smaller is better ◮ but not always SOTA: try, test and pick the best! 3 / 29
Introduction Optimally propagating encodings Framework Conclusion H OW TO DESIGN SAT SOLVER FRIENDLY ENCODINGS ? 1 Known as propagation completeness in AI knowledge compilation. 4 / 29
Introduction Optimally propagating encodings Framework Conclusion H OW TO DESIGN SAT SOLVER FRIENDLY ENCODINGS ? ◮ property of interest: propagation power 1 Known as propagation completeness in AI knowledge compilation. 4 / 29
Introduction Optimally propagating encodings Framework Conclusion H OW TO DESIGN SAT SOLVER FRIENDLY ENCODINGS ? ◮ property of interest: propagation power Can all logically entailed literals be inferred by unit propagation? 1 Known as propagation completeness in AI knowledge compilation. 4 / 29
Introduction Optimally propagating encodings Framework Conclusion H OW TO DESIGN SAT SOLVER FRIENDLY ENCODINGS ? ◮ property of interest: propagation power Can all logically entailed literals be inferred by unit propagation? ◮ automatically generate optimally propagating encodings 1 1 Known as propagation completeness in AI knowledge compilation. 4 / 29
Introduction Optimally propagating encodings Framework Conclusion H OW TO DESIGN SAT SOLVER FRIENDLY ENCODINGS ? ◮ property of interest: propagation power Can all logically entailed literals be inferred by unit propagation? ◮ automatically generate optimally propagating encodings 1 ◮ abstract satisfaction framework for encodings 1 Known as propagation completeness in AI knowledge compilation. 4 / 29
Introduction Optimally propagating encodings Framework Conclusion P RELIMINARIES Σ variables v l ∈ { v , ¬ v } literal C Σ clauses c = l 1 ∨ . . . ∨ l n 5 / 29
Introduction Optimally propagating encodings Framework Conclusion P RELIMINARIES Σ variables v l ∈ { v , ¬ v } literal C Σ clauses c = l 1 ∨ . . . ∨ l n A Σ assignments a : Σ → {⊥ , ⊤} p : Σ → {⊥ , ? , ⊤} P Σ partial assignments 5 / 29
Introduction Optimally propagating encodings Framework Conclusion P RELIMINARIES Σ variables v l ∈ { v , ¬ v } literal C Σ clauses c = l 1 ∨ . . . ∨ l n A Σ assignments a : Σ → {⊥ , ⊤} p : Σ → {⊥ , ? , ⊤} P Σ partial assignments UP : ( 2 C Σ × P Σ ) → P Σ unit propagation 5 / 29
Introduction Optimally propagating encodings Framework Conclusion P RELIMINARIES Σ variables v l ∈ { v , ¬ v } literal C Σ clauses c = l 1 ∨ . . . ∨ l n A Σ assignments a : Σ → {⊥ , ⊤} p : Σ → {⊥ , ? , ⊤} P Σ partial assignments UP : ( 2 C Σ × P Σ ) → P Σ unit propagation � l ∨ l 1 ∨ . . . ∨ l k ∈ C p [ l ← ⊤ ] p ( l i ) = ⊥ and p ( l ) =? 5 / 29
Introduction Optimally propagating encodings Framework Conclusion F ULL - ADDER E XAMPLE Truth table: c in a b c in c out s a b 1 1 1 1 1 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 c out s 0 0 0 0 0 6 / 29
Introduction Optimally propagating encodings Framework Conclusion F ULL - ADDER E XAMPLE Encoding: c in a b {¬ a , ¬ b , c in , ¬ s } {¬ a , b , ¬ c in , ¬ s } { a , ¬ b , ¬ c in , ¬ s } { a , b , c in , ¬ s } {¬ a , ¬ b , ¬ c in , s } {¬ a , b , c in , s } { a , b , ¬ c in , s } { a , ¬ b , c in , s } {¬ a , ¬ b , c out } {¬ a , ¬ c in , c out } {¬ b , ¬ c in , c out } { a , b , ¬ c out } { a , c in , ¬ c out } { b , c in , ¬ c out } c out s 6 / 29
Introduction Optimally propagating encodings Framework Conclusion F ULL - ADDER E XAMPLE Encoding: c in a b {¬ a , ¬ b , c in , ¬ s } {¬ a , b , ¬ c in , ¬ s } { a , ¬ b , ¬ c in , ¬ s } { a , b , c in , ¬ s } {¬ a , ¬ b , ¬ c in , s } {¬ a , b , c in , s } { a , b , ¬ c in , s } { a , ¬ b , c in , s } {¬ a , ¬ b , c out } {¬ a , ¬ c in , c out } {¬ b , ¬ c in , c out } { a , b , ¬ c out } { a , c in , ¬ c out } { b , c in , ¬ c out } c out s 6 / 29
Introduction Optimally propagating encodings Framework Conclusion O PTIMALLY PROPAGATING ENCODINGS We want to encode a model M ⊂ A Σ (the truth table) using a set of clauses E M ⊂ C Σ such that: E M = { C ⊂ C Σ | AofC ( C ) = M } where: AofC ( C ) = { a ∈ A Σ |∀ c ∈ C � a | = c } 7 / 29
Introduction Optimally propagating encodings Framework Conclusion O PTIMALLY PROPAGATING ENCODINGS We want to encode a model M ⊂ A Σ (the truth table) using a set of clauses E M ⊂ C Σ such that: E M = { C ⊂ C Σ | AofC ( C ) = M } where: AofC ( C ) = { a ∈ A Σ |∀ c ∈ C � a | = c } Optimally propagating encoding E is optimally propagating if E ∧ p | = l then UP ( E , p )( l ) = ⊤ . 7 / 29
Introduction Optimally propagating encodings Framework Conclusion F ULL - ADDER E XAMPLE Encoding: c in a b {¬ a , ¬ b , c in , ¬ s } {¬ a , b , ¬ c in , ¬ s } { a , ¬ b , ¬ c in , ¬ s } { a , b , c in , ¬ s } {¬ a , ¬ b , ¬ c in , s } {¬ a , b , c in , s } { a , b , ¬ c in , s } { a , ¬ b , c in , s } {¬ a , ¬ b , c out } {¬ a , ¬ c in , c out } {¬ b , ¬ c in , c out } { a , b , ¬ c out } { a , c in , ¬ c out } { b , c in , ¬ c out } c out s Is this optimally propagating? 8 / 29
Introduction Optimally propagating encodings Framework Conclusion F ULL - ADDER E XAMPLE Encoding: c in a b {¬ a , ¬ b , c in , ¬ s } {¬ a , b , ¬ c in , ¬ s } { a , ¬ b , ¬ c in , ¬ s } { a , b , c in , ¬ s } {¬ a , ¬ b , ¬ c in , s } {¬ a , b , c in , s } { a , b , ¬ c in , s } { a , ¬ b , c in , s } {¬ a , ¬ b , c out } {¬ a , ¬ c in , c out } {¬ b , ¬ c in , c out } { a , b , ¬ c out } { a , c in , ¬ c out } { b , c in , ¬ c out } c out s p = [ s , c out ] UP ( E , p ) = p 8 / 29
Introduction Optimally propagating encodings Framework Conclusion F ULL - ADDER E XAMPLE Encoding: c in a b {¬ a , ¬ b , c in , ¬ s } {¬ a , b , ¬ c in , ¬ s } { a , ¬ b , ¬ c in , ¬ s } { a , b , c in , ¬ s } {¬ a , ¬ b , ¬ c in , s } {¬ a , b , c in , s } { a , b , ¬ c in , s } { a , ¬ b , c in , s } {¬ a , ¬ b , c out } {¬ a , ¬ c in , c out } {¬ b , ¬ c in , c out } { a , b , ¬ c out } { a , c in , ¬ c out } { b , c in , ¬ c out } c out s p = [ s , c out , ¬ a ] 8 / 29
Introduction Optimally propagating encodings Framework Conclusion A UTOMATICALLY STRENGTHEN ENCODINGS Given: ◮ initial encoding E 0 ◮ reference encoding E ref 9 / 29
Introduction Optimally propagating encodings Framework Conclusion A UTOMATICALLY STRENGTHEN ENCODINGS Given: ◮ initial encoding E 0 ◮ reference encoding E ref Return an encoding E such that: 9 / 29
Recommend
More recommend