Deductive Systems. Lecture - 3

Similar documents
02 Propositional Logic

Advanced Topics in LP and FP

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

Language of Propositional Logic

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

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

Propositional and Predicate Logic - V

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

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

Logic and Inferences

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

Chapter 3: Propositional Calculus: Deductive Systems. September 19, 2008

Propositional Resolution

Inference in Propositional Logic

Natural Deduction for Propositional Logic

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

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

Propositional Resolution

Logic: Propositional Logic (Part I)

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Inference Methods In Propositional Logic

Propositional Reasoning

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Knowledge based Agents

Part 1: Propositional Logic

Proof Methods for Propositional Logic

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

A brief introduction to Logic. (slides from

Propositional Logic: Models and Proofs

Inference Methods In Propositional Logic

6. Logical Inference

Propositional Logic Language

Propositional logic II.

Propositional Resolution Introduction

Propositional Logic: Gentzen System, G

CS 380: ARTIFICIAL INTELLIGENCE

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional Calculus - Soundness & Completeness of H

Propositional and Predicate Logic - IV

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

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

Logical agents. Chapter 7. Chapter 7 1

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

Intelligent Agents. Pınar Yolum Utrecht University

Logical Agent & Propositional Logic

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

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

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


Artificial Intelligence Chapter 7: Logical Agents

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

Logic: First Order Logic

Logical Agent & Propositional Logic

Marie Duží

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

Logic for Computer Science - Week 4 Natural Deduction

3 Propositional Logic

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

Discrete Mathematics

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

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

Lecture 13: Soundness, Completeness and Compactness

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Discrete Mathematics (VI) Yijia Chen Fudan University

Section 1.2: Propositional Logic

Notes on Inference and Deduction

Comp487/587 - Boolean Formulas

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Logical Agents. Chapter 7

Chapter 11: Automated Proof Systems (1)

Propositional Logic: Review

PL: Truth Trees. Handout Truth Trees: The Setup

Supplementary exercises in propositional logic

Inf2D 13: Resolution-Based Inference

Logical Agents (I) Instructor: Tsung-Che Chiang

Propositional logic. Programming and Modal Logic

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Propositional Logic: Methods of Proof (Part II)

Artificial Intelligence

CS:4420 Artificial Intelligence

Propositional Logic: Syntax

Classical Propositional Logic

Propositional Logic Part 1

15414/614 Optional Lecture 1: Propositional Logic

Version January Please send comments and corrections to

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Warm-Up Problem. Write a Resolution Proof for. Res 1/32

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

KE/Tableaux. What is it for?

Introduction to Intelligent Systems

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional Logic. Fall () Propositional Logic Fall / 30

Artificial Intelligence

Chapter 11: Automated Proof Systems

Introduction to Metalogic

Transcription:

Deductive Systems Lecture - 3

Axiomatic System

Axiomatic System (AS) for PL AS is based on the set of only three axioms and one rule of deduction. It is minimal in structure but as powerful as the truth table and natural deduction approaches. The proofs of the theorems are often difficult and require a guess in selection of appropriate axiom(s) and rules. These methods basically require forward chaining strategy where we start with the given hypotheses and prove the goal.

Axiomatic System for PL -Cont Three axioms and one rule of deduction. Axiom1 (A1): α (β α) Axiom2 (A2): (α (β γ)) ((α β) (α γ)) Axiom3 (A3): (~ α ~ β) ( β α) Modus Ponen (MP) defined as follows: Hypotheses: α β and α Consequent: β

Cont Definition: A deduction of a formula in Axiomatic System for Propositional Logic is a sequence of wellformed formulae α 1, α 2,..., α n such that for each i, (1 i n), either Either α i is an axiom or α i is a hypothesis (given to be true) Or α i is derived from α j and α k where j, k < i using modus ponen inference rule. We call α i to be a deductive consequence of {α 1,...,α i-1 }. It is denoted by {α 1,.., α i-1 } - α i. More formally, deductive consequence is defined on next slide.

Cont Definition: If is a set of hypotheses involved in the deduction of α as defined above, then α is called to be a deductive consequence of or α is deducible from. It is written as -α. Definition: If is an empty set and α is deduced, then we write - α. In this case α is deduced from axioms only and no hypotheses are used. In such case we call α to be a theorem. Instances of the axioms are the simplest forms of theorems in Axiomatic Theory.

Cont It should be noted that proofs need not be unique. We have to carefully select axioms, which can lead to the proof. The proof of a theorem can be tricky and hard. The proofs require mixture of bottom up and top down reasoning. Start reasoning bottom up seeing what we can do with axioms and top down reasoning seeing what might possibly lead to answer.

Examples Establish the following: Ex1: {Q} - (P Q) i.e.,p Q is a deductive consequence of {Q}. {Hypothesis} Q (1) {Axiom A1} Q (P Q) (2) {MP, (1,2)} P Q proved

Examples Cont Ex2: { P Q, Q R } - ( P R ) i.e., P R is a deductive consequence of { P Q, Q R }. {Hypothesis} P Q (1) {Hypothesis} Q R (2) {Axiom A1} (Q R) (P (Q R)) (3) {MP, (2, 3)} P (Q R) (4) {Axiom A2} (P (Q R)) ((P Q) (P R)) (5) {MP, (4, 5)} (P Q) (P R) (6) {MP, (1, 6)} P R proved

Deduction Theorems in AS Deduction Theorem: If is a set of hypotheses and α and β are well-formed formulae, then { α } - β implies - (α β ). Converse of deduction theorem: Given - (α β ), we can prove { α } - β.

Useful Tips 1. Given α, we can easily prove β α for any well-formed formulae α and β. 2. If α β is to be proved, then include α in the set of hypotheses and derive β from the set { α}. Then using deduction theorem, we conclude α β.

Examples Example1: Prove - ~P (P Q) using deduction theorem of Axiomatic System. Proof: Prove {~ P} - (P Q) and - ~ P (P Q) follows from deduction theorem.

Proof {Prove} {~ P} - (P Q) {Hypothesis} ~ P (1) {Axiom A1} ~ P (~ Q ~ P) (2) {MP, (1, 2)} ~ Q ~ P (3) {Axiom A3} (~ Q ~ P) ( P Q) (4) {MP, (3,4)} P Q proved Hence by using deduction theorem, we conclude - ~ P (P Q)

Cont Example2: Prove that - (~ ~ P ~ ~P) is a theorem. Proof: {Theorem} {Axiom A1} {Axiom A2} - (~ ~P ~ ~P) ~ ~ P (( Q ~ ~P) ~ ~P) (1) (~ ~P (( Q ~ ~P) ~ ~P)) ((~ ~P ( Q ~ ~ P)) (~ ~P ~ ~P)) (2) { MP, (1, 2)} ((~ ~P ( Q ~ ~ P)) (~ ~P ~ ~P)) (3) {Axiom A1} ~ ~P ( Q ~ ~ P) (4) { MP, (3, 4) } ~ ~P ~ ~ P proved

Cont Definition: A truth valuation is a function ν from a set of well-formed formulae to the set {T, F} such that for any well-formed formulae α and β ν(~ α ) ν (α ) ν (α β ) = F iff ν (α ) = T and ν (β ) = F The truth assignment to the atoms uniquely determines the truth valuation of all formulae. Definition: A formula α is said to be valid (denoted by = α) if and only if for all valuation ν, ν(α) = T. Lemma 1: If α and β are well-formed formulae, then = α and = (α β) implies = β.

Cont Definition: A formula α is said to be inconsistent if and only if for all valuation ν, ν(α) = F. Definition: If α is a formula and a valuation ν such that ν(α) = T, then α is said to be consistent. Definition: A set of formulae is said to be mutually consistent if and only if they are all true simultaneously for some valuation. Definition: A set of formulae is said to be mutually inconsistent if and only if there exists no valuation under which conjunction of formulae is true.

Soundness and Completeness in AS Theorem : If α is a formula in AS, then α is a theorem if and only if α is valid. (Soundness): Every theorem is valid i.e., - α = α. (Completeness): if α is valid then α is a theorem i.e., = α - α. (Consistency): Axiomatic System for propositional logic is consistent if it is not possible to prove both α and ~ α for any well-formed formula α i.e., not both - α and - ~ α.

Semantic Tableaux Method

Semantic Tableaux System in PL Earlier approaches require construction of proof of a formula from given set of formulae and are called direct methods. In semantic tableaux, the set of rules are applied systematically on a formula or set of formulae to establish its consistency or inconsistency. Semantic tableau binary tree constructed by using semantic rules with a formula as a root Assume α and β be any two formulae.

Semantic Tableaux Rules Let α and β be any two formulae. Rule 1: A tableau for a formula (α Λ β) is constructed by adding both α and β to the same path (branch). This can be represented as follows: α Λ β α β Interpretation: α Λ β is true if both α and β are true

Rules - Cont Rule 2: A tableau for a formula ~ (α Λ β) is constructed by adding two alternative paths one containing ~ α and other containing ~ β ~ (α Λ β) ~ α ~ β Interpretation: or ~ β is true ~ (α Λ β ) is true if either ~ α

Cont Rule 3: A tableau for a formula (α V β) is constructed by adding two new paths one containing α and other containing β. α V β α β Interpretation: α V β is true if either α or β is true

Cont Rule 4: A tableau for a formula ~ (α V β) is constructed by adding both ~ α and ~ β to the same path. This can be expressed as follows: ~ ( α V β) ~ α ~ β Rule 5: Semantic tableau for ~~ α ~~ α α

Rule 6: Semantic tableau for α β α β ~ α β Rule 7: Semantic tableau for ~ ( α β) ~ (α β) α ~ β

Rule 8: Semantic tableau for α β α β (α Λ β) V (~ α Λ ~ β) α β α Λ β ~ α Λ ~ β Rule 9: Semantic tableau for ~ (α β) ~ (α β) (α Λ ~ β) V (~ α Λ β) ~ (α β) α Λ ~ β ~ α Λ β

Consistency and Inconsistency If an atom P and ~ P appear on a same path of a semantic tableau, then inconsistency is indicated and such path is said to be contradictory or closed (finished) path. Even if one path remains non contradictory or unclosed (open), then the formula α at the root of a tableau is consistent.

Valuation A valuation ν is said to be a model of α (or ν satisfies α) iff ν (α) = T. In tableaux approach, model for a consistent formula α is constructed as follows: On an open path, assign truth values to atoms (positive or negative) of α which is at the root of a tableau such that α is made to be true. It is achieved by assigning truth value T to each atomic formula (positive or negative) on that path.

Contradictory Tableau Contradictory tableau (or finished tableau) is defined to be a tableau in which all the paths are contradictory or closed (finished). If a tableau for a formula α at the root is a contradictory tableau, then a formula α is said to be inconsistent. A formula α is consistent if there is at least on open path in a tableau with root α

Example Inconsistent Example: Show that α : (P Λ Q R) Λ (~P S) Λ Q Λ ~ R Λ ~ S is inconsistent using tableaux method. {T-root} (P Λ Q R) Λ ( ~P S) Λ Q Λ ~ R Λ ~ S (1) {Apply rule 1 to 1} P Λ Q R (2) ~P S (3) Q ~ R ~ S {Apply rule 6 to 3} P S Closed: {S, ~ S} on the path {Apply rule 6 to 2)} ~ (P Λ Q) R Closed { R, ~ R} ~P ~ Q Closed {P, ~ P} Closed{~ Q, Q}

