Finding Conflicting Instances of Quantified Formulas in SMT Andrew Reynolds Cesare Tinelli Leonardo De Moura July 18, 2014.

Slides:



Advertisements
Similar presentations
SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Satisfiability modulo the Theory of Bit Vectors
Satisfiability Modulo Theories and Network Verification Nikolaj Bjørner Microsoft Research Formal Methods and Networks Summer School Ithaca, June
50.530: Software Engineering
Satisfiability Modulo Theories (An introduction)
SMT Solvers (an extension of SAT) Kenneth Roe. Slide thanks to C. Barrett & S. A. Seshia, ICCAD 2009 Tutorial 2 Boolean Satisfiability (SAT) ⋁ ⋀ ¬ ⋁ ⋀
Verification of Functional Programs in Scala Philippe Suter (joint work w/ Ali Sinan Köksal and Viktor Kuncak) ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE,
Software Engineering & Automated Deduction Willem Visser Stellenbosch University With Nikolaj Bjorner (Microsoft Research, Redmond) Natarajan Shankar (SRI.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
Interpolants from Z3 proofs Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
Leonardo de Moura and Nikolaj Bjørner Microsoft Research.
Proof translation from CVC3 to Hol light Yeting Ge Acsys Mar 5, 2008.
PROOF TRANSLATION AND SMT LIB CERTIFICATION Yeting Ge Clark Barrett SMT 2008 July 7 Princeton.
Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
1 Satisfiability Modulo Theories Sinan Hanay. 2 Boolean Satisfiability (SAT) Is there an assignment to the p 1, p 2, …, p n variables such that  evaluates.
Solving Partial Order Constraints for LPO termination.
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
Yeting Ge Leonardo de Moura New York University Microsoft Research.
SAT-Based Decision Procedures for Subsets of First-Order Logic
The Simplify Theorem Prover Greg Nelson, Dave Detlefs and Jim Saxe Mooly Sagiv.
Counterexample Generation for Separation-Logic-Based Proofs Arlen Cox Samin Ishtiaq Josh Berdine Christoph Wintersteiger.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Decision Procedures Mooly Sagiv. Bibliography Nelson & Oppen Fast Decision Procedures Based on Congruence Closure JACM 1979 Stump, Dill, Barrett, Levitt.
Nikolaj Bjørner Leonardo de Moura Nikolai Tillmann Microsoft Research August 11’th 2008.
A two-tier approach for supporting quantifiers in a lazily proof-explicating theorem prover K. Rustan M. Leino Microsoft Research, Redmond Madan Musuvathi.
1 A propositional world Ofer Strichman School of Computer Science, Carnegie Mellon University.
On Solving Presburger and Linear Arithmetic with SAT Ofer Strichman Carnegie Mellon University.
Leonardo de Moura Microsoft Research. Many approaches Graph-based for difference logic: a – b  3 Fourier-Motzkin elimination: Standard Simplex General.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
Leonardo de Moura Microsoft Research. Quantifiers in Satisfiability Modulo Theories Logic is “The Calculus of Computer Science” (Z. Manna). High computational.
Boolean Satisfiability and SAT Solvers
CMU, Oct 4 DPLL-based Checkers for Satisfiability Modulo Theories Cesare Tinelli Department of Computer Science The University of Iowa Joint work with.
From SAT to SMT A Tutorial Nikolaj Bjørner Microsoft Research Dagstuhl April 23, 2015.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Leonardo de Moura and Nikolaj Bjørner Microsoft Research.
Advances in Automated Theorem Proving Leonardo de Moura, Nikolaj Bjørner Ken McMillan, Margus Veanes presented by Thomas Ball
Introduction to Satisfiability Modulo Theories
Leonardo de Moura Microsoft Research. Is formula F satisfiable modulo theory T ? SMT solvers have specialized algorithms for T.
1 MVD 2010 University of Iowa New York University Comparing Proof Systems for Linear Real Arithmetic Using LFSC Andrew Reynolds September 17, 2010.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
CJAdviser: SMT-based Debugging Support for ContextJ* Shizuka Uchio(Kyushu University, Japan) Naoyasu Ubayashi(Kyushu University, Japan) Yasutaka Kamei(Kyushu.
Leonardo de Moura Microsoft Research. Quantifiers in Satisfiability Modulo Theories Logic is “The Calculus of Computer Science” (Z. Manna). High computational.
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Solving Non-linear Arithmetic Dejan Jovanovic and Leonadro de Moura Presented by Boris Trayvas.
Leonardo de Moura and Nikolaj Bjørner Microsoft Research.
Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015Information Security, CS 5261.
Efficient SAT Solving Under Assumptions Alexander Nadel 1 and Vadim Ryvchin 1,2 1 – Intel, Haifa, Israel 2 – Technion, Haifa, Israel SAT’12, Trento, Italy.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
Leonardo de Moura Microsoft Research. Applications and Challenges in Satisfiability Modulo Theories Verification/Analysis tools need some form of Symbolic.
Theory-Aided Model Checking of Concurrent Transition Systems Guy Katz, Clark Barrett, David Harel New York University Weizmann Institute of Science.
Logic Engines as a Service Leonardo de Moura and Nikolaj Bjørner Microsoft Research.
Selected Decision Procedures and Techniques for SMT More on combination – theories sharing sets – convex theory Un-interpreted function symbols (quantifier-free.
Nikolaj Bjørner Microsoft Research DTU Winter course January 4 th 2012 Organized by Hanne Riis Nielson, Flemming Nielson.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
CVC4 for Sygus Comp 2017 CVC4 is an SMT solver
Satisfiability Modulo Theories
SS 2017 Software Verification Software Model Checking 2 - Parallelism
Lazy Proofs for DPLL(T)-Based SMT Solvers
SMT-Based Verification of Parameterized Systems
A theory-based decision heuristic for DPLL(T)
Solving Linear Arithmetic with SAT-based MC
Satisfiability Modulo Theories
A Progressive Approach for Satisfiability Modulo Theories
The SMT-LIB Initiative
Model Generation Theorem Proving for First-Order Logic Ontologies
Presentation transcript:

Finding Conflicting Instances of Quantified Formulas in SMT Andrew Reynolds Cesare Tinelli Leonardo De Moura July 18, 2014

Outline of Talk SMT solvers: – Efficient methods for ground constraints – Heuristic methods for quantified formulas  Can we reduce dependency on heuristic methods? New method for quantifiers in SMT – Finds conflicting instances of quantified formulas Experimental results Summary and Future Work

Satisfiability Modulo Theories (SMT) SMT solvers – Are efficient for problems over ground constraints G – Determine the satisfiability of G using a combination of: Off-the-shelf SAT solver Efficient ground decision procedures, e.g. – Uninterpreted Functions – Linear arithmetic – Arrays – Datatypes – … Used in many applications: – Software/hardware verification – Scheduling and Planning – Automated Theorem Proving f(3)  f(c) c=2  c+1 ≤ 0 a+1 = read(A,b) tail(l 1 )=cons(a,l 2 ) G

DPLL(T)-Based SMT Solver SAT Solver f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) Ground Theory Solvers SMT Solver G

DPLL(T)-Based SMT Solver SAT Solver f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) Ground Theory Solvers G f(a) =5 f(a) ≥ 10 M “context” UNSAT unsat sat

DPLL(T)-Based SMT Solver SAT Solver f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) Ground Theory Solvers G UNSAT SAT T-inconsistent T-consistent f(a) =5 f(a) ≥ 10 M  f(a) =5   f(a) ≥ 10

