The Top-level Prolog Prompt

The prompt | ?- indicates that Prolog is waiting for a goal to be typed in. For example, you can call built-in predicates like this:

     | ?- write(hello).
     | ?- X is 2+2.
     X = 4 <RET>
     | ?-

When Prolog prints a variable binding at the top level like X = 4 in this example, it waits for you to either type a <RET>, which brings it back to the top level, or else type a ;, which causes it to backtrack and look for another solution. In this case, you would get

     | ?- X is 2+2.
     X = 4 ;
     | ?-

because there is only one X for which the goal can be satisfied.

It is always possible to interrupt any Prolog process and return to the top-level Prolog prompt. To do this, type ^c. The system then displays the message

     Prolog interruption (h for help)?

Type a (for abort) and press <RET>. The system then displays a message indicating that execution has been aborted, followed by the top-level Prolog prompt.

     ! Execution aborted
     | ?-