Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 7: Procedures for First-Order Theories, Part 1
|
|
- Winfred Hodges
- 5 years ago
- Views:
Transcription
1 Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 7: Procedures for First-Order Theories, Part 1 Matt Fredrikson mfredrik@cs.cmu.edu October 17, 2016 Matt Fredrikson Theory Procedures 1 / 36
2 First-Order Theories A first-order theory T is defined by: Its signature Σ T, a set of non-logical symbols Its axioms A T, a set of closed formulas over Σ Σ T -formula A Σ T -formula contains only non-logical symbols from Σ T, as well as variables and logical connectives. Basicidea: First-order theories define a limited vocabulary for talking about a subject of interest. Theory axioms define the intended meaning. Matt Fredrikson Theory Procedures 2 / 36
3 Theory of Equality Signature: Σ E : {=, a, b, c,..., f, g, h,..., p, q, r,...} Axioms: 1. Reflexivity: x.x = x 2. Symmetry: x, y.x = y y = x 3. Transitivity: x, y, z.x = y y = z x = z 4. Function congruence: x, y. ( n i=1 x i = y i ) f(x) = f(y) 5. Predicate congruence: x, y. ( n i=1 x i = y i ) (p(x) p(y)) Matt Fredrikson Theory Procedures 3 / 36
4 Theory of Equality and Uninterpreted Functions We will make things simpler by removingpredicatesymbols Signature: Σ E : {=, a, b, c,..., f, g, h,..., p, q, r,...} Axioms: 1. Reflexivity: x.x = x 2. Symmetry: x, y.x = y y = x 3. Transitivity: x, y, z.x = y y = z x = z 4. Function congruence: x, y. ( n i=1 x i = y i ) f(x) = f(y) This is the TheoryofEqualityandUninterpretedFunctions(EUF) Does this restrict the theory? Matt Fredrikson Theory Procedures 4 / 36
5 Removing Predicates from T E We can remove predicate symbols entirely 1. For each predicate p, introduce a fresh function symbol f p 2. Introduce a fresh constant 3. Replace each instance p(t 1,..., t n ) with f p (t 1,..., t n ) = Basicidea: can define f p (...) = whenever p(...) is true Example: x = y (p(x) p(y)) becomes: x = y ((f p (x) = ) (f p (y) = )) Example: p(x) q(x, y) q(y, z) q(x, z) becomes: (f p (x) = f q (x, y) = f q (y, z) = f q (x, z) Matt Fredrikson Theory Procedures 5 / 36
6 Deciding T E Today we ll discuss an algorithm for deciding T E It is called the CongruenceClosure Algorithm Recall: binary relation R over set S is an equivalencerelation when It is reflexive: s S.sRs It is symmetric: s 1, s 2 S.s 1 Rs 2 s 2 Rs 2 It is transitive: s 1, s 2, s 3 S.s 1 Rs 2 s 2 Rs 3 s 1 Rs 3 If it also obeys congruence, the it is a congruencerelation: Functioncongruence: s, t S n. ( n i=1 s irt i ) f(s)rf(t) I.e., evaluation of terms related by R yields results related by R Matt Fredrikson Theory Procedures 6 / 36
7 Classes Let R be an equivalence relation over S The equivalenceclass of s S under R is: def [s] R = {s S : srs } Every member of S belongs to an equivalence class of R If R is a congruence relation, then [s] R is the congruenceclass of s Consider the relation 2 over Z, where a 2 b iff (a mod 2) = (b mod 2) The equivalence class of 4 under 2 is: [4] 2 = {n Z : (n mod 2) = 0} = {n Z : n is even} Matt Fredrikson Theory Procedures 7 / 36
8 Refinements We can view a relation R over S as a set of pairs, i.e., ˆR S S For any two s 1, s 2 S, the set ˆR determined by R is: ˆR def = {(s 1, s 2 ) S S s 1 Rs 2 } Given two relations R 1 and R 2 over S, we say R 1 refines R 2 if: ˆR 1 ˆR 2 Notationally, we write R 1 R 2, and can also define it as: R 1 R 2 iff s 1, s 2 S.s 1 R 1 s 2 s 1 R 2 s 2 Matt Fredrikson Theory Procedures 8 / 36
9 Refinement Examples Consider the relations: Does R 1 R 2? R 1 : {sr 1 s : s S} R 2 : {s 1 R 2 s 2 : s 1, s 2 S} Recall the relation: n : {a n b : (a mod n) = (b mod n)} Does 2 4? What about 4 2? Matt Fredrikson Theory Procedures 9 / 36
10 Equivalence Closure The equivalenceclosure R E of a relation R over S is the relation: R refines R E, R R E For all other equivalence relations R where R R, either: 1. R = R E 2. R E R R E is the smallest equivalence relation that includes R Matt Fredrikson Theory Procedures 10 / 36
11 Equivalence Closure: Example Suppose S = {a, b, c, d}, and R is an equivalence relation where arb, brc, drd To fine R E, think in terms of the definitions: R R E : arb, brc, drd R E Reflexivity: ara, brb, crc R E Symmetry: bra, crb R E Transitivity: arc R E We have to keep repeating until there aren t more updates Symmetry: cra R E R E = {arb, bra, ara, brb, brc, cra, crb, crc, drd} Matt Fredrikson Theory Procedures 11 / 36
12 Congruence Closures Define the CongruenceClosure R C of R similarly: R C is a congruence relation, and R R C For all other congruence relations R where R R, either: 1. R = R C 2. R C R MainIdea: Given a T E -formula F, F : s 1 = t 1 s m = t m s m+1 t m+1 s n t n F is T E -satisfiable iff there exists a congruence relation where: for each i {1,..., m}, s i t i for each i {m + 1,..., n}, s i t i Note: We ll only work with conjunctions. Why isn t this a problem? Matt Fredrikson Theory Procedures 12 / 36
13 Congruence Closure Algorithm More precisely, is a relation over the set of subterms S F in F We want to decide the satisfiability of: F : s 1 = t 1 s m = t m s m+1 t m+1 s n t n The algorithm works as follows: Construct the congruence closure of {s 1 = t 1,..., s m = t m } If s i t i for any i {m + 1,..., n} then return unsat Otherwise, return sat Matt Fredrikson Theory Procedures 13 / 36
14 Congruence Closure Algorithm F : s 1 = t 1 s m = t m s m+1 t m+1 s n t n Given that satisfies: for each i {1,..., m}, s i t i for each i {m + 1,..., n}, s i t i We construct a T E -interpretation that satisfies F D consists of the congruence classes of I assigns elements of D to terms of S F to satisfy I assigns = a relation that behaves like Matt Fredrikson Theory Procedures 14 / 36
15 Example F : f(a, b) = a f(f(a, b), b) a 1. Build the subterm set S F : S F = {a, b, f(a, b), f(f(a, b), b)} 2. Construct the finest congruence relation on S F : {{a}, {b}, {f(a, b)}, {f(f(a, b), b)}} 3. For each i {1,..., m}, impose s i = t i by merging: {{a, f(a, b)}, {b}, {f(f(a, b), b)}} 4. After each merge, apply axioms to propagate Matt Fredrikson Theory Procedures 15 / 36
16 Example F : f(a, b) = a f(f(a, b), b) a 1. We left off with: {{a, f(a, b)}, {b}, {f(f(a, b), b)}} 2. We can apply function congruence using f(a, b) a, b b: {{a, f(a, b), f(f(a, b), b)}, {b}} 3. This is the congruence closure of S F Matt Fredrikson Theory Procedures 16 / 36
17 Example Given {{a, f(a, b), f(f(a, b), b)}, {b}}, we construct an interpretation D = {, } I[a] =, I[f(a, b)] =, I[f(f(a, b), b)] = I[b] = =: {(, ), (, )} Does {{a, f(a, b), f(f(a, b), b)}, {b}} = F? Therefore, this formula is unsat Matt Fredrikson Theory Procedures 17 / 36
18 Example F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a 1. Build the subterm set S F : S F = {a, f(a), f 2 (a), f 3 (a), f 4 (a), f 5 (a)} 2. Construct the initial congruence relation on S F : {{a}, {f(a)}, {f 2 (a)}, {f 3 (a)}, {f 4 (a)}, {f 5 (a)}} 3. From f 3 (a) = a, merge {f 3 (a)} and {a} {{a, f 3 (a)}, {f(a)}, {f 2 (a)}, {f 4 (a)}, {f 5 (a)}} 4. From f 3 (a) a, propagate f 4 (a) f(a): {{a, f 3 (a)}, {f(a), f 4 (a)}, {f 2 (a)}, {f 5 (a)}} 5. From f 4 (a) f(a), propagate f 5 (a) f 2 (a): {{a, f 3 (a)}, {f(a), f 4 (a)}, {f 2 (a), f 5 (a)}} Matt Fredrikson Theory Procedures 18 / 36
19 Example F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a 1. We re at: {{a, f 3 (a)}, {f(a), f 4 (a)}, {f 2 (a), f 5 (a)}} 2. From f 5 (a) = a, merge {f 2 (a), f 5 (a)} and {a, f 3 (a)} {{a, f 2 (a), f 3 (a), f 5 (a)}, {f(a), f 4 (a)}, } 3. From f 3 (a) f 2 (a), propagate f 4 (a) f 3 (a) {{a, f(a), f 2 (a), f 3 (a), f 4 (a), f 5 (a)}} 4. This is the congruence closure of S F {{a, f(a), f 2 (a), f 3 (a), f 4 (a), f 5 (a)}} = F, so unsat Matt Fredrikson Theory Procedures 19 / 36
20 Example F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a 1. We re at: {{a, f 3 (a)}, {f(a), f 4 (a)}, {f 2 (a), f 5 (a)}} 2. From f 5 (a) = a, merge {f 2 (a), f 5 (a)} and {a, f 3 (a)} {{a, f 2 (a), f 3 (a), f 5 (a)}, {f(a), f 4 (a)}, } 3. From f 3 (a) f 2 (a), propagate f 4 (a) f 3 (a) {{a, f(a), f 2 (a), f 3 (a), f 4 (a), f 5 (a)}} 4. This is the congruence closure of S F {{a, f(a), f 2 (a), f 3 (a), f 4 (a), f 5 (a)}} = F, so unsat Matt Fredrikson Theory Procedures 20 / 36
21 Computing Congruence Closures The UnionFind algorithm efficiently computes congruence closures Firststep: represent the subterm set S F as a DAG For each t S F : Each node has a unique id Each node stores the function or constant symbol it represents Directed edges from a function node to its arguments What term does this graph represent? Matt Fredrikson Theory Procedures 21 / 36
22 Computing Congruence Closures To support merging, each node also tracks its equivalence class This is done by maintaining a unique representative node for each class Each node keeps a pointer to another node in its class The representative points to itself To find the representative for a given node, we follow these pointers transitively What are the congruence classes in this graph? What are the representatives? Matt Fredrikson Theory Procedures 22 / 36
23 Computing Congruence Closures When merging classes, we need to propagate congruences This requires tracking parents of subterms in the congruence class We track all parents in the representative node type Id = int datatype Node = Node( id: Id, fn: string, args: seq<id>, find: Id, ccpar: set<id> ) // unique id // symbol // arg pointers // class pointer // parent set Matt Fredrikson Theory Procedures 23 / 36
24 Union Find: Basic Operations find(i): traces the find field of node i s congruence class When a node s find field points to itself, it is the representative union(i1, i2): union of the classes of i1 and i2 First, find the class representatives for nodes i1 and i2 Make one of them the representative by setting the other s find field to it Update the parents of the new representative by adding the other s Matt Fredrikson Theory Procedures 24 / 36
25 Merging Congruence Classes For each equality s i = t i in F, we need to merge classes First we can imply call union(s i, t i ) After this, we also need to propagate the new congruence Look at pairs of parents (p 1, p 2 ) from s i and t i s respective classes 1. If p 1 and p 2 share the same function symbol, 2. have the same arity, 3. and all their children are in the same classes, pairwise then we recursively merge the classes of p 1, p 2 Matt Fredrikson Theory Procedures 25 / 36
26 Decision Procedure for T E -Satisfiability Given a T E -formula F : s 1 = t 1 s m = t m s m+1 t m+1 s n t n with subterm set S F : 1. Construct the DAG for S F 2. For i {1,..., m}, merge s i and t i 3. If find(s i ) = find(t i ) for an i {m + 1,..., n}, then unsat 4. If find(s i ) find(t i ) for all i {m + 1,..., n}, then sat Matt Fredrikson Theory Procedures 26 / 36
27 Example F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a The initial DAG: We first process f(f(f(a))) = a, by merging 3 and 0 The parents of each class in this merge are {4} and {1} So we recursively merge 4 and 1 The next parents are {5} and {2} Matt Fredrikson Theory Procedures 27 / 36
28 Example, contd. The initial DAG: F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a We first process f(f(f(a))) = a, by merging 3 and 0 The parents of each class in this merge are {4} and {1} The next parents are {5} and {2} Matt Fredrikson Theory Procedures 28 / 36
29 Example, contd. F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a The next parents are {5} and {2} After processing f(f(f(a))) = a, we have the congruence class: {{a, f 3 (a)}, {f(a), f 4 (a)}, {f 2 (a), f 5 (a)}} Now, process f 5 (a) = a by merging the representatives of 5 and 0 Matt Fredrikson Theory Procedures 29 / 36
30 Example, contd. F : f(f(f(a))) = a f(f(f(f(f(a))))) = a f(a) a The parents of 5 are {3}, and of 0 are {1, 4}, so merge 3 and 1 Now we have a single congruence class: {{a, f(a), f 2 (a), f 3 (a), f 4 (a), f 5 (a)}} And our class violates the inequality f(a) a, so unsat Matt Fredrikson Theory Procedures 30 / 36
31 T A : Theory of Arrays Signature: Σ A : {=, [ ], } a[i] is a binary function denoting read of a at index i a i v is a ternary function denoting write of value v into a at index i We ll see how to decide the quantifier-free, conjunctive fragment Is this expressive? Can only talk about individual elements, not entire arrays See chapter 11 of the book for more expressive fragments Matt Fredrikson Theory Procedures 31 / 36
32 Deciding Theory of Arrays BasicIdea: We ll reduce this to deciding T E If a T A -formula has no writes, then reads can be viewed as uninterpreted function terms If there is a write, it must occur in the context of a read. Why? So all writes occur in read-over-write terms a i v [j] We apply the read-over-write axioms to decompose these terms into simpler ones Then we use our T E solver Matt Fredrikson Theory Procedures 32 / 36
33 Deciding Theory of Arrays, In Detail Given T A -formula F, follow these steps recursively: If F doesn t contain any write terms, do the following: 1. Associate each array variable a with a fresh function symbol f a 2. Replace each read term a[i] with f a (i) 3. Decide and return the T E satisfiability of the resulting formula Otherwise, select a term a i v [j], and split into cases: 1. By (read-over-write 1), replace F [a i v [j]] with F 1 : F [v] i = j. 2. By (read-over-write 2), repl. F [a i v [j]] with F 2 : F [a[j]] i j. 3. Recurse on F 1 and F 2. If both are unsat, then return unsat. 4. If either is sat, then return sat Matt Fredrikson Theory Procedures 33 / 36
34 T A Example F : i 1 = j i 1 i 2 a[j] = v 1 a i 1 v 1 i 2 v 2 [j] a[j] F has a write term, so select a read-over-write term to deconstruct: a i 1 v 1 i 2 v 2 [j] According to (read-over-write 1), assume i 2 = j and recurse on: F 1 : i 1 = j i 1 i 2 a[j] = v 1 v 2 a[j] i 2 = j This doesn t have any write terms, so build a T E -formula: F 1 : i 1 = j i 1 i 2 f a (j) = v 1 v 2 f a (j) i 2 = j This is unsatisfiable, so let s move on to the next case Matt Fredrikson Theory Procedures 34 / 36
35 T A Example F : i 1 = j i 1 i 2 a[j] = v 1 a i 1 v 1 i 2 v 2 [j] a[j] According to (read-over-write 2), assume i 2 j and recurse on: F 2 : i 1 = j i 1 i 2 a[j] = v 1 a i 1 v 1 [j] a[j] i 2 j This has a write term, so apply (read-over-write 1) and assume i 1 = j F 3 : i 1 = j i 1 i 2 a[j] = v 1 v 1 a[j] i 2 j This is unsatisfiable, so (read-over-write 2) and assume i 1 j: F 3 : i 1 = j i 1 i 2 a[j] = v 1 a[j] a[j] i 1 j Now all branches have been tried, and we conclude that F is T A -unsat Matt Fredrikson Theory Procedures 35 / 36
36 Next Lecture For more on today s material, see Chapter 9 of Bradley & Manna Next time, we ll talk about Dealing with quantifiers Disjunctive formulas, better approaches than DNF Satisfiability Modulo Theories (SMT) Second homework is due on Tuesday! Good questions on Piazza so far, be sure to check up on the answers Matt Fredrikson Theory Procedures 36 / 36
9. Quantifier-free Equality and Data Structures
9. Quantifier-free Equality and Data Structures The Theory of Equality T E Σ E : {=, a, b, c,..., f, g, h,..., p, q, r,...} uninterpreted symbols: constants a, b, c,... functions f, g, h,... predicates
More informationAutomated Program Verification and Testing 15414/15614 Fall 2016 Lecture 8: Procedures for First-Order Theories, Part 2
Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 8: Procedures for First-Order Theories, Part 2 Matt Fredrikson mfredrik@cs.cmu.edu October 17, 2016 Matt Fredrikson Theory Procedures
More informationDecision Procedures for Verification
Decision Procedures for Verification Zohar Manna with Aaron R. Bradley Computer Science Department Stanford University 1 Motivation int[] BubbleSort(int[] a) { int i, j, t; for (i := a 1; i > 0; i := i
More informationMotivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory
Motivation CS389L: Automated Logical Reasoning Lecture 10: Overview of First-Order Theories Işıl Dillig Last few lectures: Full first-order logic In FOL, functions/predicates are uninterpreted (i.e., structure
More informationSatisfiability Modulo Theories (SMT)
CS510 Software Engineering Satisfiability Modulo Theories (SMT) Slides modified from those by Aarti Gupta Textbook: The Calculus of Computation by A. Bradley and Z. Manna 1 Satisfiability Modulo Theory
More informationSMT: Satisfiability Modulo Theories
SMT: Satisfiability Modulo Theories Ranjit Jhala, UC San Diego April 9, 2013 Decision Procedures Last Time Propositional Logic Today 1. Combining SAT and Theory Solvers 2. Theory Solvers Theory of Equality
More informationWHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008
WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008 WHAT I LL TALK ABOUT Propositional Logic Terminology, Satisfiability, Decision Procedure First-Order Logic Terminology, Background Theories Satisfiability
More informationCSE507. Satisfiability Modulo Theories. Computer-Aided Reasoning for Software. Emina Torlak
Computer-Aided Reasoning for Software CSE507 Satisfiability Modulo Theories courses.cs.washington.edu/courses/cse507/18sp/ Emina Torlak emina@cs.washington.edu Today Last lecture Practical applications
More informationFirst-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig
First-Order Logic First-Order Theories Roopsha Samanta Partly based on slides by Aaron Bradley and Isil Dillig Roadmap Review: propositional logic Syntax and semantics of first-order logic (FOL) Semantic
More informationReading 11 : Relations and Functions
CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Reading 11 : Relations and Functions Instructor: Beck Hasti and Gautam Prakriya In reading 3, we described a correspondence between predicates
More informationSection Summary. Relations and Functions Properties of Relations. Combining Relations
Chapter 9 Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations Closures of Relations (not currently included
More informationSatisfiability Modulo Theories (SMT)
Satisfiability Modulo Theories (SMT) Sylvain Conchon Cours 7 / 9 avril 2014 1 Road map The SMT problem Modern efficient SAT solvers CDCL(T) Examples of decision procedures: equality (CC) and difference
More informationCSC Discrete Math I, Spring Relations
CSC 125 - Discrete Math I, Spring 2017 Relations Binary Relations Definition: A binary relation R from a set A to a set B is a subset of A B Note that a relation is more general than a function Example:
More informationLeonardo de Moura Microsoft Research
Leonardo de Moura Microsoft Research Is formula F satisfiable modulo theory T? SMT solvers have specialized algorithms for T b + 2 = c and f(read(write(a,b,3), c-2)) f(c-b+1) b + 2 = c and f(read(write(a,b,3),
More informationAutomated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic
Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic Matt Fredrikson mfredrik@cs.cmu.edu October 17, 2016 Matt Fredrikson Propositional Logic 1 / 33 Propositional
More informationSyntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.
First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable
More informationFirst Order Logic (FOL)
First Order Logic (FOL) Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel based on slides by Prof. Ruzica Piskac, Nikolaj Bjorner, and others References Chpater 2 of Logic for
More informationSMT BASICS WS 2017/2018 ( ) LOGIC SATISFIABILITY MODULO THEORIES. Institute for Formal Models and Verification Johannes Kepler Universität Linz
LOGIC SATISFIABILITY MODULO THEORIES SMT BASICS WS 2017/2018 (342.208) Armin Biere Martina Seidl biere@jku.at martina.seidl@jku.at Institute for Formal Models and Verification Johannes Kepler Universität
More informationCS156: The Calculus of Computation
Page 1 of 31 CS156: The Calculus of Computation Zohar Manna Winter 2010 Chapter 3: First-Order Theories Page 2 of 31 First-Order Theories I First-order theory T consists of Signature Σ T - set of constant,
More informationOverview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method
Overview CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL Agenda for today: Semantic argument method for proving FOL validity Işıl Dillig Important properties of FOL
More informationTutorial 1: Modern SMT Solvers and Verification
University of Illinois at Urbana-Champaign Tutorial 1: Modern SMT Solvers and Verification Sayan Mitra Electrical & Computer Engineering Coordinated Science Laboratory University of Illinois at Urbana
More informationFirst-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)
First-Order Theorem Proving and Vampire Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester) Outline Introduction First-Order Logic and TPTP Inference Systems
More informationComp487/587 - Boolean Formulas
Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested
More informationDefinition: A binary relation R from a set A to a set B is a subset R A B. Example:
Chapter 9 1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Let A = {0,1,2} and B = {a,b} {(0, a), (0, b), (1,a), (2, b)} is a relation from A to B.
More informationMath 42, Discrete Mathematics
c Fall 2018 last updated 12/05/2018 at 15:47:21 For use by students in this class only; all rights reserved. Note: some prose & some tables are taken directly from Kenneth R. Rosen, and Its Applications,
More informationFirst-Order Theorem Proving and Vampire
First-Order Theorem Proving and Vampire Laura Kovács 1,2 and Martin Suda 2 1 TU Wien 2 Chalmers Outline Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination
More informationLecture 4.3: Closures and Equivalence Relations
Lecture 4.3: Closures and CS 250, Discrete Structures, Fall 2015 Nitesh Saxena Adopted from previous lectures by Cinda Heeren Course Admin Mid-Term 2 Exam Solution will be posted soon Should have the results
More informationDiscrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland
Discrete Mathematics W. Ethan Duckworth Fall 2017, Loyola University Maryland Contents 1 Introduction 4 1.1 Statements......................................... 4 1.2 Constructing Direct Proofs................................
More informationAutomated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving
Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving Matt Fredrikson mfredrik@cs.cmu.edu October 17, 2016 Matt Fredrikson SAT Solving 1 / 36 Review: Propositional
More informationEquality Logic and Uninterpreted Functions
Equality Logic and Uninterpreted Functions Seminar: Decision Procedures Michaela Tießler 28.06.2016 Agenda 1. Definitions 2. Use of Uninterpreted Functions 3. Decision Procedures formula: atom: term: Equality
More informationTopics in Model-Based Reasoning
Towards Integration of Proving and Solving Dipartimento di Informatica Università degli Studi di Verona Verona, Italy March, 2014 Automated reasoning Artificial Intelligence Automated Reasoning Computational
More informationSatisfiability Modulo Theories
Satisfiability Modulo Theories Summer School on Formal Methods Menlo College, 2011 Bruno Dutertre and Leonardo de Moura bruno@csl.sri.com, leonardo@microsoft.com SRI International, Microsoft Research SAT/SMT
More informationCombining Decision Procedures
Combining Decision Procedures Ashish Tiwari tiwari@csl.sri.com http://www.csl.sri.com/. Computer Science Laboratory SRI International 333 Ravenswood Menlo Park, CA 94025 Combining Decision Procedures (p.1
More information14 Equivalence Relations
14 Equivalence Relations Tom Lewis Fall Term 2010 Tom Lewis () 14 Equivalence Relations Fall Term 2010 1 / 10 Outline 1 The definition 2 Congruence modulo n 3 Has-the-same-size-as 4 Equivalence classes
More informationLecture Notes 1 Basic Concepts of Mathematics MATH 352
Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,
More informationPart IA Numbers and Sets
Part IA Numbers and Sets Definitions Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)
More informationCS156: The Calculus of Computation Zohar Manna Winter 2010
Page 3 of 31 Page 4 of 31 CS156: The Calculus of Computation Zohar Manna Winter 2010 First-Order Theories I First-order theory T consists of Signature ΣT - set of constant, function, and predicate symbols
More informationCOMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University
COMP 182 Algorithmic Thinking Relations Luay Nakhleh Computer Science Rice University Chapter 9, Section 1-6 Reading Material When we defined the Sorting Problem, we stated that to sort the list, the elements
More informationOverview, cont. Overview, cont. Logistics. Optional Reference #1. Optional Reference #2. Workload and Grading
Course staff CS389L: Automated Logical Reasoning Lecture 1: ntroduction and Review of Basics şıl Dillig nstructor: şil Dillig E-mail: isil@cs.utexas.edu Office hours: Thursday after class until 6:30 pm
More informationRelations, Functions, and Sequences
MCS-236: Graph Theory Handout #A3 San Skulrattanakulchai Gustavus Adolphus College Sep 13, 2010 Relations, Functions, and Sequences Relations An ordered pair can be constructed from any two mathematical
More information1 Propositional Logic
CS 2800, Logic and Computation Propositional Logic Lectures Pete Manolios Version: 384 Spring 2011 1 Propositional Logic The study of logic was initiated by the ancient Greeks, who were concerned with
More informationCSE507. Course Introduction. Computer-Aided Reasoning for Software. Emina Torlak
Computer-Aided Reasoning for Software CSE507 courses.cs.washington.edu/courses/cse507/14au/ Course Introduction Emina Torlak emina@cs.washington.edu Today What is this course about? Course logistics Review
More informationCS156: The Calculus of Computation
CS156: The Calculus of Computation Zohar Manna Winter 2010 It is reasonable to hope that the relationship between computation and mathematical logic will be as fruitful in the next century as that between
More informationRelations Graphical View
Introduction Relations Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Recall that a relation between elements of two sets is a subset of their Cartesian
More informationAbout the relationship between formal logic and complexity classes
About the relationship between formal logic and complexity classes Working paper Comments welcome; my email: armandobcm@yahoo.com Armando B. Matos October 20, 2013 1 Introduction We analyze a particular
More informationConstraint Solving for Finite Model Finding in SMT Solvers
myjournal manuscript No. (will be inserted by the editor) Constraint Solving for Finite Model Finding in SMT Solvers Andrew Reynolds Cesare Tinelli Clark Barrett Received: date / Accepted: date Abstract
More informationMath 300: Final Exam Practice Solutions
Math 300: Final Exam Practice Solutions 1 Let A be the set of all real numbers which are zeros of polynomials with integer coefficients: A := {α R there exists p(x) = a n x n + + a 1 x + a 0 with all a
More informationComputation and Inference
Computation and Inference N. Shankar Computer Science Laboratory SRI International Menlo Park, CA July 13, 2018 Length of the Longest Increasing Subsequence You have a sequence of numbers, e.g., 9, 7,
More informationG52DOA - Derivation of Algorithms Predicate Logic
G52DOA - Derivation of Algorithms Predicate Logic Venanzio Capretta Predicate Logic So far, we studied propositional logic, in which we started with unspecified propositional variables A, B, C, and combined
More informationFrom Constructibility and Absoluteness to Computability and Domain Independence
From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main
More informationSolving Quantified Verification Conditions using Satisfiability Modulo Theories
Solving Quantified Verification Conditions using Satisfiability Modulo Theories Yeting Ge, Clark Barrett, Cesare Tinelli Solving Quantified Verification Conditions using Satisfiability Modulo Theories
More informationAn Introduction to Z3
An Introduction to Z3 Huixing Fang National Trusted Embedded Software Engineering Technology Research Center April 12, 2017 Outline 1 SMT 2 Z3 Huixing Fang (ECNU) An Introduction to Z3 April 12, 2017 2
More informationCSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/
Computer-Aided Reasoning for Software CSE507 courses.cs.washington.edu/courses/cse507/17wi/ Introduction Emina Torlak emina@cs.washington.edu Today What is this course about? Course logistics Review of
More informationSymbolic Analysis. Xiangyu Zhang
Symbolic Analysis Xiangyu Zhang What is Symbolic Analysis CS510 S o f t w a r e E n g i n e e r i n g Static analysis considers all paths are feasible Dynamic considers one path or a number of paths Symbolic
More informationCSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.
CSE 311: Foundations of Computing I Autumn 014 Practice Final: Section X YY ZZ Name: UW ID: Instructions: Closed book, closed notes, no cell phones, no calculators. You have 110 minutes to complete the
More informationRED. Fall 2016 Student Submitted Sample Questions
RED Fall 2016 Student Submitted Sample Questions Name: Last Update: November 22, 2016 The questions are divided into three sections: True-false, Multiple Choice, and Written Answer. I will add questions
More informationDeviations from the Mean
Deviations from the Mean The Markov inequality for non-negative RVs Variance Definition The Bienaymé Inequality For independent RVs The Chebyeshev Inequality Markov s Inequality For any non-negative random
More informationCombinations of Theories for Decidable Fragments of First-order Logic
Combinations of Theories for Decidable Fragments of First-order Logic Pascal Fontaine Loria, INRIA, Université de Nancy (France) Montreal August 2, 2009 Montreal, August 2, 2009 1 / 15 Context / Motivation
More informationRelations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)
Relations Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations Reading (Epp s textbook) 8.-8.3. Cartesian Products The symbol (a, b) denotes the ordered
More informationSatisfiability Modulo Theories
Satisfiability Modulo Theories Bruno Dutertre SRI International Leonardo de Moura Microsoft Research Satisfiability a > b + 2, a = 2c + 10, c + b 1000 SAT a = 0, b = 3, c = 5 Model 0 > 3 + 2, 0 = 2 5 +
More informationRelations. P. Danziger. We may represent a relation by a diagram in which a line is drawn between two elements if they are related.
- 10 Relations P. Danziger 1 Relations (10.1) Definition 1 1. A relation from a set A to a set B is a subset R of A B. 2. Given (x, y) R we say that x is related to y and write xry. 3. If (x, y) R we say
More information6c Lecture 14: May 14, 2014
6c Lecture 14: May 14, 2014 11 Compactness We begin with a consequence of the completeness theorem. Suppose T is a theory. Recall that T is satisfiable if there is a model M T of T. Recall that T is consistent
More informationTheory Combination. Clark Barrett. New York University. CS357, Stanford University, Nov 2, p. 1/24
CS357, Stanford University, Nov 2, 2015. p. 1/24 Theory Combination Clark Barrett barrett@cs.nyu.edu New York University CS357, Stanford University, Nov 2, 2015. p. 2/24 Combining Theory Solvers Given
More informationCS156: The Calculus of Computation Zohar Manna Autumn 2008
Page 3 of 52 Page 4 of 52 CS156: The Calculus of Computation Zohar Manna Autumn 2008 Lecturer: Zohar Manna (manna@cs.stanford.edu) Office Hours: MW 12:30-1:00 at Gates 481 TAs: Boyu Wang (wangboyu@stanford.edu)
More informationSatisfiability Modulo Theories
Satisfiability Modulo Theories Summer School on Formal Methods Menlo College, 2011 Bruno Dutertre and Leonardo de Moura bruno@csl.sri.com, leonardo@microsoft.com SRI International, Microsoft Research SAT/SMT
More informationRelations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.
Relations Binary Relation Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation Let R A B be a relation from A to B. If (a, b) R, we write a R b. 1 Binary Relation Example:
More informationAutomata and Languages
Automata and Languages Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Mathematical Background Mathematical Background Sets Relations Functions Graphs Proof techniques Sets
More informationPart 2: First-Order Logic
Part 2: First-Order Logic First-order logic formalizes fundamental mathematical concepts is expressive (Turing-complete) is not too expressive (e. g. not axiomatizable: natural numbers, uncountable sets)
More informationChapter12. Relations, Functions, and Induction
. Relations. Functions. Seuences.4 Mathematical Induction.5 Recurrence Relations Chapter Review Chapter Relations, Functions, and Induction In this chapter we introduce the concepts of a relation and a
More informationFoundations of Lazy SMT and DPLL(T)
Foundations of Lazy SMT and DPLL(T) Cesare Tinelli The University of Iowa Foundations of Lazy SMT and DPLL(T) p.1/86 Acknowledgments: Many thanks to Albert Oliveras for contributing some of the material
More informationChapter 9: Relations Relations
Chapter 9: Relations 9.1 - Relations Definition 1 (Relation). Let A and B be sets. A binary relation from A to B is a subset R A B, i.e., R is a set of ordered pairs where the first element from each pair
More informationNotes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.
Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 7.1, 7.3 7.5 of Rosen cse235@cse.unl.edu
More information1.4 Equivalence Relations and Partitions
24 CHAPTER 1. REVIEW 1.4 Equivalence Relations and Partitions 1.4.1 Equivalence Relations Definition 1.4.1 (Relation) A binary relation or a relation on a set S is a set R of ordered pairs. This is a very
More informationThe Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna
The Calculus of Computation: Decision Procedures with Applications to Verification Part I: FOUNDATIONS by Aaron Bradley Zohar Manna 1. Propositional Logic(PL) Springer 2007 1-1 1-2 Propositional Logic(PL)
More informationAutomata Theory for Presburger Arithmetic Logic
Automata Theory for Presburger Arithmetic Logic References from Introduction to Automata Theory, Languages & Computation and Constraints in Computational Logic Theory & Application Presented by Masood
More informationChapter 2 - Relations
Chapter 2 - Relations Chapter 2: Relations We could use up two Eternities in learning all that is to be learned about our own world and the thousands of nations that have arisen and flourished and vanished
More informationExercises 1 - Solutions
Exercises 1 - Solutions SAV 2013 1 PL validity For each of the following propositional logic formulae determine whether it is valid or not. If it is valid prove it, otherwise give a counterexample. Note
More informationExamples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:
Logic: The Big Picture Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and
More informationChapter 6. Relations. 6.1 Relations
Chapter 6 Relations Mathematical relations are an extremely general framework for specifying relationships between pairs of objects. This chapter surveys the types of relations that can be constructed
More informationEssential facts about NP-completeness:
CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions
More informationSAT/SMT/AR Introduction and Applications
SAT/SMT/AR Introduction and Applications Ákos Hajdu Budapest University of Technology and Economics Department of Measurement and Information Systems 1 Ákos Hajdu About me o PhD student at BME MIT (2016
More informationIn mathematics there are endless ways that two entities can be related
CHAPTER 16 Relations In mathematics there are endless ways that two entities can be related to each other. Consider the following mathematical statements. 5 < 10 5 5 6 = 30 5 5 80 7 > 4 x y 8 3 a b ( mod
More information1 Predicates and Quantifiers
1 Predicates and Quantifiers We have seen how to represent properties of objects. For example, B(x) may represent that x is a student at Bryn Mawr College. Here B stands for is a student at Bryn Mawr College
More information6.825 Techniques in Artificial Intelligence. Logic Miscellanea. Completeness and Incompleteness Equality Paramodulation
6.825 Techniques in Artificial Intelligence Logic Miscellanea Completeness and Incompleteness Equality Paramodulation Lecture 9 1 Logic is a huge subject. It includes esoteric mathematical and philosophical
More informationPredicate Logic - Introduction
Outline Motivation Predicate Logic - Introduction Predicates & Functions Quantifiers, Coming to Terms with Formulas Quantifier Scope & Bound Variables Free Variables & Sentences c 2001 M. Lawford 1 Motivation:
More informationHerbrand Theorem, Equality, and Compactness
CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Herbrand Theorem, Equality, and Compactness The Herbrand Theorem We now consider a complete method for proving the unsatisfiability of sets of first-order
More informationAn Introduction to Satisfiability Modulo Theories
ICCAD 2009 Tutorial p. 1/78 An Introduction to Satisfiability Modulo Theories Clark Barrett and Sanjit Seshia ICCAD 2009 Tutorial p. 2/78 Roadmap Theory Solvers Examples of Theory Solvers Combining Theory
More informationMathematical Preliminaries. Sipser pages 1-28
Mathematical Preliminaries Sipser pages 1-28 Mathematical Preliminaries This course is about the fundamental capabilities and limitations of computers. It has 3 parts 1. Automata Models of computation
More informationAn Abstract Decision Procedure for a Theory of Inductive Data Types
An Abstract Decision Procedure for a Theory of Inductive Data Types lark Barrett Igor Shikanian Department of omputer Science ourant Institute of Mathematical Sciences New York University esare Tinelli
More informationFirst-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms
First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO
More information1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions
CS 6743 Lecture 15 1 Fall 2007 1 Circuit Complexity 1.1 Definitions A Boolean circuit C on n inputs x 1,..., x n is a directed acyclic graph (DAG) with n nodes of in-degree 0 (the inputs x 1,..., x n ),
More informationCombined Satisfiability Modulo Parametric Theories
Intel 07 p.1/39 Combined Satisfiability Modulo Parametric Theories Sava Krstić*, Amit Goel*, Jim Grundy*, and Cesare Tinelli** *Strategic CAD Labs, Intel **The University of Iowa Intel 07 p.2/39 This Talk
More informationLecture Notes on SAT Solvers & DPLL
15-414: Bug Catching: Automated Program Verification Lecture Notes on SAT Solvers & DPLL Matt Fredrikson André Platzer Carnegie Mellon University Lecture 10 1 Introduction In this lecture we will switch
More informationFoundations of Mathematics
Foundations of Mathematics L. Pedro Poitevin 1. Preliminaries 1.1. Sets We will naively think of a set as a collection of mathematical objects, called its elements or members. To indicate that an object
More informationThe Lattice of All Clones Definable by Binary Relations on a Three-Element Set
1 The Lattice of All Clones Definable by Binary Relations on a Three-Element Set Stanislav V. Moiseev The 94th Workshop on General Algebra (AAA94) Novi Sad, Serbia, June 15
More informationCOMP 409: Logic Homework 5
COMP 409: Logic Homework 5 Note: The pages below refer to the text from the book by Enderton. 1. Exercises 1-6 on p. 78. 1. Translate into this language the English sentences listed below. If the English
More informationLeonardo de Moura Microsoft Research
Leonardo de Moura Microsoft Research Logic is The Calculus of Computer Science (Z. Manna). High computational complexity Naïve solutions will not scale Is formula F satisfiable modulo theory T? SMT solvers
More informationPropositional and Predicate Logic - V
Propositional and Predicate Logic - V Petr Gregor KTIML MFF UK WS 2016/2017 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - V WS 2016/2017 1 / 21 Formal proof systems Hilbert s calculus
More informationNotes. Corneliu Popeea. May 3, 2013
Notes Corneliu Popeea May 3, 2013 1 Propositional logic Syntax We rely on a set of atomic propositions, AP, containing atoms like p, q. A propositional logic formula φ Formula is then defined by the following
More informationFinal Exam (100 points)
Final Exam (100 points) Honor Code: Each question is worth 10 points. There is one bonus question worth 5 points. In contrast to the homework assignments, you may not collaborate on this final exam. You
More information