I am currently learning about predicate logic in Prolog. I am having trouble answering a question on the topic and would like to know the steps one one take to solve such a question using Prolog predicates. I have a scenario which must be represented in Prolog predicates using only two different predicate names.
- A and B are married
- B likes C
- C and D are married
- D likes E
- F likes B
- E likes B
- E and G are married
- A likes G
Just write down what it says.
And so on. We've used two names of predicates so far.
In Prolog, atoms are denoted by identifiers starting with a lower case letter. Identifiers starting with an upper case letter or an underscore
_
denote logical variables.