Prev Up Next
Go backward to Question 5
Go up to Top
Go forward to Question 7

Question 6

Suppose you have a base-level knowledge base defined in terms of An example knowledge base is
at(Ag,Pos) <= sitting_at(Ag,Pos).
adjacent(P_1,P_2) <=
     between(Door,P_1,P_2) &
     unlocked(Door).
between(door1,o103,lab2) <= true.
primitive(unlocked(D)).
primitive(sitting_at(A,P)).
primitive(carrying(A,O)).
Write a meta-interpreter reduce_prove(L0,L1) that, given a list L0 of atoms, reduces them to a list L1 of primitive atoms that, given the knowledge base, implies the elements of L0.

For example, the query

ask reduce_prove([at(rob,P),adjacent(P,lab2),carrying(rob,parcel)],L).
returns with one answer with L=[carrying(rob,parcel),unlocked(door1),sittingat(rob,o103)]. Note that this operation was assumed in the regression planner.
  • Solution to Question 6

  • Prev Up Next