Reputation: 2372
What does ?-
mean in Prolog?
for example:
?- consult(solve)
Upvotes: 4
Views: 221
Reputation: 10102
?-
is typically the prompt of the top level loop or top level shell — which is the place where you can ask queries and enter commands. It has similar functionality as the read-eval-print loop in other languages.
In some systems this prompt is or used to be | ?-
which is the more traditional prompt. This prompt comes from one of the earlier Prolog systems of ~1978, DECsystem 10 Prolog. The OS prompt for input was |
and the user had to type ?- X is 1+1.
to enter a query.
Upvotes: 4
Reputation: 16304
Within a prolog interpreter you can request data (that's basically running prolog scripts), the system replies with a yes or no. The interpreter signals with ?-
, that he awaits a request.
Example:
?- male(adam).
yes.
?- male(eve).
no.
Read more in the wikipedia article for it
Upvotes: 2