Representing Knowledge Using Rules
Representing Knowledge Using Rules
Representing Knowledge Using Rules
Knowledge Select
Working Execute
Memory Base
The above cycle is repeated until no rules are put in the conflict set
or until stopping condition is reached.
To eliminate the need to perform thousands of matches of cycles on
effective matching algorithm is called RETE.
The Algorithm consists of two Steps:
1. Working memory changes need to be examined.
2. Grouping rules which share the same condition & linking them
to their common terms.
RETE gains efficiency from 3 major sources.
1. RETE maintains a network of rule condition and it uses changes
in the state description to determine which new rules might apply.
Full matching is only pursued for candidates that could be affected
by incoming/outgoing data.
2. Structural Similarity in rules: RETE stores the rules so that they
share structures in memory, set of conditions that appear in several
rules are matched once for cycle.
3. Persistence of variable binding consistency. While all the
individual preconditions of the rule might be met, there may be
variable binding conflicts that prevent the rule from firing.
RETE remembers its previous calculations and is able to merge
new binding information efficiently.
Approximate Matching:
Rules should be applied if their preconditions
approximately match to the current situation.
Eg: Speech understanding program
Rules: A description of a physical waveform to phones
Physical Signal: difference in the way individuals
speak, result of background noise.
Conflict Resolution:
When several rules matched at once such a situation is called conflict
resolution.
There are 3 approaches to the problem of conflict resolution in
production system:
1. Preference based on rule match
2. Preference based on the objects match
3. Preference based on the action
1. Preference based on rule match:
a. Physical order of rules in which they are presented to the
system
b. Priority is given to rules in the order in which they appear
2. Preference based on the objects match:
a. Considers importance of objects that are matched
b. Considers the position of the match able objects in terms of
Long Term Memory (LTM) & Short Term Memory(STM)
LTM: Stores a set of rules
STM (Working Memory): Serves as storage area for the facts deduced by
rules in long term memory
3. Preference based on the Action:
a. One way to do is find all the rules temporarily and examine the results
of each.
Using a Heuristic Function that can evaluate each of the resulting states
compare the merits of the result and then select the preferred one.
Search Control Knowledge:
It is knowledge about which paths are most likely to lead quickly to a
goal state
Search Control Knowledge requires Meta Knowledge.
It can take many forms.
Knowledge about
which states are more preferable to others.
which rule to apply in a given situation.
the Order in which to pursue sub goals.
useful Sequences of rules to apply.