Example - Consistent Problem: Show that α: ( Q Λ~R) Λ (R P) is consistent and find its model. Solution: {T-root} ( Q Λ ~ R) Λ ( R P) (1) {Apply rule 1 to 1} (Q Λ ~ R) (2) {Apply rule 1 to 2} ( R P) (3) Q {Apply rule 6 to 3} ~R ~ R P open open

Example -Cont Since tableau for α has open paths, we conclude that α is consistent. The models are constructed by assigning T to all atomic formulae appearing on open paths. Assign Q = T and ~ R = T i.e., R = F. So { Q = T, R = F } is a model of α. Assign Q = T and ~ R = T and P = T. So { P = T, Q = T, R = F } is another model. Useful Tip: Thumb rule for constructing a tableau is to apply non branching rules before the branching rules in any order

Important Definitions A set of formulae {α 1, α 2,.,α n } is said to be consistent if the formulae in a set are simultaneously true for some model i.e., if a tableau for α 1 Λ α 2 Λ.. Λ α n has at least one open (or non contradictory) path. A set of formulae {α 1, α 2,.,α n } is said to be inconsistent iff all the formulae can not be true simultaneously i.e., tableau for (α 1 Λ α 2 Λ.Λ α n ) as a root is a contradictory tableau.

Definitions Cont A formula α is tableau provable if tableau with root entry as ~ α is contradictory tableau. A tableau proof of a formula α is a contradictory tableau with root entry as ~ α. A formula α is valid if α is tableau provable.

