Inf2D 13: Resolution-Based Inference

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

Propositional Reasoning

Inference in first-order logic

Proof Methods for Propositional Logic

Inf2D 11: Unification and Generalised Modus Ponens

Deductive Systems. Lecture - 3

Propositional Logic: Bottom-Up Proofs

Logic and Inferences

Inference in first-order logic

Propositional Resolution

Advanced Topics in LP and FP

Inference Methods In Propositional Logic

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

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

7.5.2 Proof by Resolution

Inference in Propositional Logic

Propositional logic II.

Propositional Logic: Methods of Proof (Part II)

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

Inference Methods In Propositional Logic

Intelligent Agents. Pınar Yolum Utrecht University

Propositional Logic Part 1

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

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

Propositional Logic: Review

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

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

Propositional Logic: Methods of Proof (Part II)

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Logical Agents (I) Instructor: Tsung-Che Chiang

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

Logical Agents. Chapter 7

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

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

CS 380: ARTIFICIAL INTELLIGENCE

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

Artificial Intelligence Chapter 7: Logical Agents

Lecture 10: Even more on predicate logic" Prerequisites for lifted inference: Skolemization and Unification" Inference in predicate logic"

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

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

Artificial Intelligence

Inference in first-order logic

CS:4420 Artificial Intelligence

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

Propositional Logic: Methods of Proof (Part II)

Lecture 9: The Splitting Method for SAT

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Introduction to Intelligent Systems

Introduction to Intelligent Systems

Logical Agents. Chapter 7

Knowledge based Agents

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Logical agents. Chapter 7. Chapter 7 1

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

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

CS 7180: Behavioral Modeling and Decision- making in AI

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

CS 2710 Foundations of AI Lecture 12. Propositional logic. Logical inference problem

Class Assignment Strategies

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

Artificial Intelligence

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

CS 771 Artificial Intelligence. Propositional Logic

Language of Propositional Logic

Propositional and Predicate Logic - V

Inference in First-Order Logic

Deliberative Agents Knowledge Representation I. Deliberative Agents

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

Learning Goals of CS245 Logic and Computation

Objectives. Logical Reasoning Systems. Proofs. Outline. Example proof. Example proof. You should

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

CS589 Principles of DB Systems Fall 2008 Lecture 4e: Logic (Model-theoretic view of a DB) Lois Delcambre

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Logic: Bottom-up & Top-down proof procedures

Logical Agents. Santa Clara University

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

AI Programming CS S-09 Knowledge Representation

Logical agents. Chapter 7. Chapter 7 1

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

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

TDT4136 Logic and Reasoning Systems

Propositional Dynamic Logic

Last update: March 4, Logical agents. CMSC 421: Chapter 7. CMSC 421: Chapter 7 1

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

Logical Agent & Propositional Logic

MAI0203 Lecture 7: Inference and Predicate Calculus

Lecture overview. Knowledge-based systems in Bioinformatics, 1MB602. Reasoning. Reasoning cont. Inference in propositional logic.

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

Artificial Intelligence Chapter 9: Inference in First-Order Logic

Logical Agents: Propositional Logic. Chapter 7

Introduction to Artificial Intelligence 2 nd semester 2016/2017. Chapter 9: Inference in First-Order Logic

Propositional Logic: Models and Proofs

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

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

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

First-Order Theorem Proving and Vampire

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

CogSysI Lecture 8: Automated Theorem Proving

Logical Inference 2 rule based reasoning

Transcription:

School of Informatics, University of Edinburgh 13/02/18 Slide Credits: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann

Last lecture: Forward and backward chaining Backward chaining: If Goal is known (goal directed) Can query for data Forward chaining: If specific Goal is not known, but system needs to react to new facts (data driven) Can make suggestions Also relevant: Combination of forward and backward chaining: Opportunistic reasoning What do users expect from the system? Which direction has the larger branching factor?

