_) beginning either with a capital letter or with an underscore. Examples:
_is used as a "don't-care" variable, when we don't mind what value the variable has. For example:
That is, X is a parent if they are a father or a mother, but we don't need to know who they are the father or mother of, to establish that they are a parent.
is_a_parent(X) :- father_of(X, _).
is_a_parent(X) :- mother_of(X, _).
Variables are used in more than one way:
likes(A,B) :- dog(B), feeds(A,B).
Bappear on both sides of the neck symbol - the appearance of the same variable in two (or more places) in effect says that when the variable is bound to a value, it must be bound to the same value in all the places that it appears in a given rule.
_3, etc. This is why variables with names like these sometimes turn up in error messages when your Prolog program goes wrong.
?- studies(X, 9311).Prolog responds by finding all the values for
studies(X, 9311)is true, and successively listing them, e.g.
X = fred ; X = jane ; X = abdul ; X = maria ;