Considering Adam is the father of John, does prolog recognize the two clauses below as the same? (thanks in anticipation)
father(john, adam).
father(adam, john).
You are the one that gives meaning to Prolog clauses. But once you give some meaning (semantic) to a Prolog term, you need to hold on to that semantic forever.
Example: for father(X, Y) you can assign the following semantic - "X is the father of Y". Remember that assigning a semantic is only in your head. You can read father(X, Y) the other way around, but then you will have to use it accordingly.
In our case, then:
- father(adam, john) means "adam is the father of john"
- father(john, adam) means "john is the father of adam"
Prolog will never know who is the father of who. If will only see father(adam, john). If you use the father(X, Y) facts with the correct meaning everywhere, Prolog doesn't even need to know who is the father of who. Only you know that. Hope you understood ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.