Enter attributes that match the patterns the rules for example has
Oops — Room Knowledgebase (room.okb)
3: not(position(end_table, W)),
4: wall(W, L),
L >= TL]
==>
[retract(1),
assert(position(end_table, W, nolamp)),
NewSpace = L - TL,
retract(4),
assert(wall(W, NewSpace))].rule f12:
[1: position(tv, W),
2: not(position(plug, W))]
==>
[assert(buy(extension_cord, W)),
assert(position(plug, W))].rule f13:
[1: position(table_lamp, W),
2: not(position(plug, W))]
==>
[assert(buy(extension_cord, W)),
assert(position(plug, W))].
183 |
---|
% from Winston & Horn's LISP
% Rules for animal identification. The first three rules are an % input loop. Enter attributes that match the patterns in the rules.
initial_data([goal(animal_id)]).
rule 1:
[1: goal(animal_id)]
==>
[assert(read_facts),
retract(1)].rule id3:
[1: has(X,feathers)]
==>
[assert(isa(X,bird)),
retract(all)].
|
Appendices - Full Source Code |
---|