PRODUCTION SYSTEMS (PRODUCTION RULES SYSTEMS) Dr. Hikmat Jaber

Similar documents
Propositional Logic: Methods of Proof. Chapter 7, Part II

Reasoning Systems Chapter 4. Dr Ahmed Rafea

Knowledge-based and Expert Systems - 1. Knowledge-based and Expert Systems - 2. Knowledge-based and Expert Systems - 4

Deliberative Agents Knowledge Representation I. Deliberative Agents

Propositional Logic: Methods of Proof (Part II)

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Intelligent Agents. Pınar Yolum Utrecht University

Logical Agents (I) Instructor: Tsung-Che Chiang

Inference in first-order logic. Production systems.

Logical Agents. Chapter 7

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples

Logical Agent & Propositional Logic

Propositional Logic: Methods of Proof (Part II)

Artificial Intelligence Chapter 7: Logical Agents

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Logic reasoning systems

This addendum describes the use of new termination actions in the Arbitrary Control Experiment in FuelCell Version 3.8d and later.

ARTIFICIAL NEURAL NETWORK PART I HANIEH BORHANAZAD

Lab 3 Parallel Circuits

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Chapter 3 Deterministic planning

Student Sheet: Self-Assessment

Desirable properties of decompositions 1. Decomposition of relational schemes. Desirable properties of decompositions 3

Logical Agent & Propositional Logic

An Active Learning Approach For Inferring Discrete Event Automata

Deductive Systems. Lecture - 3

Lab 4. Current, Voltage, and the Circuit Construction Kit

Physics 220: Worksheet 7

Advanced Topics in LP and FP

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

31.1.1Partial derivatives

CS:4420 Artificial Intelligence

Chapter 6 Constraint Satisfaction Problems

Discrete Mathematics

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Physics 2B Notes - Capacitors Spring 2018

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

Problem Solving and Inferencing REASONING AND INFERENCE Characteristics of Classification Type

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope)

Knowledge-based systems

Rule-Based Classifiers

Logical agents. Chapter 7. Chapter 7 1

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

CS 380: ARTIFICIAL INTELLIGENCE

Lecture 22/Chapter 19 Part 4. Statistical Inference Ch. 19 Diversity of Sample Proportions

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

Hoare Logic and Model Checking

Compiling and Executing PDDL in Picat

Artificial Intelligence

Proof Methods for Propositional Logic

Franz J. Kurfess Computer Science Department California Polytechnic State University San Luis Obispo, CA, U.S.A.

From SAT To SMT: Part 1. Vijay Ganesh MIT

Logical agents. Chapter 7. Chapter 7 1

Lecture 4: Simulated Annealing. An Introduction to Meta-Heuristics, Produced by Qiangfu Zhao (Since 2012), All rights reserved

ADDITIONAL RESOURCES. Duration of resource: 12 Minutes. Year of Production: Stock code: VEA12054

Inference Methods In Propositional Logic

Reinforcement Learning and Control

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and

The Assignment Axiom (Hoare)

Frames of reference. Objectives. Assessment. Physics terms. Equations. What is a frame of reference? 5/19/14

Logic. Propositional Logic: Syntax

TDT4136 Logic and Reasoning Systems

Lesson 23: The Defining Equation of a Line

Axiomatic Verification II

CS 771 Artificial Intelligence. Propositional Logic

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Cockpit System Situational Awareness Modeling Tool

Lecture 23: Reinforcement Learning

Neural Networks. CSE 6363 Machine Learning Vassilis Athitsos Computer Science and Engineering Department University of Texas at Arlington

Introduction to Intelligent Systems

Strong AI vs. Weak AI Automated Reasoning

Class Assignment Strategies

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Propositional inference, propositional agents

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

Electricity and Magnetism DC Circuits Using Kirchhoff s Laws

1 [15 points] Search Strategies

Artificial Intelligence

Algorithms and Complexity theory

Logical Agents. Outline

K owi g yourself is the begi i g of all wisdo.

Inference Methods In Propositional Logic

Learning Analytics. Dr. Bowen Hui Computer Science University of British Columbia Okanagan

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

SPSS, University of Texas at Arlington. Topics in Machine Learning-EE 5359 Neural Networks

KNOWLEDGE-BASED AGENTS INFERENCE

Reinforcement Learning II

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

AN AXIOMATIC APPROACH TO KNOWLEDGE-BASED MAP GENERALISATION

Collision. Kuan-Yu Chen ( 陳冠宇 ) TR-212, NTUST

Propositional Logic. Fall () Propositional Logic Fall / 30

Inf2D 13: Resolution-Based Inference

Introduction to Reinforcement Learning

