Integration of SMT-LIB Support into Maple

Similar documents
Practical Course: SMT Solving

Lost in translation. Leonardo de Moura Microsoft Research. how easy problems become hard due to bad encodings. Vampire Workshop 2015

OpenMath and SMT-LIB

The SMT-LIB Standard Version 2.0

The SMT-LIB 2 Standard: Overview and Proposed New Theories

Symbolic and Concolic Execution of Programs

Quantifier Inference Rules for SMT proofs

Deductive Methods, Bounded Model Checking

SMTCoq: A plug-in for integrating SMT solvers into Coq

Quantier Inference Rules for SMT proofs

The Barcelogic SMT Solver

Generating Small Countermodels. Andrew Reynolds Intel August 30, 2012

Yices 2.2. Bruno Dutertre. Computer Science Laboratory, SRI International, 333 Ravenswood Avenue, Menlo Park, CA 94025, USA

Andrew Reynolds Liana Hadarean

SMT Solvers for Verification and Synthesis. Andrew Reynolds VTSA Summer School August 1 and 3, 2017

arxiv: v1 [cs.pl] 22 May 2014

SMT solvers for Rodin

SMT-LIB for HOL. Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory. ITP Workshop MSR Cambridge 25 August 2009

Symbolic Execution as DPLL Modulo Theories

Evaluation of SAT like Proof Techniques for Formal Verification of Word Level Circuits

The SMT-LIBv2 Language and Tools: A Tutorial

A Tour of CVC4. Tim King

Formally Certified Satisfiability Solving

Towards certification of TLA + proof obligations with SMT solvers

Satisfiability Modulo Theories. DPLL solves Satisfiability fine on some problems but not others

What's the difference between the entailment symbol with the equals vs the entailment symbol with one line? Single turnstile meaning

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS

Efficient Instantiation Techniques in SMT (Work In Progress)

Lecture Notes on Real-world SMT

Boolean Representations and Combinatorial Equivalence

SAT/SMT Solvers and Applications

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS

Pluggable SAT-Solvers for SMT-Solvers

GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK

An Introduction to Satisfiability Modulo Theories

The SMT-LIB Standard Version 2.0. Clark Barrett Aaron Stump Cesare Tinelli

ddsmt: A Delta Debugger for the SMT-LIB v2 Format

OpenSMT2. A Parallel, Interpolating SMT Solver. Antti Hyvärinen, Matteo Marescotti, Leonardo Alt, Sepideh Asadi, and Natasha Sharygina

Yices 1.0: An Efficient SMT Solver

Nenofar: A Negation Normal Form SMT Solver

SAT Solver. CS 680 Formal Methods Jeremy Johnson

CSE 20 DISCRETE MATH. Fall

Seminar decision procedures: Certification of SAT and unsat proofs

Unification in Maude. Steven Eker

Extended Abstract: Combining a Logical Framework with an RUP Checker for SMT Proofs

Reasoning About Set Comprehensions

SAT/SMT summer school 2015 Introduction to SMT

CAV Verification Mentoring Workshop 2017 SMT Solving

Encoding First Order Proofs in SMT

The SMT-LIB Standard Version 2.0. Clark Barrett Aaron Stump Cesare Tinelli

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS

Turbo-Charging Lemmas on Demand with Don t Care Reasoning

Doing Algebraic Geometry with the RegularChains Library

A Pearl on SAT Solving in Prolog (extended abstract)

ArgoSMTExpression: an SMT-LIB 2.0 compliant expression library

VS 3 : SMT Solvers for Program Verification

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

An Evolution of Mathematical Tools

Automatic Verification of Firewall Configuration with Respect to Security Policy Requirements

Specification, Verification, and Interactive Proof

LEARNING TO INSTANTIATE QUANTIFIERS

Language and Proofs for Higher-Order SMT (Work in Progress)

Integrating SMT solvers in Rodin

SAT Solvers. Ranjit Jhala, UC San Diego. April 9, 2013

Symbolic Execu.on. Suman Jana

JPF SE: A Symbolic Execution Extension to Java PathFinder

