204k views
4 votes
Write the following statement as Prolog clauses: Mammals have four legs and no arms, or two arms and two legs. A horse is a mammal. A horse has no arms. Can Prolog derive that a horse has four legs

1 Answer

5 votes

Answer:

Step-by-step explanation:

mammal(X) :- legs(X,4), arms(X,0).

mammal(X) :- legs(X,2), arms(X,2).

mammal(horse).

arms(horse,0).

As far as I can tell, prolog cannot derive that a horse has four legs. Why so? You may ask. I'd say then, because there isn't any rule(s) for prolog to use in determining the legs. Inference rules can also not be used to determine that the fact that a horse is a mammal and it has 0 arms, it certainly must have 4 legs.

User Kanwar Singh
by
5.0k points