1swipl(1)                    General Commands Manual                   swipl(1)
2
3
4

NAME

6       swipl - SWI-Prolog 8.0.2
7

SYNOPSIS

9       swipl [--help|--version|--arch|--dump-runtime-variables]
10       swipl [options] prolog-file ... [--] [arg ...]
11       swipl [options] [-o output] -c file ...
12       swipl [options] [-o output] -b initfile ...
13
14       The first version provides information about the system and exits imme‐
15       diately. The second version is the primary way to call Prolog on one or
16       more  Prolog  source  file(s)  and provide arguments to the application
17       that can be requested using current_prolog_flag(argv, Argv).  The third
18       version  is used to create a saved state while the last version is used
19       for boot-compilation of the Prolog parts of the system.
20
21

DESCRIPTION

23       SWI-Prolog is a comprehensive and stable implementation of  the  Prolog
24       language  with  a large set of libraries. Among its distinguishing fea‐
25       tures are mature support for multi-threading, a  mature  embedded  web-
26       server library, graphical development tools (debugger, profiler, cross-
27       referencer, editor), an  embedded  efficient  RDF  store,  support  for
28       XML/SGML/HTML  and Unicode.  More widely supported features are support
29       for constraint programming,  atom  garbage  collection,  interfaces  to
30       databases (ODBC), C, C++ and Java (JPL).
31
32       SWI-Prolog implements the ISO core standard. Many of its extensions are
33       largely compatible to YAP and SICStus Prolog.
34
35       This manual page only lists the commandline options.   Full  documenta‐
36       tion  is  available  on-line as well as in HTML and PDF format from the
37       WWW home page at http://www.swi-prolog.org
38
39

LICENSE INFORMATION

41       SWI-Prolog is distributed under the Simplified BSD or BSD-2 License.  A
42       particular  configuration  may  contain  components that are subject to
43       other license conditions.  Use license/0 to find components  with  less
44       permissive  license  conditions.   See  the  SWI-Prolog  home  page  at
45       http://www.swi-prolog.org for details.
46
47

OPTIONS

