2
6
8scene(X):- part_of(X,Y),large(X),red(Y),
9 part_of(X,Z),small(Z),green(Z),left_of(Y,Z).
10scene(X):- part_of(X,Y),small(X),red(Y),
11 part_of(X,Z),large(Z),green(Z),left_of(Y,Z).
12
13
15pet(X) :- cat(X).
16pet(X) :- dog(X).
17small(X) :- cat(X).
18
19cuddly_pet(X):- small(X),fluffy(X),dog(X).
20cuddly_pet(X):- fluffy(X),cat(X).
21
22ex(cuddly_pet(cathy_the_cat),+).
23ex(cuddly_pet(rosi_the_rabbit),+).
24ex(cuddly_pet(tom_the_turtle),-).
25
27has_wings(p).
28has_beak(p).
29has_wings(X):- bird(X).
30has_beak(X):- bird(X).
31
35