Home      Affiliated Colleges      Course content      First Sem     Second Sem     Third Sem     Fourth Sem     Fifth Sem     Sixth Sem     Seventh Sem     Eighth Sem     Lab report 4th sem     Contact    

Thursday, January 27, 2011

Artificial Intelligence: Prolog Program for Solving Kitchen Problem

object(candle,red,small,1).
object(apple,red,small,1).
object(apple,green,small,1).
object(table,blue,big,50).
location_s(object(candle,red,small,1),kitchen).
location_s(object(apple,red,small,1),kitchen).
location_s(object(apple,green,small,1),kitchen).
location_s(object(table,blue,big,50),kitchen).
list_things_s(Place):-
 location_s(object(Thing,Color,Size,Weight),Place),
 write('A'),tab(1),write(Size),tab(1),
 write(Color),tab(1),
 write(Thing),write(' weighing'),tab(1),
 write(Weight),tab(1),write(' pounds'),nl,fail.
list_things_s(_).
=====================================================
consult(kitchen).
list_things_s(kitchen).

No comments:

Post a Comment

^ Scroll to Top Related Posts with Thumbnails ^ Go to Top