CS 520: Introduction to Artificial Intelligence. Review

Similar documents
Inference in first-order logic

7.5.2 Proof by Resolution

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

CS 730/730W/830: Intro AI

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

Inference in First Order Logic

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

CS 771 Artificial Intelligence. First Order Logic Inference

Inference in first-order logic

Strong AI vs. Weak AI Automated Reasoning

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

Inference in first-order logic

CS 771 Artificial Intelligence. Propositional Logic

Inference in first-order logic

Guest Speaker. CS 416 Artificial Intelligence. First-order logic. Diagnostic Rules. Causal Rules. Causal Rules. Page 1

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Artificial Intelligence Chapter 9: Inference in First-Order Logic

Logical Agents (I) Instructor: Tsung-Che Chiang

Logical Agents. Santa Clara University

Logic and Reasoning. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Inference in first-order logic

The only sets are the empty set and those made by adjoining something to a set: s: Set(s) s = Ø x, s 2 : Set(s 2 ) s = { x s 2 }.

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Inference Methods In Propositional Logic

Convert to clause form:

Artificial Intelligence Chapter 7: Logical Agents

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

Artificial Intelligence. Propositional logic

Inference Methods In Propositional Logic

Logical Agent & Propositional Logic

Agents that reason logically

Inference in First-Order Logic

Logical Inference 2 rule based reasoning

CS 380: ARTIFICIAL INTELLIGENCE

Logical Agent & Propositional Logic

Outline. Reducing first-order inference to propositional inference Unification. Forward chaining Backward chaining

[1] Describe with examples, the three inference rules involving quantifiers

Intelligent Agents. Pınar Yolum Utrecht University

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

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

Proof Methods for Propositional Logic

Inference in first-order logic

Knowledge based Agents

First order logic (FOL) Chapters 8 & 9

Announcements. Today s Menu

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

473 Topics. Knowledge Representation III First-Order Logic. Logic-Based KR. Propositional. Logic vs. First Order

First Order Logic (FOL)

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Introduction to Intelligent Systems

AI Programming CS S-09 Knowledge Representation

Introduction to Intelligent Systems

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

Logical Agents. Chapter 7

Set 8: Inference in First-order logic. ICS 271 Fall 2013 Chapter 9: Russell and Norvig

CS 4700: Foundations of Artificial Intelligence

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope)

Inference in First-Order Predicate Calculus

Introduction to Artificial Intelligence. Logical Agents

CS 4700: Artificial Intelligence

CSC242: Intro to AI. Lecture 13. Thursday, February 28, 13

Inference in first-order logic

CogSysI Lecture 8: Automated Theorem Proving

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

6.825 Techniques in Artificial Intelligence. Logic Miscellanea. Completeness and Incompleteness Equality Paramodulation

Adam Blank Spring 2017 CSE 311. Foundations of Computing I

Set 8: Inference in First-order logic. ICS 271 Fall 2017 Chapter 9: Russell and Norvig

Logical Agents. Outline

Logic III. Introduction to Artificial Intelligence CSE 150

Foundations of Artificial Intelligence

Inference in First-Order Logic

Propositional Resolution

Foundations of Artificial Intelligence

Lecture Overview [ ] Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 6. Motivation. Logical Agents

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

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

Kecerdasan Buatan M. Ali Fauzi

Propositional and First-Order Logic

Deliberative Agents Knowledge Representation I. Deliberative Agents

Propositional Logic: Review

Inf2D 13: Resolution-Based Inference

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Knowledge and reasoning 2

Logical Agents. CITS3001 Algorithms, Agents and Artificial Intelligence. 2018, Semester 2

Inference in first-order logic. Production systems.

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

Logical Inference and Reasoning Agents. Foundations of Artificial Intelligence

Inference in first-order logic

Propositional Logic: Methods of Proof (Part II)

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

COMP9414: Artificial Intelligence First-Order Logic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Inf2D 11: Unification and Generalised Modus Ponens

