ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] KNOWLEDGE PROCESSING IN RULE-BASED EXPERT SYSTEMS Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information Technology Institute of Applied Computer Systems Department of Systems Theory and Design E-mail: Janis.Grundspenkis@rtu.lv Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (FORWARD CHAINING) The start Working Memory Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (continued) Askable premise for initialization: Q: “The engine does not turn over?” A: false Working Memory The engine turns over Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Rule 2 fails; consideration moves to Rule 3, where the first premise fails. Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (continued) At Rule 4 both premises are askable. Q1: “Is there gas in the fuel tank?” A: true Q2: “Is there gas in the carburator?” A: true Working Memory There is gas in the carburator There is gas in the fuel tank The engine turns over Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (continued) Rule 4 fires: Working Memory The engine is getting gas There is gas in the carburator There is gas in the fuel tank The engine turns over Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (continued) Rule 1 fires: Working Memory The problem is spark plugs The engine is getting gas There is gas in the carburator There is gas in the fuel tank The engine turns over Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Rules 2 and 3 fails. The process terminates with no further rules matching. Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (continued) • Breadth-First search strategy is used in the previous example. • Opportunistic search strategy is: whenever a rule fires to conclude new knowledge, control moves to consider those rules which have that new knowledge as a premise. • In data-driven reasoning goal orientation does not exist. As a result, the progress of search often is diffuse and unfocused. Knowledge Processing in Rule-Based Expert Systems DATA-DRIVEN REASONING (continued) • Consequently, the explanation available is quite limited. When user asks why some information is required, the current rule under consideration can be presented. When a goal is achieved it is difficult to get full how explanation, because contents of the working memory or a list of rules fired can be presented, but these will not offer the consistent focused accountability. Knowledge Processing in Rule-Based Expert Systems GOAL-DRIVEN REASONING The top-level goal is placed in working memory. Working Memory The problem is X Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Three rules match with the working memory. So, the conflict set contains Rules 1, 2, and 3. Knowledge Processing in Rule-Based Expert Systems GOAL-DRIVEN REASONING (continued) Conflicts are resolved in favor of Rule 1. X is bound to the value spark plugs and Rule 1 fires. Working Memory The engine is getting gas The engine will turn over The problem is spark plugs Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Knowledge Processing in Rule-Based Expert Systems GOAL-DRIVEN REASONING (continued) The problem is decomposed in two subproblems: The engine is getting gas The engine will turn over Working Memory Gas is in the fuel tank Gas is in the carburator The engine is getting gas The engine will turn over The problem is spark plugs Knowledge Base Rule 1 Rule 2 Rule 3 Rule 4 Knowledge Processing in Rule-Based Expert Systems GOAL-DRIVEN REASONING (continued) • There are three entries in working memory that do not match with any rule conclusions. The expert system will query the user directly about these subgoals: Q1: Will the engine turn over? A: true Q2: Is gas in the carburator? A: true Q3: Is gas in the fuel tank? A: true • The expert system determines that the car will not start because the spark plugs are bad. Knowledge Processing in Rule-Based Expert Systems GOAL-DRIVEN REASONING (continued) • Depth-First search is used in the previous example. • In goal-driven reasoning goal orientation is maintained. As a result, reasoning is in pursuit of a particular goal. That goal is decomposed into subgoals that support the top-level goal and these subgoals may be even further broken down. The search is always directed through this goal and subgoal hierarchy. Knowledge Processing in Rule-Based Expert Systems GOAL-DRIVEN REASONING (continued) • Consequently, the production system uses a trace of the search to answer user queries why and how. When user asks why some knowledge is required, the expert system responds with a restatement of the current rule that the production system is attempting to fire. When user asks how the expert system get the result, the response is a trace of the reasoning that led to this conclusion working back from a goal along the rules that support it to the user responses.