Unification Unification (Unify.java) Doing exercises.

Slides:



Advertisements
Similar presentations
Inference in First-Order Logic
Advertisements

Some Prolog Prolog is a logic programming language
First-Order Logic.
Inference Rules Universal Instantiation Existential Generalization
Standard Logical Equivalences
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Horn Form A sentence is in Horn form if and only if ….
Knowledge Representation Methods
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
Propositional Calculus Knowledge based agent Knowledge is contained in agents in the form of sentences in a knowledge representation language stored in.
Knoweldge Representation & Reasoning
Inference in First-Order Logic
CSE (c) S. Tanimoto, 2007 Unification 1 Unification Predicate calculus rules are sometimes so general that we need to create specializations of.
Inference in First-Order Logic Inference Rules with Quantifiers The three new inference rules are as follows: Universal Elimination: For any sentence ,
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Logical Agents Logic Propositional Logic Summary
Inference in FOL Compared to predicate logic, more abstract reasoning and specific conclusions.
Propositional Calculus Knowledge based agent Knowledge is contained in agents in the form of sentences in a knowledge representation language stored in.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
1 Unification ( 統一 ) Forward Chaining ( 前向き仮説推理 ) Backward Chaining ( 後ろ向き仮説推理 ) Unification ( 統一 ) Forward Chaining ( 前向き仮説推理 ) Backward Chaining ( 後ろ向き仮説推理.
111 Artificial Intelligence CS 165A Tuesday, November 6, 2007  Inference in FOL (Ch 9) 1.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 17 Wednesday, 01 October.
1 Knowledge Representation & Reasoning First Order Logic chapter 6 Dr Souham Meshoul CAP492.
9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998.
1ApatiraUthman 2AtphasoukJason 3ChauMinh 4CohenDavid 5CookNathan 6de GuzmanArmand 7EdgcombAlex 8GarciaSteven 9HichbornGeoffrey 10HuiCharles 11KazemiAzadeh.
1 Unification ( 統一 ) Forward Chaining ( 前向き推論 ) Backward Chaining ( 後ろ向き推論 ) Unification ( 統一 ) Forward Chaining ( 前向き推論 ) Backward Chaining ( 後ろ向き推論 )
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
1 Inference in First Order Logic CS 171/271 (Chapter 9) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Propositional Logic Predicate Logic
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 05 : Knowledge Base & First Order Logic.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
For Friday Finish chapter 9 Program 1 due. Program 1 Any questions?
L3. Knowledge Representation and Matching in Java Matching.java Unify.java.
L An Example of Forward Chaining Program in Java
EA C461 Artificial Intelligence
L7. Logic for knowledge representation
Announcements No office hours today!
Inference in First-Order Logic
Logical Inference 1 introduction
L9. Planning Agents L7_exAnswer and explanation Review
EA C461 – Artificial Intelligence Logical Agent
Introduction to Knowledge-bases
10. A rule based system Forward Chaining based rule base system.
First Order Logic.
Inference in First-Order Logic
Inference in first-order logic part 1
L7. Logic for knowledge representation
Artificial Intelligence
Jess Architecture Diagram WORKING MEMORY INFERENCE ENGINE EXECUTION ENGINE PATTERN MATCHER RULE BASE Here you can see how all the parts fit.
Artificial Intelligence
Inference in first-order logic part 1
L9. Matching Program in Java
Inference in First Order Logic (1)
CSE (c) S. Tanimoto, 2004 Unification
CSE S. Tanimoto Unification
Horn Clauses and Unification
CSE (c) S. Tanimoto, 2002 Unification
Horn Clauses and Unification
Propositional Calculus
L9. Matching Program in Java
Relational Proofs Computational Logic Lecture 7
Relational Proofs Computational Logic Lecture 7
Presentation transcript:

Unification Unification (Unify.java) Doing exercises

Seven inference rules for propositional Logic (1) Modus Ponens (2) And-Elimination (3) And-Introduction (4) Or-Introduction (5) Double-Negation Elimination (6) Unit Resolution (7) Logic connectives:    ,  i 1  2 … n 1  2 … n 1, 2, …, n 1  2  …  n i        ,     ,       

The three new inference rules (8) Universal Elimination: For any sentence , variable v, and ground term g: e. g.,  x Likes(x, IceCream), we can use the substitute {x/Rose} and infer Like(Rose, IceCream). (9) Existential Elimination: For any sentence , variable v, and constant symbol k that does not appear elsewhere in the knowledge base: e. g.,  x Kill(x, Victim), we can infer Kill(Murderer, Victim), as long as Murderer does not appear elsewhere in the knowledge base. (10) Existential Introduction: For any sentence , variable v that does not occur in , and ground term g that does occur in : e. g., from Likes(Rose, IceCream) we can infer  x Likes(x, IceCream). SUBST({v/g}, )  v  Ground term is a term that contains no variables. SUBST({v/k}, )  v   v SUBST({g/v}, ) 

Example of proof Bob is a buffalo | 1. Buffalo(Bob) --f1 Pat is a pig | 2. Pig(Pat) --f2 Buffaloes run faster than pigs | 3.  x, y Buffalo(x)  Pig(y)  Faster(x,y) --r1 ---------------------------------------------------------------------------------------------------- To proof: Bob runs faster than Pat --------------------------------------------------------------------------------------------------- Apply R(3) to f1 And f2 | 4. Buffalo(Bob)  Pig(Pat) --f3 (And-Introduction) Apply R(8) to r1 {x/Bob, y/Pat} | 5. Buffalo(Bob)  Pig(Pat)  Faster(Bob,Pat) --f4 (Universal-Elimination) Apply R(1) to f3 And f4 | 6. Faster(Bob,Pat) --f5 (Inplication-Elimination )

Search with primitive inference rules Operators are inference rules States are sets of sentences Goal test checks state to see if it contains query sentence R(1) to R(10) are common inference pattern Problem: branching factors are huge, esp. for R(8) Idea: find a substitution that makes the rule premise match some known facts. 1 2 3 Apply R(3) to 1 & 2 1 2 3 4 Apply R(8) to 3 Stored in rule base Stored in working memory 1 2 3 4 5 Apply R(1) to 4 & 5 1 2 3 4 5 6

A Reasoning System Rule Base Working Memory Interaction with Inference Engine Matching Fire a Rule Select a Rule Acting

Unification The process of matching is called unification: for example, - p(x) matches p(Jack) with x = Jack - q(fatherof(x),y) matches q(y,z) with y=fatherof(x) and z = y note the result of the match is q(fatherof(x),fatherof(x)) - p(x) matches p(y) with x = Jack and y = Jack x = John and y = John or x = y

Unify Unification function, Unify, is to take two atomic sentences p and q and return a substitution that would make p and q look the same. A substitute  unifies atomic sentences p and q if p  =q  For example, p q  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Knows(John, x) | Knows(John, Jane) | {x/Jane} Knows(John, x) | Knows(y, OJ) | {y/John, x/OJ} Knows(John, x) | Knows(y, Mother(y)) | {y/John, x/Mother(John)} e.g., Unify(Knows(John, x), Knows(John, Jane)) = {x/Jane} Idea: Unify rule premises with known facts, apply unifier to conclusion. e.g., if we know q and Knows(John, x) Likes(John, x) then we can conclude Likes(John, Jane) Likes(John, OJ) Likes(John, Mother(John)) Premise 前提

String matching: string1 = string2 e.g. “rose” = “rose” if string1.equals(string2) “I am Rose” = “I am Rose” “I am ?x” = “I am Rose” “I am ?x” = “?y am Rose” I = ?y am = am ?x = Rose ? e.g. ?x is ?y and ?x Rose is rose and ?y e.g. husband(father(?x), Mike) husband(father(John), Mike) ?x = Rose ?y = rose ?x = ?y ?x = John

課題 Understand the Java program (Unify.java) (参考図書:Javaによる知能プログラミング入門) (We will have quiz problems regarding the Java program, Unify.java in next week lecture)