Assume the member/2 predicate is defined as:
member(X,[X|R]).
member(X,[Y|R]) :- member(X,R).
My query is:
member(X, [1, 2, 3]).
Once prolog unifies X with 1, how does prolog get the other possible unifications if I type ;?
Wouldn't Prolog backtrack and then re-read my file containing the definition of member from top to bottom and evaluate member(X,[X|R]). again which would unify X with 1 again?
How about this

Note the following:
,) must be made TRUEAnd:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With