Search code examples
windowsprologsicstus-prolog

Switching Modes in Prolog on the Windows Command Line


The Sicstus Prolog manual says to user "| ?- consult(user)." to enter clauses and to "to return to top-level, type ^D.". However, I am using Windows and the manual doesn't have Windows instructions. How can I return to query mode in Windows?


Solution

  • In many Prolog systems, like SICStus 4, you can enter the fact end_of_file. to finish consultation. This fact will not be consulted, it only serves to indicate the end.

    (Warning: I am not a frequent user of Wind-ows. That is, I only have rdesktop for such activity.)

    Should you ever have the need to define the fact end_of_file. in your program, write end_of_file :- true. instead.

    If you enter end_of_file. as a query on the toplevel, many Prolog systems stop. You can circumvent this by entering true,end_of_file. instead.

    This slightly bizarre behavior is by no means standardized.