SWI-Prolog can be executed in one of the following modes:
swipl[option ...] script-file [arg ...]
#!/path/to/executable[option ...] is executed. Arguments after the script file are made available in the Prolog flag argv.
swipl[option ...] prolog-file ... [[
--] arg ...]
.prologor (on Windows) the user preferred extension registered during installation), these files are loaded. The first file is registered in the Prolog flag associated_file. In addition, pl-win[.exe] switches to the directory in which this primary source file is located using working_directory/2.
swipl-o output -c prolog-file ...
swipl-o output -b bootfile prolog-file ...
eval `swipl --dump-runtime-variables` cc -I$PLBASE/include -L$PLBASE/lib/$PLARCH ...
The option can be followed by
=sh to dump in POSIX shell
format (default) or
=cmd to dump in MS-Windows cmd.exe
silent, suppressing informational and banner messages. Also available as -q.
false. See section 10.4.21.1 for details.
...\My Documents\Prologor local equivalent thereof (see win_folder/2). The
Prologsubdirectory is created if it does not exist.
swipl.ini(Windows). `-f none' stops SWI-Prolog from searching for a startup file. This option can be used as an alternative to -s file that stops Prolog from loading the personal initialisation file. See also section 2.2.
<script>.rc. The default script name is deduced from the executable, taking the leading alphanumerical characters (letters, digits and underscore) from the program name. -F none stops looking for a script. Intended for simple management of slightly different versions. One could, for example, write a script
iso.rcand then select ISO compatibility mode using
pl -F isoor make a link from iso-pl to pl.
. On other systems it is
. A value is either a term of the form alias(value) or pathname. The computed aliases are added to file_search_path/2 using asserta/1, so they precede predefined values for the alias. See file_search_path/2 for details on using this file location mechanism.
The default limit for the Prolog stacks is 128 MB on 32-bit and 256 MB on 64-bit hardware. The 128 MB limit on 32-bit systems is the highest possible value and the command line options can thus only be used to lower the limit. On 64-bit systems, the limit can both be reduced and enlarged. See section 2.19. Below are two examples, the first reducing the local stack limit to catch unbounded recursion quickly and the second using a big (32 GB) global limit, which is only possible on 64-bit hardware. Note that setting the limit using the command line only sets a soft limit. Stack parameters can be changed (both reduced and enlarged) at any time using the predicate set_prolog_stack/2.
$ swipl -L8m $ swipl -G32g
% swipl <options> -g go,halt -t 'halt(1)'
The following options are for system maintenance. They are given for reference only.
-DO_DEBUGflag. System maintenance only.