Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

Automated Theorem Proving
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Models and Propositional Logic In propositional logic, a model in general simply fixes the truth value – true or false – for every proposition symbol.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
The Theory of NP-Completeness
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Methods of Proof Chapter 7, second half.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
ECI 2007: Specification and Verification of Object- Oriented Programs Lecture 4.
GRASP: A Search Algorithm for Propositional Satisfiability EE878C Homework #2 2002/11/1 KAIST, EECS ICS Lab Lee, Dongsoo.
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Boolean Satisfiability and SAT Solvers
Quantified Formulas - Decision Procedure Daniel Kroening, Ofer Strichman Presented by Changki Hong 07 NOV 08.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Propositional calculus
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Decision methods for arithmetic Third summer school on formal methods Leonardo de Moura Microsoft Research.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Review of Propositional Logic Syntax
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Planning as Satisfiability (SAT-Plan). SAT-Plan Translate the planning problem into a satisfiability problem for length n of Plan garb 0 (proposition)present.
28.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
NPC.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
 Conjunctive Normal Form: A logic form must satisfy one of the following conditions 1) It must be a single variable (A) 2) It must be the negation of.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Gábor Kusper University of Linz RISC Austria
Polynomial-Time Reduction
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
Introduction to Software Verification
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
NP-Completeness Proofs
Binary Decision Diagrams
PROPOSITIONAL LOGIC - SYNTAX-
Instructor: Aaron Roth
Presentation transcript:

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 Since p is true,  p is false, so it can be removed New clauses subsumes previous one unit clause: {p}

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)} }