A.Darbari¹, B. Fischer², J. Marques-Silva³ ¹ARM, Cambridge ²University of Southampton ³University College Dublin Industrial-Strength.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

The Model Evolution Calculus with Built-in Theories Peter Baumgartner MPI Informatik, Saarbrücken
SAT Solver CS 680 Formal Methods Jeremy Johnson. 2 Disjunctive Normal Form  A Boolean expression is a Boolean function  Any Boolean function can be.
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,
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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
1 Dependent Types for Termination Verification Hongwei Xi University of Cincinnati.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Effective Propositional Reasoning CSE 473 – Autumn 2003.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
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 methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
PROOF TRANSLATION AND SMT LIB CERTIFICATION Yeting Ge Clark Barrett SMT 2008 July 7 Princeton.
Willis Lemasters Grant Conklin. Searching a tree recursively one branch at a time, abandoning any branch which does not satisfy the search constraints.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
MinML: an idealized programming language CS 510 David Walker.
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.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
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.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Boolean Satisfiability and SAT Solvers
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
1 MVD 2010 University of Iowa New York University Comparing Proof Systems for Linear Real Arithmetic Using LFSC Andrew Reynolds September 17, 2010.
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
Automated tactics for separation logic VeriML Reconstruct Z3 Proof Safe incremental type checker Certifying code transformation Proof carrying hardware.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Finding Models for Blocked 3-SAT Problems in Linear Time by Systematical Refinement of a Sub- Model Gábor Kusper Eszterházy Károly.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
NPC.
CMSC 330: Organization of Programming Languages Operational Semantics.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Inference in Propositional Logic (and Intro to SAT)
Inference and search for the propositional satisfiability problem
EA C461 – Artificial Intelligence Logical Agent
Lazy Proofs for DPLL(T)-Based SMT Solvers
Introduction to Software Verification
Lecture 2 Propositional Logic
NP-Completeness Yin Tat Lee
Propositional Calculus: Boolean Algebra and Simplification
Propositional Resolution
ECE 667 Synthesis and Verification of Digital Circuits
Logics for Data and Knowledge Representation
Resolution Proofs for Combinational Equivalence
Logics for Data and Knowledge Representation
Verifying Clausal Proofs, DRUPing and Interpolants SAT/SMT Seminar
Presentation transcript:

A.Darbari¹, B. Fischer², J. Marques-Silva³ ¹ARM, Cambridge ²University of Southampton ³University College Dublin Industrial-Strength Certified SAT Solving through Verified SAT Proof Checking

Boolean Satisfiability (SAT) Problems Given a propositional Boolean formula φ (a ∨ b) ∧ ( a → b) ∧ ( a ← b) ∧ ¬ ( a ∧ b) determine whether a satisfying assignment of variables to truth values exists. Result is a claim: SAT:at least one satisfying assignment exists UNSAT:no satisfying assignment exists Back-end language for many applications: Hardware verification Software verification System configuration Genome analysis...

Boolean Satisfiability Solving Given a propositional Boolean formula φ in clausal form {{a, b}, {¬ a, b}, { a, ¬b}, {¬ a, ¬b}} determine whether a satisfying assignment of variables to truth values exists. Solvers based on Davis-Putnam-Logemann-Loveland algorithm: 1.If φ = ∅ then SAT 2.If ⃞ ∈ φ then UNSAT 3.If φ = φ’ ∪ {x}then DPLL( φ’[ x ↦ true]) If φ = φ’ ∪ {¬x}then DPLL( φ’[ x ↦ false]) 4.Pick arbitrary x and return DPLL( φ[ x ↦ false]) ∨ DPLL( φ[ x ↦ true]) +NP-complete but many heuristics and optimizations ⇒ can handle problems with 100,000’s of variables {{a, b}, {¬ a, b}, { a, ¬b}} {{ b}, {¬b}} { {b}} {⃞}{⃞} {⃞}{⃞} ∅ a ↦ false a ↦ true b ↦ false b ↦ true

