Rules: Knowledge Representation & Manipulation

Slides:



Advertisements
Similar presentations
Rule-based representation
Advertisements

1 Rule Based Systems Introduction to Production System Architecture.
Rulebase Expert System and Uncertainty. Rule-based ES Rules as a knowledge representation technique Type of rules :- relation, recommendation, directive,
Building a Knowledge Base with VPExpert (VPX. exe) see also: vpxguide
Reasoning Forward and Backward Chaining Andrew Diniz da Costa
CS 484 – Artificial Intelligence1 Announcements Choose Research Topic by today Project 1 is due Thursday, October 11 Midterm is Thursday, October 18 Book.
(FO) Inference Methods CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Reasoning System.  Reasoning with rules  Forward chaining  Backward chaining  Rule examples  Fuzzy rule systems  Planning.
Intelligent systems Lecture 6 Rules, Semantic nets.
Knowledge Engineering.  Process of acquiring knowledge from experts and building knowledge base  Narrow perspective  Knowledge acquisition, representation,
Rule Based Systems Michael J. Watts
Artificial Intelligence Lecture No. 16
Rule Based Systems Alford Academy Business Education and Computing
FT228/4 Knowledge Based Decision Support Systems Rule-Based Systems Ref: Artificial Intelligence A Guide to Intelligent Systems Michael Negnevitsky – Aungier.
Expert System Human expert level performance Limited application area Large component of task specific knowledge Knowledge based system Task specific knowledge.
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.
Artificial Intelligence CAP492
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
Production Rules Rule-Based Systems. 2 Production Rules Specify what you should do or what you could conclude in different situations. Specify what you.
EXPERT SYSTEMS Part I.
CS 561, Session 25 1 Introduction to CLIPS Overview of CLIPS Facts Rules Rule firing Control techniques Example.
Artificial Intelligence CSC 361
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
INTELLIGENT SYSTEMS Rule based systems 1. Aims of session To understand  Basic principles  Forward chaining  Problems with rule-based systems  Backward.
Production Systems A production system is –a set of rules (if-then or condition-action statements) –working memory the current state of the problem solving,
Knowledge based Humans use heuristics a great deal in their problem solving. Of course, if the heuristic does fail, it is necessary for the problem solver.
Chapter 9: Rules and Expert Systems Lora Streeter.
Jess: A Rule-Based Programming Environment Reporter: Yu Lun Kuo Date: April 10, 2006 Expert System.
ARTIFICIAL INTELLIGENCE DR. ABRAHAM AI a field of computer science that is concerned with mechanizing things people do that require intelligent.
Rule Based Systems  If then  Rules to solve problems  What is forward chaining?  What is backward chaining?  Expert systems.
Expert System Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Rule-based Systems: Mechanisms & Efficiency Artificial Intelligence CMSC January 10, 2002.
Inferencing in rule-based systems: forward and backward chaining.
Chapter 4: Inference Techniques
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Chapter 9. Rules and Expert Systems Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Forward and Backward Chaining
Logic Programming Lecture 2: Unification and proof search.
Artificial Intelligence: Applications
Intelligent Systems Rule based systems 1. Aims of session To understand Basic principles Forward chaining Problems with rule-based systems Backward chaining.
UCT Department of Computer Science Computer Science 1015F Iteration
Lecture 20. Recap The main components of an ES are –Knowledge Base (LTM) –Working Memory (STM) –Inference Engine (Reasoning)
Advanced AI Session 2 Rule Based Expert System
Presented By S.Yamuna AP/CSE
Chapter 9. Rules and Expert Systems
Preserving and Applying Human Expertise: Knowledge-Based Systems
The following materials are borrowed from Prof. Ken Forbus’ class
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Artificial Intelligence Chapter 17 Knowledge-Based Systems
10. A rule based system Forward Chaining based rule base system.
The Physical Symbol Systems Hypothesis
Knowledge Representation
CS62S: Expert Systems Based on:
Building Java Programs
Engineering Mechanics : STATICS
Forward Chaining DFS can supply compatible bindings for forward chaining.
Logical assertions assertion: A statement that is either true or false. Examples: Java was created in The sky is purple. 23 is a prime number. 10.
Program Flow Control Selection & repetition
Building Java Programs
Three Special Structures – Case, Do While, and Do Until
CPSC 433 : Artificial Intelligence Tutorials T01 & T02
Artificial Intelligence Chapter 17. Knowledge-Based Systems
Building Java Programs
What’s the matter with you?
Chapter 9. Rules and Expert Systems
ZB B yB zA B0 VA0B0 A xB yA A0 xA Figure 2.1: Two Coordinate Systems.
Artificial Intelligence Chapter 17 Knowledge-Based Systems
Proofs (2.7) (How to compute logical consequences of a KB rather that
Presentation transcript:

Rules: Knowledge Representation & Manipulation Artificial Intelligence CMSC 25000 January 8, 2002

Agenda Knowledge Representation: Knowledge Manipulation: Assertions & Rules Knowledge Manipulation: Forward & Backward Chaining Deduction & Reaction Systems Costs, Choices, and Mechanisms

Representing Knowledge Assertion: Statement that something is true “Stretch is a giraffe”,”The sky is blue” Collection of assertions: “Working Memory”

Representing Knowledge: Rules If - then rules If A1, A2 Antecedent Then B1, B2 Consequent

Representing Knowledge: Rules May include variables, e.g. Variables: ?x,?y,?z Same name => same value If (parent-of ?x ?y), (parent-of ?y ?z), then (grandparent-of ?x ?z)

Knowledge Manipulation Forward chaining: Reason from “if” antecedents to “then” consequents Backward chaining: Confirm hypothesis matching “then” patterns by verifying “if” patterns

Rule-based Systems Separate knowledge from control Rules Contrast from typical programming: Integrated Add consequent Assertions Rules Rule Interpreter Select rule Match antecedent

Forward Chaining Identify triggered rules Antecedents match assertions Match variables -> rule instances Select a triggered rule to fire Conflict resolution strategy: first, random, LRU, combination Fire a rule Add consequents to list of assertions (deduction) Perform action(s) in consequent (reaction)

Forward Chaining Example R1: if (signs (nasal congestion)) (signs (viremia)) then (diagnosis influenza) R2: if (runny nose) then (signs (nasal congestion)) R3: if (body-aches) then (signs (achiness)) R4: if (temp >100) then (signs (fever)) R5: if (headache) then (signs (achiness)) R6: if (signs (fever)) (signs (achiness)) (cough) then (signs (viremia)) Assertions: F1: runny nose F2: temp = 101.5 F3: headache Execution: R2 Fires: Asserts (signs (nasal congestion)) R4 Fires: Asserts (signs (fever)) R5 Fires: Asserts (signs (achiness)) R6 Fires: Asserts (signs (viremia)) R1 Fires: Asserts (diagnosis influenza)

Forward Chaining with variables IF (parent ?x ?y) (parent A B) (parent ?y ?z) (parent A C) THEN (grand-parent ?x ?z) (parent B D) (parent C E) (parent ?x ?y) (parent ?y ?z) (grand-parent ?x ?z) (x:A y:B) (y:A z:B) conflict in y (y:A z:C) conflict in y (y:B z:D) (x:A y:B z:D) (y:C z:E) conflict in y (x:A y:C) (y:A z:B) conflict in y (y:B z:D) conflict in y (y:C z:E) (x:A y:C z:E) (x:B y:D) (y:A z:B) conflict in y (x:C y:E) (y:A z:B) conflict in y

Forward Chaining: Analysis Reason from antecedents to consequents Trigger rules if all antecedents match assertions Add assertions or do actions in consequents May be computationally expensive Many possible deductions to make Brute force approach: k antecedents, N assertions N^k!! Rete method

Backward Chaining Test hypothesis Reason from consequents to antecedents Use assertions and rules If no assertions or rules give evidence, ask questions

Backchain(G) - Rule interpreter If G matched assertion in database, then return True Else If there are rules whose consequent matches G For each matching rule R For each antecedent C of R If Backchain(C) is true, proceed Else go to next rule. Return True /* when all antecedents are true */ Return False /* when no matching rule succeeds */ Else, ask user if G is true. If answer is “yes” return True, Else return False. From Lozano-Perez, April 00

Backward Chaining Example R1: if (signs (nasal congestion)) (signs (viremia)) then (diagnosis influenza) R2: if (runny nose) then (signs (nasal congestion)) R3: if (body-aches) then (signs (achiness)) R4: if (temp >100) then (signs (fever)) R5: if (headache) then (signs (achiness)) R6: if (signs (fever)) (signs (achiness)) (cough) then (signs (viremia))

Backward Chaining Example Hypothesis: (diagnosis influenza) Diagnosis Influenza AND (Signs (nasal congestion)) (Signs (viremia) AND (Runny nose) (Signs (fever)) (Signs (achiness)) (cough) Ask Ask OR Yes (Temp > 100) Yes Ask Yes (Body-ache) (Headache) Ask Ask No Yes

Reaction Systems Deduction systems Reaction systems Produce new assertions Keep firing all triggered rules Order less important Reaction systems Produce arbitrary actions: assertions, printing, moving, bagging Side effects -> Order important

Reaction System: Example For example, IF (at ?x ?y) (move ?x to ?z) ADD (at ?x ?z) DELETE (move ?x to ?z) (at ?x ?y) Assume an initial database: (at A room1) (move A room2) Then the rule would add: (at A room2) And, delete:

Conflict Resolution When >1 rule is triggered, which fires?? First: Rules are ordered. Fire first triggered. Random: Randomly select a rule to fire Most specific: Fire rule with most antecedents Least recently fired: Avoids rule starvation. Combination Design rule set wrt conflict resolution strategy

Conflict Resolution: Deduction Generally, less important,but Possible to create infinitely recursive rule if ?x, (not (not ?x))…. Need conflict resolution Allow other rules to fire E.g. stop rule