Third homework: Programmable logic.


You have two options for this homework.

In option 1, you are to implement a query system in prolog. Certain "facts" will be accerted in a prolog file, such as "true([the,ball,is,on,the,floor])." The system of rules you create should be able to receive a query among the lines of  "question([where,is,the,ball], X)" or where([the, ball], X), and reply with something among the lines of X=floor. Your code should present examples to deal with at least two"wh questions" (who, where, why, etc.) You can use any algorithms, set of rules, or "tricks" that will get the problem solved.

In option 2, your goal is to implement a 'labirinth navigation' system. In it, you define the graph connectivity with a series of 'areconnected(x,y)' statements, and then implement a 'thereisapath' predicate.