Propositional Logic Part 1

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

(Refer Slide Time: 02:20)

Logical Agents. September 14, 2004

Logic. Stephen G. Ware CSCI 4525 / 5525

Rational Agents. Paolo Turrini. Introduction to Artificial Intelligence 2nd Part. Department of Computing, Imperial College London

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Transcription:

CS 520: Introduction to Artificial Intelligence Prof. Louis Steinberg : First-order Logic Proof Algorithms 1 Review Representing a Domain in FOL A domain is a portion of the world about which we wish to express knowledge. We can define a set of basic predicates from which all other predicates can be defined. An FOL Agent Executive tells KB what sensors perceive Executive asks KB what it should do 2

Review - Types of FOL Agents Reflex agent Non-FOL: percept --rule--> action FOL: percept --inference--> abstract percept --inference--> action FOL agents with state percept -------inference--> world state --inference--> action world state 3 Review - Situation Calculus How to represent changeable facts in FOL Basic idea: time is a sequence of states States and Predicates Every changeable predicate gets an extra parameter: the state. Effect, frame, and successor state axioms 4

Inference in FOL Inference in FOL is semi-decidable There are algorithms such that: If an inference can be proven, the algorithm will produce a proof in finite time If the inference cannot be proven, the algorithm may run forever And this is the best we can do One such algorithm is Resolution Refutation The key problem in FOL inference is handling universals x even(x) <=> y x=2*y => even(324) <=> y 324=2*y 5 6

Resolution Refutation Refutation proof: to prove that KB entails α, add α to KB and infer false Eg, propositionally, KB: A v B, A. Prove: B KB + α : A v B, A, B AvB A B B false 7 Generalized Modus Ponens Generalized Modus Ponens (GMP): A 1,, A n, A 1 ^ ^ A n =>B B Equivalent Resolution Refutation: A 1,, A n, A 1 v v A n v B, B false 8

GMP and Quantifiers We can get rid of by Skolemization If we have x P(x), make up a name for the object that makes this true. x y loves(y, x) ----> y loves(y, s) Must be a new name. y loves(y, Raymond) If there are outside the, use a function y x loves(y, x) ----> y loves(y, s(y)) w y x P(w, x) ^ Q(x, y) --------> w y P(w, s(w, y)) ^ Q(s(w, y), y) 9 GMP and Problem: Anything a cow eats is a plant x eats(cow, x)=>plant(x) Everything eats lettuce y eats(y, lettuce) Lettuce is a plant plant(lettuce) These are not identical! But if we substitute lettuce for y and cow for x eats(cow, lettuce)=>plant(lettuce) eats(cow, lettuce) plant(lettuce) 10

GMP and If there is a substitution θ such that SUBST(θ, P i ) = SUBST(θ, P i ') SUBST(θ, Q) = SUBST(θ, Q') Then P 1,, P n, P 1^ ^P n =>Q Q 11 Example John loves his mother Everyone s mother loves them To love one who loves you is to be happy John is happy P 1 ': loves (John, mother-of (John)) P2': x loves (mother-of (x), x) P1 P2 Pn Q: x, y loves (y, z) loves(z, y) happy(y) Q': happy (John) 12

P s s and Q s Q s and θ P 1 ' = loves (John, mother-of (John)) P 1 = loves (y, z) How? P 2 ' = loves (mother-of (x), x) P 2 = loves (z, y) θ = {y/john, z/mother-of(john), x/john) Q' = happy(john) Q = happy(y) 13 Unification Make variables in each sentence unique Already ok. For each pair of atomic sentences: loves (John, mother-of (John)) loves ( y, z ) Predicates must be the same Unify each pair of corresponding terms 14

Unifying Terms If either term is a variable: John y add the substitution variable / other-term to θ : { y / John } apply to all sentences: loves (John, mother-of (John)) loves (y, z) loves (mother-of (x), x) loves (z, y) 15 Unifying Terms If either term is a variable: John y add the substitution variable / other-term to θ : { y / John } apply to all sentences: loves (John, mother-of (John)) loves (y, z) loves (mother-of (x), x) loves (z, y) 16

