Propositional and First Order Reasoning

Similar documents
The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Lecture 2 Propositional Logic & SAT

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

CS156: The Calculus of Computation

Comp487/587 - Boolean Formulas

A brief introduction to Logic. (slides from

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

Part 1: Propositional Logic

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

CS156: The Calculus of Computation Zohar Manna Autumn 2008

Formal Verification Methods 1: Propositional Logic

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel

Tutorial 1: Modern SMT Solvers and Verification

Tecniche di Verifica. Introduction to Propositional Logic

Foundations of Artificial Intelligence

Propositional logic. Programming and Modal Logic

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

LOGIC PROPOSITIONAL REASONING

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

Propositional Logic: Evaluating the Formulas

Propositional Logic: Models and Proofs

Logic and Inferences

ECE473 Lecture 15: Propositional Logic

Part 1: Propositional Logic

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Propositional Resolution

Satisfiability Modulo Theories

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

Maximum 3-SAT as QUBO

Lecture 9: The Splitting Method for SAT

Propositional Calculus

1 Efficient Transformation to CNF Formulas

Lecture Notes on SAT Solvers & DPLL

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Foundations of Artificial Intelligence

Solutions to Sample Problems for Midterm

Introduction to Artificial Intelligence. Logical Agents

SAT Solvers: Theory and Practice

Classical Propositional Logic

Computation and Logic Definitions

Truth-Functional Logic

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

NP and Computational Intractability

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas

Logical Agents. Chapter 7

Equivalences. Proposition 2.8: The following equivalences are valid for all formulas φ, ψ, χ: (φ φ) φ. Idempotency Idempotency Commutativity

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

NP-Hardness reductions

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Chapter 4: Classical Propositional Semantics

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

An Introduction to SAT Solving

Propositional Reasoning

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

Chapter 7 Propositional Satisfiability Techniques

Intelligent Agents. Pınar Yolum Utrecht University

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz )

Planning as Satisfiability

Kecerdasan Buatan M. Ali Fauzi

Propositional Logic: Methods of Proof (Part II)

Decision Procedures for Satisfiability and Validity in Propositional Logic

A Collection of Problems in Propositional Logic

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Supplementary exercises in propositional logic

Solutions to Homework I (1.1)

2.5.2 Basic CNF/DNF Transformation

Language of Propositional Logic

Propositional and Predicate Logic - II

Critical Reading of Optimization Methods for Logical Inference [1]

Propositional and Predicate Logic. jean/gbooks/logic.html

On the Relative Efficiency of DPLL and OBDDs with Axiom and Join

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

CS 380: ARTIFICIAL INTELLIGENCE

Deductive Systems. Lecture - 3

NP-Complete Reductions 2

Propositional Logic: Methods of Proof. Chapter 7, Part II

Solving SAT Modulo Theories

A New 3-CNF Transformation by Parallel-Serial Graphs 1

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Satisfiability and SAT Solvers. CS 270 Math Foundations of CS Jeremy Johnson

Chapter 7 Propositional Satisfiability Techniques

Worst-Case Upper Bound for (1, 2)-QSAT

Normal Forms of Propositional Logic

CS 512, Spring 2017, Handout 10 Propositional Logic: Conjunctive Normal Forms, Disjunctive Normal Forms, Horn Formulas, and other special forms

Propositional logic. Programming and Modal Logic

Exercises 1 - Solutions

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Introduction to Solving Combinatorial Problems with SAT

Proof Methods for Propositional Logic

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Propositional Logic: Methods of Proof (Part II)

Propositional Logic Part 1

Pythagorean Triples and SAT Solving

A Method for Generating All the Prime Implicants of Binary CNF Formulas

Transcription:

Propositional and First Order Reasoning

Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p p Clause: disjunction of literals q \/ p \/ r given by set of literalsl {q, p, r} Conjunctive Normal Form: conjunction of clauses (q \/ p \/ r) /\ (p \/ r) given by set of sets of literals { {q, p, r}, {p, q} }

Generate Verification Condition if (p) q=true; else r=true; if (!p) q=false; else r=false; assert(q =!r);

