Propositional Logic: Models and Proofs

Similar documents
Propositional Logic Language

Comp487/587 - Boolean Formulas

Language of Propositional Logic

Tecniche di Verifica. Introduction to Propositional Logic

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

Part 1: Propositional Logic

Inference in Propositional Logic

Advanced Topics in LP and FP

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

Chapter 11: Automated Proof Systems (1)

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

Propositional and Predicate Logic - II

A brief introduction to Logic. (slides from

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

Computation and Logic Definitions

Propositional logic. First order logic. Alexander Clark. Autumn 2014

3 Propositional Logic

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

Propositional Resolution Introduction

Chapter 11: Automated Proof Systems

Propositional Resolution Part 1. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

Propositional Logic: Part II - Syntax & Proofs 0-0

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic

Logic: Propositional Logic (Part I)

Warm-Up Problem. Is the following true or false? 1/35

ECE473 Lecture 15: Propositional Logic

6. Logical Inference

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional logic II.

Propositional and Predicate Logic - V

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

Learning Goals of CS245 Logic and Computation

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Logic and Inferences

Deductive Systems. Lecture - 3

LOGIC PROPOSITIONAL REASONING

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Propositional Logic Part 1

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Inference Methods In Propositional Logic

Propositional Logic: Review

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Introduction to Artificial Intelligence. Logical Agents

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Logical Agents (I) Instructor: Tsung-Che Chiang


Foundations of Artificial Intelligence

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Foundations of Artificial Intelligence

Propositional Logic: Methods of Proof (Part II)

Propositional logic. Programming and Modal Logic

CS 380: ARTIFICIAL INTELLIGENCE

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

Propositional Logic: Methods of Proof (Part II)

Inference Methods In Propositional Logic

Propositional logic (revision) & semantic entailment. p. 1/34

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

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

Propositional Logic: Methods of Proof (Part II)

Chapter 4: Classical Propositional Semantics

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

CS 7180: Behavioral Modeling and Decision- making in AI

PL: Truth Trees. Handout Truth Trees: The Setup

Propositional Logic: Evaluating the Formulas

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

Introduction to Solving Combinatorial Problems with SAT

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Lecture 11: Measuring the Complexity of Proofs

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Critical Reading of Optimization Methods for Logical Inference [1]

Foundations of Artificial Intelligence

cis32-ai lecture # 18 mon-3-apr-2006

Proof Methods for Propositional Logic

Conjunctive Normal Form and SAT

Propositional Logic: Gentzen System, G

Propositional Resolution

Normal Forms of Propositional Logic

2.2: Logical Equivalence: The Laws of Logic

Part I: Propositional Calculus

Part 1: Propositional Logic

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

Kecerdasan Buatan M. Ali Fauzi

Predicate Logic. CSE 595 Semantic Web Instructor: Dr. Paul Fodor Stony Brook University

Syntax of propositional logic. Syntax tree of a formula. Semantics of propositional logic (I) Subformulas

Reasoning with Quantified Boolean Formulas

Conjunctive Normal Form and SAT

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

Intelligent Agents. Pınar Yolum Utrecht University

Knowledge based Agents

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Exercises 1 - Solutions

Propositional logic. Programming and Modal Logic

Classical Propositional Logic

15414/614 Optional Lecture 1: Propositional Logic

Decision Procedures for Satisfiability and Validity in Propositional Logic

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

A Logic Primer. Stavros Tripakis University of California, Berkeley. Stavros Tripakis (UC Berkeley) EE 144/244, Fall 2014 A Logic Primer 1 / 35

Transcription:

Propositional Logic: Models and Proofs C. R. Ramakrishnan CSE 505 1 Syntax 2 Model Theory 3 Proof Theory and Resolution Compiled at 11:51 on 2016/11/02 Computing with Logic Propositional Logic CSE 505 1 / 17

Propositional logic Alphabet A: Propositional symbols (identifiers) Connectives: (conjunction), (disjunction), (negation), (logical equivalence), (implication). Well-formed formulas (wffs, denoted by F) over alphabet A is the smallest set such that: If p is a predicate symbol in A then p F. If F, G F then so are ( F ), (F G), (F G), (F G) and (F G). Computing with Logic Propositional Logic CSE 505 2 / 17

Interpretation An interpretation I is a subset of propositions in an alphabet A. Alternatively, you can view I as a mapping from the set of all propositions in A to a 2-values Boolean domain {true, false}. This name, interpretation, is more commonly used for predicate logic; in the propositional case, this is sometimes called a substitution or truth assignment. Computing with Logic Propositional Logic CSE 505 3 / 17

Semantics of Well-Formed Formulae A formula s meaning is given w.r.t. an interpretation I. I = p iff p I. Computing with Logic Propositional Logic CSE 505 4 / 17

Semantics of Well-Formed Formulae A formula s meaning is given w.r.t. an interpretation I. I = p iff p I. I = F iff I = F Computing with Logic Propositional Logic CSE 505 4 / 17

Semantics of Well-Formed Formulae A formula s meaning is given w.r.t. an interpretation I. I = p iff p I. I = F iff I = F I = F G iff I = F and I = G Computing with Logic Propositional Logic CSE 505 4 / 17

Semantics of Well-Formed Formulae A formula s meaning is given w.r.t. an interpretation I. I = p iff p I. I = F iff I = F I = F G iff I = F and I = G I = F G iff I = F or I = G (or both) Computing with Logic Propositional Logic CSE 505 4 / 17

Semantics of Well-Formed Formulae A formula s meaning is given w.r.t. an interpretation I. I = p iff p I. I = F iff I = F I = F G iff I = F and I = G I = F G iff I = F or I = G (or both) I = F G iff I = G whenever I = F Computing with Logic Propositional Logic CSE 505 4 / 17

Semantics of Well-Formed Formulae A formula s meaning is given w.r.t. an interpretation I. I = p iff p I. I = F iff I = F I = F G iff I = F and I = G I = F G iff I = F or I = G (or both) I = F G iff I = G whenever I = F I = F G iff I = F G and I = G F Computing with Logic Propositional Logic CSE 505 4 / 17

Models An interpretation I such that I = F is called a model of F. G is a logical consequence of F (denoted by F = G) iff every model of F is also a model of G. (in other words, G holds in every model of F ; or G is true in every interpretation that makes F true) Computing with Logic Propositional Logic CSE 505 5 / 17

Models (contd.) A formula that has at least one model is said to be satisfiable. A formula for which every interpretation is a model is called a tautology. A formula is inconsistent if it has no models. Checking whether or not a formula is satisfiable is NP-Complete. (There are exponentially many interpretations) Many interesting combinatorial problems can be reduced to checking satisfiability: hence there is a significant interest in efficient algorithms/heuristics/systems for solving the SAT problem. Computing with Logic Propositional Logic CSE 505 6 / 17

Logical Consequence Let P be a set of clauses {C 1, C 2,... C n }, where each clause C i is of the form (L 1 L 2 L k ), and where each L j is a literal: i.e. a possibly negated proposition A model for P makes every one of C i s in P true. Let G be a literal (called Goal ) Consider the question: P? = G We can use a proof procedure, based on resolution to answer this question. Computing with Logic Propositional Logic CSE 505 7 / 17

Proof System for Resolution {C} P C P (A C 1 ) P ( A C 2 ) P (C 1 C 2 ) ( P) Res The above notation is of inference rules where each rule is of the form Antecedent(s). Conclusion P C is called as a sequent. Computing with Logic Propositional Logic CSE 505 8 / 17

Proof System for Resolution (Contd.) Given a sequent, a derivation of a sequent (sometimes called its proof ) is a tree with that sequent as the root, empty leaves, and each internal node is an instance of an inference rule. A proof system based on Resolution is Sound: i.e. if F G then F = G. not Complete: i.e. there are F, G s.t. F = G but F G. E.g., p = (p q) but there is no way to derive p (p q). Computing with Logic Propositional Logic CSE 505 9 / 17

Resolution Proof (in pictures) P = {(p q), ( p r), ( q r)} (p q) Computing with Logic Propositional Logic CSE 505 10 / 17

Resolution Proof (in pictures) P = {(p q), ( p r), ( q r)} (p q) ( p r) Computing with Logic Propositional Logic CSE 505 10 / 17

Resolution Proof (in pictures) P = {(p q), ( p r), ( q r)} (p q) ( p r) (q r) ( q r) Computing with Logic Propositional Logic CSE 505 10 / 17

Resolution Proof (in pictures) P = {(p q), ( p r), ( q r)} (p q) ( p r) (q r) ( q r) r Computing with Logic Propositional Logic CSE 505 10 / 17

Resolution Proof (An Alternative View) The clauses of P are all in a soup. Resolution rule picks two clauses from the soup, of the form A C 1 and A C 2. and adds C 1 C 2 to the soup. The newly added clause can now interact with other clauses and produce yet more clauses. Ultimately, the soup consists of all clauses C such that P C. Computing with Logic Propositional Logic CSE 505 11 / 17

Resolution Proof (An Example) P = {(p q), ( p r), ( q r)} Here is a proof for P = r: Clause Number Clause How Derived 1 p q P 2 p r P 3 q r P Computing with Logic Propositional Logic CSE 505 12 / 17

Resolution Proof (An Example) P = {(p q), ( p r), ( q r)} Here is a proof for P = r: Clause Number Clause How Derived 1 p q P 2 p r P 3 q r P 4 q r Res. 1 & 2 Computing with Logic Propositional Logic CSE 505 12 / 17

Resolution Proof (An Example) P = {(p q), ( p r), ( q r)} Here is a proof for P = r: Clause Number Clause How Derived 1 p q P 2 p r P 3 q r P 4 q r Res. 1 & 2 5 r Res. 3 & 4 Computing with Logic Propositional Logic CSE 505 12 / 17

Refutation Proofs While resolution alone is incomplete for determining logical consequence, resolution is sufficient to show inconsistency i.e. show when P has no model. This leads to Refutation proofs for showing logical consequence. Say we want to determine P? = r, where r is a proposition. This is equivalent to checking if P { r} has an empty model. This we can check by constructing a resolution proof for P { r} where denotes the unsatisfiable empty clause. Computing with Logic Propositional Logic CSE 505 13 / 17

Refutation Proofs: An Example Let P = {(p q), ( p r), ( q r), (p s)}, and G = (r s) Clause Number Clause How Derived 1 p q P G 2 p r P G 3 q r P G Computing with Logic Propositional Logic CSE 505 14 / 17

Refutation Proofs: An Example Let P = {(p q), ( p r), ( q r), (p s)}, and G = (r s) Clause Number Clause How Derived 1 p q P G 2 p r P G 3 q r P G 4 r P G Computing with Logic Propositional Logic CSE 505 14 / 17

Refutation Proofs: An Example Let P = {(p q), ( p r), ( q r), (p s)}, and G = (r s) Clause Number Clause How Derived 1 p q P G 2 p r P G 3 q r P G 4 r P G 5 s P G Computing with Logic Propositional Logic CSE 505 14 / 17

Refutation Proofs: An Example Let P = {(p q), ( p r), ( q r), (p s)}, and G = (r s) Clause Number Clause How Derived 1 p q P G 2 p r P G 3 q r P G 4 r P G 5 s P G 6 q r Res. 1 & 2 Computing with Logic Propositional Logic CSE 505 14 / 17

Refutation Proofs: An Example Let P = {(p q), ( p r), ( q r), (p s)}, and G = (r s) Clause Number Clause How Derived 1 p q P G 2 p r P G 3 q r P G 4 r P G 5 s P G 6 q r Res. 1 & 2 7 r Res. 3 & 6 Computing with Logic Propositional Logic CSE 505 14 / 17

Refutation Proofs: An Example Let P = {(p q), ( p r), ( q r), (p s)}, and G = (r s) Clause Number Clause How Derived 1 p q P G 2 p r P G 3 q r P G 4 r P G 5 s P G 6 q r Res. 1 & 2 7 r Res. 3 & 6 8 Res. 4 & 7 Computing with Logic Propositional Logic CSE 505 14 / 17

Soundness of Resolution If F G then F = G: For F G, we will have a derivation (aka proof ) of finite length. We can show that F = G by induction on the length of derivation. Computing with Logic Propositional Logic CSE 505 15 / 17

Refutation-Completeness of Resolution If F is inconsistent, then F : Note that F is a set of clauses. A clause is called an unit clause if it consists of a single literal. If all clauses in F are unit clauses, then for F to be inconsistent, clearly a literal and its negation will be two of the clauses in F. Then resolving those two will generate the empty clause. A clause with n + 1 literals has n excess literals. The proof of refutation-completeness is by induction on the total number of excess literals in F. Assume refutation completeness holds for programs with a total of n excess literals; show that it holds for programs with a total of n + 1 excess literals. Computing with Logic Propositional Logic CSE 505 16 / 17

Refutation-Completeness of Resolution (contd.) If F is inconsistent, then F : From F, pick some clause α with excess literals. Pick some literal, say A from α. Consider α = α {A}. Both F 1 = (F {α}) {α } and F 2 = (F {α}) {A} have at most n excess literals. If F is inconsistent, then both F 1 and F 2 are inconsistent as well. By ind. hyp., both F 1 and F 2 have refutations. If there is a refutation of F 1 not using α, then that is a refutation for F as well. If refutation of F 1 uses α, then construct a resolution of F by adding A to the first occurrence of α (and its descendants); that will end with {A}. From here on, follow the refutation of F 2. This constructs a refutation of F. Computing with Logic Propositional Logic CSE 505 17 / 17