Unifying Terms If either term is a variable: John y add the substitution variable / other-term to θ : { y / John } apply to all sentences: loves (John, mother-of (John)) loves (John, z) loves (mother-of (x), x) loves (z, John) 17 Again Unify next pair of terms mother-of (John)) z θ = { y / John, z / mother-of(john)} loves (John, mother-of (John)) loves (John, mother-of (John)) loves (mother-of (x), x) loves (mother-of (John), John) 18

Next Pair of Atomic Sentences loves (mother-of (x), x) loves (mother-of (John), John) Predicates match loves loves Match terms, first mother-of (x) mother-of (John) 19 To match Function Terms: mother-of (x) mother-of (John) Functions must be the same mother-of mother-of Then match arguments x John θ = {y / John, x / mother-of(john), x / John} loves (John, mother-of (John)) loves (John, mother-of (John)) loves (mother-of (John), John) loves (mother-of (John), John) 20

John John Final Pair of Terms Two constants only match if they are the same. 21 Final θ θ = { y / John, z / mother-of(john), x / John} Note: Occurs check Can t unify x with f(x) 22

Summary of Unification Unify-Sentences(A, B) Unify corresponding atomic sentences Unify-Atomic Sentences (A, B) If either A or B is a variable, add substitution var / other term to θ and apply to A and B If predicates differ, fail Unify corresponding terms Unify-terms If both A and B are constants if A=B succeed else fail If both A and B are function terms If not same function, fail Unify-terms on corresponding arguments 23 Normal Forms We have discussed two proof methods involving two different inference rules: Generalized Modus Ponens Resolution refutation Each requires the KB in a certain form GMP: implicative normal form (inf) A(x) B(x) C(x) D(x) RR: conjunctive normal form (cnf) A(x) B(x) D(x) 24

Conjunctive Normal Form Eliminate implications Move inwards Standardize variables Move quantifiers left Skolemize Distribute (For INF: gather negative literals and convert to implication) 25 What s s Wrong With This Picture? Inferring answers to a query: Inference Engine facts Knowledge Base facts Inference Rule 26

Forward vs Backward Chaining Forward: I have P 1 ' P 2 ' P 1 P 2 Q I get Q Backward: I want Q' I have P 1 P 2 Q So now I want P 1 ' P 2 ' 27 KB: Example A(x) B(y) C(z) A(w) B(w) D(w) D(v) C(v) F(v) Query: F(Sam) 28

A Proof Tree D(v) C(v) F(v) F(Sam) A(v) B(v) D(v) D(Sam) C(Sam) C(x) A(Sam) A(x) B(Sam) B(x) 29 An Example With a Choice KB: A(x) B(y) C(z) A(w) B(w) D(w) D(u) E(u) F(u) D(v) C(v) F(v) Query: F(Sam) 30

Searching for a Proof Tree D(u) E(u) F(u) F(Sam) D(Sam) A(w) B(w) D(w) E(Sam) Fails A(Sam) A(x) B(Sam) B(x) 31 Find a Choice Point F(Sam) D(u) E(u) F(u) D(v) C(v) F(v) D(Sam) E(Sam) D(Sam) C(Sam) A(w) B(w) D(w) A(Sam) A(x) B(Sam) B(x) 32

And Continue F(Sam) D(u) E(u) F(u) D(v) C(v) F(v) D(Sam) A(v) B(v) D(v) E(Sam) Fails D(Sam) C(Sam) C(x) A(w) B(w) D(w) A(Sam) A(x) B(Sam) B(x) A(Sam) A(x) B(Sam) B(x) 33 Searching a Tree of Search Trees r1 r5 r1 r2 r5 r2 r1 r2 r3 r4 r1 r2 r3 r5 r2 r3 r5 r2 r6 r7 r5 r2 r6 r5 r2 r6 r7 r8 34