Automated Theorem Proving and Proof Checking. Proof Checking. Motivation. Cunning Plan. Standard Architecture. History

Size: px
Start display at page:

Download "Automated Theorem Proving and Proof Checking. Proof Checking. Motivation. Cunning Plan. Standard Architecture. History"

Transcription

1 Automated Theorem Proving and Proo Checking Engler: Automatically Generating Malicious Disks using Symex IEEE Security and Privacy 2006 Use CIL and Symbolic Execution on Linux FS code Special model o memory, makes theorem prover calls, aims to hit all paths, has trouble with loops New: transorm program so that it combines concrete and symbolic execution (c. RTCG) New: uses contraint solver to automatically generate test case (= FS image) Found 5 bugs (4 panic, 1 root) Special thanks to Wei Hu or noticing this #1 #2 Cunning Plan There are ull-semester courses on automated deduction; we will elide details. Logic Syntax Theories Satisiability Procedures Mixed Theories Theorem Proving Proo Checking SAT-based Theorem Provers (c. Engler paper) #3 Motivation Can be viewed as decidable AI Would be nice to have a procedure to automatically reason rom premises to conclusions Used to rule out the exploration o ineasible paths (model checking, datalow) Used to reason about the heap (McCarthy, symbolic execution) Used to automatically synthesize programs rom speciications (e.g. Leroy, Engler optional papers) Used to discover proos o conjectures (e.g., Tarski conjecture proved by machine in 1996, eicient geometry theorem provers) Generally under-utilized #4 History Standard Architecture Automated deduction is logical deduction perormed by a machine Involves logic and mathematics One o the oldest and technically deepest ields o computer science Some results are as much as 75 years old Checking a Large Routine, Turing 1949 Automation eorts are about 40 years old Floyd-Hoare axiomatic semantics Still experimental (even ater 40 years) Program Speciication Veriication Condition Generation Validity Theorem In A Logic Semantics Provability Meets Spec Or Found A Bug Automated Theorem Proving #5 #6 1

2 Logic Grammar We ll use the ollowing logic: Goals: G ::= L true G 1 G 2 H G x. G Hypotheses: H ::= L true H 1 H 2 Literals: L ::= p(e 1,, E k ) Expressions: E ::= n (E 1,, E m ) This is a subset o irst-order logic Intentionally restricted: no so ar Predicate unctions p: <, =, Expression unctions : +, *, sel, upd, #7 Theorem Proving Problem Write an algorithm prove such that: I prove(g) = true then G Soundnes (must have) I G then prove(g) = true Completeness (nice to have, optional) prove(h,g) means prove H G Architecture: Separation o Concerns #1. Handle,,, = #2. Handle, *, sel, upd, = #8 Theorem Proving Want to prove true things Avoid proving alse things We ll do proo-checking later to rule out the cat proo shown here For now, let s just get to the point where we can prove something Basic Symbolic Theorem Prover Let s deine prove(h,g) prove(h, true) = true prove(h, G 1 G 2 ) = prove(h,g 1 )&& prove(h, G 2 ) prove(h 1, H 2 G) = prove(h 1 H 2, G) prove(h, x. G) = prove(h, G[a/x]) prove(h, L) =??? (a is resh ) #9 #10 Theorem Prover or Literals Theory Terminology We have reduced the problem to prove(h,l) But H is a conjunction o literals L 1 L k Thus we really have to prove that L 1 L k L Equivalently, that L 1 L k L is unsatisiable For any assignment o values to variables the truth value o the conjunction is alse Now we can say prove(h,l) = Unsat(H L) #11 A theory consists o a set o unctions and predicate symbols (syntax) and deinitions or the meanings o those symbols (semantics) Examples: 0, 1, -1, 2, -3,, +, -, =, < (usual meanings; theory o integers with arithmetic or Presburger arithmetic ) =, (axioms o transitivity, anti-symmetry, and x. y. x y y x ; theory o total orders ) sel, upd (McCarthy s theory o lists ) #12 2

