Reasoning Forward and Backward Chaining Andrew Diniz da Costa

Slides:



Advertisements
Similar presentations
The Basics of Logical Argument Two Kinds of Argument The Deductive argument: true premises guarantee a true conclusion. e.g. All men are mortal. Socrates.
Advertisements

Basic Terms in Logic Michael Jhon M. Tamayao.
1 Knowledge Representation Introduction KR and Logic.
Framing an Experimental Hypothesis WP5 Professor Alan K. Outram University of Exeter 8 th October 2012.
Modelling with expert systems. Expert systems Modelling with expert systems Coaching modelling with expert systems Advantages and limitations of modelling.
Expert Systems Reasonable Reasoning An Ad Hoc approach.
CHAPTER 13 Inference Techniques. Reasoning in Artificial Intelligence n Knowledge must be processed (reasoned with) n Computer program accesses knowledge.
1 Rule Based Systems Introduction to Production System Architecture.
Expert Systems Reasonable Reasoning An Ad Hoc approach.
Logic Use mathematical deduction to derive new knowledge.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
CS 484 – Artificial Intelligence1 Announcements Choose Research Topic by today Project 1 is due Thursday, October 11 Midterm is Thursday, October 18 Book.
Inferences The Reasoning Power of Expert Systems.
Reasoning System.  Reasoning with rules  Forward chaining  Backward chaining  Rule examples  Fuzzy rule systems  Planning.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Artificial Intelligence Lecture No. 16
Chapter 12: Expert Systems Design Examples
Reasoning Automated Deduction. Reasonable Arguments Argument: An attempt to demonstrate the truth of a conclusion from the truth of a set of premises.
Expert System Human expert level performance Limited application area Large component of task specific knowledge Knowledge based system Task specific knowledge.
CPSC 322, Lecture 20Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Computer Science cpsc322, Lecture 20 (Textbook.
1 5.0 Expert Systems Outline 5.1 Introduction 5.2 Rules for Knowledge Representation 5.3 Types of rules 5.4 Rule-based systems 5.5 Reasoning approaches.
1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining.
Rules and Expert Systems
© C. Kemke1Reasoning - Introduction COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Production Rules Rule-Based Systems. 2 Production Rules Specify what you should do or what you could conclude in different situations. Specify what you.
Marakas: Decision Support Systems, 2nd Edition © 2003, Prentice-Hall Chapter Chapter 7: Expert Systems and Artificial Intelligence Decision Support.
EXPERT SYSTEMS Part I.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2005.
Artificial Intelligence Chapter 17 Knowledge-Based Systems Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers note: please include.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
1 Backward-Chaining Rule-Based Systems Elnaz Nouri December 2007.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Knowledge Acquisition. Concepts of Knowledge Engineering Knowledge engineering The engineering discipline in which knowledge is integrated into computer.
Chapter 14: Artificial Intelligence Invitation to Computer Science, C++ Version, Third Edition.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
13: Inference Techniques
THIS CD HAS BEEN PRODUCED FOR TEACHERS TO USE IN THE CLASSROOM. IT IS A CONDITION OF THE USE OF THIS CD THAT IT BE USED ONLY BY THE PEOPLE FROM SCHOOLS.
‘In which we introduce a logic that is sufficent for building knowledge- based agents!’
Logical Agents Logic Propositional Logic Summary
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Artificial Intelligence
Forward and Backward Chaining
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
By Muhammad Safdar MCS [E-Section].  There are times in life when you are faced with challenging decisions to make. You have rules to follow and general.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Computer Science cpsc322, Lecture 20
Chapter 9. Rules and Expert Systems
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Knowledge-Based Systems Chapter 17.
Artificial Intelligence Chapter 17 Knowledge-Based Systems
CS62S: Expert Systems Based on:
Artificial Intelligence
Assignment-2 due now Enterprise Architecture Conference Sat. Oct 27
Critical Thinking part 2
CPSC 433 : Artificial Intelligence Tutorials T01 & T02
Artificial Intelligence Chapter 17. Knowledge-Based Systems
Computer Science cpsc322, Lecture 20
Chapter 9. Rules and Expert Systems
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Logical and Rule-Based Reasoning Part I
Habib Ullah qamar Mscs(se)
Presentation transcript:

Reasoning Forward and Backward Chaining Andrew Diniz da Costa

© LES/PUC-Rio Roadmap Overview about Reasoning Forward Chaining –Presentation –Examples Backward Chaining –Presentation –Examples JTP API Final Considerations

© LES/PUC-Rio Reasoning Reasoning is the mental (cognitive) process of looking for reasons to support beliefs, conclusions, actions or feelings. In philosophy, the study of reasoning typically focuses on what makes reasoning efficient or inefficient, appropriate or inappropriate, good or bad.

© LES/PUC-Rio Reasoning The main division between forms of reasoning that is made in philosophy is between deductive reasoning and inductive reasoning. Formal logic has been described as 'the science of deduction'. The study of inductive reasoning is generally carried out within the field known as informal logic or critical thinking.

© LES/PUC-Rio Deductive Reasoning Deductive arguments are intended to have reasoning that is valid. Reasoning in an argument is valid if the argument's conclusion must be true when the premises (the reasons given to support that conclusion) are true. Example Premise 1: All humans are mortal. Premise 2: Socrates is a human. Conclusion: Socrates is mortal.

© LES/PUC-Rio Deductive Reasoning Within the field of formal logic, a variety of different forms of deductive reasoning have been developed. Some logics –Modal logic –Propositional logic –Predicate logic

© LES/PUC-Rio Inductive Reasoning Inductive reasoning contrasts strongly with deductive reasoning. Even in the best, or strongest, cases of inductive reasoning, the truth of the premises does not guarantee the truth of the conclusion. The conclusion of an inductive argument follows with some degree of probability. Example –Premise: The sun has risen in the east every morning up until now. –Conclusion: The sun will also rise in the east tomorrow.

© LES/PUC-Rio Reasoning If-then rules have become the most popular form of declarative knowledge representation used in AI applications. Algorithms to process if-the rules –Forward Chaining –Backward Chaining Forward Chaining can be used to produce new facts Backward Chaining can deduce whether conclusions are true or not.

© LES/PUC-Rio Forward Chaining It is one of the two main methods of reasoning when using inference rules. Forward chaining starts with the available data until a goal to be reached. Use inference rules to extract more data until a goal to be reached.

© LES/PUC-Rio Forward Chaining An inference engine using forward chaining searches the inference rules until it finds one where the If clause is known to be true. When found it can conclude, or infer, the Then clause, resulting in the addition of new information to its dataset. Require three basic elements –A knowledge base of rules and facts; –A working memory for storing data during inferencing; –An inference engine.

© LES/PUC-Rio Forward Chaining – First Example The Vehicles Rule Base Cycle: IF num_wheels < 4 THEN vehicleType=cycle Automobile: IF num_wheels=4 AND motor=yes THEN vehicleType=automobile MiniVan: IF vehicleType=automobile AND size=medium AND num_doors=3 THEN vehicle=MiniVan...

© LES/PUC-Rio Forward Chaining – First Example Initial values in the working memory –num_wheels=4 –motor=yes –num_doors=3 –size=medium Cycle: IF num_wheels < 4 THEN vehicleType=cycle (Rule is false) Automobile: IF num_wheels=4 AND motor=yes THEN vehicleType=automobile

© LES/PUC-Rio Forward Chaining – First Example Values in the working memory –num_wheels=4 –motor=yes –num_doors=3 –size=medium –vehicleType=automobile MiniVan: IF vehicleType=automobile AND size=medium AND num_doors=3 THEN vehicle=MiniVan

© LES/PUC-Rio Forward Chaining – First Example Values in the working memory –num_wheels=4 –motor=yes –num_doors=3 –size=medium –vehicleType=automobile –vehicle=MiniVan

© LES/PUC-Rio Forward Chaining – Second Example Suppose that the goal is to conclude the color of my pet Fritz, given that he croaks and eats flies, and that the rule base contains the following two rules: –If Fritz croaks and eats flies - Then Fritz is a frog –If Fritz is a frog - Then Fritz is green croaks=true eats_flies=true croaks=true eats_flies=true Fritz=frog croaks=true eats_flies=true Fritz=frog green=true Working memory

© LES/PUC-Rio Forward Chaining Cycle 1 - Load the rule base into the inference engine and load any facts from the knowledge base into the working memory. 2 - Add any additional initial data into the working memory 3 - Match the rules against the data in the working memory which rules are triggered, meaning that all of their antecedent clauses are true. This set of triggered rules is called the conflict set. 4 – Use a procedure to select a single rule from the conflict set. 5 – Update the working memory. 6 – Repeat steps 3, 4 and 5 until the conflict set is empty.

© LES/PUC-Rio Backward Chaining A particular consequence or goal clause is evaluated first. Unlike forward chaining, which uses rules to produce new information, backward chaining uses rules to answer questions about whether a goal clause is true or not. It only processes rules that are relevant to the question.

© LES/PUC-Rio Backward Chaining - Example We go to work using a rule from our Vehicles rule base as an example. Cycle: IF num_wheels < 4 THEN vehicleType=cycle Automobile: IF num_wheels=4 AND motor=yes THEN vehicleType=automobile MiniVan: IF vehicleType=automobile AND size=medium AND num_doors=3 THEN vehicle=MiniVan...

© LES/PUC-Rio Backward Chaining - Example Suppose we want to find out whether the vehicle we have is a MiniVan. MiniVan: IF vehicleType=automobile AND size=medium AND num_doors=3 THEN vehicle=MiniVan We start with an empty working memory. To verify if vehicle=MiniVan in the work memory. If not, then all the antecedent clauses of the MiniVan=true: rule must be true.

© LES/PUC-Rio Backward Chaining - Example The first thing we do is test if vehicleType=automobile is true. The vehicleType variable has no value, so we look for a rule that has vehicleType=automobile in its consequence clause Automobile: IF num_wheels=4 AND motor=yes AND vehicleType=automobile We look num_wheels=4 in the work memory and if there is a rule related. There are none, so we ask the user.

© LES/PUC-Rio Backward Chaining - Example Working memory –num_wheels=4 –motor=yes –vehicleType=automobile Going back to our original rule MiniVan: IF vehicleType=automobile AND size=medium AND num_doors=3 THEN vehicle=MiniVan

© LES/PUC-Rio Backward Chaining - Example Working memory –num_wheels=4 –motor=yes –vehicleType=automobile –size=medium –num_doors=3 –vehicle=MiniVan

© LES/PUC-Rio Backward Chaining - Cycle 1 - Load the rule base into the inference engine and load any facts from the knowledge base into the working memory 2 - Add any additional initial data into the working memory 3 – Specify a goal variable for the inference engine to find 4 – Find the set rules that refer to the goal variable in a consequence clause. Put each rule on the goal stack 5 – Take the top rule off the goal stack 6 – Try to prove the rule is true by testing all antecedent clauses to see if they are true.

© LES/PUC-Rio JTP:An Object-Oriented Modular Reasoning System Knowledge Systems Laboratory of Computer Science Department in Stanford University JTP is based on a very simple and general reasoning architecture. Backward-chaining and forward chaining Reasoner is the principal functional component of the architecture. –process - This method attempts to find proof for the goal.

© LES/PUC-Rio Final Considerations Forward-chaining uses inference rules to extract more data. Backward chaining uses rules to answer questions about whether a goal clause is true or not. Very used in AI applications. APIs that use forward- and backward-chaining (ex: JTP).

© LES/PUC-Rio Bibliography Bigus, Joseph P.; Bigus, Jennifer, Constructing Intelligent Agents Using Java – Second Edition. Forward chaining - Wikipedia (2007), August. Forward chaining of Rules (2007), August. Reasoning – Wikipedia (2007), August

© LES/PUC-Rio Bibliography Backward chaining – Wikipedia (2007) August. API JTP Web site (2007), ksl.stanford.edu/software/jtp/, August.

Questions?

The End.