Search code examples
prologprolog-toplevel

What does "?-" mean in Prolog?


What does ?- mean in Prolog?

for example:

?- consult(solve)

Solution

  • ?- 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.