Boolean Satisfiability Solving Given a propositional Boolean formula φ in clausal form {{a, b}, {¬ a, b}, { a, ¬b}, {¬ a, ¬b}} determine whether a satisfying assignment of variables to truth values exists. Solvers based on Davis-Putnam-Logemann-Loveland algorithm: 1.If φ = ∅ then SAT 2.If ⃞ ∈ φ then UNSAT 3.If φ = φ’ ∪ {x}then DPLL( φ’[ x ↦ true]) If φ = φ’ ∪ {¬x}then DPLL( φ’[ x ↦ false]) 4.Pick arbitrary x and return DPLL( φ[ x ↦ false]) ∨ DPLL( φ[ x ↦ true]) +NP-complete but many heuristics and optimizations ⇒ can handle problems with 100,000’s of variables {{a, b}, {¬ a, b}, { a, ¬b},{¬a,¬b}} {{ b}, {¬b}} {⃞}{⃞} {⃞}{⃞} a ↦ false a ↦ true b ↦ false b ↦ true {⃞}{⃞} {⃞}{⃞} Result is a claim: SAT:at least one satisfying assignment exists UNSAT:no satisfying assignment exists Do you trust your SAT-solver?

Certificates provide assurance for untrusted systems. Def.: A certificate is externally checkable evidence of the validity of a claim. ⇒ valid certificate guarantees correctness of specific run only ⇒ but even for incorrect systems

Certificates for SAT Claims Def.: A certificate is externally checkable evidence of the validity of a claim. SAT-certificate: satisfying assignment provided by almost all SAT-solvers easy to check: evaluate formula wrt. assignment

Certificates for SAT & UNSAT Claims Def.: A certificate is externally checkable evidence of the validity of a claim. SAT-certificate: satisfying assignment provided by almost all SAT-solvers easy to check: evaluate formula wrt. assignment UNSAT-certificate: checkable evidence of exhaustive search??

Certificates for SAT & UNSAT Claims Def.: A certificate is externally checkable evidence of the validity of a claim. SAT-certificate: satisfying assignment provided by almost all SAT-solvers easy to check: evaluate formula wrt. assignment UNSAT-certificate: propositional resolution proof provided by many SAT-solvers can be reconstructed from DPLL search (more) difficult to check: need to replay resolution steps Do you trust your proof checker?

SHRUTI: Goal and Architecture Goal: extend off-the-shelf SAT-solver by verified proof checker but not compromise industrial-strength performance Goal: prevent system lock-in but fix proof format (tracecheck) ⇒box up solver and proof transformation if necessary ⊳Picosat + tracecheck clause reordering ⊳zChaff + transformation to tracecheck format ⊳... but can’t assign blame to solver or transformation checkers simpler than solvers, so formal verification is feasible SAT Solver industrial-strength large & complex untrusted (ad-hoc) proof-generating + proof transformation SHRUTI small & clean trusted (formal) proof checking CNF claim certificate (proof) certified checked claim proof Industrial Strength Certified Solver rejected claim

Proof format is integer-based. Example proof: * * : 12 {a, b} 2: 2 {¬ a, b} 3: 1-2 {a, ¬b} 4: -2 {¬ a, ¬b} 5: *31 {a} 6: *42 {¬ a } clausesresolution chains integers are variables zero is delimiter sign determines polarity integers are clause indexes zero is delimiter ‘*’ is placeholder for resolvent must be ordered correctly

1: 12 {a, b} 2: 2 {¬ a, b} 3: 1-2 {a, ¬b} 4: -2 {¬ a, ¬b} 5: *31 {a} 6: *425 ⃞ Proof format is integer-based. Example proof: * * clausesresolution chains integers are variables zero is delimiter sign determines polarity integers are clause indexes zero is delimiter ‘*’ is placeholder for resolvent must be ordered correctly Things that can go wrong: clauses not in problem wrong indices in chain wrong ordering in chain wrong literals resolved last resolvent is not empty clause

SHRUTI: Approach and Design Idea: use extraction from formalized development (Coq) –formalize theory and algorithm (LCF style) –prove correctness properties –extract code ⇒ checker is never run inside prover Shallow embedding, but close to actual data structures –clauses are integer lists (sorted by abs. value), not booleans –simplifies integration: not much to do on parsing –simplifies optimization of extracted code Not dogmatic about correct-by-construction –not verifying everything (e.g. I/O) but focus on crucial core