SMT + Quantified Formulas SMT solvers have limited support for: – First-order universally quantified formulas Q Used in an increasing number of applications, for: – Defining axioms for symbols not supported natively – Encoding frame axioms, transition systems, … – Universally quantified conjectures When universally quantified formulas Q are present, problem is generally undecidable – Approaches for G  Q in SMT are usually heuristic f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c)  x. f(x) < 0 G Q

SMT Solver + Quantified Formulas SAT Solver Ground Theory Solvers Quantifiers Module  x. f(x) < 0 SMT solver f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) G Q

SMT Solver + Quantified Formulas SAT Solver Ground Theory Solvers Quantifiers Module  x. f(x) < 0 f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) G M Q f(a) ≥10 f(b)=f(c) Find (T-consistent) context M

SMT Solver + Quantified Formulas SAT Solver Ground Theory Solvers Quantifiers Module  x. f(x) < 0 f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) G M Q f(a) ≥10 f(b)=f(c) We must answer: “is M  Q consistent?” – Problem is generally undecidable T-sat

Quantifier Instantiation SAT Solver Ground Theory Solvers Quantifiers Module  x. f(x) < 0 M Q f(a) ≥10 f(b)=f(c) Instantiation-based approaches: – Add instances of quantified formulas, based on some strategy E.g. based on patterns (known as “E-matching”) f(a)<0f(c)<0f(b)<0 … f(a) =5  f(b)=f(c) f(a)≥10  read( B, 5 ) ≤ f(c) G UNSAT