Soundness and Completeness Theorem: (Soundness) If α is tableau provable ( - α ), then α is valid ( = α ) i.e., - α = α. Theorem: (Completeness) If α is valid, then α is tableau provable i.e., = α - α.

Example - Validity Example: Show that α : P ( Q P) is valid Solution: In order to show that α is a valid, we will try to show that α is tableau provable i.e., ~ α is inconsistent. {T-root} ~ (P ( Q P)) (1) {Apply rule7 to 1} P ~ ( Q P) (2) {Apply rule 7 to 2} Q ~P Closed {P, ~ P} Hence P ( Q P) is valid.

Logical Consequence A tableau proof of a formula α from a set of premises = {α 1, α 2,,α n } is a tableau obtained from (α 1 Λ α 2 Λ.. Λ α n ) with ~ α as a root entry. If it is a contradictory tableau, then we say that α is tableau provable from. It is denoted by - α. A formula α is said to be a logical consequence (LC) of a set of premises, if α is tableau provable from. It is denoted by = α.

Soundness and Completeness of LC Theorem: (Soundness of deduction from premises): If there is a tableau proof of α from a set of premises, then α is a logical consequence of, i.e., - α = α. Theorem: (Completeness of deduction from premises): If α is a logical consequence of a set of premises, then α is tableau provable from, i.e., = α - α.