Limitations (due to restriction to definite clauses) In order to apply GMP: Premises of all rules contain only non-negated symbols Conclusions of all rules is a non-negated symbol Facts are non-negated propositions Possible solution: Introduce more variables, e.g. Q := P What about: If we cannot prove A, then A is true? (works only if there is a rule for each variable)

Last lecture: Resolution Negate query α Convert everything to CNF Repeat: Choose clauses and resolve (based on unification) If resolution results in empty clause, α is proved Return all substitutions (or Fail)

Mid-lecture question Is the following sentence unsatisfiable? P (x, t), P (s, x) with x: variable, s t: constants

Answer Is the following set of clauses unsatisfiable? P (x, t), P (s, x) Not necessarily, if this was a propositionalisation of x. (P (x, t) P (s, x)) It is unsatisfiable, if this was a propositionalisation of ( x. P (x, t)), ( x. P (s, x)) Here we can standardise-away the clash of the variablex (which we should have done in the first place!) and obtain a contradiction by instantiation.

Binary Resolution and Modus Ponens Ground binary resolution Suppose C = False C P D P C D P P D D i.e. P and P D entails D. Modus ponens is a special case of binary resolution.

Full Resolution and Generalised Modus Ponens GMP with p i θ p iθ i p 1,..., p n (p 1 p n q) qθ p 1,..., p n q p 1 p n qθ Full resolution with θ MGU of all P i and P i θ P iθ i C P 1... P m D P 1... P n (C D) θ

Resolution in Implication Form Ground binary resolution Set C = A C P D P C D A P P D A D

Example: Quacks and Doctors Some patients like all doctors F 1 x. P (x) y. D (y) Likes (x, y) No patient likes any quack F 2 x. P (x) y. Q (y) Likes (x, y) Show: No doctor is a quack F x. D (x) Q (x)

Example: Quacks and Doctors CNF F 1 x. P (x) y. D (y) Likes (x, y) x. P (x) y. D (y) Likes (x, y) F 2 x. P (x) y. Q (y) Likes (x, y) x. P (x) y. Q (y) Likes (x, y) F x. D (x) Q (x) x. D (x) Q (x)

Example: Quacks and Doctors Propositionalisation F 1 x. P (x) y. D (y) Likes (x, y) P (G) ( D (y) Likes (G, y)) F 2 x. P (x) y. Q (y) Likes (x, y) P (w) Q (z) Likes (w, z) F x. D (x) Q (x) D (x) Q (x)

Example: Quacks and Doctors Unification F 1 P (G) D (y) Likes (G, y) F 2 P (w) Q (z) Likes (w, z) w/g P (G) Q (z) Likes (G, z) Negation of proof goal ( D (x) Q (x)) D (x) Q (x)

Example: Quacks and Doctors Resolution P (G) D (y) Likes (G, y), P (G) Q (z) Likes (G, z), D (x) Q (x) Clauses: P (G), D (y), Q (z), D (y) Likes (G, y), Q (z) Likes (G, z) D (y) Likes (G, z) Q (z) Likes (G, z) D (y) Q (z) Substitute y/x and z/x D (x) Q (x) D (x) Q (x) and Q (x) Q (x) Therefore: D (x) Q (x), i.e. D (x) Q (x) for any x such that x. D (x) Q (x)

Example: Quacks and Doctors (Variant) Some patients like all doctors F 1 x. P (x) y. D (y) Likes (x, y) No patient likes any quack F 2 x. P (x) y. Q (y) Likes (x, y) Show: No doctor is a quack F x. D (x) Q (x)

Example: Quacks and Doctors (Variant) CNF F 1 x. P (x) y. D (y) Likes (x, y) x. P (x) y. D (y) Likes (x, y) F 2 x. P (x) y. Q (y) Likes (x, y) x. P (x) y. Q (y) Likes (x, y) F x. D (x) Q (x) x. D (x) Q (x)

Example: Quacks and Doctors (Variant) Propositionalisation F 1 x. P (x) y. D (y) Likes (x, y) P (G) ( D (y) Likes (G, y)) F 2 x. P (x) y. Q (y) Likes (x, y) P (w) Q (z) Likes (w, z) F x. D (x) Q (x) D (x) Q (x)

