Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Rete Algorithm
Topic & Structure of The Lesson
usages
• Rete algorithm
• knowledge representation,
• knowledge management (i.e. introduction of changes into the
knowledge base).
Any rule that is reachable in the Rete graph (see below) via
nonempty relation nodes can be fired.
Agenda
Pattern Matching
match match
value to ?c value to ?c
join
variable
?c Complete pattern and
join variables join networks
?c and ?h
join
variables ?c
AAPP002-4-2 Intro to AI Rete algotihm Slides 14 of 28
If we had the following set of facts:
1. (cat yellow large short rebel)
2. (cat calico large short rubble)
3. (cat calico small short kitty)
4. (dog brown medium long charlie)
5. (cat brown small medium prince)
6. (dog brown small short sam)
7. (dog calico medium medium butcher)
8. (dog brown large medium star)
9. (dog calico medium long tramp)
Each of these facts is first parsed through the network. The network will then look as in the
handout.
Using the network, rules that can execute can be determined quickly in a forward reasoning
system using Rete.
Knowledge includes:
1. facts, e.g.
(goal e1 simplify), (goal e2 simplify), (goal e3 simplify),
(expr e1 0 + 3), (expr e2 0 + 5), (expr e3 0 * 2),...
2. patterns, e.g.
(goal ?x simplify)
(expr ?y 0 ?op ?a2)
(parent ?x ?y)
...
3. and rules, e.g.
(R1 (goal ?x simplify) (expr ?x 0 + ?y) => (expr ?x ?y))
(R2 (goal ?x simplify) (expr ?x 0 * ?y) => (expr ?x 0))
...
x y x y
*** ***
e3 2 e1 3
e2 5
R2 R1
root
beta-nodes
(with two inputs)
a(X,Y) b(X,Z)
- There is a starting
node and a node for Y=1 Y=2
each of the rule
conditions and
conjunctions of
conditions.
- Arcs are labeled with a(X,1),b(X,Z) a(X,2),b(X,Z)
variable bindings
a(3,1) is deposited
in the node labeled Y=1 Y=2
a(X,Y) and will
propagate through
the arc labeled Y=1 a(3,1)
a(X,1),b(X,Z) a(X,2),b(X,Z)
b(3,4) is deposited
in the node labeled Y=1 Y=2
b(Y,Z) and will
propagate through
the arcs labeled Y=1 a(3,1),b(3,4) b(3,4)
and Y=2
a(X,1),b(X,Z) a(X,2),b(X,Z)
a(3,2) is deposited
in the node labeled Y=1 Y=2
a(X,Y) and will
propagate through
the arc labeled Y=2 a(3,1),b(3,4) a(3,2),b(3,4)
a(X,1),b(X,Z) a(X,2),b(X,Z)
• Recency
A conflict resolution strategy used in forward chaining
systems. The system fires the rule which depends on the
most recently added facts in working memory.
• Refractoriness
A conflict resolution strategy used in forward chaining
systems. The system does not fire a rule which has already
been fired (unless a change has occurred in working
memory).
Q&A
• Automated Systems