Resolution Method in PL

Resolution Refutation in PL Resolution refutation is another simple method to prove a formula by contradiction. Here negation of goal to be proved is added to given set of clauses. It is shown then that there is a refutation in new set using resolution principle. Resolution: During this process we need to identify two clauses, one with positive atom (P) and other with negative atom (~P) for the application of resolution rule.

Cont Resolution is based on modus ponen inference rule. This method is most favoured for developing computer based theorem provers. Automatic theorem provers using resolution are simple and efficient systems. Resolution is performed on special types of formulae called clauses. Clause is propositional formula expressed using {V, ~ } operators.

Conjunctive and Disjunctive Normal Forms In Disjunctive Normal Form (DNF), a formula is represented in the form (L 11 Λ.. Λ L 1n ) V.. V (L m1 Λ.. Λ L mk ), of where all L ij are literals. It is a disjunction conjunction. In Conjunctive Normal Form (CNF), a formula is represented in the form (L 11 V.. V L 1n ) Λ Λ (L p1 V.. V L pm ), where all L ij are literals. It is a conjunction of disjunction. A clause is a special formula expressed as disjunction of literals. If a clause contains only one literal, then it is called unit clause.

Conversion of a Formula to its CNF Each formula in Propositional Logic can be easily transformed into its equivalent DNF or CNF representation using equivalence laws. Eliminate and by using the following equivalence laws. P Q ~ P V Q P Q ( P Q) Λ ( Q P) Eliminate double negation signs by using ~ ~ P P

