1swipl(1) General Commands Manual swipl(1)
2
3
4
6 swipl - SWI-Prolog 8.2.4
7
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
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
41 --help Give a summary of the most important options.
42
43 --version
44 Display version and architecture information.
45
46 --abi-version
47 Display ABI version key. This key indicates binary compatibil‐
48 ity of various interfaces.
49
50 --arch Print the architecture identifier.
51
52 --dump-runtime-variables[=format]
53 Dump information that is generally useful for installation
54 scripts in a form defined by format. Defines formats are sh
55 (default, bourne shell) and cmd (Windows CMD). This option is
56 used by swipl-ld (1) to fetch necessary information about Pro‐
57 log. It is normally invoked as eval `swipl --dump-runtime-vari‐
58 ables`, which assigns the following shell variables:
59
60 CC The C- compiler used to compile SWI-Prolog.
61
62 PLBASE The home directory of SWI-Prolog. This is the same value
63 as returned by the current_prolog_flag home.
64
65 PLARCH The architecture identifier used. Together with PLBASE
66 this defines the location of various components. For
67 example, the library for embedding is in
68 $PLBASE/lib/$PLARCH/libswipl.a
69
70 PLBITS Address bits for VM. Either 32 or 64.
71
72 PLLIB CC identifier to link to SWI-Prolog. Typically -lswipl
73
74 PLLIBS Additional libraries needed for linking PLLIB
75
76 PLCFLAGS
77 Flags that need to be passed to the C-compiler to gener‐
78 ate compatible code.
79
80 PLLDFLAGS
81 Flags that need to be passed to the C-linker for linking
82 embedded executables.
83
84 PLSOEXT
85 Extension used by the hosting operating system for shared
86 objects. On most Unix systems this is "so"; on MS-Windows
87 it is "dll". AIX uses "o", HPUX "sl".
88
89 PLSOPATH
90 Environment variable used by the hosting operating system
91 to extend the search path for shared objects. For exam‐
92 ple, on ELF systems this is "LD_LIBRARY_PATH" and on MS-
93 Windows it is "PATH".
94
95 PLVERSION
96 Numeric representation of the SWI-Prolog version.
97
98 PLVERSIONTAG
99 If present, a version tag such as "rc1".
100
101 PLSHARED
102 Has the value yes if Prolog supports linking shared
103 libraries using load_foreign_library/[1,2] and no other‐
104 wise.
105
106 PLTHREADS
107 Has the value yes if Prolog was compiled for multi-
108 threading and no otherwise.
109
110 --home=DIR
111 Use DIR as home directory.
112
113 --stack-limit=size[bkmg]
114 Set the combined stack limit to size bytes. The suffix is case
115 insensitive and defines the unit as b (bytes), k (Kbytes), m
116 (Mbytes) or g (Gbytes).
117
118 --table-space=size[bkmg]
119 Set the table space limit for SLG resolution (tabling) to size
120 bytes. The suffixes are the same as for the --stack-limit
121 option.
122
123 --shared-table-space=size[bkmg]
124 Set the table space limit for shared tabling to size bytes. The
125 suffixes are the same as for the --stack-limit option.
126
127 -O Optimised compilation. See set_prolog_flag/2 in the SWI-Prolog
128 Reference Manual.
129
130 -b initfile ... -c file ...
131 Boot compilation. initfile ... are compiled by the C written
132 bootstrap compiler, file ... by the normal Prolog compiler into
133 an intermediate code file. This option is for system maintenance
134 and is given for reference only.
135
136 -c file ...
137 Compile file ... into an intermediate code file.
138
139 -d level
140 Set debug level to level. This option is for system maintenance
141 and is given for reference only.
142
143 --packs[=bool]
144 Disable attaching extension packs (add-ons).
145
146 --pce[=bool]
147 Disable the XPCE GUI subsystem.
148
149 --pldoc[=port]
150 Start the PlDoc documentation system on a free network port and
151 launch the user's browser on http://localhost:port. If port is
152 specified, the server is started at the given port but the
153 browser is not launched.
154
155 -f file
156 Use file as initialisation file instead of `init.pl'. `-f none'
157 stops SWI-Prolog from searching for an initialisation file.
158
159 -F file
160 Select startup script from the SWI-Prolog home directory. file
161 Specifies the base-name of the script. The extension is .rc.
162 The default script is deduced from the basename of the exe‐
163 cutable, taking all leading alphanumerical (letters, digits and
164 underscore) from the program name. Thus if the program is named
165 swi-2.0 it will try to load the file swi.rc from the SWI-Prolog
166 home directory. If the file does not exist, or the user has no
167 read-access to it, the script is silently not loaded.
168
169 -s file
170 Load file as a script. This option may be used from the shell
171 to make Prolog load a file before entering the toplevel. Depre‐
172 cated as file names with a Prolog extension (.pl or .qlf) are
173 used to load the program.
174
175 -l file
176 Load file as a script. This is a synonym for -s that is compat‐
177 ible with several other Prolog implementations. If multiple -s
178 or -l arguments are provided, all specified files are loaded in
179 the order in which they appear on the argument list.
180
181 --quiet[=bool] -q
182 Operate silently. This option suppresses all informational mes‐
183 sages.
184
185 --debug[=bool]
186 Disable generating code that can be debugged using trace/0,
187 spy/1, etc.
188
189 -g goal
190 Goal is executed just before entering the top level. This option
191 may appear multiple times. Goals are executed in the order of
192 appearance. Possible choice points are pruned. If a goal fails
193 an error is printed (depending on the -q flag) and the process
194 stops with exit code 1. If a goal raises an exception the error
195 is printed and the process stops with exit code 2. In no goal
196 is present version/0 is called to write the welcome message.
197 The welcome message can thus be suppressed by giving -g true.
198 goal can be a complex term. In this case, quotes are normally
199 needed to protect it from being expanded by the Unix shell.
200
201 -o output
202 Used in combination with -b or -c to determine the output file
203 for compilation.
204
205 -p alias=pathlist
206 Define a path alias for file_search_path/2. pathlist is a ":"
207 separated list of values for the alias. See file_search_path/2
208 in the SWI-Prolog Reference Manual.
209
210 -t goal
211 Use goal as an interactive top level instead of the default goal
212 prolog/0. goal can be a complex term. If the top level goal
213 succeeds, SWI-Prolog exits with status 0. If it fails, the exit
214 status is 1. This flag also determines the goal started by
215 break/0 and abort/0. If you want to stop the user from entering
216 interactive mode, start the application with `-g goal' and give
217 `halt' as the top level.
218
219 -x bootfile
220 Start from an intermediate code file resulting from a Prolog
221 compilation using the -b or -c option, or created using
222 qsave_program/[1,2].
223
224 --tty[=bool]
225 Switches tty control (using ioctl(2)). Normally tty control is
226 switched on. This default depends on the installation. You may
227 wish to switch tty control off if SWI-Prolog is used from an
228 editor such as GNU Emacs. If switched off, get_single_char/1 and
229 the tracer will wait for a carriage return.
230
231 --win-app
232 This option is available only in swipl-win.exe. The Start menu
233 shortcut uses this option to change the working directory to
234 ...\Documents\Prolog. The Prolog subdirectory will be created
235 if it does not exist.
236
237 --signals[=bool]
238 Disable handling of signals. Often used if SWI-Prolog is embed‐
239 ded in another application on Unix systems.
240
241 --sigalert=NUM
242 Use NUM for unblocking system calls. Default is SIGUSR2. Using
243 0 disables installing a signal handler, delaying the delivery of
244 thread signals until the blocking system call completes.
245
246 --threads[=bool]
247 Disable creating threads in the multi-threaded version. This
248 notably prevents running global garbage collection on a separate
249 thread and may be used for situations where multiple threads are
250 not desirable.
251
252 --traditional
253 Disable SWI-Prolog version 7 extensions that are incompatible
254 with earlier versions.
255
256 -- Stop scanning for more arguments.
257
259 SWI_HOME_DIR
260 Location for finding the startup file and the libraries. Nor‐
261 mally discovered from the executable or configured default loca‐
262 tion. Providing the value through the environment may be needed
263 if SWI-Prolog is embedded into another executable.
264
266 SWI-Prolog has on-line help. This provides a fast lookup and browsing
267 facility to the SWI-Prolog Reference manual. The on-line manual can
268 show predicate definitions as well as entire sections of the manual.
269
270 help Equivalent to help(help/1).
271
272 help(+What)
273 Show a specified part of the manual. What is one of:
274
275 Name/Arity
276 give help on the specified predicate
277
278 Name give help on the named predicate with any arity or a C
279 interface function with that name.
280
281 Section
282 display the specified section of the SWI-Prolog Reference
283 Manual. Section numbers are dash separated numbers: e.g.
284 2-3 refers to section 2.3 of the manual.
285
286 If Prolog is used together with the GUI tool XPCE, these predi‐
287 cates start a graphical interface, providing a coherent inter‐
288 face to help/1, apropos/1 and explain/1.
289
291 This installation of SWI-Prolog has been configured using the configure
292 option --prefix=/usr. If the files listed below are not at the indi‐
293 cated place, the installation has probably been moved. Use
294
295 ?- current_prolog_flag(home, Home).
296
297 to find the local installation directory of SWI-Prolog.
298
299 ~/.config/swi-prolog/init.pl
300 Personal initialisation files consulted by SWI-Prolog on
301 startup. The exact location depends on the OS.
302
304 The SWI-Prolog web-home at http://www.swi-prolog.org
305
306 Jan Wielemaker SWI-Prolog Reference Manual at http://www.swi-pro‐
307 log.org/pldoc/index.html
308
309 William F. Clocksin & Christopher S. Mellish, Programming in Prolog,
310 fourth edition, Springer Verlag, Berlin 1994.
311
312 swipl-ld(1)
313
315 The software is provided as is, without warranty of any kind, express
316 or implied, including but not limited to the warranties of mer‐
317 chantability, fitness for a particular purpose and non infringement. In
318 no event shall the author or his employer be liable for any claim, dam‐
319 ages or other liability, whether in an action of contract, tort or oth‐
320 erwise, arising from, out of or in connection with the software or the
321 use or other dealings in the software.
322
324 SWI-Prolog is distributed under the Simplified BSD or BSD-2 License. A
325 particular configuration may contain components that are subject to
326 other license conditions. Use license/0 to find components with less
327 permissive license conditions. See the SWI-Prolog license page at
328 http://www.swi-prolog.org/license.html for details.
329
331 Copyright (c) 1986-2020 University of Amsterdam, VU University Amster‐
332 dam
333
335 Jan Wielemaker
336
337
338
339SWI-Prolog 8 Oct 10, 2020 swipl(1)