CVCL Lite: An Efficient Theorem Prover Based on Combination of Decision Procedures Presented by: Sergey Berezin Stanford University, U.S.A.

Slides:



Advertisements
Similar presentations
Logical Abstract Interpretation Sumit Gulwani Microsoft Research, Redmond.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Modified.
Presented by Monissa Mohan 1.  A highly optimized BCP algorithm  Two watched literals  Fast Backtracking  Efficient Decision Heuristic  Focused on.
Finding bugs: Analysis Techniques & Tools Symbolic Execution & Constraint Solving CS161 Computer Security Cho, Chia Yuan.
Satisfiability Modulo Theories (An introduction)
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Logic Use mathematical deduction to derive new knowledge.
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
Logic.
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.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
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.
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Nikolaj Bjørner Microsoft Research Lecture 3. DayTopicsLab 1Overview of SMT and applications. SAT solving, Z3 Encoding combinatorial problems with Z3.
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.
Proof-system search ( ` ) Interpretation search ( ² ) Main search strategy DPLL Backtracking Incremental SAT Natural deduction Sequents Resolution Main.
Katz Formal Specifications Larch 1 Algebraic Specification and Larch Formal Specifications of Complex Systems Shmuel Katz The Technion.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
SAT-Based Decision Procedures for Subsets of First-Order Logic
` ² Q E D I Nelson-Oppen review
1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL.
Some administrative stuff Class mailing list: –send to with the command “subscribe”
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
Chapter 3 Propositional Logic
1 A propositional world Ofer Strichman School of Computer Science, Carnegie Mellon University.
1 First order theories. 2 Satisfiability The classic SAT problem: given a propositional formula , is  satisfiable ? Example:  Let x 1,x 2 be propositional.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Introduction to Satisfiability Modulo Theories
Pattern-directed inference systems
1 MVD 2010 University of Iowa New York University Comparing Proof Systems for Linear Real Arithmetic Using LFSC Andrew Reynolds September 17, 2010.
Introduction to Data Structures and Algorithms CS 110: Data Structures and Algorithms First Semester,
Logic in Computer Science - Overview Sep 1, 2009 박성우.
Lazy Annotation for Program Testing and Verification Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang November 26,
Analyzing relational logic Daniel Jackson, MIT WG 2.3 · Newcastle April 2000.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CSE Winter 2008 Introduction to Program Verification January 31 proofs through simplification.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CS6133 Software Specification and Verification
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
Random Interpretation Sumit Gulwani UC-Berkeley. 1 Program Analysis Applications in all aspects of software development, e.g. Program correctness Compiler.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
1/24 An Introduction to PVS Charngki PSWLAB An Introduction to PVS Judy Crow, Sam Owre, John Rushby, Natarajan Shankar, Mandayam Srivas Computer.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
1 Lecture 5 PVS commands. 2 Last week Logical formalisms, first-order logic (syntax, semantics). Introduction to PVS. Language of PVS. Proving sequents.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Finding Conflicting Instances of Quantified Formulas in SMT Andrew Reynolds Cesare Tinelli Leonardo De Moura July 18, 2014.
Selected Decision Procedures and Techniques for SMT More on combination – theories sharing sets – convex theory Un-interpreted function symbols (quantifier-free.
CSE Winter 2008 Introduction to Program Verification February 5 calculating with simplify.
Computer Systems Laboratory Stanford University Clark W. Barrett David L. Dill Aaron Stump A Framework for Cooperating Decision Procedures.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
SS 2017 Software Verification Software Model Checking 2 - Parallelism
Lazy Proofs for DPLL(T)-Based SMT Solvers
A theory-based decision heuristic for DPLL(T)
Automating Induction for Solving Horn Clauses
Satisfiability Modulo Theories
Lifting Propositional Interpolants to the Word-Level
Decision Procedures An Algorithmic Point of View
Program correctness Axiomatic semantics
Presentation transcript:

CVCL Lite: An Efficient Theorem Prover Based on Combination of Decision Procedures Presented by: Sergey Berezin Stanford University, U.S.A.

People Project leaders: Sergey Berezin, Clark Barrett, David Dill Developers and contributors: Daniel Wichs Ying Hu Mark Zavislak Jim Zhuang Deepak Goyal Jake Donham Sean McLaughlin Vijay Ganesh Mehul Trivedi

Outline Theoretical Basis CVCL from User's Point of View –C++ library –Command line –Theory API Architecture and Design Decisions Information Flow in CVCL Other Functionality

What is CVC Lite? Validity Checker:  ²  –First-Order Logic with interpreted theories Arithmetic, uninterpreted functions, arrays, etc. –Theorem Prover based on multiple DPs

Logic Many-sorted FOL + '=' + Theories x=y ) a[i]+2*y < f(rec.f, 15-3*b[j+1]) –Partial functions (e.g. x/y) –Quantifiers (experimental) Validity Problem: –Is  valid under the set of assumptions  ?  ² 

Theoretical Basis: Combination of Decision Procedures Clark Barrett's thesis –Fusion of Nelson-Oppen + Shostak methods T 1 [ T 2 ²  T 1 [ T 2 [ :  ² ? (T 1 [  1 ) [ (T 2 [  2 ) ² ? –Search for an arrangement A over  0 such that (T 1 [  1 ) [ A and (T 2 [  2 ) [ A are SAT

Theoretical Basis: Real Implementation Vijay Ganesh's extension of Ghilardi's method: T 1 [ T 2 ²  T 1 [ T 2 [ :  ² ? (T 1 [  1 ) [ (T 2 [  2 ) ² ? T i [  i [ C k ² C k+1, i 2 {1,2} C k are positive ground clauses

Outline Theoretical Basis CVCL from User's Point of View –C++ library –Command line –Theory API Architecture and Design Decisions Information Flow in CVCL Other Functionality

CVCL as C++ Library API: ValidityChecker class Provides functionality: –Create terms and formulas as CVCL Expr –Manipulate logical context  –Solve  ² 

Command Line Executable PVS-like input language Parser and command processor –implemented on top of C++ API CVCL Executable CVCL library Parser & Command Processor User Input CVCL API

Theory API (For New Decision Procedures) "Hackability" – very important! All functionality implemented locally in DP –No changes to the Core files CVCL Core ArithUFArrays CVCL Library Theory API

Outline Theoretical Basis CVCL from User's Point of View –Command line –C++ library –Theory API Architecture and Design Decisions Information Flow in CVCL Other Functionality

CVCL Core ArithUFArrays CVC Lite Architecture SAT Solver Fact Queue Union-Find DB Notify List

Union-Find & Notify List x' y' x' = y' => x = y x y 2*x + 3*y => 5*y

... Setup / Update Mechanism + * * x 2 3 y x = y 2*x = 2*y 2*x + 3*y = 5*y update(x=y, 2*x) update(2*x=2*y, 2*x+3*y)

Soundness: Theorems and Proof Rules Computing with proof rules –Every proven formula is a Theorem object –Theorems are constructed with Proof Rules –Proof rules comprise Trusted Code Soundness checked on-the-fly Transparent assumption tracking and proof production –Automatically up-to-date

Computing with Proof Rules Example: Fourier-Motzkin elimination t 1 · x, x · t 2 => t 1 · t 2 Proof Rule: t 1 · x x · t 2 t 1 · t 2 R C++ Method: R(t 1 · x, x · t 2 ) { return t 1 · t 2 ; }

Theorem Class Sequent:  ²  class Theorem { // private constructors Formula  ; Assumptions  ; Proof pf; };

Trusted Code R(Theorem(  1 ² t 1 · x), Theorem(  2 ² y · t 2 )) { check_sound(x == y); Proof pf =... // Compute the proof object return Theorem(  1 [  2 ² t 1 · t 2, pf); }  1 ² t 1 · x  2 ² x · t 2  1 [  2 ² t 1 · t 2 R

Outline Theoretical Basis CVCL from User's Point of View –Command line –C++ library –Theory API Architecture and Design Decisions Information Flow in CVCL Other Functionality

SAT Solver + DPs (BCP; DP)* BCP: Unit Clauses DP: T i [  i [ C k ² C k+1 (BCP; DP)* ? s1s1 s2s2 s3s3 ? :s3:s3 :s2:s2 Backtracking Mechanism!

Backtracking Mechanism CDO -- generic backtracking object –read, assign CDList -- backtracking stack –push, read-only CDMap – backtracking STL-like map –add, change value; [no deletion] ~1% CPU overhead

Completeness of CVC Lite s1s1 (BCP; DP)* s2s2 s3s3 SAT T 1 [ T 2 ²  T 1 [ T 2 [ :  ² ? (T 1 [  1 ) [ (T 2 [  2 ) ² ? T i [  i [ C k ² C k+1, i 2 {1,2} Derived  0 such that: (T i [  i ) [  0 ²  0 ? 2  0 Therefore (T 1 [  1 ) [ (T 2 [  2 ) is SAT Hence, T 1 [ T 2 ² 

Efficiency: Tracking Assumptions for Conflict Analysis Splitters:  ²  ²  assump Typical Proof Rule:  1 ²  1  2 ²  2  1 [  2 ²  R Assumptions are proof explications!  ² ?

Implication Graph and Conflict Clauses ? :l:l ll1l1 l2l2 l3l3 l7l7 l5l5 l4l4 l6l6 l8l8 l9l9 Conflict Clause: ( : l 1 Ç : l 6 Ç : l 7 )

Implication Graph from Theorems ? y<x x<yy<zz<x x<y y<x ? LT ? y<z z<x y<x R

Implication Graph from  ² ?² ? x<y y<x ? LT ? y<z z<x y<x R ² x<y ² y<x ² z<x ² y<z

Outline Theoretical Basis CVCL from User's Point of View Architecture and Design Decisions Information Flow in CVCL Other Functionality –Proofs –Quantifiers –Partial Functions

Proof Production pf[y<x] = R(pf[y<z], pf[z<y]) Curry-Howard Isomorphism: –Proofs are terms –Formulas are types R: (y<z) £ (z<x) ! (y<x) Constructed in proof rules y<z z<x y<x R

Outline Theoretical Basis CVCL from User's Point of View Architecture and Design Decisions Information Flow in CVCL Other Functionality –Proofs –Quantifiers –Partial Functions

Existential Quantifiers Add "axiom": ( 9 x.  (x)) )  (a) –fresh Skolem constant a Skolemization by Modus Ponens Set of axioms  is eliminated: ,  ²   ²  9E9E

Universal Quantifiers Instantiate: Search for terms in current context Cache useful instantiations –Those that derive ? 8 x.  (x)  (t) 8E8E

Outline Theoretical Basis CVCL from User's Point of View Architecture and Design Decisions Information Flow in CVCL Other Functionality –Proofs –Quantifiers –Partial Functions

Partial Functions & Subtypes True, False or Undefined? x/y · x/y x/y > x/y : (y = 0) => x/y · x/y : (x/y · x/y) => y = 0 x/y > x/y => y = 0

Kleene Semantics Values: T, F, ? Connectives: –F Æ ? ´ F, T Æ ? ´ ? –F Ç ? ´ ?, T Ç ? ´ T Most general –Agrees with classical logic –  ´ ? iff value of  depends on particular total extension

Type Correctness Conditions (TCCs) TCC[  ] iff  is defined (T or F) TCC[f(t)] =  f (t) Æ TCC[t] TCC[  1 Ç  2 ] = (TCC[  1 ] Æ TCC[  2 ]) Ç (TCC[  1 ] Æ  1 ) Ç (TCC[  2 ] Æ  2 )

Total Extensions with TCCs If TCC[  ] ´ T, Then M ²  iff M total ²  E.g. arithmetic: x / 0 = 0

Partial Functions with Subtypes Subtypes: NAT = { x: REAL | int(x) Æ x ¸ 0 } R 0 = { x : REAL | x != 0 } x / y: REAL £ R 0 ! REAL TCC[x/y] = (y != 0)

Example of TCC TCC[y=0 Ç x/y · x/y] ´ (T Æ y != 0) Ç (T Æ y=0) Ç ( y != 0 Æ x/y · x/y) ´ T´ T Therefore: y!=0 ) x/y · x/y ´ T

Decision Procedure: Any Total Extension CVCL Core ArithUFArrays CVCL Library Theory API TCCs User Input

Hack to the Future New Decision Procedures –Bit Vectors, Datatypes Functionality –Symbolic Simulation –Interpolation? Predicate Abstraction? Interface –Multiple input languages Performance –Raw speed –SAT heuristics (DP-specific?)

CVCL Theory UI Architecture SAT TCCs 8, 9 C++ lib cvc.exe Theory API Core DP Theorems  ²  Completeness Impl Graph Backtracking x / 0 NAT v INT Kleene T i [ C k ² C k+1  ²  ²  8 x.  (x)  (t) 8E8E 9 x.  (x) )  (a) Notify List DPs: 2x+3y<8, f(x)=g(y), a[i], r.f, 8 x.  (x) Questions?

Thank you!

Other Important Features Efficient backtracking mechanism Partial Functions and Subtypes –Kleene semantics (most general) Quantifiers (experimental) Symbolic Simulator (in progress) Proof Production

Adding Decision Procedures Core files need not be modified All functionality is coded locally in DP –Type checking –TCCs (partial functions) –Specialized expressions –Parsing aid –Pretty-printing Distribution of responsibility among developers