Cont Use De Morgan s laws to push ~ (negation) immediately before atomic formula. ~ ( P Λ Q) ~ P V ~ Q ~ ( P V Q) ~ P Λ ~ Q Use distributive law to get CNF. P V (Q Λ R) (P V Q) Λ (P V R) We notice that CNF representation of a formula is of the form (C 1 Λ.. ΛC n ), where each C k, (1 k n ) is a clause that is disjunction of literals.

Resolution of Clauses If two clauses C 1 and C 2 contain a complementary pair of literals {L, ~L}, then these clauses can be resolved together by deleting L from C 1 and ~ L from C 2 and constructing a new clause by the disjunction of the remaining literals in C 1 and C 2. The new clause thus generated is called resolvent of C 1 and C 2. Here C and C 1 2 clause. are called parents of resolved If the resolvent contains one or more set of complementary pair of literals, then resolvent is always true.

Resolution Tree Inverted binary tree is generated with the last node of the binary tree to be a resolvent. This also called resolution tree. Example: Find resolvent of: C 1 = P V Q V R C 2 C 3 = ~ Q V ~ W = ~ P V ~ W

Example- Resolution Tree P V Q V R ~ Q V ~W {Q, ~ Q} P V R V ~W {P, ~P} ~ P V ~ W R V ~W Thus Resolvent(C 1,C 2, C 3 ) = R V ~W

Definitions Theorem: If C is a resolvent of two clauses C 1 and C 2, then C is a logical consequence of {C 1, C 2 }. Definition: A deduction of an empty clause from a set S of clauses is called a resolution refutation of S. Theorem: (Soundness & Completeness of resolution): There is a resolution refutation of S iff S is unsatisfiable / inconsistent.

Cont Theorem: Let S be a set of clauses. A clause C is a logical consequence of S iff the set S = S {~ C} is unsatisfiable. In other words, C is a logical consequence of a given set S iff an empty clause is deduced from the set S'.

Example Example: Mary will get her degree if she registers as a student and pass her exam. She has registered herself as a student. She has passed her exam. Show that she will get a degree. Solution: Symbolize above statements as follows: R: Mary is a registered student P: Mary has passed her exam D: Mary gets her degree The formulae corresponding to above listed sentences are as follows:

Cont Mary will get her degree if she registers as a student and pass her exam. R Λ P D (~ R V ~ P V D) She has registered herself as a student. R She has passed her exam. P Conclude Mary will get a degree. D

Example Cont Set of clauses are: S = {~ R V ~ P V D, R, P } Add negation of "Mary gets her degree (= D)" to S. New set S' is: S' = {~ R V ~ P V D, R, P, ~ D} We can easily see that empty clause is deduced from above set. Hence we can conclude that Mary gets her degree

Deriving Contradiction ~ R V ~ P V D R ~ P V D P D ~ D

Exercises I. Establish the following: 1. { P Q, Q R } - ( P R ) 2. { P Q} - (R P) (R Q) 3. { P } - (~ P Q) 4. { ~Q, P ( ~Q R) } - P R 5. {P Q, ~ Q } - ~ P. This is called Modus Tollen rule. II. Prove the following theorems 1. - (P P) 2. - (~ P P) P 3. - (P Q) (~ Q ~ P) 4. - (P ~ Q) ( Q ~ P) III. Give tableau proof of each of the following formulae and show that formulae are valid. 1. P ( Q P) 2. (P Λ (Q V R) (( P Λ Q) V ( P Λ R)) 3. ~ (P V Q) (~ P Λ ~ Q) IV. Are the following arguments valid? 1. If John lives in England then he lives in UK. John lives in England. Therefore, John lives in UK. 2. If John lives in England then he lives in UK. John lives in UK. Therefore, John lives in England. 3. If John lives in England then he lives in UK. John does not live in UK. Therefore, John does not live in England. V. Prove by resolution refutation 1. {P Λ Q, ~ P V R} = Q V R 2. { P, Q R, P R} = P Λ R 3. {P Q Λ R, P} = R