8/2/2018 4:21 AM Lifting SAT to richer theories: bit-vectors, finite bases, and theory combination Christoph M. Wintersteiger © 2013 Microsoft Corporation.

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Ian Ellison-Taylor General Manager Microsoft Corporation PC27.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
Decision methods for arithmetic Third summer school on formal methods Leonardo de Moura Microsoft Research.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

IoCompleteRequest (Irp);... p = NULL; …f(p);
Ctrl-K, X Ctrl-K, S
MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Satisfiability Modulo Theories
Lazy Proofs for DPLL(T)-Based SMT Solvers
Возможности Excel 2010, о которых следует знать
Title of Presentation 11/22/2018 3:34 PM
Baseline: How Are We Doing Now?
Title of Presentation 12/2/2018 3:48 PM
1/3/2019 1:21 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of your Project (do not use words: project and math)
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
4/27/17, Bell #8 What amount of net pay has been earned this period?
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
Why is it important to follow an order of operations?
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
5/6/19, Bell #6 12/11/2019 8:26 PM Explain the relationship between this picture and the events that took place in Chapter 7 in Animal Farm. © 2007 Microsoft.
Presentation transcript:

8/2/2018 4:21 AM Lifting SAT to richer theories: bit-vectors, finite bases, and theory combination Christoph M. Wintersteiger © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

What is SMT? Satisfiability Modulo Theories SMT Theories Decision procedures for pre-defined theories/logics Theory combination strategy Language standard Benchmark library http://smtlib.org http://github.com/Z3Prover/Z3 SMT Theories Booleans Uninterpreted functions Integers (linear & non-linear) Reals (linear & non-linear) Bit-vectors Arrays Floating-point arithmetic (Datatypes, Strings, Probabilities, … )

The big picture mcSAT DP Nelson/Oppen T/C ADPLL (with learning) DPLL ADPLL(T) Model-based T/C CDCL ACDCL Abstract interpretation B-CSP CSP R. Nieuwenhuis, A. Oliveras, C. Tinelli: Solving SAT and SAT Modulo Theories: From an abstract Davis-Putnam-Logemann-Loveland procedure to DPLL(T). J. ACM 53(6) 2006. R. Nieuwenhuis, A. Oliveras, C. Tinelli: Abstract DPLL and Abstract DPLL Modulo Theories. LPAR 2004. V. D'Silva, L. Haller, D. Kroening: Abstract conflict driven learning. POPL 2013. L. de Moura, D. Jovanović: A Model-Constructing Satisfiability Calculus. VMCAI 2013. N. Creignou, H. Vollmer: Boolean Constraint Satisfaction Problems: When Does Post's Lattice Help? Complexity of Constraints 2008.

Abstract DPLL 𝑀∥𝐹, 𝐶∨𝑙 ⇒ 𝑀𝑙∥𝐹,𝐶∨𝑙 Start at ∅∥𝐹 UnitPropagate: If 𝑀⊨¬𝐶 and 𝑙 is undefined in 𝑀 R. Nieuwenhuis, A. Oliveras, C. Tinelli: Solving SAT and SAT Modulo Theories: From an abstract Davis-Putnam- Logemann-Loveland procedure to DPLL(T). J. ACM 53(6) 2006

Abstract DPLL(T) (One theory; combinations hidden) 𝑀∥𝐹 ⇒ 𝑀∥𝐹, 𝐶 T-Learn: 𝑀∥𝐹 ⇒ 𝑀∥𝐹, 𝐶 If each atom of 𝐶 occurs in 𝐹 or in 𝑀 and 𝐹 ⊨ 𝑇 𝐶. R. Nieuwenhuis, A. Oliveras, C. Tinelli: Solving SAT and SAT Modulo Theories: From an abstract Davis-Putnam- Logemann-Loveland procedure to DPLL(T). J. ACM 53(6) 2006

Model-constructing satisfiability calculus Microsoft Research 2013 8/2/2018 4:21 AM Model-constructing satisfiability calculus Borrows from ADPLL(T) Finite basis 𝔹 A finite number of predicates (for termination, in the worst case) Pick a new predicate at any time Explanations Explain conflicts, implications (usually clauses) Performance depends on Good basis exploration (and coverage?) Good decision making Efficient domain representation L. de Moura, D. Jovanović: A Model-Constructing Satisfiability Calculus. VMCAI 2013. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

mcSAT clausal rules 𝑀,𝐶 ⇒ 𝑀,𝐿 ,𝐶 Decide: If 𝐿∈𝔹, 𝑣𝑎𝑙𝑢𝑒 𝐿,𝑀 =𝑢𝑛𝑑𝑒𝑓 𝑀,𝐶 ⇒ 𝑀,𝐿 ,𝐶 If 𝐿∈𝔹, 𝑣𝑎𝑙𝑢𝑒 𝐿,𝑀 =𝑢𝑛𝑑𝑒𝑓 L. de Moura, D. Jovanović: A Model-Constructing Satisfiability Calculus. VMCAI 2013.