Ranking Functions for Loops with Disjunctive Exit-Conditions

argo-lib: A Generic Platform for Decision Procedures

EasyChair Preprint. A FOOLish Encoding of the Next State Relations of Imperative Programs

CS558 Programming Languages

12th International Satisfiability Modulo Theories Competition (SMT-COMP 2017): Rules and Procedures

Bit-Vector Approximations of Floating-Point Arithmetic

CSE 20 DISCRETE MATH. Winter

Counterexample-Driven Genetic Programming

Decision Procedures in the Theory of Bit-Vectors

Using Higher Levels of Abstraction for Solving Optimization Problems by Boolean Satisfiability

The Design and Implementation of the Model Constructing Satisfiability Calculus

Scaling Up DPLL(T) String Solvers Using Context-Dependent Simplification

Built-in Treatment of an Axiomatic Floating-Point Theory for SMT Solvers

Learning a SAT Solver from Single-

Pooya Saadatpanah, Michalis Famelis, Jan Gorzny, Nathan Robinson, Marsha Chechik, Rick Salay. September 30th, University of Toronto.

Leonardo de Moura and Nikolaj Bjorner Microsoft Research

Walking through the Forest: a Fast EUF Proof-Checking Algorithm

Evaluating the SMT-LIB repository as a benchmark source for software verification

Automated Reasoning. Natural Deduction in First-Order Logic

CVC4. 2 University of Iowa

Advances in Programming Languages

Proving SPARK Verification Conditions with SMT solvers

Introductory logic and sets for Computer scientists

Basic data types. Building blocks of computation

Yices 1.0: An Efficient SMT Solver

Clause Sharing and Partitioning for Cloud-Based SMT Solving

1. [5 points each] True or False. If the question is currently open, write O or Open.

Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries

1 Inference for Boolean theories

Efficiently Solving Bit-Vector Problems Using Model Checkers

OpenSMT2: An SMT Solver for Multi-Core and Cloud Computing

Logic Programming with Satisfiability

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

CSP- and SAT-based Inference Techniques Applied to Gnomine

Transcription:

Integration of SMT-LIB Support into Maple

SMT-CAS Integration Some SMT solvers presently incorporate computer algebra techniques in their theory solvers. Examples: verit [3], SMT-RAT [4] Alternate avenue of co-operation: CAS dispatching instances of SMT problems which it encounters in the course of symbolic computation to a SAT/SMT solver Examples: many, e.g. see [5] 1

Logic in Maple Maple s built-in logic is three-valued (true, false, FAIL) Also has a package (Logic) for two-valued propositional logic: BooleanSimplify return an equivalent but more compact formula if one exists Dual construct the logical dual Equivalent check equivalence of two formulae Normalize convert to a normal form (CNF or DNF) Satisfy / Satisfiable generate a satisfying truth assignment Tautology check if formula holds for all truth assignments Since Maple 2016, Satisfy and related commands use MiniSat. Package does not support existential or universal quantification 2

Maple Assume Facility (1) Maple's assume facility allows checking of Boolean propositions subject to declared assumptions. Assumptions consist of Boolean predicates or properties attached to specified symbols. Two main commands exist: is: equivalent of coulditbe: equivalent of General form (fv stands for free variables ): is(p) assuming q fv(q,p) (q => p) coulditbe(p) assuming q fv(q,p) (q => p) 3

Maple Assume Facility (2) Maple's assume facility allows checking of propositions subject to assumptions. Queries often include inequalities but in practice rarely have significant Boolean structure 4

Maple Assume Facility (3) Symbolic evaluation in Maple makes regular use of the assume facility and its associated queries Example: evaluation of symbolic product Implementation includes a case which computes the roots of f(n) and checks whether any of them are integers in the range [a, b] using the coulditbe command. 5

Invocations of is/coulditbe in tests is coulditbe Total distinct queries 24085 5771 Queries with result true 2335 3582 Queries with result false 19020 1519 Queries with result FAIL 2730 670 Queries including addition 9849 2022 Queries including multiplication 17097 3106 Queries including equations, inequations, or inequalities 11333 4439 Queries including integer exponents >= 2 7965 875 Queries including complex arithmetic 6215 389 Queries with Boolean structure (,, ) 564 168 6

