pluggable sat solvers for smt solvers
play

Pluggable SAT-Solvers for SMT-Solvers Bas Schaafsma DISI, - PowerPoint PPT Presentation

Introduction The DPLL and DPLL( T ) algorithms Architecture & Implementation Experimental Evaluation Demo Conclusion & Future Work Pluggable SAT-Solvers for SMT-Solvers Bas Schaafsma DISI, University of Trento & Fondazione Bruno


  1. Introduction The DPLL and DPLL( T ) algorithms Architecture & Implementation Experimental Evaluation Demo Conclusion & Future Work Pluggable SAT-Solvers for SMT-Solvers Bas Schaafsma DISI, University of Trento & Fondazione Bruno Kessler May 29, 2013 http://mathsat.fbk.eu/ 1

  2. Introduction The DPLL and DPLL( T ) algorithms The SAT/SMT problem Architecture & Implementation Applications of SAT/SMT-Solvers Experimental Evaluation Motivation Demo Conclusion & Future Work The SMT problem The SAT problem Given a Boolean formula F , is there an assignment for which F evaluates to true ? The SMT problem SAT extended with a set of theories T 1 ∪ T 2 · · · ∪ T n Example ( EUF ∪ LA ( Z )): ( x + 2 y = 6 ∨ y = 9) ∧ ¬ ( f ( x ) = f ( y )) ∧ x = 2 http://mathsat.fbk.eu/ 2

  3. Introduction The DPLL and DPLL( T ) algorithms The SAT/SMT problem Architecture & Implementation Applications of SAT/SMT-Solvers Experimental Evaluation Motivation Demo Conclusion & Future Work Some Useful Theories Theory of Linear Arithmetic ( LA ) F LA = L ( x =  ) ∧ L ( x< ) Theory of BitVectors ( BV ) F BV = L ( zext �  � ( x �  � )) > u  �  � ) Theory of Arrays ( ARR ) F ARR∪LA = L ( read ( a, )=  ) ∧ ¬ L ( read ( write ( a,, ) ,i )= read ( a,i )) http://mathsat.fbk.eu/ 3

  4. Introduction The DPLL and DPLL( T ) algorithms The SAT/SMT problem Architecture & Implementation Applications of SAT/SMT-Solvers Experimental Evaluation Motivation Demo Conclusion & Future Work Applications of SMT-Solvers • Bounded Model Checking • Equivalence Testing [GPB01] • Property Driven Reachability Testing [CNR12] • Scheduling [ABP + 11] • Test Case Generation [GLM12] • Software model checking through Predicate Abstraction [FQ02] • Program Synthesis [SGCF11] • ... http://mathsat.fbk.eu/ 4

  5. Introduction The DPLL and DPLL( T ) algorithms The SAT/SMT problem Architecture & Implementation Applications of SAT/SMT-Solvers Experimental Evaluation Motivation Demo Conclusion & Future Work Pluggable SAT solvers: Motivation • Developing a new (allround) SMT solver entails more than a new SAT solver. → MathSAT5 ∼ 150kloc vs MiniSAT ∼ 6kloc • Success of SAT solvers highly dependent on heuristics. • Tuning SAT solvers requires investment of time and money. • SAT-Solver is a deciding factor for BV & BV ∪ ARR instances. • We want to combine state-of-the-art SAT solvers & SMT solvers. • This is NOT a straight forward bitblasting approach. http://mathsat.fbk.eu/ 5

  6. Introduction The DPLL and DPLL( T ) algorithms The SAT/SMT problem Architecture & Implementation Applications of SAT/SMT-Solvers Experimental Evaluation Motivation Demo Conclusion & Future Work Introduction 1 The DPLL and DPLL( T ) algorithms 2 Architecture & Implementation 3 Experimental Evaluation 4 Demo 5 Conclusion & Future Work 6 http://mathsat.fbk.eu/ 6

  7. Introduction The DPLL and DPLL( T ) algorithms Architecture & Implementation The DPLL algorithm Experimental Evaluation The DPLL( T ) algorithm Demo Conclusion & Future Work The DPLL algorithm 1: Preprocess( F ) 2: while true do BCP( F ) 3: if not conflict then 4: if all variables assigned then 5: return SAT 6: end if 7: decide() 8: else 9: C conflict ← analyze() 10: if top level conflict found then 11: return UNSAT 12: end if 13: backtrack(C conflict ) 14: end if 15: 16: end while http://mathsat.fbk.eu/ 7

  8. Introduction The DPLL and DPLL( T ) algorithms Architecture & Implementation The DPLL algorithm Experimental Evaluation The DPLL( T ) algorithm Demo Conclusion & Future Work DPLL( T ) = DPLL + .. • For correctness: Theory consistency checks. Case splitting. • For optimization: Early pruning. Theory deductions. • (Incrementality) For specific details check [ST09]. http://mathsat.fbk.eu/ 8

  9. Introduction The DPLL and DPLL( T ) algorithms Architecture & Implementation The DPLL algorithm Experimental Evaluation The DPLL( T ) algorithm Demo Conclusion & Future Work (Simplified) DPLL( T ) algorithm 1: Preprocess( F ) 2: while true do BCP( F ) 3: if not conflict and theories consistent then 4: if all variables assigned and no case splitting needed. 5: then return SAT 6: end if 7: decide() 8: else 9: C conflict ← analyze() 10: if top level conflict found then 11: return UNSAT 12: end if 13: backtrack(C conflict ) 14: end if 15: 16: end while http://mathsat.fbk.eu/ 9

  10. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work DPLL( T ) Architectural Overview Theory Solvers .. T -Solver 1 T -Solver n Conflicts/ Generated Lemmas Theory Manager Predicate Assignments Internal SAT-Solver SAT/UNSAT UNSAT Core / Interpolant / Model API F input http://mathsat.fbk.eu/ 10

  11. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work DPLL( T ) + Pluggable Solver Architectural Overview Theory Solvers .. T -Solver 1 T -Solver n Conflicts/ Generated Lemmas Theory Manager Predicate Assignments SAT-Solver Stub Callback functions SAT API calls Pluggable Solver SAT/UNSAT UNSAT Core / Interpolant / Model API F input http://mathsat.fbk.eu/ 11

  12. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work Pluggable SAT solvers: A quick overview • 3rd Party SAT solvers can be plugged in MathSAT5 by: Implementing a worker interface. Invoking required callback functions during search. • The worker interface allows MathSAT5 to: Specify the problem for the SAT solver to solve. Communicate deduced values. • Callbacks allow the SAT solver to: Communicate found (partial) models to MathSAT5 Invoke T -consistency checks. http://mathsat.fbk.eu/ 12

  13. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work Pluggable SAT solvers: Requirements • Must be able to act as an enumerator. • Should support, solving under assumptions. • Able to create new variables, add new clauses during search. • Support variable freezing and reintroduction of eliminated variables. • In order to support popping, must be able to delete all clauses containing certain variables. http://mathsat.fbk.eu/ 13

  14. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work Worker Interface Functions void s o l v e ( std : : vector < int > & assump , std : : vector < int > & c assump ) ; bool add clause ( std : : vector < int > & clause , bool permanent , bool d u r i n g c a l l b a c k ) ; void s e t f r o z e n ( i n t var , bool b ) ; i n t new var ( bool p o l a r i t y , bool dvar ) ; void enqueue assignment ( i n t assignment ) ; void r em ov e cl a u s es con t a i n i n g ( i n t v ) ; http://mathsat.fbk.eu/ 14

  15. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work Callback functions TCODE n o c o n f l i c t a t e r b c p ( std : : vector < int > & conf ) ; TCODE model found ( std : : vector < int > & c o n f l i c t ) ; void inform hook of assignment ( i n t assignment ) ; void i n f or m h ook of n e w l e v e l ( ) ; void i n f or m h ook of b a c k t r a c k ( i n t l e v e l ) ; void a s k h o o k f o r t r e a s o n ( i n t assignment , std : : vector < int > & r ) ; http://mathsat.fbk.eu/ 15

  16. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work Pluggable SAT solvers: Two Case Studies • Extending Minisat (& Cleaneling). • Extending Fiver. http://mathsat.fbk.eu/ 16

  17. Introduction The DPLL and DPLL( T ) algorithms Architectural Overview Architecture & Implementation Communication Protocols Experimental Evaluation Case Studies Demo Conclusion & Future Work Case Study A: Extending Minisat • The internal addClause method should be changed such that: Clauses are added at the correct level. For conflicts, jump back to the level, the conflict was introduced. • The analyze method must take into account that assignments can be from deductions, asking the reason if necessary. • After each round of BCP, in search which does not result in, theory propagation should be called -until fixpoint-. http://mathsat.fbk.eu/ 17

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend