Interrupting the Execution of a Program

You can interrupt the execution of a Prolog program at any time by typing ^c (^c^c under GNU Emacs). For example, if you submit a query to Prolog and then decide you want to stop (abort) the query, type ^c to which Prolog will respond by displaying the message

     Prolog interruption (h for help)?
     

At this point, you can either type h to see a list of the options available to you, as shown below, or you can simply type the letter that corresponds to the option you want to select.

If you type h, Prolog displays the following list of options:

     Prolog interrupt options:
       h  help         - this list
       c  continue     - do nothing
       d  debug        - debugger will start leaping
       t  trace        - debugger will start creeping
       a  abort        - abort to the current break level
       q  really abort - abort to the top level
       e  exit         - exit from Prolog
     Prolog interruption (h for help)?
     

To select an option, type the letter that corresponds to that option and press <RET>. For example, to stop the execution of the current query, type a followed by <RET>. Prolog will print

     ! Execution aborted
     

and then return to its top level, displaying the main Prolog prompt.

Typing c causes the current procedure to continue executing as if nothing had happened. Typing t turns on the trace option of the debugger (see dbg-bas-con-tdz). Typing d turns on the debug option of the debugger (see dbg-bas-bas). Typing a causes the current query to be aborted and the main Prolog prompt to be redisplayed, as shown above. Typing e ends your Prolog session.