0

These are simple statements:

  1. Marcus was a man
  2. Marcus was a Roman
  3. All men are people
  4. Caesar was a ruler
  5. All Romans were either loyal to Caesar or hated him
  6. Everyone is loyal to someone.
  7. People only try to assassinate rulers they are not loyal to
  8. Marcus tried to assassinate Caesar.

I have converted them to First Order Logic statements but I'm stuck in converting them to prolog code.

This is my prolog code up to statement number 5, and I don't know whether what I have done so far is correct or not. Also, I cannot find any docs about negation, for all, there exists in prolog code. How to translate them to prolog code?

man(marcus).
pompeian(marcus).
ruler(caesar).
pompeian(X) :- roman(X).
roman(X):-loyalto(X,caesar);hate(X,caesar).
Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503

0 Answers0