Supplemental slides for CSE 327 Prof. Jeff Heflin

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

Some Prolog Prolog is a logic programming language
First-Order Logic.
Inference Rules Universal Instantiation Existential Generalization
SLD-resolution Introduction Most general unifiers SLD-resolution
Chapter 11 :: Logic Languages
Standard Logical Equivalences
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
Prolog The language of logic. History Kowalski: late 60’s Logician who showed logical proof can support computation. Colmerauer: early 70’s Developed.
Artificial Intelligence Inference in first-order logic Fall 2008 professor: Luigi Ceccaroni.
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.
Logic.
Ch. 19 – Knowledge in Learning Supplemental slides for CSE 327 Prof. Jeff Heflin.
Ch. 2 – Intelligent Agents Supplemental slides for CSE 327 Prof. Jeff Heflin.
Ch. 8 – First Order Logic Supplemental slides for CSE 327 Prof. Jeff Heflin.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
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.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Introduction to Prolog Notes for Ch.1 of Bratko For CSCE 580 Sp03 Marco Valtorta.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Fall 2004.
Artificial Intelligence Chapter 17 Knowledge-Based Systems Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
0 1 Todays Topics Resolution – top down and bottom up j-DREW BU procedure Subsumption – change to procedure Infinite Loops RuleML input – Prolog output.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
Ch. 14 – Probabilistic Reasoning Supplemental slides for CSE 327 Prof. Jeff Heflin.
Logical Inference 2 rule based reasoning
Ch. 9 – FOL Inference Supplemental slides for CSE 327 Prof. Jeff Heflin.
First Order Predicate Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
1 Prolog and Logic Languages Aaron Bloomfield CS 415 Fall 2005.
First-Order Logic and Inductive Logic Programming.
Computing & Information Sciences Kansas State University Lecture 15 of 42 CIS 530 / 730 Artificial Intelligence Lecture 15 of 42 William H. Hsu Department.
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Ch. 7 – Logical Agents Supplemental slides for CSE 327 Prof. Jeff Heflin.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Introduction to Prolog Asst. Prof. Dr. Senem Kumova Metin Revised lecture notes of “Concepts of Programmig Languages, Robert W. Sebesta, Ch. 16”
Ch. 4 – Informed Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Ch. 7 – Logical Agents Supplemental slides for CSE 327 Prof. Jeff Heflin.
Prolog Fundamentals. 2 Review Last Lecture A Prolog program consists of a database of facts and rules, and queries (questions). –Fact:.... –Rule:... :-....
Logic Programming Lecture 2: Unification and proof search.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Logical Inference 2 Rule-based reasoning
Recursive stack-based version of Back-chaining using Propositional Logic
Ch. 2 – Intelligent Agents
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Knowledge-Based Systems Chapter 17.
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Supplemental slides for CSE 327 Prof. Jeff Heflin
First-Order Logic and Inductive Logic Programming
Logical Inference 2 Rule-based reasoning
Jess Architecture Diagram WORKING MEMORY INFERENCE ENGINE EXECUTION ENGINE PATTERN MATCHER RULE BASE Here you can see how all the parts fit.
Supplemental slides for CSE 327 Prof. Jeff Heflin
Ch. 19 – Knowledge in Learning
Artificial Intelligence Chapter 17. Knowledge-Based Systems
Introduction to PROLOG
CS 188: Artificial Intelligence
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Chapter 2: Prolog (Introduction and Basic Concepts)
Constraint Handling Rules with Disjunction (CHRv)
Supplemental slides for CSE 327 Prof. Jeff Heflin
Supplemental slides for CSE 327 Prof. Jeff Heflin
Supplemental slides for CSE 327 Prof. Jeff Heflin
Ch. 2 – Intelligent Agents
Supplemental slides for CSE 327 Prof. Jeff Heflin
Presentation transcript:

Supplemental slides for CSE 327 Prof. Jeff Heflin Ch. 9 – FOL Inference Supplemental slides for CSE 327 Prof. Jeff Heflin

EBNF Grammar for Prolog <program>  <clause> { <clause> } <clause>  <fact> | <rule> <fact>  <compound> . <compound>  <atom> ( <termlist> ) <rule>  <head> :- <body> . <head>  <compound> <body>  <compound> { , <compound> } <termlist>  <term> { , <term> } <term>  <atom> | <num> | <var> | … Notes: { <a> } means 0, 1 or more <a>’s This grammar is slightly more restrictive than the actual language

Backward Chaining function FOL-BC-Ask (KB, goals, ) returns a set of substitutions local answers, a set of substitutions, initially empty if goals is empty then return { } q’  Subst( ,First(goals)) for each sentence r in KB where Standardize-Apart(r) = (p1  … pn  q) and ’  Unify(q,q’) succeeds new_goals  Prepend([p1,…,pn], Rest(goals)) answers  FOL-BC-Ask(KB, new_goals, Compose(’, ))  answers return answers Alternative description of Figure 9.6, p. 338

Backward Chaining Example Set of sentences: S1: x1,y1 child(x1,y1)  parent(y1,x1) S2: x2,y2 parent(x2,y2)  female(x2)  mother(x2,y2) S3: child(Lisa,Homer) S4: child(Lisa,Marge) S5: female(Marge) Note: variables have already been standardized apart using subscripts Query: x mother(x,Lisa)

Backward Chaining Search Tree mother(x0,Lisa) match rule S2 ’={x2/x0, y2/Lisa} parent(x0,Lisa), female(x0) match rule S1 ’={y1/x0, x1/Lisa} child(Lisa,x0), female(x0) match S4 ’={x0/Marge} match S3 ’={x0/Homer} female(Homer) female(Marge) matches S5 ’={ x0/Marge} no matches answers={} (FAIL!)  answers= { x0/Marge}

Forward Chaining function FOL-FC-Ask (KB,) returns a substitution or false local new, the new sentences inferred on each iteration repeat until new is empty new  {} for each sentence r in KB do (p1  … pn  q )  Standardize-Apart (r) for each  such that Subst( , p1  … pn)= Subst( , p1’  … pn’) for some p1’ ,…, pn’ in KB q’  Subst( ,q) if q’ does not unify with some sentence already in KB or new then do add q’ to new   Unify(q’, ) if  is not fail then return  add new to KB return answers From Figure 9.3, p. 332