Proof translation from CVC3 to Hol light Yeting Ge Acsys Mar 5, 2008.

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 Theories and Network Verification Nikolaj Bjørner Microsoft Research Formal Methods and Networks Summer School Ithaca, June
Finding bugs: Analysis Techniques & Tools Symbolic Execution & Constraint Solving CS161 Computer Security Cho, Chia Yuan.
PZ03D Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03D - Program verification Programming Language Design.
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) ⋁ ⋀ ¬ ⋁ ⋀
Certified Typechecking in Foundational Certified Code Systems Susmit Sarkar Carnegie Mellon University.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
A.Darbari¹, B. Fischer², J. Marques-Silva³ ¹ARM, Cambridge ²University of Southampton ³University College Dublin Industrial-Strength.
Software Engineering & Automated Deduction Willem Visser Stellenbosch University With Nikolaj Bjorner (Microsoft Research, Redmond) Natarajan Shankar (SRI.
Logic.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute.
PROOF TRANSLATION AND SMT LIB CERTIFICATION Yeting Ge Clark Barrett SMT 2008 July 7 Princeton.
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.
On-The-Fly Resolve Trace Minimization Ohad Shacham and Karen Yorav IBM Haifa Research Laboratory.
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
ECI 2007: Specification and Verification of Object- Oriented Programs Lecture 4.
Using Decision Procedures for Program Verification Christopher Lynch Clarkson University.
Describing Syntax and Semantics
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
On Bridging Simulation and Formal Verification Eugene Goldberg Cadence Research Labs (USA) VMCAI-2008, San Francisco, USA.
Intro. to Logic CS402 Fall Propositional Calculus - Semantics (2/3) Propositional Calculus - Semantics (2/3) Moonzoo Kim CS Division of EECS Dept.
MATH 224 – Discrete Mathematics
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
1 MVD 2010 University of Iowa New York University Comparing Proof Systems for Linear Real Arithmetic Using LFSC Andrew Reynolds September 17, 2010.
HW #1. Due Mar 22 Midnight Verify the following program using SAT solver 1. Translate the program into a SSA form 2. Create a Boolean formula from.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Activity 1-19: The Propositional Calculus
Certifying Intermediate Programming Zhaopeng Li
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
CSE Winter 2008 Introduction to Program Verification January 31 proofs through simplification.
CS6133 Software Specification and Verification
An Axiomatic Basis for Computer Programming Robert Stewart.
Automated tactics for separation logic VeriML Reconstruct Z3 Proof Safe incremental type checker Certifying code transformation Proof carrying hardware.
Random Interpretation Sumit Gulwani UC-Berkeley. 1 Program Analysis Applications in all aspects of software development, e.g. Program correctness Compiler.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
Finding Conflicting Instances of Quantified Formulas in SMT Andrew Reynolds Cesare Tinelli Leonardo De Moura July 18, 2014.
Computer Systems Laboratory Stanford University Clark W. Barrett David L. Dill Aaron Stump A Framework for Cooperating Decision Procedures.
Formal Verification – Robust and Efficient Code Lecture 1
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Lazy Proofs for DPLL(T)-Based SMT Solvers
Solving Linear Arithmetic with SAT-based MC
Jared Davis The University of Texas at Austin April 6, 2006
Lecture 2 Propositional Logic
Satisfiability Modulo Theories
Mining backbone literals in incremental SAT
Elementary Metamathematics
Canonical Computation without Canonical Data Structure
Canonical Computation Without Canonical Data Structure
Resolution Proofs for Combinational Equivalence
Canonical Computation without Canonical Data Structure
Canonical Computation without Canonical Data Structure
Verifying Clausal Proofs, DRUPing and Interpolants SAT/SMT Seminar
Presentation transcript:

Proof translation from CVC3 to Hol light Yeting Ge Acsys Mar 5, 2008

CVC3: a SMT solver CVC3 is complicated SAT, decision procedures, …… About 400k lines of code in all Are the results from CVC3 correct? Extremely difficult to verify CVC3 is correct Check the proofs from CVC3 CVC3 can produce a “proof” for a unsat case Proofs are big and a proof checker is needed Is the proof checker correct? Have to check hundreds of proof rules

Outline SMT solvers and CVC3 SMT example Proofs in CVC3 HOL and Hol light Features Proofs in HOL Translation from CVC3 into Hol light Boolean resolution Theory proof rules SMT LIB benchmarks certification

SMT solver Satisfiability Modulo Theories Arithmetic, bit vector, array, equality,…… Is satifisabile? Abstraction SAT solver Arithmetic Theory solver Equality ……

SMT example To prove is unsatisfiable Abstraction SAT solver Theory solver

Proofs in CVC3 Proofs from theory solvers Proofs from the SAT solver Modern SAT solvers can dump proofs A tree of boolean resolutions To prove ~A \/ B, ~A \/ ~B, A |- F A:BOOLEAN; B:BOOLEAN; ASSERT(NOT A OR B); ASSERT((NOT A) OR (NOT B)); ASSERT(A); QUERY(FALSE); DUMP_PROOF;

5 I : : 6 I : +1 : 9 I : : 10 I : +4 : 11 I : +3 : 12 D : +2 : D : : I : B, ~(B \/ ~A), ~A 6 I : (B \/ ~A) 9 I : ~B, ~A, ~(~A \/ ~B) 10 I : (~A \/ ~B) 11 I : A 12 D : B : B, ~A : 5 6 B : D : : ~A, ~(~A \/ ~B) : 9 12 ~(~A \/ ~B) : 11 : : 10 ~A \/ B, ~A \/ ~B, A |- F 1 : (B \/ ~A) 2 : B 3 : A 4 : (~A \/ ~B) Boolean resolution Dumped proof from minisat

Proof(minisat_proof(FALSE, bool_resolution(NOT (NOT A OR NOT B), bool_resolution(NOT A, bool_resolution(NOT B, CNF("or_final", (NOT A OR NOT B), (NOT A OR NOT B), 0), bool_resolution(NOT A, bool_resolution(NOT (B OR NOT A), CNF("or_final", (B OR NOT A), (B OR NOT A), 0), cnf_add_unit((B OR NOT A), iff_mp((NOT A OR B), (B OR NOT A), assump_23, rewrite_or((NOT A OR B), (B OR NOT A))))), cnf_add_unit(A, assump_25))), cnf_add_unit(A, assump_25)), cnf_add_unit((NOT A OR NOT B), assump_24)))) The proof from CVC3

Proofs from theory solvers Proof rules are much more complicated than boolean resolution Over 400 proof rules in CVC3 Example: mult_eqn |- (x = y) (x * z = y * z) A proof checker must make sure that z is not equivalent to 0, which is not a easy job

Ideal proof checker for SMT solvers CNF clauses in CVC3 Orginal clauses (assumptions) CNF translation clauses Tautologies (not always) Theory clauses Extra clauses asserted by theory solvers Can check boolean resolution and tautologies Can handle all theory proof rules Theory specific calculations

HOL family of proof assistants Based on higher order logic (lambda calculus) Powerful, can formalize most mathematics Simple and small core only four kinds of terms Definitional extension All theories (even /\ \/ ) are defined All theorems must be created in a constructive way Soundness is guaranteed if the core is correct Implemented in ML Programmable, easy to extend and include new decision procedures

Hol light Minimized core 10 inference rules on equality 3 axioms (axiom of choice, infinity) about 400 lines of Ocaml Chosen for a number of projects Verification of float point algorithm at Intel Kepler Conjecture A group of experts spent five years, unable to verify the proof Formalize the proof in Hol light Includes theory of arithmetic

Proofs in Hol light All theorem are constructed by using Hol proof rules Derived proof rules are just Ocaml functions #ASSUME `a:bool`;; val it : thm = a |- a let PROVE_HYP ath bth = if exists (aconv (concl ath)) (hyp bth) then EQ_MP (DEDUCT_ANTISYM_RULE ath bth) ath else bth;;

Translate proofs into HOL light Instead of a proof checker, we propose a translator of the proofs from CVC3 into Hol light Proof checking is done by Hol Light If the translation is successful, then the same theorem is proved in Hol light If a theorem is proved in Hol light, we are more confident that the theorem is true

Translation into Hol light Hol light and CVC3 are connected through C interface of Ocaml and CVC3 CVC3 terms are translated into Hol terms CVC3 uninterpreted functions are translated into combination For each CVC3 proof rules, we write a Ocaml function Prove a higher order theorem, then instantiate it

Translate boolean resolution Suppose two theorems, corresponding two CNF clauses, have been proved in HOL (1) … |- A 1 \/ (A 2 \/ (A 3 \/ ……))) (2) … |- B 1 \/ (~A 2 \/ (B 3 \/ ……))) The desired theorem is: (3) …|- A 1 \/ A 3 \/ B 1 \/ B 3 \/ …… The proof of (3) is time consuming Duplicated terms in the (3) must be removed Change the representation (1)’ … ~A 1, ~A 2,~A 3 …… |- F (2)’ … ~B 1, A 2, ~B 3 …… |- F

Translate theory proof rules |- (x = y) (x * z = y * z) let x = translate_term vc (child expr 1) in let y = translate_term vc (child expr 2) in let z = translate_term vc (child expr 3) in let znz = prove_DIV_NOT_EQ_0 z in SPECL[x;y] (MATCH_MP REAL_NZ_RMUL znz) # REAL_NZ_RMUL;; val it : thm = |- !x y z. ~(z = &0) ==> (x = y x * z = y * z)

A problem CVC3 proves a theoem is translated into Hol light that produces a theorem Are and the same theorem? A tentative solution: Dump and into some canonical form Compare the canonized theorems in syntax Dump from Hol light Translate back into CVC3 and dump it from CVC3

SMT LIB benchmarks certification SMT LIB A collection of smt benchmarks Arithmetic, Bit vector, array, unintepreted function,…… The ‘status’ in each case shows whether it is sat, unsat or unknown SMT COMP Annual competition for SMT solvers Are the answers from SMT solvers correct? Are the ‘status’ fields in SMT LIB benchmarks show the correct results We propose to prove these benchmarks in Hol light A certificate to show a case is proved

Future work Prove more cases in Hol light Support more proof rules Define new theories in Hol light theory of array are defined by a new axiom