Forward Chaining (propositional) Recursive stack-based version of Back-chaining using Propositional Logic could be modified to handle... variables.

Slides:



Advertisements
Similar presentations
Some Prolog Prolog is a logic programming language
Advertisements

Russell and Norvig Chapter 7
Inference Rules Universal Instantiation Existential Generalization
Chapter 11 :: Logic Languages
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
Logic Programming (cont’d): Lists Lists in Prolog are represented by a functor (similar to cons in Scheme): 1.The empty list is represented by the constant.
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.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
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.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
MB: 2 March 2001CS360 Lecture 31 Programming in Logic: Prolog Prolog’s Declarative & Procedural Semantics Readings: Sections
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CSCE 580 Sp03 Marco Valtorta.
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Modelling planning problems using PDDL
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
FATIH UNIVERSITY Department of Computer Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CENG 421 Fall03.
For Wednesday Read chapter 10 Prolog Handout 4. Exam 1 Monday Take home due at the exam.
Logical Inference 2 rule based reasoning
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
Ch. 9 – FOL Inference Supplemental slides for CSE 327 Prof. Jeff Heflin.
CT214 – Logical Foundations of Computing Lecture 8 Introduction to Prolog.
1 Prolog and Logic Languages Aaron Bloomfield CS 415 Fall 2005.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Ch. 13 Ch. 131 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes?) Dr. Carter Tiernan.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Logic Programming Tarik Booker. What will we cover?  Introduction  Definitions  Predicate Calculus  Prolog  Applications.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
In The Name Of Allah Lab 03 1Tahani Aldweesh. objectives Searching for the solution’s. Declaration. Query. Comments. Prolog Concepts. Unification. Disjunction.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Section 16.5, 16.6 plus other references
EA C461 Artificial Intelligence
Logical Inference 2 Rule-based reasoning
Announcements No office hours today!
Prolog a declarative language
Computer Science cpsc322, Lecture 20
Recursive stack-based version of Back-chaining using Propositional Logic
Resolution in the Propositional Calculus
Exercises: First Order Logics (FOL)
Logical Inference 2 Rule-based reasoning
Horn Clauses and Unification
NPDAs Accept Context-Free Languages
3.5 Programming paradigms
Artificial Intelligence
Jess Architecture Diagram WORKING MEMORY INFERENCE ENGINE EXECUTION ENGINE PATTERN MATCHER RULE BASE Here you can see how all the parts fit.
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
Prolog a declarative language
Prolog a declarative language
Logics for Data and Knowledge Representation
Prolog a declarative language
Artificial Intelligence: Agents and Propositional Logic.
Horn Clauses and Unification
Horn Clauses and Unification
Horn Clauses and Unification
Horn Clauses and Unification
Computer Science cpsc322, Lecture 20
Methods of Proof Chapter 7, second half.
Presentation transcript:

Forward Chaining (propositional)

Recursive stack-based version of Back-chaining using Propositional Logic could be modified to handle... variables (using unification) negation context (fail if sub-goal is repeated) Backchain(KB,query) stack {query} // initialize return BC(KB,stack)   BC(KB,stack) if stack empty, return True goal  stack.pop() if goalKB, return BC(KB,stack) // a known fact for each rule a1..angoal in KB: stack.push(a1..an) result  BC(KB,stack) if result=True, return True remove a1..an from stack return False

KB = {CanBikeToWork  CanGetToWork CanDriveToWork  CanGetToWork CanWalkToWork  CanGetToWork HaveBike  Sunny  CanBikeToWork OwnCar  CanDriveToWork HaveMoney  RentCar  CanDriveToWork HaveMoney  TaxiAvailable  CanDriveToWork Sunny  CanWalkToWork HaveUmbrella  CanWalkToWork Rainy, // facts HaveBike, HaveMoney, RentCar } query = CanGetToWork ?

{CanGetToWork} // initialize goal stack with query {CanBikeToWork} // replace subgoal with rule 1 {HaveBike,Sunny} // push antecedents for rule 4 {Sunny} // HaveBike is fact, so pop it backtrack since Sunny in not a fact and can’t be proved {CanDriveToWork} // rule 2, another way CanGetToWork {OwnCar} // try rule 5 backtrack, not provable {HaveMoney,RentCar} // another way to prove CanDriveToWork {RentCar} // pop HaveMoney since known fact {} // success! empty goal stack, return True