Unit One Worksheet Motion and Forces WS PS U1

Transcription:

PROUCTION SYSTEMS (PROUCTION RULES SYSTEMS) r. Hikmat Jaber

WHT ROUCTION SYSTEM IS USE OR? The production system describes the systems that represent knowledge in the form of rules for modeling human problem solving and for implementing search algorithms. EINITION production system is a system based on I THEN ules a d o sisti g of 3 parts: 1. Rule Set. 2. Working Memory. 3. Inference Engine.

ROUCTION SYSTEM 1. Rule Set: is the set of Production Rules: - If <condition> then action - nalogous to long term memory. 2. Working Memory: Inference Engine Working Memory - Maintains the facts that inference engine matches against. - The current state of the world. - nalogous to short term memory. Rule Set If then B If B then 3. Inference Engine: (Production System Interpreter) - way of choosing between rules (Conflict Resolution) and acting on rules (Recognize-ct Cycle).

1. PROUCTION production or a rule is condition-action pair presented in the following form: I condition THEN action Production is a single chunk of problem-solving knowledge. The condition part matched against working memory. The condition part of the rule is a pattern that determines when the rule may be applied to a problem. The process of matching the new or existing facts against Production Rules is called pattern matching, which is performed by the Inference Engine. The action part defines the associated problem-solving step if the condition is true.

2. WORKING MEMORY Working memory contains a description of the current state of the problem-solving. 3. INERENCE ENGINE Role to determine what to do i.e. implement search allowing the production system to move towards a goal within the set of rules (this is the role of Recognize-act cycle) I.e. to look at the current state of the world and then find from production rules the best to apply. By 1. Match find relevant rules. Those whose conditions match the current state of long term memory 2. Conflict Resolution choose between relevant rules 3. ct apply or fire the rule 4. Repeat

PTTERN-IRECTE SERCH Operations of the recognize-act cycle are based on the pattern-directed search 1. The working memory contains a pattern corresponding to the current state in the problem-solving process. 2. The pattern is matched against I or THEN part of rules (it depends on the direction of search) 3. If several rules match the pattern, the conflict set appears (i.e. conflict appears when many rules being true for the same fact). The production rules in the conflict set are said to be enabled. Selection of one rule from the conflict set is called conflict resolution.

PTTERN-IRECTE SERCH (cont.) 4. One of the enabled rules is fired and it changes the content of the working memory. 5. The control cycle repeats with the modified working memory. 6. The process terminates when no rules are matched by the content of the working memory. C-condition -action Working memory [Pattern] Knowledge base I C1 THEN 1 I C2 THEN 2 I Cn THEN n

CONTROL O SERCH IN PROUCTION SYSTEMS or real world problems a knowledge base typically i ludes a huge u e of I THEN ules. I o de to make search more effective, developers of intelligent systems must use heuristic control of search. There are 3 control strategies: 1. Control through choice of search strategy 2. Control through rule structure 3. Control through conflict resolution

CONTROL THROUGH CHOICE O SERCH STRTEGY It is possible to choose a direction of search in production systems: 1. ata-driven search (forward chaining) 2. Goal-driven search (backward chaining)

ORWR CHINING orward chaining or data-driven inference works by repeatedly: starting from the current state, matching the premises of the rules (the I parts), and performing the corresponding actions (the THEN parts) that usually update the knowledge base or working memory. The process continues until no more rules can be applied, or some cycle limit is met, e.g. CTS CTS B E execute match &B C& E C RULES CTS C B match &B C& RULES execute CTS E C B execute E C B match &B C& RULES

ORWR CHINING (cont.) In this example there are no more rules, so we can draw the inference chain: C B ata-driven search 1. Begins with a problem description (a pattern) added to the working memory 2. The recognize-act cycle compares matching of the pattern with I part of rules in the knowledge base 3. iring a rule, its THEN part is added to the working memory and the process continues 4. Search stops when the goal is found

ORWR CHINING (cont.) search Example: ata-driven B 1. I hmad is a student THEN h ad e jo s stude t s life C B 2. I h ad e jo s stude t s life THEN hmad meets friends N h ad pa ti ipates i u i e sit s e e ts C E E 3. I hmad meets friends THEN hmad needs money 4. I hmad needs money THEN hmad has a job C 5. I hmad meets friends N hmad participates in G u i e sit s e e ts THEN hmad has little free time G 6. I hmad has little free time N hmad has a job THEN H hmad is not successful in studies N hmad doesi not receive scholarship