Resolution Rule Goal: obtain empty clause (contradiction) Observation: if the above resolution can be made, and if D is a superset of D, then also this works (but is worse): We keep only D. A subset clause subsumes its supersets.

Unit Resolution unit clause: {p} Since p is true, p is false, so it can be removed New clauses subsumes previous one

Boolean Constraint Propagation def BCP(S : Set[Clause]) : Set[Clause] = if for some unit clause U S clause C S, resolve(u,c) S then BCP(S resolve(u,c)) else S def delsubsumed(s : Set[Clause]) : Set[Clause] = if there are C1,C2 S such that C1 C2 then delsubsumes(s \ {C2}) else S

DPLL Algorithm def issatdpll(s : Set[Clause]) : Boolean = val S' = delsubsumed(bcp(s)) if ({} in S') then false else if (S' has only unit clauses) then true else val P = pick a variable from FV(S') DPLL(F' union {p}) DPLL(F' union {Not(p)})

How to obtain clauses?

Translate to Conjunctive Normal Form Generate a set of clauses for a formula A) Applying: p \/ (q /\ r) (p \/ q) /\ (p \/ r) + simple + no new variables introduced in translation - obtain exponentially size formula, e.g. from (p 1 /\ p 2 ) \/ (p 2 /\ p 3 ) \/... \/ (p n-1 /\ p n ) B) Introducing fresh variables due to Tseitin + not exponential + useful and used in practice Key idea: give names to subformulas

Apply Transformation to Example Without fresh variables With fresh variables

Tseitin s translation Translate to negation normal form (optional) push negation to leaves polynomial time, simple transformation For each subformula F i have variable p i For F i of the form F m \/ F n introduce into CNF the conjunct p i <-> (p m \/ p n ) i.e. (p i -> p m \/ p n ), (p m \/ p n ) -> p i { p i, p m, p n }, { p m, p i }, { p n, p i } 3 small clauses per node of original formula

Polynomial algorithm for SAT? Checking satisfiability of formulas in DNF is polynomial time process DNF is disjunction of conjunctions of literals If a formula is in DNF, it is satisfiable iff one of its disjuncts is satisfiable A conjunction is satisfiable iff it does not list two contradictory literals Algorithm: Analogously to CNF, use Tseitin s transformation to generate DNF of a formula test the satisfiability of the resulting formula

Correctness of Tseitin s transformation Original formula: F Translated formula: [[F]] Variables introduced in translation: p 1,..., p n [[F]] is equivalent to p 1,..., p n. F A satisfiable assignment for [[F]] is a satisfiable assignment for F. If we find satisfiable assignment for F, subformulas give us assignment for p i

DPLL Davis Putnam Logemann Loveland Algorithm for SAT Key ideas use Boolean Constraint Propagation (BCP) exhaustively apply unit resolution otherwise, try to set variable p true/false (add the appropriate unit clause {p}, { p})

DPLL Algorithm def issatdpll(s : Set[Clause]) : Boolean = val S' = delsubsumed(bcp(s)) if ({} in S') then false else if (S' has only unit clauses) then true else val P = pick a variable from FV(S') DPLL(S' union {p}) DPLL(S' union {Not(p)})

DPLL is complete Case analysis on all truth values Truth table method, with optimizations

DPLL Proof is Resolution Proof Why is each reasoning step resolution When DPLL terminates, it can emit a proof Claim: it can always emit a resolution proof emitting proofs is only polynomial overhead, a natural extension of the algorithm What steps does DPLL make: unit resolution is resolution subsumption does not remove proof existence case analysis on truth values why is it resolution?

decision: p false

Why Case Analysis is Resolution

First-Order Logic Terminology Terms: built using function symbols from variables constants Atomic formulas: combine terms using relation symbols they are like propositional formulas (but have structure) equality is one binary relation symbol Literal: atomic formula or its negation Clause: disjunction of literals Conjunctive Normal Form: conjunction of clauses { {Q(f(x),x), P(a), R(x,f(x))}, {Q(a,b), P(b)} }