Assert goal couch rules illustrate the strength rule based programming
Foops — Room Knowledgebase (room.fkb)
pos_add(C,N,position-CP/P) :-
nl, write_line(['Not enough room on',CP,P,for,C,N]), !, fail.rule 1:
[goal - gather_data]
==>
[call(gather_data),
assert( goal - couch_first )].% Rules f1-f13 illustrate the strength of rule based programming. % Each rule captures a rule of thumb used in configuring furniture % in a living room. The rules are all independent, transparent, % and can be easily maintained. Complexity can be added without % concern for the flow of control.
|
195 |
---|
Foops — Room Knowledgebase (room.fkb)
% f5 - the coffee table should be in front of the couch.
rule f5:
[coffee_table - CT with [position-none],
couch - C]
==>
[update(coffee_table - CT with [position-frontof(couch/C)])].rule f9:
[end_table - ET with [position-none],
not tv - TV with [position-none,place_on-table], couch - C with [position-wall/W],
|
Appendices - Full Source Code |
---|