ORWR CHINING (cont.) Example: ata-driven search Knowledge base 1. 2. 3. 4. 5. 6. I THEN B I B THEN C N I C THEN E I E THEN I C N THEN G I G N THEN H N I Iteration Working memory Start Goal I Conflict set ired rule 0 1 1 1, B 1, 2 2 2, B, C, 1, 2, 3, 5 5 3, B, C,, G 1, 2, 3, 5 3 4, B, C,, G, E 1, 2, 3, 5, 4 4 5, B, C,, G, E, 1, 2, 3, 5, 4, 6 6 6, B, C,, G, E,, H, I 1, 2, 3, 5. 4, 6 goal

BCKWR CHINING Backward chaining or goal-driven inference works towards a final state by looking at the working memory to see if the sub-goal states already exist there. If not, the actions (the THEN parts) of the rules that will establish the sub-goals are identified, and new sub-goals are set up for achieving the premises of those rules (the I parts). The previous example now becomes CTS CTS CTS CTS E E B C E E B C B C Want B C Want Want Get, Get B Get C, Get Get &B C& &B C& &B C& RULES RULES RULES RULES CTS E B C E B C Execute Execute &B C& CTS &B C& RULES Execute &B C& RULES

BCKWR CHINING (cont.) The first part of the chain works back from the goal until only the initial facts are required, at which point we know how to traverse the chain to achieve the goal state. B C Goal-driven search 1. goal (a pattern) is added to the working memory 2. The recognize-act cycle compares matching of the pattern with THEN part of rules in the knowledge base 3. iring a rule, its I part is added to the working memory and the process continues 4. Search stops when facts on problem are found

BCKWR CHINING (cont.) Example: Goal-driven search Knowledge base 1. 2. 3. 4. 5. 6. I p N q THEN goal I r N s THEN p I w N r THEN q I t N u THEN q I v THEN s I start THEN v N r N q Iteration Working memory Start goal Goal start Conflict set ired rule 0 goal 1 1 1 goal, p, q 1, 2, 3, 4 2 2 goal, p, q, r, s 1, 2, 3, 4, 5 3 3 goal, p, q, r, s, w 1, 2, 3, 4, 5 4 4 goal, p, q, r, s, w, t, u 1, 2, 3, 4, 5 5 5 goal, p, q, r, s, w, t, u, v 1, 2, 3, 4, 5, 6 6 6 goal, p, q, r, s, w, t, u, v, start 1, 2, 3, 4. 5, 6 stop

CONTROL THROUGH RULE STRUCTURE Human experts encode crucial heuristics within their rules of expertise. The order of conditions encodes important procedural information for solving the problem. It is important that this form be preserved in building an intelligent system that sol es p o le s like the e pe t. Whe a the e gi e o t tu he k the atte e ha i sa s if o e a d the lights do t o e o the, he/she is suggesti g a spe ifi se ue e of things to try. This form of the rules is critical in controlling search, making the system behave logically.

CONTROL THROUGH RULE STRUCTURE (cont.) RULE STRUCTURE + RULE ORER IN THE KNOWLEGE BSE efines search order and its effectiveness

CONTROL THROUGH RULE STRUCTURE (cont.) RULE STRUCTURE What is the content of I part? What is the content of THEN part? How several What will be the What will be the conditions will order of conditions order of actions if be connected if they are several? they are several? (N, OR)? I a & b & c THEN a & & I b & a & c THEN & a &

CONTROL THROUGH CONLICT RESOLUTION The simplest strategy is to choose the first rule that matches the content of the working memory and do not use recently fires rules. Common strategy: 1. Once a rule has fired, it may not fire again until the working memory elements that match its conditions have been modified, this discourages looping. 2. Rules whose conditions match with the patterns most recently added to the working memory are more preferred. This focuses the search on a single line of reasoning. 3. more specific problem-solving rule is preferred to a general rule. rule is more specific than another if it has more conditions. I a THEN c I a N b THEN c more specific

EXERCISE Consider the following set of rules: R1: I: engine does not turn N battery is not flat THEN: ask user to test starter motor R2: I: there is no spark THEN: ask user to check the points R3: I: engine turns N engine does not start THEN: ask user to check the spark R4: I: engine does not turn THEN: ask user to check the battery R5: I: battery is flat THEN: ask user to charge battery N EXIT Build a production system to formulate and resolve the above simple mechanical diagnosis problem of a vehicle. The production system should list the working memory (facts), the rule set (rules) and inference engine (recognize-act cycle and conflict set). Your system should specify and verify what search strategy is chosen (forward or backward reasoning). In addition, your answer should include: 1. The table that describes the working memory, conflict set and the rule triggered for each process iteration. 2. The figure that describes the rules, the facts, and the inference engine that apply the rules on the facts for firing the rules on the matched facts.