Example: Quacks and Doctors (Variant) Unification F 1 P (G) D (y) Likes (G, y) F 2 P (w) Q (z) Likes (w, z) w/g P (G) Q (z) Likes (G, z) Negation of proof goal ( D (x) Q (x)) D (x) Q (x)

Example: Quacks and Doctors (Variant) Resolution P (G) D (y) Likes (G, y), P (G) Q (z) Likes (G, z), D (x) Q (x) Clauses: P (G), D (y), Q (z), D (y) Likes (G, y), P (G) Q (z) Likes (G, z) P (G) P (G) Q (z) Likes (G, z) Q (z) Likes (G, z) D (y) Likes (G, z) Q (z) Likes (G, z) D (y) Q (z) Substitute y/x and z/x D (x) Q (x) D (x) Q (x) and Q (x) Q (x) Therefore: D (x) Q (x), i.e. D (x) Q (x) for any x such that x. D (x) Q (x)

Resolution: Soundness and completeness Resolution is sound and complete: If a set of clauses is unsatisfiable, then one can derive an empty clause from this set. Soundness is evident since the conclusion of any inference rule is a logical consequence of its premises. Completeness can be proved using completeness of propositional resolution and lifting (see the following slides, but full proof is beyond the scope of this course).

Reminder: Factoring More generally where θ is the MGU of the P i A B A B A A C P 1... P m (C P 1 ) θ Soundness: by universal instantiation and deletion of duplicates.

Resolvent Let C 1 and C 2 be two clauses. A resolvent is a binary resolvent of C 1 and C 2 binary resolvent of a factor of C 1 and C 2 binary resolvent of C 1 and a factor of C 2 binary resolvent of a factor of C 1 and a factor of C 2

Factoring example C 1 = P (x) P (f (y)) R (g (y)) C 2 = P (f (g (a))) Q (b) C 1 = P (f (y)) R (g (y)) is a factor of C 1 C = R (g (g (a))) Q (b) is a resolvent of C 1and C 2 and thus a resolvent of C 1 and C 2. Choose θ = {x/f (y), y/g (a)}

The lifting lemma If C 1 and C 2 are two clauses with no shared variables and C 1 and C 2 their respective instances and C is a resolvent of C 1 and C 2, then there exists a clause C such that both C is a resolvent of C 1 and C 2 and C is and instance of C. C 1, C 2 C 1 C 2 C C Instantiation C 1, C 2 Lifting C 1 C 2 C Instantiation C

Lifting lemma: Example Clauses C 1 = P (x) Q (x) C 2 = P (f (y)) R (y) Resolving C 1 and C 2 gives C = Q (f (y)) R (y) Instances: C 1 C 2 = P (f (a)) Q (f (a)) using x/f (a) = P (f (a)) R (a) using y/a Resolving C 1 and C 2 gives C = Q (f (a)) R (a) C is an instance of C as predicted by the Lifting Lemma!

Remark: Resolution for 3SAT (X i X j X k ) (X j X r X s ) ( X k X l X m ) }{{} M clauses with i, j, k, r, s, l, m, {1,..., N} Assuming X i = 0: First two clauses: X i X i X j X k X j X k (we can t really use the (negated) goal at this stage) X j X k X j X r X s X k X r X s More assumptions? More symbols per clause?

Efficient algorithms for resolution Heuristics to make resolution more efficient (compare DPLL!) Unit preference: Prefer clauses with only one symbol Pure clauses: Pure clauses contains symbol A which does not occur in any other clause: Cannot lead to contradiction. Tautology: Clauses containing A and A Set of support: Identify useful rules and ignore the rest. Input resolution: Intermediately generated sentences can only be combined with original inputs or original rules. Subsumption: If a clause contains another one, use only the shorter clause. Prune unnecessary facts from the database. Including heuristics, resolution is more efficient than DPLL.

Summary Forward chaining Backward chaining Resolution