Given premises and corresponding FOPL. Goal: Prove that Marcus hated Caesar.
Marcus was a Pompeian
pompeian(Marcus)All Pompeians were Romans.
Vx: pompeian(x) --> roman(x)All Romans were either loyal to Caesar or hated him.
Vx: roman(x) --> loyalto(x, Caesar) v hate(x, Caesar)Everyone is loyal to someone.
Vx Ey: loyalto(x, y)People only try to assassinate rulers they aren't loyal to.
Vx Vy: ~loyalto(x, y) --> trytoassassinate(x, y)Marcus tried to assassinate Caesar.
trytoassassinate(Marcus, Caesar)
How can I implement each of the premises one by one using SWI Prolog? I tried to write prolog and code and attached my implementation below, I am having difficulty implementing rule number 4.
roman(X):-
pompeians(X).
hates(X, caesar):-
roman(X), not_loyal(X, caesar).
not_loyal(X,Y):-
not(loyal(X,Y)).
% How to implement "Everyone is loyal to someone."?
not_loyal(X,Y):-
assassinate(X,Y).
assassinate(marcus, caesar).
pompeians(marcus).