Decision Procedures for Equality Logic. Daniel Kroening and Ofer Strichman 1

Similar documents
Decision Procedures in First Order Logic

Decision Procedures in First Order Logic

Lecture Notes on Real-world SMT

PROPOSITIONAL LOGIC (2)

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Model Checking and Its Applications

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

Deductive Methods, Bounded Model Checking

Normal Forms for Boolean Expressions

Decision Procedures in the Theory of Bit-Vectors

NP-Complete Reductions 2

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

SAT Solver. CS 680 Formal Methods Jeremy Johnson

Learning a SAT Solver from Single-

Propositional Logic. Part I

MajorSat: A SAT Solver to Majority Logic

Rethinking Automated Theorem Provers?

Where Can We Draw The Line?

An Annotated Language

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

Lecture 7: Counting classes

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

Polynomial SAT-Solver Algorithm Explanation

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

Improving Coq Propositional Reasoning Using a Lazy CNF Conversion

Linear Time Unit Propagation, Horn-SAT and 2-SAT

Binary Decision Diagrams

CS February 17

Automated Theorem Proving and Proof Checking

Seminar decision procedures: Certification of SAT and unsat proofs

W4231: Analysis of Algorithms

Yices 1.0: An Efficient SMT Solver

Nenofar: A Negation Normal Form SMT Solver

Boolean Functions (Formulas) and Propositional Logic

Computer-Aided Program Design

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

NP-Completeness. Algorithms

Mixed Integer Linear Programming

2SAT Andreas Klappenecker

8.1 Polynomial-Time Reductions

OpenSMT2. A Parallel, Interpolating SMT Solver. Antti Hyvärinen, Matteo Marescotti, Leonardo Alt, Sepideh Asadi, and Natasha Sharygina

Randomness and Computation March 25, Lecture 5

NP-complete Reductions

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

NP and computational intractability. Kleinberg and Tardos, chapter 8

P -vs- NP. NP Problems. P = polynomial time. NP = non-deterministic polynomial time

8 NP-complete problem Hard problems: demo

Chapter 10 Part 1: Reduction

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

Motivation. CS389L: Automated Logical Reasoning. Lecture 5: Binary Decision Diagrams. Historical Context. Binary Decision Trees

CAV Verification Mentoring Workshop 2017 SMT Solving

Complexity Classes and Polynomial-time Reductions

Decision Procedures. An Algorithmic Point of View. Bit-Vectors. D. Kroening O. Strichman. Version 1.0, ETH/Technion

Parallel and Distributed Computing

A Retrospective on Datalog 1.0

Introduction to Logic Programming

Lecture 2: Symbolic Model Checking With SAT

Complexity of unique list colorability

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language

A Knowledge Compilation Technique for ALC Tboxes

Knowledge Representation and Reasoning Logics for Artificial Intelligence

P and NP (Millenium problem)

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Small Formulas for Large Programs: On-line Constraint Simplification In Scalable Static Analysis

Week 4. COMP62342 Sean Bechhofer, Uli Sattler

Program Verification & Testing; Review of Propositional Logic

Boolean Representations and Combinatorial Equivalence

Andrew Reynolds Liana Hadarean

8. Symbolic Trajectory Evaluation, Term Rewriting. Motivation for Symbolic Trajectory Evaluation

SAT-CNF Is N P-complete

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Leonardo de Moura and Nikolaj Bjorner Microsoft Research

Applications of Logic in Software Engineering. CS402, Spring 2016 Shin Yoo

Computability Theory

Shared Variables and Interference

OpenMath and SMT-LIB

Satisfiability. Michail G. Lagoudakis. Department of Computer Science Duke University Durham, NC SATISFIABILITY

P = NP; P NP. Intuition of the reduction idea:

Operational Semantics 1 / 13

Implementation of a Sudoku Solver Using Reduction to SAT

Generating Small Countermodels. Andrew Reynolds Intel August 30, 2012

Generating Tests for Detecting Faults in Feature Models

SAT Solvers. Ranjit Jhala, UC San Diego. April 9, 2013

CS-E3200 Discrete Models and Search

An IPS for TQBF Intro to Approximability

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

A Proof-Producing CSP Solver

Formal Verification. Lecture 7: Introduction to Binary Decision Diagrams (BDDs)

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

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

The Design and Implementation of the Model Constructing Satisfiability Calculus

Reasoning About Imperative Programs. COS 441 Slides 10

Resolution (14A) Young W. Lim 6/14/14

Satisfiability (SAT) Applications. Extensions/Related Problems. An Aside: Example Proof by Machine. Annual Competitions 12/3/2008

Homework 4 Solutions

Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries.

Practical Course: SMT Solving

Transcription:

in First Order Logic for Equality Logic Daniel Kroening and Ofer Strichman 1