Instantiation-Based Approaches Complete approaches: – E.g. Complete instantiation, local theory extensions, finite model finding, Inst-Gen Cons: only work for limited fragments General approaches: – Heuristic E-matching Cons: only for UNSAT, highly heuristic, often inefficient

Motivation In this talk: new method for quantified formulas – Goals: Reduce dependency on heuristic methods Applicable to arbitrary quantified formulas – Not goals: Completeness (thus, focus only on UNSAT)

Ground Theories : Conflicts SAT Solver Ground Theory Solvers Quantifiers Module UNSAT f(a) ≥ 10 f(a)=5 … If M is inconsistent according to ground theory, M

Ground Theories : Conflicts SAT Solver Ground Theory Solvers Quantifiers Module UNSAT (  f(a) ≥ 10   f(a)=5) Ground theory solver reports a single conflict clause – Typically, can be determined efficiently f(a) ≥ 10 f(a)=5 …

Quantifiers : Heuristic Instantiation? SAT Solver Ground Theory Solvers Quantifiers Module  x.f(x)<0 UNSAT M is T-consistent f(a) ≥ 10 f(c)=f(b) … The decision problem for M  Q is undecidable,

Quantifiers : Heuristic Instantiation? SAT Solver Ground Theory Solvers Quantifiers Module  x.f(x)<0 UNSAT E-matching for (M, G) f(a)<0f(c)<0f(b)<0 … Add a potentially large set of instances, heuristically – This can overload the ground solver f(a) ≥ 10 f(c)=f(b) …

Conflicting Instances  Can we make the quantifiers module behave more like a theory solver? Idea: find cases when M  Q is UNSAT: – Find grounding substitution  Such that M  Q  Q  is a  conflicting instance

Conflict-Based Instantiation SAT Solver Ground Theory Solvers Conflict-Based Instantiation UNSAT f(a)<0 Heuristic Instantiation  x.f(x)<0 f(a) ≥ 10 f(c)=f(b) … “conflicting instance” First, determine if a conflicting instance exists – If not, resort to heuristic instantiation

Limit of Approach Caveat: No complete method will determine whether a conflicting instance exists for ( M, Q ) Thus, our approach: 1.Uses an incomplete procedure to determine a conflicting instance for ( M, Q ) 2.If not, resort to E-matching for ( M, Q )  In practice, Step 1 succeeds for a majority of ( M, Q )

E-matching vs Conflicting Instances  x. f(x) = g(h(x))g(b)  f(a) b=h(a) In example, g(h(x)) matches ground term g(b) – That is: M g(b)=g(h(x)) , for  = {x  a}  E-matching for (M,Q) returns  M Q Ground term Trigger term

E-matching vs Conflicting Instances In this example, for  = { x  a }: 1.Ground terms match each sub-term from Q M g(b)=g(h(x))  M f(a)=f(x)  2.…and the body of Q is falsified: M f(x)  g(h(x))   M  Q  is UNSAT  x. f(x) = g(h(x))g(b)  f(a) b=h(a) M Q

E-matching vs Conflicting Instances In this example, for  = { x  a }: 1.Ground terms match each sub-term from Q M g(b)=g(h(x))  M f(a)=f(x)  2.…and the body of Q is falsified: M f(x)  g(h(x))   M  Q  is UNSAT  x. f(x) = g(h(x))g(b)  f(a) b=h(a) M Q In paper, limit T to EUF

E-matching vs Conflicting Instances Consider flat form of Q:  x. f(x) = g(h(x))g(b)  f(a) b=h(a) M Q Conflicting substitution  for ( M, Q ) is such that: – M entails  – M entails   x y 1 y 2 y 3. y 1 = f(x)  y 2 = g(y 3 )  y 3 = h(x)  y 1 = y 2 Matching constraints  Flattened body 

