Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
assert goal couch rules illustrate the strength ru

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.

Building Expert Systems in Prolog

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],

196

Appendices - Full Source Code

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Harry Hutchinson

PageId: ELI80B101A