COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Similar documents
COMP9414: Artificial Intelligence First-Order Logic

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

Propositional Resolution

Advanced Topics in LP and FP

Knowledge based Agents

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Logic: Propositional Logic (Part I)

Inference in Propositional Logic

Logical Agent & Propositional Logic

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

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

Proof Methods for Propositional Logic

Propositional Reasoning

Logical Agents (I) Instructor: Tsung-Che Chiang

Language of Propositional Logic

Inference Methods In Propositional Logic

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Logical Agent & Propositional Logic

Part 1: Propositional Logic

Inference Methods In Propositional Logic

Propositional Logic: Methods of Proof (Part II)

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

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

Artificial Intelligence Chapter 7: Logical Agents

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Class Assignment Strategies

Foundations of Artificial Intelligence

Deductive Systems. Lecture - 3

Intelligent Agents. Pınar Yolum Utrecht University

Propositional logic II.

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

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

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional and Predicate Logic - V

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Supplementary exercises in propositional logic

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Logic and Inferences

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

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional Resolution Introduction

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

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

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Tautologies, Contradictions, and Contingencies

A brief introduction to Logic. (slides from

6. Logical Inference

CS 730/730W/830: Intro AI

Deliberative Agents Knowledge Representation I. Deliberative Agents

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

Propositional Logic: Methods of Proof (Part II)

Introduction to Intelligent Systems

LOGIC PROPOSITIONAL REASONING

Propositional Logic Part 1

Learning Goals of CS245 Logic and Computation

Artificial Intelligence

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

Artificial Intelligence

Introduction to Artificial Intelligence. Logical Agents

Logical Agents. Chapter 7

Propositional Logic: Models and Proofs

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

COMP4418: Knowledge Representation and Reasoning First-Order Logic

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

Propositional Resolution

Comp487/587 - Boolean Formulas

Propositional Logic: Review

Kecerdasan Buatan M. Ali Fauzi

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

Introduction to Intelligent Systems

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

CS 380: ARTIFICIAL INTELLIGENCE

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

CS 730/830: Intro AI. 3 handouts: slides, asst 6, asst 7. Wheeler Ruml (UNH) Lecture 12, CS / 16. Reasoning.

Propositional Logic Language

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

CS 771 Artificial Intelligence. Propositional Logic

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

Logical agents. Chapter 7. Chapter 7 1

Logic: Propositional Logic Truth Tables

Artificial Intelligence

Propositional Logic: Evaluating the Formulas

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

Logical Agents. September 14, 2004

Propositional Logic: Semantics and an Example

CS 4700: Foundations of Artificial Intelligence

Strong AI vs. Weak AI Automated Reasoning

02 Propositional Logic

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

CS:4420 Artificial Intelligence

Logical Agents: Propositional Logic. Chapter 7

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

CS 188: Artificial Intelligence Spring 2007

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Transcription:

COMP9414, Monday 26 March, 2012 Propositional Logic 2 COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning Overview Proof systems (including soundness and completeness) Normal Forms Resolution Wayne Wobcke Room J17-433 wobcke@cse.unsw.edu.au Based on slides by Maurice Pagnucco Refutation Systems Correctness of the resolution rule soundness and completeness Conclusion COMP9414 c UNSW, 2012 COMP9414, Monday 26 March, 2012 Propositional Logic 1 COMP9414, Monday 26 March, 2012 Propositional Logic 3 Propositional Logic So far we have considered propositional logic as a knowledge representation language We can write sentences in this language (syntax) with some logical structure We can define the interpretations of these sentences using truth tables (semantics) What remains is reasoning; to draw new conclusions from what we know (proof system) and to automate the process References: Ivan Bratko, Prolog Programming for Artificial Intelligence, Fourth Edition, Pearson Education, 2012. (Chapter 15) Stuart J. Russell and Peter Norvig, Artificial Intelligence: A Modern Approach, Third Edition, Pearson Education, 2010. (Chapter 7) What is a Logic? A logic consists of 1. A formal system for expressing knowledge about a domain consisting of Syntax Set of legal sentences (well formed formulae) Semantics Interpretation of legal sentences 2. A proof system a set of axioms plus rules of inference for deducing sentences from a knowledge base

COMP9414, Monday 26 March, 2012 Propositional Logic 4 COMP9414, Monday 26 March, 2012 Propositional Logic 6 Mechanising Proof Resolution Question: Assuming knowledge can be captured using propositional logic, how do we automate reasoning (i.e. perform inference)? One answer: a proof of a formula from a set of premises is a sequence of steps in which any step of the proof is: 1. An axiom or premise 2. A formula deduced from previous steps of the proof using some rule of inference The last step of the proof should deduce the formula we wish to prove This is intended to formally capture the notion of proof that is commonly applied in other fields (e.g. mathematics) Another type of proof system based on refutation Better suited to computer implementation than systems of axioms and rules (can give correct no answers) Generalizes to first-order logic (see next week) The basis of Prolog s inference method To apply resolution, all formulae in the knowledge base and the query must be in clausal form (c.f. Prolog clauses) We use the notation S P to denote that the set of formulae S prove the formula P; alternatively, we say that P follows from (premises) S COMP9414, Monday 26 March, 2012 Propositional Logic 5 COMP9414, Monday 26 March, 2012 Propositional Logic 7 Soundness and Completeness Normal Forms A logic is sound if it preserves truth (i.e. if a set of premises are all true, any conclusion drawn from those premises must also be true) Technically, a proof system is sound if whenever S P (P follows from S using the proof system), S = P (P is entailed by S, e.g. using truth tables) A logic is complete if it is capable of proving all consequences of any knowledge base Technically, a proof system is complete if whenever S = P (P is entailed by S, e.g. using truth tables), S P (P follows from S using the proof system) A logic is decidable if there is a mechanical procedure (computer program) which when asked whether S P, can always answer yes or no (correctly) A literal is a propositional letter or the negation of a propositional letter A clause is a disjunction of literals Conjunctive Normal Form (CNF) a conjunction of clauses, e.g. (P Q R) ( S R) or just one clause, e.g. P Q Disjunctive Normal Form (DNF) a disjunction of conjunctions of literals, e.g. (P Q R) ( S R) or just one conjunction, e.g. P Q Every propositional logic formula can be converted to CNF and DNF

COMP9414, Monday 26 March, 2012 Propositional Logic 8 Conversion to Conjunctive Normal Form COMP9414, Monday 26 March, 2012 Propositional Logic 10 Resolution Rule of Inference Eliminate rewriting P Qas (P Q) (Q P) Eliminate rewriting P Qas P Q Use De Morgan s laws to push inwards: rewrite (P Q) as P Q rewrite (P Q) as P Q Eliminate double negations: rewrite P as P Use the distributive laws to get CNF [or DNF]: rewrite (P Q) R as(p R) (Q R) [for CNF] rewrite (P Q) R as(p R) (Q R) [for DNF] Resolution Rule A B B C A C where B is a propositional letter and A and C are clauses (possibly empty) A C is the resolvent of the two clauses COMP9414, Monday 26 March, 2012 Propositional Logic 9 Example COMP9414, Monday 26 March, 2012 Propositional Logic 11 Resolution Rule: Key Idea (P (Q R)) ( P (Q R)) P (Q R) P ( Q R) P ( Q R) Two clauses: P, Q R Consider A B and B C if B is True, B is False and truth of second formula depends only on C if B is False, truth of first formula depends only on A Only one of B, B is True, so if both A B and B C are True, either A or C is True, i.e. A C is True Hence the resolution rule is sound

COMP9414, Monday 26 March, 2012 Propositional Logic 12 COMP9414, Monday 26 March, 2012 Propositional Logic 14 Applying Resolution Applying Resolution Refutation The resolution rule is sound (resolvent entailed by two parent clauses) How can we use the resolution rule? One way: Convert knowledge base into clausal form Repeatedly apply resolution rule to the resulting clauses A query A follows from the knowledge base if and only if each of the clauses in the CNF of A can be derived using resolution There is a better way... Negate query to be proven (resolution is a refutation system) Convert knowledge base and negated conclusion into CNF and extract clauses Repeatedly apply resolution until either the empty clause (contradiction) is derived or no more clauses can be derived If the empty clause is derived, answer yes (query follows from knowledge base), otherwise answer no (query does not follow from knowledge base) COMP9414, Monday 26 March, 2012 Propositional Logic 13 COMP9414, Monday 26 March, 2012 Propositional Logic 15 Refutation Systems To show that P follows from S (i.e. S P) using refutation, start with S and P in clausal form and derive a contradiction using resolution A contradiction is the empty clause (a clause with no literals) The empty clause is unsatisfiable (always False) So if the empty clause is derived using resolution, the original set of clauses is unsatisfiable (never all True together) That is, if we can derive from the clausal forms of S and P, these clauses can never be all True together Hence whenever the clauses of S are all True, at least one clause from P must be False, i.e. P must be False and P must be True By definition, S = P (so P can correctly be concluded from S) Resolution: Example 1 (G H) ( J K), G J Clausal form of (G H) ( J K) is { G J, H J, G K, H K} 1. G J [Premise] 2. H J [Premise] 3. G K [Premise] 4. H K [Premise] 5. G [Premise] 6. J [ Conclusion] 7. G [1, 6 Resolution] 8. [5, 7 Resolution]

COMP9414, Monday 26 March, 2012 Propositional Logic 16 COMP9414, Monday 26 March, 2012 Propositional Logic 18 Resolution: Example 2 P Q, Q R P R Recall P R P R Clausal form of ( P R) is{p, R} 1. P Q [Premise] 2. Q R [Premise] 3. P [ Conclusion] 4. R [ Conclusion] 5. Q [1, 3 Resolution] 6. R [2, 5 Resolution] 7. [4, 6 Resolution] Soundness and Completeness Again Resolution refutation is sound, i.e. it preserves truth (if a set of premises are all true, any conclusion drawn from those premises must also be true) Resolution refutation is complete, i.e. it is capable of proving all consequences of any knowledge base (not shown here!) Resolution refutation is decidable, i.e. there is an algorithm implementing resolution which when asked whether S P, can always answer yes or no (correctly) COMP9414, Monday 26 March, 2012 Propositional Logic 17 COMP9414, Monday 26 March, 2012 Propositional Logic 19 Resolution: Example 3 ((P Q) P) Q Clausal form of (((P Q) P) Q) is{p Q, P, Q} 1. P Q [ Conclusion] 2. P [ Conclusion] 3. Q [ Conclusion] 4. Q [1, 2 Resolution] 5. [3, 4 Resolution] Heuristics in Applying Resolution Clause elimination can disregard certain types of clauses Pure clauses: contain literal L where L doesn t appear elsewhere Tautologies: clauses containing both L and L Subsumed clauses: another clause exists containing a subset of the literals Ordering strategies Resolve unit clauses (only one literal) first Start with query clauses Aim to shorten clauses

COMP9414, Monday 26 March, 2012 Propositional Logic 20 Conclusion We have now investigated one knowledge representation and reasoning formalism This means we can draw new conclusions from the knowledge we have: we can reason Have enough to build a knowledge-based agent However, propositional logic is a weak language; there are many things that cannot be expressed To express knowledge about objects, their properties and the relationships that exist between objects, we need a more expressive language: first-order logic