home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / TESTS / LF / WLIFE.LF < prev    next >
Text File  |  1996-06-04  |  925b  |  34 lines

  1. thing         := {animal ; habitat}.
  2. animal         := {mammal ; bird}.
  3. mammal         := {land_mammal ; aquatic_mammal}.
  4. land_mammal     := {feline ; elephant ; ruminant}.
  5. feline         := {lion ; tiger}.
  6. ruminant     := {antelope ; deer}.
  7. aquatic_mammal     := {seal ; cetaceous}.
  8. cetaceous     := {whale ; dolphin}.
  9. bird         := {penguin ; bird_of_prey}.
  10. bird_of_prey     := {eagle ; condor}.
  11. habitat     := {water ; land}.
  12. water         := {sea ; river ; ice}.
  13. land         := {ice ; savanna ; jungle}.
  14.  
  15. carnivorous({feline;aquatic_mammal;bird}). %penguin;bird_of_prey}).
  16.  
  17. herbivorous({elephant;ruminant}).
  18.  
  19. lives_in({lion;elephant;ruminant},savanna).
  20. lives_in({tiger;antelope},jungle).
  21. lives_in(cetaceous,sea).
  22. lives_in({seal;penguin},ice).
  23.  
  24. fly(bird_of_prey).
  25.  
  26. aquatic(X) :- lives_in(X,water).
  27.  
  28. terrestrial(X) :- fly(X:bird).
  29. terrestrial(X) :- lives_in(X,land).
  30.  
  31. eat(X:feline,Z:ruminant) :- lives_in(X,Y), lives_in(Z,Y).
  32.  
  33. what(X) :- carnivorous(X),aquatic(X),terrestrial(X).
  34.