3 Decision Procedures or Theories The Decision Problem Decide whether a ormula in a theory with irstorder logic is true Example: Decide x. x>0 ( y. x=y+1) in {N, +, =, >} A theory is decidable when there is an algorithm that solves the decision problem This algorithm is the decision procedure or that theory Satisiability Procedures The Satisiability Problem Decide whether a conjunction o literals in the theory is satisiable Factors out the irst-order logic part The decision problem can be reduced to the satisiability problem Parameters or, skolem unctions or, negate and convert to DNF (sorry; I won t explain this here) Easiest Theory = Propositional Logic = SAT A decision procedure or it is a SAT solver #13 #14 Theory o Equality Theory o equality with uninterpreted unctions Symbols: =,,, g, Axiomatically deined (A,B,C Expressions): A=A B=A A=B A=B A=C B=C A=B (A) = (B) Example satisiability problem: g(g(g(x)))=x g(g(g(g(g(x)))))=x g(x) x More Satisying Examples Theory o Linear Arithmetic Symbols:, =, +, -, integers Example: y > 2x + 1, x > 1, y < 0 is unsat Satisiability problem is in P (loosely, no multiplication means no tricky encodings) Theory o Lists Symbols: cons, head, tail, nil head(cons(a,b)) = A tail(cons(a,b) = B Theorem: head(x) = head(y) tail(x) = tail(y) x = y #15 #16 Mixed Theories Oten we have acts involving symbols rom multiple theories E s symbols =,,, g, (uninterp unction equality) R s symbols =,, +, -,, 0, 1, (linear arithmetic) Running Example (and Fact): x y y + z x 0 z ((x) (y)) = (z) To prove this, we must decide: Unsat(x y, y + z x, 0 z, ((x) (y)) (z)) We may have a sat procedure or each theory E s sat procedure by Ackermann in 1924 R s proc by Fourier The sat proc or their combination is much harder Only in 1979 did we get E+R #17 Satisiability o Mixed Theories Unsat(x y, y + z x, 0 z, ((x) (y)) (z)) Can we just separate out the terms in Theory 1 rom the terms in Theory 2 and see i they are separately saisiable? No, unsound, equi-sat equivalent. The problem is that the two satisying assignments may be incompatible Idea (Nelson and Oppen): Each sat proc announces all equalities between variables that it discovers #18 3

