13.1 sicstus — SICStus Prolog Development System
Synopsis
% sicstus [options] [-a argument...]
Description
The prompt `| ?-' indicates that the execution of is top-level
mode. In this mode, Prolog queries may be issued and executed
interactively. To exit from the top-level and return to the shell,
either type ^D at the top-level, or call the built-in predicate
halt/0
, or use the e (exit) command following a ^C
interruption.
Under Windows, sicstus.exe is a console-based
program that can run in a command prompt window, whereas spwin.exe
runs in its own window and directs the Prolog standard streams to that
window. spwin.exe
is a “windowed” executable.
Options
- -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 ref-fdi-syn, 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.
- -m
- Use
malloc()
et al. for memory
allocations. See cpg-ref-SP_set_memalloc_hooks for more
information.
- --noinfo
- Start with the
informational
Prolog flag set to off
initially, suppressing informational messages. The flag is set before
any prolog-file or initialization file is loaded or any
saved-state is restored.
- --nologo
- Start without the initial version message.
- -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.
- --help
- Display a help message and exit.
- -- argument...
- -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.
Environment
The following environment variables can be set before starting SICStus
Prolog. Some of these override the default sizes of certain areas.
For variables enging with `SIZE', the size is in bytes, but may
be followed by `K' or `M' meaning kilobytes or megabytes
respectively.
- SP_PATH
- This environment variable can be used to specify the location of the
Runtime Library.
In most cases there is no need to use it,
but see CPL Notes.
- GLOBALSTKSIZE
- Controls the initial size of the global stack.
Please note: The global stack will not be subsequently
trimmed to a size smaller than this initial size.
- LOCALSTKSIZE
- Controls the initial size of the local stack.
Please note: The local stack will not be subsequently
trimmed to a size smaller than this initial size.
- CHOICESTKSIZE
- Controls the initial size of the choicepoint stack.
Please note: The choicepoint stack will not be subsequently
trimmed to a size smaller than this initial size.
- TRAILSTKSIZE
- Controls the initial size of the trail stack.
Please note: The trail stack will not be subsequently
trimmed to a size smaller than this initial size.
- GROWTHFACTOR
- Meaningful values are between 10 and 100; the default is 62.
Controls the rate at which the Prolog stacks grow when they are
expanded. These stacks are stored in two data areas: one holding
the global and local stacks; another one holding the choicepoint and
trail stacks. In addition, both data areas hold some memory
reserved for the garbage collector.
The sizes of the two data areas are constrained to take certain
discrete values only. The initial size as well as the size after
expansion is constrained to be w*((1+g)^n) kilobytes, rounded up
to an integral number of words, where w is the word length in
bits, g is GROWTHFACTOR/100, and n is an integer.
- PROLOGINITSIZE
- Controls the size of Prolog's initial memory allocation.
Only used by the default memory allocator
(see SP_set_memalloc_hooks).
Please note: This initially allocated memory will be kept by
the Prolog process forever.
- PROLOGMAXSIZE
- Defines an upper bound on the amount of memory that Prolog will use.
If not set, Prolog will try to use the available address space.
Only used by the default memory allocator
(see SP_set_memalloc_hooks).
Thus if Prolog needs to allocate memory beyond this bound, a memory
resource error will be raised.
- PROLOGINCSIZE
- Controls the amount of memory Prolog asks the operating system for in any
given memory expansion.
Only used by the default memory allocator
(see SP_set_memalloc_hooks).
- PROLOGKEEPSIZE
- Defines a lower bound on the amount of memory retained by
trimcore/0
. By default, Prolog gets memory from the O/S as the
user program executes, whereas trimcore/0
endeavors to return
free memory back to the O/S. If the programmer knows that her
program, once it has grown to a certain size, is likely to need as
much memory for future computations, she can advise Prolog not to
return all the free memory back to the operating system by setting
this variable. trimcore/0
only endavors to return memory that is
allocated above and beyond PROLOGKEEPSIZE; the rest will be
kept. Only used by the default memory allocator
(see SP_set_memalloc_hooks).
Please note: The initially allocated memory will be kept by
the Prolog process forever, so it is not meaningful to set
PROLOGKEEPSIZE smaller than PROLOGINITSIZE.
- SP_ULIMIT_DATA_SEGMENT_SIZE
- Sets the maximum size of the data segment of the Prolog process. The
value can be
unlimited
or a numeric value as described in the
first paragraph in this section. A numeric value of zero (0) is
equivalent to unlimited
. Not used under Windows.
- SP_USE_MALLOC
- If
yes
then malloc()
et al. will be used for memory
management instead of the default memory allocator. This is sometimes
useful, e.g$: with debugging tools like valgrind. Corresponds to the
-m flag to sicstus and the --userhook=malloc
flag to spld (see SP_set_memalloc_hooks).
In addition the following environment variables are set automatically
on startup.
- SP_APP_DIR
- The absolute path to the directory that contains the executable.
Also available as the
application
file search path.
- SP_RT_DIR
- The full path to the directory that contains the SICStus run-time. If
the application has linked statically to the SICStus run-time, SP_RT_DIR
is the same as SP_APP_DIR.
Also available as the
runtime
file search path.
- SP_LIBRARY_DIR
- The absolute path to the directory that contains the SICStus library files.
Also available as the initial value of the
library
file search path.
- SP_TEMP_DIR
- A directory suitable for storing temporary files. It is particularly
useful with the
open/4
option
if_exists(generate_unique_name)
.
Also available as the temp
file search path.
Files
- file.pl
- Prolog source file
- file.po
- Prolog Object file
- .sicstusrc
- sicstus.ini
- SICStus Prolog initialization file, looked up in the
home directory
See Also
Start.
Send feedback on this subject.