SMT-LIB 2 Logics Relations between logics induce a partial order. [Source: http://smtlib.cs.uiowa.edu/logics.shtml] 7

SMTLIB Package in Maple SMTLIB is a Maple package implementing connection to an external SMT solver using the SMT-LIB2 language [1]. New in Maple 2017, with plans to expand for 2018 Upcoming version of the package will offer: ToString translate input to string encoding SMT-LIB 2 query (in Maple 2017) Satisfiable check for satisfiability (to be added) Satisfy generate a satisfying truth assignment (to be added) Supports some Maple primitives not supported by Logic package: (forall, exists, abs, floor, iquo, irem, piecewise) The default SMT solver used is Z3, but the interface permits an alternate SMT solver executable to be specified. 8

Type Inference Traverse input expression with the goal of assigning one of the types {Bool,Int,Real} to each symbol in the input 1. If type was explicitly provided by the user, done. Satisfy( a + b < 3 ) assuming a::real, b::real; 2. If expression occurs as an operand in an expression where only one type could be valid, assign that type: Satisfy( a ^ 2 > 1 or abs(c) > 0 or d ); 3. Propagate resolved types through expression: Satisfy( a^2 + 2 = b ) assuming a::integer; Satisfy( { a * b = 2.5, b = 1.5 } ) 4. Remaining ambiguous expressions: If symbol appears in an arithmetic context, assign to Int Otherwise, assign to Bool 9

Supported SMT-LIB 2 Logics Dark green indicates logics for which all formulas correspond to some possible input to the Maple SMTLIB[Satisfy] command. Light green indicates logics for which a proper subset of formulas correspond to some possible input to the Maple SMTLIB[Satisfy] command. 10

Examples 11

Future Work Examine incorporating solver link into Maple proper, i.e. using SMT as a general-purpose tool for solving SMT instances which arise during evaluation of symbolic expressions. Find ways of meaningfully incorporating other parts of the SMT- LIB 2 specification into Maple: Support additional types Uninterpreted functions (QF_UF and logics including it) Arrays, bit vectors Floating-point arithmetic? Algebraic datatypes? (new in SMT-LIB 2.6) Offer undecidable cores / proof of UNSAT to user 12

References 1. Clark Barrett, Pascal Fontaine, and Cesare Tinelli. The Satisfiability Modulo Theories Library (SMT-LIB), http://www.smt-lib.org, 2016. 2. Logics in SMT-LIB, de Moura, L. M., and Björner, N. Z3: an efficient SMT solver. In TACAS (2008) vol. 4963 of Lecture Notes in Computer Science, Springer, pp. 337340. Z3 is available at https://github.com/z3prover/z3. 3. Thomas Bouton, Diego Caminha B. de Oliveira, David Deharbe, Pascal Fontaine. (2009). verit: An Open, Trustable and Efficient SMT-Solver. 151-156. https://doi.org/10.1007/978-3-642-02959-2_12. 4. Florian Corzilius, Ulrich Loup, Sebastian Junges, and Erika Abraham. 2012. SMT- RAT: an SMTcompliant nonlinear real arithmetic toolbox. In Proceedings of the 15th international conference on Theory and Applications of Satisfiability Testing (SAT'12), Alessandro Cimatti and Roberto Sebastiani (Eds.). Springer-Verlag, Berlin, Heidelberg, 442-448. http://dx.doi.org/10.1007/978-3-642-31612-8_35. 5. Konstantin Korovin, Marek Kosta, Thomas Sturm. Towards Confict-Driven Learning for Virtual Substitution. Vladimir P. Gerdt and Wolfram Koepf and Werner M. Seiler and Evgenii V. Vorozhtsov. Computer Algebra in Scientific Computing - 16 th International Workshop, CASC 2014, 2014,Warsaw, Poland. Springer, 8660, pp.256-270, 2014, Lecture Notes in Computer Science. http://dx.doi.org/10.1007/978-3-319-10515-4_19. 13

Questions Thank you! 14