These messages are caused by common misunderstanding of the
Prolog interactive toplevel. Both (:-)/1 and (?-)/1 are used to
specify queries. If some text reads ?- is the prompt and should
not be typed. Repeating the prompt results in: ?- ?- prove(X).
ERROR: Undefined procedure: (?-)/1 ERROR: ?- is the Prolog
prompt ERROR: See FAQ at http://www.swi-
prolog.org/FAQ/ToplevelMode.txt Terms that you enter at the
toplevel are processes as queries, while terms that appear in a
file that is loaded into Prolog is processed as a set of rules
and facts. If a text reads as below, this is a rule.
carnivore(X) :- animal(X), eats_meat(X). Trying to enter this at
the toplevel results in the error below. Why? Because a rule is
a term :-(Head, Body), and because the toplevel interprets terms
as queries. There is no predicate with the name :- and two
arguments. ?- carnivore(X) :- animal(X), eats_meat(X). ERROR:
Undefined procedure: (:-)/2 ERROR: Rules must be loaded from a
file ERROR: See FAQ at http://www.swi-prolog.org/FAQ/Top