Getting Started

Under UNIX, SICStus Prolog is normally started from one of the shells. On other platforms, it is normally started by clicking on an icon. However, it is often convenient to run SICStus Prolog under GNU Emacs instead. A GNU Emacs interface for SICStus Prolog is described later (see Emacs Interface). From a shell, SICStus Prolog is started by typing:

     % sicstus [options] [-a argument...]
     

where options have the following meaning:


-f
Fast start. Don't read any initialization file on startup. If the option is omitted and the initialization file exists, SICStus Prolog will consult it on startup after running any initializations and printing the version banners. The initialization file is .sicstusrc or .sicstus.ini in the users home directory, i.e. ~/.sicstusrc or ~/.sicstus.ini. See Input Output, for an explanation of how a file specification starting with ~/ is interpreted.
-i
Forced interactive. Prompt for user input, even if the standard input stream does not appear to be a terminal.
--iso
--sicstus
Start up in ISO Prolog mode or SICStus Prolog mode respectively. The language mode is set before any prolog-file or initialization file is loaded and any saved-state is restored.
-m
For compatibility with previous versions. Ignored.
-l prolog-file
Ensure that the file prolog-file is loaded on startup. This is done before any initialization file is loaded. Only one -l option is allowed.
-r saved-state
Restore the saved-state saved-state on startup. This is done before any prolog-file or initialization file is loaded. Only one -r option is allowed.
--goal Goal
Read a term from the text Goal and pass the resulting term to call/1 after all files have been loaded. As usual Goal should be terminated by a full stop (.). Only one --goal option is allowed.
-a argument...
where the arguments can be retrieved from Prolog by prolog_flag(argv, Args), which will unify Args with argument... represented as a list of atoms.
-B[abspath]
Creates a saved-state for a development system. This option is not needed for normal use. If abspath is given, it specifies the absolute pathname for the saved-state. Please note: There must not be a space before the path, lest it be interpreted as a separate option.
-R[abspath]
Equivalent to the -B option, except that it builds a saved-state for a runtime system instead.

Under UNIX, a saved-state file can be executed directly by typing:

     % file argument...
     

This is equivalent to:

     % sicstus -r file [-a argument...]
     
Please note: As of release 3.7, saved-states do not store the complete path of the binary sp.exe. Instead, they call the main executable sicstus, which is assumed to be found in the shell's path. If there are several versions of SICStus installed, it is up to the user to make sure that the correct start-script is found.

Notice that the flags are not available when executing saved-states--all the command-line arguments are treated as Prolog arguments.

The development system checks that a valid SICStus license exists and responds with a message of identification and the prompt | ?-  as soon as it is ready to accept input, thus:

     SICStus 3.11.2 ...
     Licensed to SICS
     | ?-
     

At this point the top-level is expecting input of a query. You cannot type in clauses or directives immediately (see Inserting Clauses). While typing in a query, the prompt (on following lines) becomes . That is, the | ?-  appears only for the first line of the query, and subsequent lines are indented.