mcSAT theory rules L. de Moura, D. Jovanović: A Model-Constructing Satisfiability Calculus. VMCAI 2013.

mcSAT crucials Pick any 𝐿∈𝔹 Assign variables T-Backjump-Decide All on one trail Assign variables Boolean or theory Such that the trail stays consistent T-Backjump-Decide Non-asserting clauses Tricky termination arguments explain(…) Contains magic

A word on ACDCL Based on Abstract Interpretation (A different “abstract”) Roughly: abstract domains implement theories Greatest fix-point implements (Boolean) constraint propagation Least fix-point implements conflict resolution Theory combination Adapted Nelson/Oppen Cartesian product of domains V. D'Silva, L. Haller, D. Kroening: Abstract conflict driven learning. POPL 2013

A bit-blasting challenge (set-logic QF_BV) (declare-fun x () (_ BitVec 29980)) (declare-fun y () (_ BitVec 29980)) (assert (and (bvuge x y) (bvule (bvadd x (_ bv1 29980)) y))) 𝑥 ≥ 𝑢 𝑦 ∧ 𝑥+1 ≤ 𝑢 𝑦 (QF_BV/pspace/ndist.b.29980.smt2; SAT; model: x=1…1, y=0…0)

mcBV Decision procedure for the theory of bit-vectors based on mcSAT Microsoft Research 2013 8/2/2018 4:21 AM mcBV Decision procedure for the theory of bit-vectors based on mcSAT avoids bit-blasting (often) preserves word-level structure using tailor-made conflict driven learning theory lemmas ~ conflict explanations A. Zeljić, C. M. Wintersteiger, P. Rümmer: Deciding Bit-Vector Formulas with mcSAT. SAT 2016. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

mcSAT requirements Finite basis of literals/predicates B Can be large Possibly the cross-product of multiple bases Explain function Returns a valid clause which evaluates to false under the trail Literals are not necessarily on the trail, but must be from B Value function Can evaluate any literal/predicate Definition affects the strength of propagation

mcBV news I Theory decisions Projections Decide on theory variables, e.g., 𝑥=0𝑥2𝐴 Projections 𝑥 7:4 =0𝑥𝐴

mcBV news II Two model assignment representations Run-length encoded bit-patterns 𝑥= 1 3 0 4 ∗ 2 0 1 Sound & complete Bounds 1<𝑥<42 Sound Cross-theory Propagation Conflicts Explanations, (some) generalization

Experiments I

Experiments II

Lessons learned Implementation complexity Heuristics Explanations Underestimated by all involved parties Abstract rules cannot be implemented directly Efficient data structures yet to be discovered Heuristics Unclear what works And what should work Explanations Extensions Generalization (Craig) Interpolation …> cat *.fs | wc -l 10633 …> cat *.fs | sed "/^\s*$/d" | wc -l 8846

Theory combination Nelson/Oppen Model-based theory combination Theory solvers deduce and exchange (disjunctions of) interface equalities (Can be delayed) Model-based theory combination “Optimistic approach” Propagates/exchanges all equalities implied by a candidate model (Interpolation) Cross-products of Abstract domains Finite bases

Wishlist Personal In theory & practice (Lazy) data structures Quantifiers, regular expressions over bit-vectors In theory & practice Extensions; at least some sub-class of Theory and understanding of heuristics Logic fragments/theory classes, sub-theories, finite bases Cross-theory interpolation/extensions Better complexity theory (Lazy) data structures Critical for any implementation Parallel/Distributed Decomposition (ideally cross-theory)

8/2/2018 4:21 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Bit-vector logic All variables are (existential) bit-vectors E.g., 𝑥 may be a 32-bit value The usual bit-vector operations +, −, ∗, /, extract, concat, zero-extend, … <, >, =, ≤,≥ (with overflows) Example: 𝑥+1=0 ∨ 𝑦∗2=1

Bit-vector explosion example Suppose ∀𝑥∈ 𝐵 32 ∃𝑦∈ 𝐵 32 . 𝑥=𝑦 Bit-blast into ∀ 𝑥 31 … 𝑥 0 ∃ 𝑦 31 … 𝑦 0 . 𝑥 31 = 𝑦 31 ∧ …∧ 𝑥 0 = 𝑦 0 100000 = 6 bits 2 6 =32 bits

Complexity UFBV QF_BV QBF SAT 2-NEXPTIME NEXPTIME EXPSPACE EXPTIME NP P UFBV QF_BV QBF SAT Kovásznai, Fröhlich, Biere: On the Complexity of Fixed-Size Bit-Vector Logics with Binary Encoded Bit-Width. SMT@IJCAR 2012 Fröhlich, Kovásznai, Biere: More on the Complexity of Quantifier-Free Fixed-Size Bit-Vector Logics with Binary Encoding. CSR 2013