SHRUTI: Formalization in Coq Definition c1 ⋈ c2 = union c1 c2 nil Definition union (c1 c2 : list Z) (acc : list Z) = match c1, c2 with | nil, c2 ⇒ app (rev acc) c2 | c1, nil ⇒ app (rev acc) c1 | x::xs, y::ys ⇒ if (x+y = 0) then auxunion xs ys acc else if (abs x < abs y) then union xs (y::ys) (x::acc) else if (abs y < abs x) then union (x::xs) ys (y::acc) else union xs ys (x::acc) end Definition auxunion (c1 c2 : list Z) (acc : list Z) = match c1, c2 with … | x::xs, y::ys ⇒ if (abs x < abs y) then auxunion xs (y::ys) (x::acc) else if (abs y < abs x ) then auxunion (x::xs) ys (y::acc) else if x=y then auxunion xs ys (x::acc) else auxunion xs ys (x::y::acc) end first pair of complementary literals remove both copy rest keep lists sorted factoring keep lists sorted factoring another pair of complementary literals... keep both

SHRUTI: Logical characterization “Soundness theorem”: ∀ c c c · {c, c } ⊢ c ⇒ {c, c } ⊧ c ≡ {definition ⊢, deduction theorem} ∀ c c c · c ⋈ c = c ⇒ ( c ∧ c ⇒ c ) ≡ {substitution, contrapositive} ∀ c c · ¬ ( c ⋈ c ) ⇒ ¬ ( c ∧ c ) ⇒ need to lift to integer-representation and explicit interpretations Theorem: ∀ c c · ∀ I · Logical I ⊃ ¬( EvalClause (c ⋈ c ) I ) ⊃ ¬( EvalCNF [c, c ] I ) ⋈ ⋈ Logical I ≡ ∀ x : Z · I(-x) = ¬I(x) EvalClause nil I ≡ false EvalClause (x::xs) I ≡ (I x) ∨ EvalClause xs I EvalCNF nil I ≡ true EvalCNF (x::xs) I ≡ EvalClause x I ∧ Eval CNF xs I

SHRUTI: Operational characterization Resolution can also be characterized operationally [Robinson65]: 1.A pair of complementary literals is deleted in the resolvent obtained from resolving a given pair of clauses. 2.All unequal literals that are not part of a complementary pair are retained in the resolvent. 3.If there are no duplicate literals within each clause, then for a literal that exists in both the clauses, only one copy of the literal is retained in the resolvent (factoring). +legality check, clause table lookup,... ⇒ can all be formalized and proven This is the technical core of the work but tedious... Only holds if there’s only one complementary pair!

Program Extraction Can use program extraction to convert formal development into executable OCaml code ⇒... but hopelessly inefficient Need to map algebraic data types to built-ins: –Z ↦ int, Boolean ↦ bool –Coq products / lists / maps ↦ OCaml records / lists / maps 7x – 10x speed-up

Program Extraction and Optimization Can use program extraction to convert formal development into executable OCaml code ⇒... but hopelessly inefficient Need to map algebraic data types to built-ins: –Z ↦ int, Boolean ↦ bool –Coq products / lists / maps ↦ OCaml records / lists / maps Things that should have been done by the compiler: –inlining / let-restructuring –replace app (rev x) y by tail recursive app_rev Tweaking the garbage collector 7x – 10x speed-up 10x speed-up on large problems 20% speed-up

Experimental Results industrial benchmarks checks zChaff proofs similar approach but runs inside HOL4 prover check PicoSAT proofs uncertified C++ proof checker

Experimental Results - Summary Proof checking can be fast but impacts proof times noticeably –tracecheck adds ≈10- 20% to PicoSAT Running checker inside a prover is prohibitively slow Extraction from formal development hits sweet spot: –1.5x to 32x faster than HOL4 –2.5x slower than tracecheck

Conclusions and Future Work Formal verification of an efficient proof checker is feasible –... but development effort remains high –... despite focus on critical core –trusted component base: Coq core, Coq extractor, mappings, I/O, glue code, compiler, operating system Combination of unverified solver and verified checker is an appealing approach Formal development available at Future work: More optimizations Translators for / adaption to other proof formats SMT proofs

SHRUTI: Operational characterization Resolution can also be characterized operationally [Robinson65]: 1.A pair of complementary literals is deleted in the resolvent obtained from resolving a given pair of clauses. 2.All unequal literals that are not part of a complementary pair are retained in the resolvent. 3.If there are no duplicate literals within each clause, then for a literal that exists in both the clauses, only one copy of the literal is retained in the resolvent (factoring). +legality check, clause table lookup,... ⇒ can all be formalized and proven, read the paper This is the technical core of the work but tedious...

Experimental Results industrial benchmarks checks zChaff proofs similar approach but runs inside HOL4 prover check PicoSAT proofs uncertified C++ proof checker