First off, I am new to Prolog, so please go easy on me… Also, I am using SWI-Prolog,
so I want to use the correct syntax for SWI.
In this case, I want to define step-parents (specifically step-mother and step-father).
My current syntax is this:
isStepFather(X, Y):-
dif(X, Y),
isMale(X),
not(isParent(X, Y)),
isMother(Z, Y), isHusband(X, Z).
First off, I know that sometimes “not” is “=” or some other slash combination, so is there a better version of my “not” statement? Also, the last line is supposed to read like:
“X is a StepFather of Y if Z is a mother of Y, and Z is a Wife of X.”
I want to specify the 2 Z-statements as a single idea/condition, so I put them on the same row, but does that matter? Or is there a better way of chaining two conditions that are linked to each other, but not necessarily to the other conditions?
Finally, would it be better/more elegant to use
isWife(Z, X)
instead of
isHusband(X, Z)
so that Z stays in the front of both statements?
Please let me know your feedback!