PROLOG

 % PROLOG EBG: THE CUP EXAMPLE


/* Domain theory */

cup(X) :- liftable(X), stable(X), open_vessel(X).
liftable(X) :- light(X), part(X, handle).
stable(X) :- part(X, bottom), flat(bottom).
open_vessel(X) :- part(X, concavity), points_up(concavity).
light(X) :- small(X).
light(X) :- made_of(X,feathers).

/* Training example */

small(obj1).
part(obj1,handle).
part(obj1, bottom).
flat(bottom).
part(obj1, concavity).
points_up(concavity).

/* operationality criteria */

operational(small(X)).
operational(part(X, Y)).
operational(flat(X)).   
operational(points_up(X)).  

Close Window