I need your help for a simple PROLOG program. I am very new to PROLOG so it might be a very trivial question, but I absolutely have no idea how to solve it.
There are 5 sentences I need to formulate into PROLOG code:
-Bill owns a dog.
-Every dogowner likes animals.
-Every person who likes animals cannot hit an animal.
-Bill or Bull hit a cat whose name is Tom.
-Every cat is an animal.
I think I have the first 3 sentences:
dogowner(bill).
lovesanimal(X):- dogowner(X).
not(hitting(X,animal(Y))):-lovesanimal(X).
The last one also is not a problem. But how do I formulate the 4th?
Thank you for your help.
owns(bill,dog). likes(X,animals):- owns(X,dog).- Luai Ghunimnot(hit(X)):-likes(X,animals).orhit(X):-not(likes(X,animals)).- Peterhit(X), what doesXhit?cannothit(X,animal):- likes(X,animals).orhit(X,animal):- \+ likes(X,animal).. This is\+used for inverting values. - Luai Ghunim