Outline Introduction Definition, complexity Reducing Uninterpreted Functions to Equality Logic Using Uninterpreted Functions in proofs Simplifications Introduction to the decision procedures The framework: assumptions and Normal Forms General terms and notions Solving a conjunction of equalities Simplifications An algorithmic point of view 2

Basic assumptions and notations Input formulas are in NNF Input formulas are checked for satisfiability Formula with Uninterpreted Functions: φ UF Equality formula: φ E An algorithmic point of view 3

First: conjunction of equalities Input: A conjunction of equalities and disequalities 1. Define an equivalence class for each variable. For each equality x = y unite the equivalence classes of x and y. Repeat until convergence. 2. For each disequality u v if u is in the same equivalence class as v return 'UNSAT'. 3. Return 'SAT'. An algorithmic point of view 4

Example x 1 = x 2 Æ x 2 = x 3 Æ x 4 =xx 5 Æ x 5 x 1 Equivalence class Equivalence class Is there a disequality between members of the same class? An algorithmic point of view 5

Next: add Uninterpreted Functions x 1 = x 2 Æ x 2 = x 3 Æ x 4 =xx 5 Æ x 5 x 1 Æ F(x 1 ) F(x 2 ) Equivalence class Equivalence class Equivalence class Equivalence class An algorithmic point of view 6

Next: Compute the Congruence Closure x 1 = x 2 Æ x 2 = x 3 Æ x 4 =xx 5 Æ x 5 x 1 Æ F(x 1 ) F(x 2 ) Equivalence class Equivalence class Now - is there a disequality between members of the same class? This is called the Congruence Closure An algorithmic point of view 7

And now: consider a Boolean structure x 1 = x 2 Ç (x 2 = x 3 Æ x 4 =xx 5 Æ x 5 x 1 Æ F(x 1 ) F(x 2 )) Equivalence class Equivalence classes case 1 case 2 Syntactic case splitting: this is what we want to avoid! An algorithmic point of view 8

Deciding Equality Logic with UFs Input: Equality Logic formula φ UF Convert φ UF to DNF For each clause: Define an equivalence class for each variable and each function instance. For each equality x = y unite the equivalence classes of x and y. For each hfunction symbol lf, unite the classes of F(x) and F(y). Repeat until convergence. If all disequalities are between terms from different equivalence classes, return 'SAT'. Return 'UNSAT'. An algorithmic point of view 9

Basic notions φ E : x = y Æ y = z Æ z x The Equality predicates: {x = y, y = z, z x} which h we can break to two sets: E = ={x = y, y = z}, E = {z x} The Equality Graph G E (φ E ) = hv,e =,E i (a.k.a E-graph ) y x z An algorithmic point of view 10

Basic notions φ E 1 : x = y Æ y = z Æ z x unsatisfiable φ 2E : x = y Æ y = z Ç z x y satisfiable x z The graph G E (φ E ) represents an abstraction of φ E It ignores the Boolean structure of φ E An algorithmic point of view 11

Basic notions y x z Dfn: a path made of E = edges is an Equality Path. we write x =*z. Dfn: a path made of E = edges + exactly one edge from E is a Disequality Path. We write x *y. An algorithmic point of view 12

Basic notions y x z Dfn. A cycle with one disequality edge is a Contradictory Cycle. In a Contradictory Cycle, for every two nodes x,y it holds that x =* y and x * y. An algorithmic point of view 13

Basic notions y x z Dfn: A subgraph is called satisfiable iff the conjunction of the predicates represented dby its edges is satisfiable. Thm: A subgraph is unsatisfiable iff it contains a Contradictory cycle An algorithmic point of view 14

Basic notions Thm: Every Contradictory Cycle is either simple or contains a simple contradictory cycle An algorithmic point of view 15

Simplifications, again Let S be the set of edges that are not part of any Contradictory Cycle Thm: replacing all solid edges in S with False, and all dashed edges in S with True, preserves satisfiability An algorithmic point of view 16

Simplification: example x 3 x 4 False x 2 x 1 (x 1 = x 2 Ç x 1 = x 4 ) Æ (x 1 x 3 Ç x 2 = x 3 ) (x 1 = x 2 Ç True) Æ (x 1 x 3 Ç x 2 = x 3 ) ( False Ç True) = True Satisfiable! An algorithmic point of view 17

Syntactic vs. Semantic splits So far we saw how to handle disjunctions through syntactic case-splitting. There are much hbetter ways to do it than simply transforming it to DNF: Semantic Tableaux, SAT-based splitting, others We will investigate some of these methods later in the course. An algorithmic point of view 18

Syntactic vs. Semantic splits Now we start looking at methods that split the search space instead. This is called semantic splitting. SAT is a very good engine for performing semantic splitting, due to its ability to guide the search, prune the search-space etc. An algorithmic point of view 19