4 Handling Multiple Theories We ll use cooperating decision procedures Each sat proc works on the literals it understands Sat procs share inormation (equalities) Consider Equality and Arith ((x) (y) (z) x y y + z x 0 z alse x = y (x) = (y) (x) (y) = z ((x) (y)) = (z) y x 0 = z How can we do this in our prover? #19 #20 Nelson-Oppen: The E-DAG Represent all terms in one Equivalence DAG Node names act as variables shared between theories! ((x) (y)) (z) y x x y + z z 0 - Nelson-Oppen: Processing Run each sat proc Report all contradictions (as usual) Report all equalities between nodes (key idea) - Implementation details: Use unionind to track node equivalence classes in E-DAG. When merging A=B, also merge (A)=(B). + + y x z 0 y x z 0 #21 #22 Nelson-Oppen: Processing Broadcast all discovered equalities Rerun sat procedures Until no more equalities or a contradiction - Contradiction X + y x z 0 Does It Work? I a contradiction is ound, then unsat This is sound i sat procs are sound Because only sound equalities are ever ound I there are no more equalities, then sat Is this complete? Have they shared enough ino? Are the two satisying assignments compatible? Yes! (Countable theories with ininite models admit isomorphic models, convex theories have necessary interpretations, etc.) #23 #24 4

5 Proos Checking proos ain t like dustin crops, boy! Proo Generation We want our theorem prover to emit proos No need to trust the prover Can ind bugs in the prover Can be used or proo-carrying code Can be used to extract invariants Can be used to extract models Implements the soundness argument On every run, a soundness proo is constructed #25 #26 Proo Representation Proos are trees Leaves are hypotheses/axioms Internal nodes are inerence rules Axiom: true introduction true Constant: truei : p p is the type o proos A B Inerence: conjunction introduction A B Constant: andi : p p p Inerence: conjunction elimination Constant: andel : p P Problem: A B A andel truei : p but does not represent a valid proo Need a more powerul type system that checks content truei andi andel Dependent Types Make p a amily o types indexed by ormulas : Type (type o encodings o ormulas) e : Type (type o encodings o expressions) p : Type (the type o proos indexed by ormulas: it is a proo that is true) Examples: true : and : truei : p true andi : p A p B p (and A B) andi : ΠA:. ΠB:. p A p B p (and A B) #27 #28 Proo Checking Validate proo trees by type-checking them Given a proo tree X claiming to prove A B Must check X : p (and A B) We use expression tree equality, so andel (andi 1+2=3 x=y ) does not have type p (3=3) This is already a proo system! I the proo-supplier wants to use the act that 1+2=3 3=3, she can include a proo o it somewhere! Thus Type Checking = Proo Checking And it s quite easily decidable! #29 Parametric Judgment Universal Introduction Rule o Inerence [a/x]a (a is resh) x. A We represent bound variables in the logic using bound variables in the meta-logic all : (e ) Example: x. x=x represented as (all (λx. eq x x)) Note: y. y=y has an α-equivalent representation Substitution is done by β-reduction in meta-logic [E/x](x=x) is (λx. eq x x) E #30 5

6 Parametric Proo Rules [a/x]a (a is resh) x. A Universal Introduction alli: ΠA:(e ). (Πa:e. p (A a)) p (all A) x. A [E/x]A Universal Elimination alle: ΠA:(e ). ΠE:e. p (all A) p (A E) Parametric Proo Rules x. A Existential Introduction existi: ΠA:(e ). ΠE:e. p (A E) p (exists A) Existential Elimination existe: ΠA:(e ). ΠB:. [E/x]A [a/x]a x. A B B p (exists A) (Πa:e. p (A a) p B) p B #31 #32 SAT-Based Theorem Provers Recall separation o concerns: #1 Prover handles connectives (,, ) #2 Sat procs handle literals (+,, 0, head) Idea: reduce proo obligation into propositional logic, eed to SAT solver (CVC) To Prove: 3*x=9 (x = 7 x 4) Becomes Prove: A (B C) Becomes Unsat: A (B C) Becomes Unsat: A ( B C) SAT-Based Theorem Proving To Prove: 3*x=9 (x = 7 x 4) Becomes Unsat: A ( B C) SAT Solver Returns: A=1, C=0 Ask sat proc: unsat(3*x=9, x 4) = true Add constraint: (A C) Becomes Unsat: A ( B C) (A C) SAT Solver Returns: A=1, B=0 Ask sat proc: unsat(3*x=9, x=7) = alse (x=3 is a satisying assignment) We re done! (original to-prove goal is alse) I SAT Solver returns no satisying assignment then original to-prove goal is true #33 #34 Homework Project Status Update Project Due Tue Apr 25 You have ~21 days to complete it. Need help? Stop by my oice or send . #35 6

Automated Theorem Proving and Proof Checking

Automated Theorem Proving and Proof Checking Automated Theorem Proving and Proof Checking #1 #2 Cunning Theorem-Proving Plan There are full-semester courses on automated deduction; we will elide details. Logic Syntax Theories Satisfiability Procedures

More information

Deductive Methods, Bounded Model Checking

Deductive Methods, Bounded Model Checking Deductive Methods, Bounded Model Checking http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Deductive methods Pavel Parízek Deductive Methods, Bounded

More information

Piecewise polynomial interpolation

Piecewise polynomial interpolation Chapter 2 Piecewise polynomial interpolation In ection.6., and in Lab, we learned that it is not a good idea to interpolate unctions by a highorder polynomials at equally spaced points. However, it transpires

More information

CS 161: Design and Analysis of Algorithms

CS 161: Design and Analysis of Algorithms CS 161: Design and Analysis o Algorithms Announcements Homework 3, problem 3 removed Greedy Algorithms 4: Human Encoding/Set Cover Human Encoding Set Cover Alphabets and Strings Alphabet = inite set o

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics Introduction to Axiomatic Semantics Meeting 10, CSCI 5535, Spring 2009 Announcements Homework 3 due tonight Homework 2 is graded 13 (mean), 14 (median), out of 21 total, but Graduate class: final project

More information

Modeling and Analysis of Workflow Based on TLA

Modeling and Analysis of Workflow Based on TLA JOURNAL OF COMPUTERS, VOL. 4, NO. 1, JANUARY 2009 27 Modeling and Analysis o Worklow Based on TLA CHEN Shu Wu Han University Computer Science Department, Wu Han China Email: Chenshu181@yahoo.com.cn WU

More information

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré Hoare Logic COMP2600 Formal Methods for Software Engineering Rajeev Goré Australian National University Semester 2, 2016 (Slides courtesy of Ranald Clouston) COMP 2600 Hoare Logic 1 Australian Capital

More information

Introduction to Axiomatic Semantics (1/2)

Introduction to Axiomatic Semantics (1/2) #1 Introduction to Axiomatic Semantics (1/2) How s The Homework Going? Remember that you can t just define a meaning function in terms of itself you must use some fixed point machinery. #2 #3 Observations

More information

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1 LAST TIME ON HOL Proof rules for propositional and predicate logic Safe and unsafe rules NICTA Advanced Course Forward Proof Slide 1 Theorem Proving Principles, Techniques, Applications Slide 3 The Epsilon

More information

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x Binary recursion Unate unctions! Theorem I a cover C() is unate in,, then is unate in.! Theorem I is unate in,, then every prime implicant o is unate in. Why are unate unctions so special?! Special Boolean

More information

Generell Topologi. Richard Williamson. May 6, 2013

Generell Topologi. Richard Williamson. May 6, 2013 Generell Topologi Richard Williamson May 6, Thursday 7th January. Basis o a topological space generating a topology with a speciied basis standard topology on R examples Deinition.. Let (, O) be a topological

More information

Global Constraints. Combinatorial Problem Solving (CPS) Enric Rodríguez-Carbonell (based on materials by Javier Larrosa) February 22, 2019

Global Constraints. Combinatorial Problem Solving (CPS) Enric Rodríguez-Carbonell (based on materials by Javier Larrosa) February 22, 2019 Global Constraints Combinatorial Problem Solving (CPS) Enric Rodríguez-Carbonell (based on materials by Javier Larrosa) February 22, 2019 Global Constraints Global constraints are classes o constraints

More information

Numerical Computations and Formal Methods

Numerical Computations and Formal Methods Program verification Formal arithmetic Decision procedures Proval, Laboratoire de Recherche en Informatique INRIA Saclay IdF, Université Paris Sud, CNRS October 28, 2009 Program verification Formal arithmetic

More information

Introduction to Axiomatic Semantics (1/2)

Introduction to Axiomatic Semantics (1/2) #1 Introduction to Axiomatic Semantics (1/2) How s The Homework Going? Remember: just do the counterexample guided abstraction refinement part of DPLL(T). If you notice any other errors, those are good

More information

The λ-calculus. 1 Background on Computability. 2 Some Intuition for the λ-calculus. 1.1 Alan Turing. 1.2 Alonzo Church

The λ-calculus. 1 Background on Computability. 2 Some Intuition for the λ-calculus. 1.1 Alan Turing. 1.2 Alonzo Church The λ-calculus 1 Background on Computability The history o computability stretches back a long ways, but we ll start here with German mathematician David Hilbert in the 1920s. Hilbert proposed a grand

More information

Boolean Functions (Formulas) and Propositional Logic

Boolean Functions (Formulas) and Propositional Logic EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving Part I: Basics Sanjit A. Seshia EECS, UC Berkeley Boolean Functions (Formulas) and Propositional Logic Variables: x 1, x 2, x 3,, x

More information

Global Caching, Inverse Roles and Fixpoint Logics

Global Caching, Inverse Roles and Fixpoint Logics Global Caching, Inverse Roles and Fixpoint Logics Rajeev Goré Logic and Computation Group College o Engineering and Computer Science The Australian National University Canberra ACT 0200, Australia Abstract.

More information

DPLL(Γ+T): a new style of reasoning for program checking

DPLL(Γ+T): a new style of reasoning for program checking DPLL(Γ+T ): a new style of reasoning for program checking Dipartimento di Informatica Università degli Studi di Verona Verona, Italy June, 2011 Motivation: reasoning for program checking Program checking

More information

Three Applications of Strictness in the Efficient Implementaton of Higher-Order Terms

Three Applications of Strictness in the Efficient Implementaton of Higher-Order Terms Three Applications of Strictness in the Efficient Implementaton of Higher-Order Terms Frank Pfenning Workshop on Implementation of Logic Réunion Island, France November 11, 2000 Joint work with Carsten

More information

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

Lecture 5 - Axiomatic semantics

Lecture 5 - Axiomatic semantics Program Verification March 2014 Lecture 5 - Axiomatic semantics Lecturer: Noam Rinetzky Scribes by: Nir Hemed 1.1 Axiomatic semantics The development of the theory is contributed to Robert Floyd, C.A.R

More information

GABRIEL C. DRUMMOND-COLE

GABRIEL C. DRUMMOND-COLE MILY RIHL: -CTGORIS FROM SCRTCH (TH SIC TWO-CTGORY THORY) GRIL C. DRUMMOND-COL I m trying to be really gentle on the category theory, within reason. So in particular, I m expecting a lot o people won t

More information

Introduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics

Introduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics Brutus Is An Honorable Man HW2 will not be due today. Homework X+1 will never be due until after I have returned Homework X to you. Normally this is never an issue, but I was sick yesterday and was hosting

More information

Lecture 4. First order logic is a formal notation for mathematics which involves:

Lecture 4. First order logic is a formal notation for mathematics which involves: 0368.4435 Automatic Software Verification April 14, 2015 Lecture 4 Lecturer: Mooly Sagiv Scribe: Nimrod Busany, Yotam Frank Lesson Plan 1. First order logic recap. 2. The SMT decision problem. 3. Basic

More information

Lambda Calculus and Type Inference

Lambda Calculus and Type Inference Lambda Calculus and Type Inference Björn Lisper Dept. of Computer Science and Engineering Mälardalen University bjorn.lisper@mdh.se http://www.idt.mdh.se/ blr/ October 13, 2004 Lambda Calculus and Type

More information

Formally Certified Satisfiability Solving

Formally Certified Satisfiability Solving SAT/SMT Proof Checking Verifying SAT Solver Code Future Work Computer Science, The University of Iowa, USA April 23, 2012 Seoul National University SAT/SMT Proof Checking Verifying SAT Solver Code Future

More information

Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories. ACSys Seminar

Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories. ACSys Seminar Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories Yeting Ge Leonardo de Moura ACSys Seminar 2008.12 Motivation SMT solvers have been successful Quantified smt formulas are

More information

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

Satisfiability Modulo Theories. DPLL solves Satisfiability fine on some problems but not others DPLL solves Satisfiability fine on some problems but not others DPLL solves Satisfiability fine on some problems but not others Does not do well on proving multipliers correct pigeon hole formulas cardinality

More information

Isabelle/HOL:Selected Features and Recent Improvements

Isabelle/HOL:Selected Features and Recent Improvements /: Selected Features and Recent Improvements webertj@in.tum.de Security of Systems Group, Radboud University Nijmegen February 20, 2007 /:Selected Features and Recent Improvements 1 2 Logic User Interface

More information

Decision Procedures for Recursive Data Structures with Integer Constraints

Decision Procedures for Recursive Data Structures with Integer Constraints Decision Procedures for Recursive Data Structures with Ting Zhang, Henny B Sipma, Zohar Manna Stanford University tingz,sipma,zm@csstanfordedu STeP Group, June 29, 2004 IJCAR 2004 - p 1/31 Outline Outline

More information

Chapter 1. Introduction

Chapter 1. Introduction 1 Chapter 1 Introduction An exciting development of the 21st century is that the 20th-century vision of mechanized program verification is finally becoming practical, thanks to 30 years of advances in

More information

Automatic Software Verification

Automatic Software Verification Automatic Software Verification Instructor: Mooly Sagiv TA: Oded Padon Slides from Eran Yahav and the Noun Project, Wikipedia Course Requirements Summarize one lecture 10% one lecture notes 45% homework

More information

9.8 Graphing Rational Functions

9.8 Graphing Rational Functions 9. Graphing Rational Functions Lets begin with a deinition. Deinition: Rational Function A rational unction is a unction o the orm P where P and Q are polynomials. Q An eample o a simple rational unction

More information

Rethinking Automated Theorem Provers?

Rethinking Automated Theorem Provers? Rethinking Automated Theorem Provers? David J. Pearce School of Engineering and Computer Science Victoria University of Wellington @WhileyDave http://whiley.org http://github.com/whiley Background Verification:

More information

Certificate Translation for Optimizing Compilers

Certificate Translation for Optimizing Compilers Certiicate Translation or Optimizing Compilers Gilles Barthe IMDEA Sotware and Benjamin Grégoire and César Kunz and Tamara Rezk INRIA Sophia Antipolis - Méditerranée Proo Carrying Code provides trust in

More information

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy!

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy! Introduction to Denotational Semantics Class Likes/Dislikes Survey would change [the bijection question] to be one that still tested students' recollection of set theory but that didn't take as much time

More information

λ calculus is inconsistent

λ calculus is inconsistent Content Rough timeline COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification Gerwin Klein, June Andronick, Toby Murray λ Intro & motivation, getting started [1] Foundations & Principles

More information

In Our Last Exciting Episode

In Our Last Exciting Episode In Our Last Exciting Episode #1 Lessons From Model Checking To find bugs, we need specifications What are some good specifications? To convert a program into a model, we need predicates/invariants and

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

Lambda Calculus and Type Inference

Lambda Calculus and Type Inference Lambda Calculus and Type Inference Björn Lisper Dept. of Computer Science and Engineering Mälardalen University bjorn.lisper@mdh.se http://www.idt.mdh.se/ blr/ August 17, 2007 Lambda Calculus and Type

More information

Decision Procedures in First Order Logic

Decision Procedures in First Order Logic in irst Order Logic for Equality Logic Part III for Equality Logic and Uninterpreted unctions Algorithm I rom Equality to Propositional Logic Adding transitivity constraints Making the graph chordal An

More information

Software Engineering Lecture Notes

Software Engineering Lecture Notes Software Engineering Lecture Notes Paul C. Attie August 30, 2013 c Paul C. Attie. All rights reserved. 2 Contents I Hoare Logic 11 1 Propositional Logic 13 1.1 Introduction and Overview..............................

More information

A Requirement Specification Language for Configuration Dynamics of Multiagent Systems

A Requirement Specification Language for Configuration Dynamics of Multiagent Systems A Requirement Speciication Language or Coniguration Dynamics o Multiagent Systems Mehdi Dastani, Catholijn M. Jonker, Jan Treur* Vrije Universiteit Amsterdam, Department o Artiicial Intelligence, De Boelelaan

More information

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) 6.1 Instructional Objective Students should understand the advantages of first order logic as a knowledge representation language Students