Equality-Inducing Instances What if we relax constraint 2? – Modified example, for  = { x  a }: 1.Ground terms match each sub-term from Q – M g(b)=g(h(x))  – M f(a)=f(x)  2.…but the body of Q is not falsified: – M f(x)  g(h(x))   x. f(x) = g(h(x)) g(b)  c d=f(a) b=h(a) M Q

Equality-Inducing Instances Still, it may be useful to add the instance Q { x  a } – In this example, Q { x  a } entails g(b) = f(a)   { x  a } is an equality-inducing substitution Mimics T-propagation done by theory solvers  x. f(x) = g(h(x)) g(b)  c d=f(a) b=h(a) M Q

Instantiation Strategy Three configurations: – cvc4 : step (3) – cvc4+c : steps (1), (3) – cvc4+ci : steps (1),(2),(3) InstantiationRound( Q, M ) (1) Return a (single) conflicting instance for ( Q, M ) (2) Return a set of equality-inducing instances for ( Q, M ) (3) Return instances based on E-matching for ( Q, M )

Experimental Results Implemented techniques in SMT solver CVC4 UNSAT benchmarks from: – TPTP – Isabelle – SMT Lib Solvers: – cvc3, z3 – 3 configurations: cvc4, cvc4+c, cvc4+ci

UNSAT Benchmarks Solved Configuration cvc4+ci solves the most (14,445) – Against cvc4 : 1,049 vs 235 (+807) – Against z3: 1,998 vs 1,310 (+688) – 359 that no implementation of E-matching (cvc3, z3, cvc4) can solve cvc3z3cvc4cvc4+ccvc4+ci TPTP Isabelle SMTLIB Total

# Instantiations for Solved Benchmarks cvc4+ci – Solves the most benchmarks for TPTP and Isabelle – Requires almost an order of magnitude fewer instantiations Improvements less noticeable on SMT LIB – Due to encodings that make heavy use of theory symbols Method for finding conflicting instances is more incomplete TPTPIsabelleSMT lib SolvedInstSolvedInstSolvedInst cvc M M M z M M M cvc M M M cvc4+c M M M cvc4+ci M M M

Instances Produced Conflicting instances found on ~75% of IR cvc4+ci : – Requires 3.1x more instantiation rounds w.r.t. cvc4 – Calls E-matching 1.5x fewer times overall As a result, adds 5x fewer instantiations InstantiationRound( Q, M ) (1) conflicting instance for ( Q, M ) (2) equality-inducing instances for ( Q, M ) (3) E-matching for ( Q, M ) E-matchingConflictingC-Inducing IR # # # smtlibcvc %60.7M cvc4+c %41.0M75.7%39.1K cvc4+ci %32.3M71.6%41.5K8.4%51.5K TPTPcvc %879.0M cvc4+c %190.1M78.3%158.2K cvc4+ci %150.4M76.4%160.0K3.3%41.6K Isabellecvc %119.0M cvc4+c %54.0M71.1%12.9K cvc4+ci %28.2M64.0%13.9K13.6%130.1K

Details on Solved Problems For the 30,081 benchmarks we considered: – cvc4+ci solves more (14,445) than any other – 359 are solved uniquely by cvc4+c or cvc4+ci Techniques increase precision of SMT solver – cvc4+ci does not use E-matching 21% of the time 94 benchmarks unsolved by E-matching implementations Techniques reduce dependency on heuristic instantiation

Competitions : CASC J7 Partly due to techniques: – Won TFA division – Finished only behind Vampire/E(s) in FOF division

Competitions : SMT COMP 2014 Partly due to techniques: – Official winner in 11 division with quantifiers – (Unofficially) beat z3 in AUFLIA, UFLIA, UF, …

Summary and Future Work Conflict-based method for quantifiers in SMT – Supplements existing techniques – Improves performance, both in: Number of instantiations required for UNSAT Number of UNSAT benchmarks solved Future work: – More incremental instantiation strategies – Specialize techniques to other theories Handle quantified formulas containing (e.g.) linear arithmetic – Completeness criteria

Thank You Solver is publicly available: Techniques enabled by option: “ cvc4 --quant-cf … ”