It's the Problem
(1) Type the following program into a file and load it into Prolog.
/* Animals Database */
animal(mammal,tiger,carnivore,stripes).
animal(mammal,hyena,carnivore,ugly).
animal(mammal,lion,carnivore,mane).
animal(mammal,zebra,herbivore,stripes).
animal(bird,eagle,carnivore,large).
animal(bird,sparrow,scavenger,small).
animal(reptile,snake,carnivore,long).
animal(reptile,lizard,scavenger,small).
Devise and test goals to find
(a) all the mammals,
(b) all the carnivores that are mammals,
(c) all the mammals with stripes,
(d) whether there is a reptile that has a mane.
and it's the Solution
1. First,You have to type all those words in notepad and then save it with .pl in the end of it's name.
Home Assignment Network Analysys
16 tahun yang lalu