More information

An Industrially Useful Prover

An Industrially Useful Prover An Industrially Useful Prover J Strother Moore Department of Computer Science University of Texas at Austin July, 2017 1 Recap Yesterday s Talk: ACL2 is used routinely in the microprocessor industry to

More information

Improving Coq Propositional Reasoning Using a Lazy CNF Conversion

Improving Coq Propositional Reasoning Using a Lazy CNF Conversion Using a Lazy CNF Conversion Stéphane Lescuyer Sylvain Conchon Université Paris-Sud / CNRS / INRIA Saclay Île-de-France FroCoS 09 Trento 18/09/2009 Outline 1 Motivation and background Verifying an SMT solver

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

Lectures 20, 21: Axiomatic Semantics

Lectures 20, 21: Axiomatic Semantics Lectures 20, 21: Axiomatic Semantics Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Static Analysis Based on slides by George Necula Pratikakis (CSD) Axiomatic Semantics

More information

Classifier Evasion: Models and Open Problems

Classifier Evasion: Models and Open Problems Classiier Evasion: Models and Open Problems Blaine Nelson 1, Benjamin I. P. Rubinstein 2, Ling Huang 3, Anthony D. Joseph 1,3, and J. D. Tygar 1 1 UC Berkeley 2 Microsot Research 3 Intel Labs Berkeley

