summary for final exam Agent System.
Inference Process 1.Rules and facts compared using pattern matcher. 2.Matched rules activated into a conflict set. 3.Conflict set resolved into agenda (process called conflict resolution). 4.Rule engine fires on agenda. 5.Engine cycles until all rules are satisfied.
Rule-Based Expert System Architecture Rule Base (knowledge base) Working Memory (fact base) Inference Engine (rule engine)
Jess Architecture Diagram WORKING MEMORY RULE BASE EXECUTION ENGINE INFERENCE ENGINE PATTERN MATCHER AGENDA describe each components
Jess’s working memory Manipulating the working memory assert — Adds facts to working memory clear — Clears all of Jess deffacts — Defines the initial contents of working memory facts — Displays the contents of working memory reset — Initializes the working memory retract — Removes facts from working memory watch — Tells Jess to print diagnostics when interesting things happen
The deffacts construct Example –
Unordered facts Unordered facts are working memory elements that behave like rows in a database table. (person (name "Bob Smith") (age 34) (gender Male)) (automobile (make Ford) (model Explorer) (year 1999)) (box (location kitchen) (contents spatula)) you have to specify their structure using the deftemplate construct.
Unordered facts The deftemplate construct you have to use the deftemplate construct to define the slots that kind of fact. Example – include “slot, multislot, default”
Forward-chaining rules defrule—Defines a new rule ppdefrule—Pretty-prints a rule run—Begins firing activated rules from the agenda undefrule—Deletes a rule watch rules—Prints a diagnostic when a rule fires watch activations—Prints a diagnostic when a rule is activated
Forward-chaining rules multi condition using variable, constrainting slot data, et al.
Constraining slot data Variables as constraints You can specify a variable instead of a literal value for any part of the slot data in a pattern. Example -
Constraining slot data Multifields Regular variables match exactly one value. Multifields can match any number of values add
Constraining slot data predicate functions Literal constraints, variables, and connectives suffice for many situations, but there are some things they can’t express. Example -
“not” and “~” conditional element empty fire!
“not” conditional element
logical conditional element
backward-chaining rule #1 “need-” 추가
backward chaining rule #2 “need-” 추가
Partitioning the rule based with defmodule
module focus
module focus (auto-focus)