49       --help Gives a summary of the most important options.
50
51       --version
52              Displays version and architecture information.
53
54       --arch Prints the architecture identifier.
55
56       --dump-runtime-variables[=format]
57              Dump information  that  is  generally  useful  for  installation
58              scripts  in  a  form  defined by format.  Defines formats are sh
59              (default, bourne shell) and cmd (Windows CMD).  This  option  is
60              used  by  swipl-ld (1) to fetch necessary information about Pro‐
61              log.  It is normally invoked as eval `swipl  -dump-runtime-vari‐
62              ables`, which assigns the following shell variables:
63
64              CC     The C- compiler used to compile SWI-Prolog.
65
66              PLBASE The home directory of SWI-Prolog.  This is the same value
67                     as returned by the current_prolog_flag home.
68
69              PLARCH The architecture identifier used.  Together  with  PLBASE
70                     this  defines  the  location  of various components.  For
71                     example,   the    library    for    embedding    is    in
72                     $PLBASE/lib/$PLARCH/libswipl.a
73
74              PLBITS Address bits for VM.  Either 32 or 64.
75
76              PLLIB  CC identifier to link to SWI-Prolog.  Typically -lswipl
77
78              PLLIBS Additional libraries needed for linking PLLIB
79
80              PLCFLAGS
81                     Flags  that need to be passed to the C-compiler to gener‐
82                     ate compatible code.
83
84              PLLDFLAGS
85                     Flags that need to be passed to the C-linker for  linking
86                     embedded executables.
87
88              PLSOEXT
89                     Extension used by the hosting operating system for shared
90                     objects. On most Unix systems this is "so"; on MS-Windows
91                     it is "dll".  AIX uses "o", HPUX "sl".
92
93              PLSOPATH
94                     Environment variable used by the hosting operating system
95                     to extend the search path for shared objects.  For  exam‐
96                     ple,  on ELF systems this is "LD_LIBRARY_PATH" and on MS-
97                     Windows it is "PATH".
98
99              PLVERSION
100                     Numeric representation of the SWI-Prolog version.
101
102              PLVERSIONTAG
103                     If present, a version tag such as "rc1".
104
105              PLSHARED
106                     Has the value  yes  if  Prolog  supports  linking  shared
107                     libraries  using load_foreign_library/[1,2] and no other‐
108                     wise.
109
110              PLTHREADS
111                     Has the value yes  if  Prolog  was  compiled  for  multi-
112                     threading and no otherwise.
113
114       --stack_limit=size[bkmg]
115              Sets the combined stack limit to size bytes.  The suffix is case
116              insensitive and defines the unit as b  (bytes),  k  (Kbytes),  m
117              (Mbytes) or g (Gbytes).
118
119       --table_space=size[bkmg]
120              Sets the space limit for tables use for SLG resolution (tabling)
121              to  size  bytes.   The  suffixes  are  the  same  as   for   the
122              --stack_limit option.
123
124       -O     Optimised  compilation.  See set_prolog_flag/2 in the SWI-Prolog
125              Reference Manual.
126
127       -b initfile ... -c file ...
128              Boot compilation.  initfile ...  are compiled by the  C  written
129              bootstrap compiler, file ...  by the normal Prolog compiler into
130              an intermediate code file. This option is for system maintenance
131              and is given for reference only.
132
133       -c file ...
134              Compiles file ...  into an intermediate code file.
135
136       -d level
137              Set debug level to level.  This option is for system maintenance
138              and is given for reference only.
139
140       -f file
141              Use file as initialisation file instead of `.swiplrc'. `-f none'
142              stops SWI-Prolog from searching for an initialisation file.
143
144       -F file
145              Select  startup script from the SWI-Prolog home directory.  file
146              Specifies the base-name of the script.  The  extension  is  .rc.
147              The  default  script  is  deduced  from the basename of the exe‐
148              cutable, taking all leading alphanumerical (letters, digits  and
149              underscore) from the program name.  Thus if the program is named
150              swi-2.0 it will try to load the file swi.rc from the  SWI-Prolog
151              home  directory.  If the file does not exist, or the user has no
152              read-access to it, the script is silently not loaded.
153
154       -s file
155              Load file as a script.  This option may be used from  the  shell
156              to make Prolog load a file before entering the toplevel.  Depre‐
157              cated as file names with a Prolog extension (.pl  or  .qlf)  are
158              used to load the program.
159
160       -l file
161              Load file as a script.  This is a synonym for -s that is compat‐
162              ible with several other Prolog implementations.  If multiple  -s
163              or  -l arguments are provided, all specified files are loaded in
164              the order in which they appear on the argument list.
165
166       --quiet[=bool] -q
167              Operate silently.  This option suppresses all informational mes‐
168              sages.
169
170       -g goal
171              Goal is executed just before entering the top level. This option
172              may appear multiple times.  Goals are executed in the  order  of
173              appearance.  Possible choice points are pruned.  If a goal fails
174              an error is printed (depending on the -q flag) and  the  process
175              stops with exit code 1.  If a goal raises an exception the error
176              is printed and the process stops with exit code 2.  In  no  goal
177              is  present  version/0  is  called to write the welcome message.
178              The welcome message can thus be suppressed by  giving  -g  true.
179              goal  can  be  a complex term. In this case, quotes are normally
180              needed to protect it from being expanded by the Unix shell.
181
182       -o output
183              Used in combination with -b or -c to determine the  output  file
184              for compilation.
185
186       -p alias=pathlist
187              Define  a  path alias for file_search_path/2.  pathlist is a ":"
188              separated list of values for the alias.  See  file_search_path/2
189              in the SWI-Prolog Reference Manual.
190
191       -t goal
192              Use goal as an interactive top level instead of the default goal
193              prolog/0.  goal can be a complex term. If  the  top  level  goal
194              succeeds,  SWI-Prolog exits with status 0. If it fails, the exit
195              status is 1. This flag  also  determines  the  goal  started  by
196              break/0 and abort/0.  If you want to stop the user from entering
197              interactive mode, start the application with `-g goal' and  give
198              `halt' as the top level.
199
200       -x bootfile
201              Start  from  an  intermediate  code file resulting from a Prolog
202              compilation  using  the  -b  or  -c  option,  or  created  using
203              qsave_program/[1,2].
204
205       --tty[=bool]
206              Switches  tty control (using ioctl(2)).  Normally tty control is
207              switched on. This default depends on the installation.  You  may
208              wish  to  switch  tty  control off if SWI-Prolog is used from an
209              editor such as GNU Emacs. If switched off, get_single_char/1 and
210              the tracer will wait for a carriage return.
211
212       --signals[=bool]
213              Disable handling of signals.  Often used if SWI-Prolog is embed‐
214              ded in another application on Unix systems.
215
216       --sigalert=NUM
217              Use NUM for unblocking system calls.  Default is SIGUSR2.  Using
218              0 disables installing a signal handler, delaying the delivery of
219              thread signals until the blocking system call completes.
220
221       --threads[=bool]
222              Disable creating threads in the  multi-threaded  version.   This
223              notably prevents running global garbage collection on a separate
224              thread and may be used for situations where multiple threads are
225              not desirable.
226
227       --     Stops scanning for more arguments.
228