More information

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

SMT-LIB for HOL. Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory. ITP Workshop MSR Cambridge 25 August 2009 1 / 13 SMT-LIB for HOL Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory ITP Workshop MSR Cambridge 25 August 2009 2 / 13 The SMT-LIB Standard SMT Satisfiability

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214 Theorem proving PVS theorem prover Abhik Roychoudhury National University of Singapore Both specification and implementation can be formalized in a suitable logic. Proof rules for proving statements in

More information

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

STABILITY AND PARADOX IN ALGORITHMIC LOGIC STABILITY AND PARADOX IN ALGORITHMIC LOGIC WAYNE AITKEN, JEFFREY A. BARRETT Abstract. Algorithmic logic is the logic of basic statements concerning algorithms and the algorithmic rules of deduction between

More information

WHEN DO THREE LONGEST PATHS HAVE A COMMON VERTEX?

WHEN DO THREE LONGEST PATHS HAVE A COMMON VERTEX? WHEN DO THREE LONGEST PATHS HAVE A COMMON VERTEX? MARIA AXENOVICH Abstract. It is well known that any two longest paths in a connected graph share a vertex. It is also known that there are connected graphs

More information

Software Verification : Introduction

Software Verification : Introduction Software Verification : Introduction Ranjit Jhala, UC San Diego April 4, 2013 What is Algorithmic Verification? Algorithms, Techniques and Tools to ensure that Programs Don t Have Bugs (What does that

More information

Deductive Program Verification with Why3

Deductive Program Verification with Why3 Deductive Program Verification with Why3 Jean-Christophe Filliâtre CNRS Mathematical Structures of Computation Formal Proof, Symbolic Computation and Computer Arithmetic Lyon, February 2014 definition

More information

The λ-calculus. 1 Background on Computability. 2 Programming Paradigms and Functional Programming. 1.1 Alan Turing. 1.

The λ-calculus. 1 Background on Computability. 2 Programming Paradigms and Functional Programming. 1.1 Alan Turing. 1. The λ-calculus 1 Background on Computability The history o computability stretches back a long ways, but we ll start here with German mathematician David Hilbert in the 1920s. Hilbert proposed a grand

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Automated Theorem Proving: DPLL and Simplex

Automated Theorem Proving: DPLL and Simplex #1 Automated Theorem Proving: DPLL and Simplex One-Slide Summary An automated theorem prover is an algorithm that determines whether a mathematical or logical proposition is valid (satisfiable). A satisfying

More information

Formal Predicate Calculus. Michael Meyling

Formal Predicate Calculus. Michael Meyling Formal Predicate Calculus Michael Meyling May 24, 2013 2 The source for this document can be found here: http://www.qedeq.org/0_04_07/doc/math/qedeq_formal_logic_v1.xml Copyright by the authors. All rights

More information

Decision Procedures in the Theory of Bit-Vectors

Decision Procedures in the Theory of Bit-Vectors Decision Procedures in the Theory of Bit-Vectors Sukanya Basu Guided by: Prof. Supratik Chakraborty Department of Computer Science and Engineering, Indian Institute of Technology, Bombay May 1, 2010 Sukanya

More information

Integration of SMT Solvers with ITPs There and Back Again

Integration of SMT Solvers with ITPs There and Back Again Integration of SMT Solvers with ITPs There and Back Again Sascha Böhme and University of Sheffield 7 May 2010 1 2 Features: SMT-LIB vs. Yices Translation Techniques Caveats 3 4 Motivation Motivation System

More information

Lecture Notes on Real-world SMT

Lecture Notes on Real-world SMT 15-414: Bug Catching: Automated Program Verification Lecture Notes on Real-world SMT Matt Fredrikson Ruben Martins Carnegie Mellon University Lecture 15 1 Introduction In the previous lecture we studied

More information

[Draft. Please do not distribute] Online Proof-Producing Decision Procedure for Mixed-Integer Linear Arithmetic

[Draft. Please do not distribute] Online Proof-Producing Decision Procedure for Mixed-Integer Linear Arithmetic [Draft Please do not distribute] Online Proof-Producing Decision Procedure for Mixed-Integer Linear Arithmetic Sergey Berezin, Vijay Ganesh, and David L Dill Stanford University {berezin,vganesh,dill}@stanfordedu

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences.

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences. Quantification In this and subsequent chapters, we will develop a more formal system of dealing with categorical statements, one that will be much more flexible than traditional logic, allow a deeper analysis

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University February 26, 2017 Version: 100 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Why3 where programs meet provers

Why3 where programs meet provers Why3 where programs meet provers Jean-Christophe Filliâtre CNRS KeY Symposium 2017 Rastatt, Germany October 5, 2017 history started in 2001, as an intermediate language in the process of verifying C and

More information

Typed Lambda Calculus for Syntacticians

Typed Lambda Calculus for Syntacticians Department of Linguistics Ohio State University January 12, 2012 The Two Sides of Typed Lambda Calculus A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a

More information

Main Goal. Language-independent program verification framework. Derive program properties from operational semantics

Main Goal. Language-independent program verification framework. Derive program properties from operational semantics Main Goal Language-independent program verification framework Derive program properties from operational semantics Questions: Is it possible? Is it practical? Answers: Sound and complete proof system,

More information

Data & Knowledge Engineering

Data & Knowledge Engineering Data & Knowledge Engineering 73 (2012) 1 22 Contents lists available at SciVerse ScienceDirect Data & Knowledge Engineering journal homepage: www.elsevier.com/locate/datak OCL-Lite: Finite reasoning on

More information

Normal Forms for Boolean Expressions

Normal Forms for Boolean Expressions Normal Forms for Boolean Expressions A NORMAL FORM defines a class expressions s.t. a. Satisfy certain structural properties b. Are usually universal: able to express every boolean function 1. Disjunctive

More information

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees Axiomatizing Arithmetic Logic: The Big Picture Suppose we restrict the domain to the natural numbers, and allow only the standard symbols of arithmetic (+,, =, >, 0, 1). Typical true formulas include:

More information

Interpretations and Models. Chapter Axiomatic Systems and Incidence Geometry

Interpretations and Models. Chapter Axiomatic Systems and Incidence Geometry Interpretations and Models Chapter 2.1-2.4 - Axiomatic Systems and Incidence Geometry Axiomatic Systems in Mathematics The gold standard for rigor in an area of mathematics Not fully achieved in most areas

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Operational Semantics CMSC 330 Summer 2018 1 Formal Semantics of a Prog. Lang. Mathematical description of the meaning of programs written in that language

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

More information

CMSC 330: Organization of Programming Languages. Operational Semantics

CMSC 330: Organization of Programming Languages. Operational Semantics CMSC 330: Organization of Programming Languages Operational Semantics Notes about Project 4, Parts 1 & 2 Still due today (7/2) Will not be graded until 7/11 (along with Part 3) You are strongly encouraged

More information

Verifying Java Programs Verifying Java Programs with KeY

Verifying Java Programs Verifying Java Programs with KeY Verifying Java Programs Verifying Java Programs with KeY Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at

More information

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

The SMT-LIB 2 Standard: Overview and Proposed New Theories 1 / 23 The SMT-LIB 2 Standard: Overview and Proposed New Theories Philipp Rümmer Oxford University Computing Laboratory philr@comlab.ox.ac.uk Third Workshop on Formal and Automated Theorem Proving and

More information

Effective Static Race Detection for Java. Part I. Chord. Chord. Chord. Chord - Overview. Problems addressed

Effective Static Race Detection for Java. Part I. Chord. Chord. Chord. Chord - Overview. Problems addressed Eective Static Race Detection or Java Mayer Naik, Alex Aiken, John Whaley Part I Introduction to Chord and Preliminaries presented by Matt McGill Chord Chord Chord is a static (data) race detection tool

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 7 This lecture returns to the topic of propositional logic. Whereas in Lecture Notes 1 we studied this topic as a way of understanding

More information

DISCRETE MATHEMATICS

DISCRETE MATHEMATICS DISCRETE MATHEMATICS WITH APPLICATIONS THIRD EDITION SUSANNA S. EPP DePaul University THOIVISON * BROOKS/COLE Australia Canada Mexico Singapore Spain United Kingdom United States CONTENTS Chapter 1 The

More information

Formal Systems and their Applications

Formal Systems and their Applications Formal Systems and their Applications Dave Clarke (Dave.Clarke@cs.kuleuven.be) Acknowledgment: these slides are based in part on slides from Benjamin Pierce and Frank Piessens 1 Course Overview Introduction

More information

Symbolic and Concolic Execution of Programs

Symbolic and Concolic Execution of Programs Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015 Information Security, CS 526 1 Reading for this lecture Symbolic execution and program testing - James

More information

A Proposed Approach for Solving Rough Bi-Level. Programming Problems by Genetic Algorithm

A Proposed Approach for Solving Rough Bi-Level. Programming Problems by Genetic Algorithm Int J Contemp Math Sciences, Vol 6, 0, no 0, 45 465 A Proposed Approach or Solving Rough Bi-Level Programming Problems by Genetic Algorithm M S Osman Department o Basic Science, Higher Technological Institute

More information

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13. 13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution Theorem Proving 13.3 PROLOG and Automated Reasoning 13.4

More information

Logic-Flow Analysis of Higher-Order Programs

Logic-Flow Analysis of Higher-Order Programs Logic-Flow Analysis of Higher-Order Programs Matt Might http://matt.might.net/ POPL 2007 Why? Tim Sweeney, POPL 2006 Static array-bounds checking. Example... a[i]... Will 0 i < a.length always hold? 3

More information

Hawraa Abbas Almurieb. Axiomatic Systems

Hawraa Abbas Almurieb. Axiomatic Systems 2 Axiomatic Systems 2.1. Introduction to Axiomatic Systems We need undefined terms for any axiomatic system to build the axioms upon them. Which are basic worlds or things for the system. 2.1.1 Definitions

More information

n HW7 due in about ten days n HW8 will be optional n No CLASS or office hours on Tuesday n I will catch up on grading next week!

n HW7 due in about ten days n HW8 will be optional n No CLASS or office hours on Tuesday n I will catch up on grading next week! Announcements SMT Solvers, Symbolic Execution n HW7 due in about ten days n HW8 will be optional n No CLASS or office hours on Tuesday n I will catch up on grading next week! n Presentations n Some of

More information

Circuit analysis summary

Circuit analysis summary Boolean Algebra Circuit analysis summary After finding the circuit inputs and outputs, you can come up with either an expression or a truth table to describe what the circuit does. You can easily convert

More information

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers. CSE 240, Fall, 2013 Homework 2 Due, Tuesday September 17. Can turn in class, at the beginning of class, or earlier in the mailbox labelled Pless in Bryan Hall, room 509c. Practice Problems: 1. Consider

More information

Software Quality Assurance

Software Quality Assurance Software Quality Assurance Every week we see new examples of: computer systems error/failure Here are some examples, taken from different industries Airport chaos after computer crash By Vanessa Allen,

More information

Hoare logic. A proof system for separation logic. Introduction. Separation logic

Hoare logic. A proof system for separation logic. Introduction. Separation logic Introduction Hoare logic Lecture 6: Examples in separation logic In the previous lecture, we saw how reasoning about pointers in Hoare logic was problematic, which motivated introducing separation logic.

More information

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions. CS 6110 S18 Lecture 18 Denotational Semantics 1 What is Denotational Semantics? So far we have looked at operational semantics involving rules for state transitions, definitional semantics involving translations

More information

The Rule of Constancy(Derived Frame Rule)

The Rule of Constancy(Derived Frame Rule) The Rule of Constancy(Derived Frame Rule) The following derived rule is used on the next slide The rule of constancy {P } C {Q} {P R} C {Q R} where no variable assigned to in C occurs in R Outline of derivation

More information

From OCL to Propositional and First-order Logic: Part I

From OCL to Propositional and First-order Logic: Part I 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 From OCL to Propositional and First-order Logic: Part I Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally

More information

Boolean Representations and Combinatorial Equivalence

Boolean Representations and Combinatorial Equivalence Chapter 2 Boolean Representations and Combinatorial Equivalence This chapter introduces different representations of Boolean functions. It then discusses the applications of these representations for proving

More information