ENVIRONMENT VARIABLES

230       SWI_HOME_DIR
231              Location  for finding the startup file  and the libraries.  Nor‐
232              mally discovered from the executable or configured default loca‐
233              tion.  Providing the value through the environment may be needed
234              if SWI-Prolog is embedded into another executable.
235

ON-LINE HELP

237       SWI-Prolog has on-line help. This provides a fast lookup  and  browsing
238       facility  to  the  SWI-Prolog  Reference manual. The on-line manual can
239       show predicate definitions as well as entire sections of the manual.
240
241       help   Equivalent to help(help/1).
242
243       help(+What)
244              Show a specified part of the manual.  What is one of:
245
246              Name/Arity
247                     give help on the specified predicate
248
249              Name   give help on the named predicate with any arity  or  a  C
250                     interface function with that name.
251
252              Section
253                     display the specified section of the SWI-Prolog Reference
254                     Manual.  Section numbers are dash separated numbers: e.g.
255                     2-3 refers to section 2.3 of the manual.
256
257              If  Prolog is used together with the GUI tool XPCE, these predi‐
258              cates start a graphical interface, providing a  coherent  inter‐
259              face to help/1, apropos/1 and explain/1.
260

FILES

262       This installation of SWI-Prolog has been configured using the configure
263       option --prefix=/usr.  If the files listed below are not at  the  indi‐
264       cated place, the installation has probably been moved.  Use
265
266       ?- current_prolog_flag(home, Home).
267
268       to find the local installation directory of SWI-Prolog.
269
270       ~/.swiplrc
271              Personal   initialisation   files  consulted  by  SWI-Prolog  on
272              startup.  If both exist .swiplrc is used.
273

SEE ALSO

275       The SWI-Prolog web-home at http://www.swi-prolog.org
276
277       Jan Wielemaker  SWI-Prolog  Reference  Manual  at   http://www.swi-pro
278       log.org/pldoc/index.html
279
280       William F. Clocksin  &  Christopher S. Mellish,  Programming in Prolog,
281       fourth edition, Springer Verlag, Berlin 1994.
282
283       swipl-ld(1)
284

WARRANTY

286       The software is provided as is, without warranty of any  kind,  express
287       or  implied,  including  but  not  limited  to  the  warranties of mer‐
288       chantability, fitness for a particular purpose and non infringement. In
289       no event shall the author or his employer be liable for any claim, dam‐
290       ages or other liability, whether in an action of contract, tort or oth‐
291       erwise,  arising from, out of or in connection with the software or the
292       use or other dealings in the software.
293

COPYING

295       SWI-Prolog is distributed under the LGPL  (GNU  Lesser  General  Public
296       License).  The license terms are in the file COPYING or on the GNU web‐
297       site at http://www.gnu.org.
298
300       Copyright (c) 1986-2015 University of Amsterdam, VU University  Amster‐
301       dam
302

AUTHOR

304       Jan Wielemaker
305
306
307
308SWI-Prolog 7                     Apr 10, 2015                         swipl(1)
Impressum