1pl(1L) pl(1L)
2
3
4
6 pl - SWI-Prolog 5.6.35
7
9 pl [-help|-v|-arch|-dump-runtime-variables]
10 pl [options]
11 pl [options] [-o output] -c file ...
12 pl [options] [-o output] -b initfile ...
13
15 SWI-Prolog is an ISO compatible Prolog compiler. It has a good collec‐
16 tion of built-in predicates, a large set of which it shares with Edin‐
17 burgh C-Prolog, Quintus Prolog and SICStus Prolog. Among its features
18 are a very fast compiler, a Quintus-like module system, library
19 autoloading, garbage collection, atom garbage collection, fast bi-
20 directional C interface, true C++ interface, execution profiling and
21 many more.
22
23 Add-on packages provide graphics (XPCE), TCP/IP, process controll,
24 SGML/XML/HTML/RDF support and many more. In addition, XPCE provides a
25 development environment, consisting of hypertext help-system, source-
26 level debugger, integrated editor and many navigation tools.
27
28 This manual page only lists the commandline options. Full documenta‐
29 tion is available on-line as well as in HTML and PDF format from the
30 WWW home page.
31
32
34 SWI-Prolog is distributed under the LGPL (Lesser Gnu Public License)
35 for maximal compatibility with the Free Software movement, while allow‐
36 ing for use with proprietary software components. See the SWI-Prolog
37 home page at http://www.swi-prolog.org for details.
38
39
41 -help Gives a summary of the most important options.
42
43 -v Displays version and architecture information.
44
45 -arch Prints the architecture identifier.
46
47 -dump-runtime-variables[=format]
48 Dump information that is generally useful for installation
49 scripts in a form defined by format. Defines formats are sh
50 (default, bourne shell) and cmd (Windows CMD). This option is
51 used by plld (1) to fetch necessary information about Prolog.
52 It is normally invoked as eval `pl -dump-runtime-variables`,
53 which assigns the following shell variables:
54
55 CC The C- compiler used to compile SWI-Prolog.
56
57 PLBASE The home directory of SWI-Prolog. This is the same value
58 as returned by the current_prolog_flag home.
59
60 PLARCH The architecture identifier used. Together with PLBASE
61 this defines the location of various components. For
62 example, the library for embedding is in $PLBASE/run‐
63 time/$PLARCH/libpl.a
64
65 PLLIBS The required libraries for linking libpl.a
66
67 PLCFLAGS
68 Flags that need to be passed to the C-compiler to gener‐
69 ate compatible code.
70
71 PLLDFLAGS
72 Flags that need to be passed to the C-linker for linking
73 embedded executables.
74
75 PLSOEXT
76 Extension used by the hosting operating system for shared
77 objects. On most Unix systems this is "so"; on MS-Windows
78 it is "dll". AIX uses "o", HPUX "sl".
79
80 PLVERSION
81 Numeric representation of the SWI-Prolog version.
82
83 PLSHARED
84 Has the value yes if Prolog supports linking shared
85 libraries using load_foreign_library/[1,2] and no other‐
86 wise.
87
88 PLTHREADS
89 Has the value yes if Prolog was compiled for multi-
90 threading and no otherwise.
91
92 -Asize[kmg]
93 Sets the argument stack size to size. The default is 1 Mbytes.
94 The argument-size determines the maximum term-nesting of terms
95 that can be compiled and executed. Both the compiler and vir‐
96 tual machine use `last-argument optimisation', so -for example-
97 intptr_t lists do not require the argument stack. See also the
98 -L option.
99
100 -Gsize[kmg]
101 Sets the global stack size to size. The default is 4 Mbytes.
102 The global stack is used to store compound terms, floating point
103 numbers, big integers and strings. See also the -L option.
104
105 -Lsize[kmg]
106 Sets the local stack size to size. The default unit is Kbytes.
107 The local stack is used to store environment frames, choice‐
108 points and foreign-language term-references. Note that SWI-Pro‐
109 log does last-call optimisation to minimize the local stack
110 requirements. If the argument ends in m , the argument is inter‐
111 preted in Mbytes. A g suffix is interpreted in Gbytes (64-bit
112 machines only). This flag sets the maximum value to which the
113 stack is allowed to grow (default 2048). A maximum is useful to
114 prevent buggy programs from claiming all the memory resources.
115 -L0 sets the limit to the highest possible value.
116
117 -O Optimised compilation. See set_prolog_flag/3 in the SWI-Prolog
118 Reference Manual.
119
120 -Tsize[kmg]
121 Sets the trail stack size to size K bytes. The default is 4096.
122 See -L for more details.
123
124 -b initfile ... -c file ...
125 Boot compilation. initfile ... are compiled by the C written
126 bootstrap compiler, file ... by the normal Prolog compiler into
127 an intermediate code file. This option is for system maintenance
128 and is given for reference only.
129
130 -c file ...
131 Compiles file ... into an intermediate code file.
132
133 -d level
134 Set debug level to level. This option is for system maintenance
135 and is given for reference only.
136
137 -f file
138 Use file as initialisation file instead of `.plrc'. `-f none'
139 stops SWI-Prolog from searching for an initialisation file.
140
141 -F file
142 Select startup script from the SWI-Prolog home directory. file
143 Specifies the base-name of the script. The extension is .rc.
144 The default script is deduced from the basename of the exe‐
145 cutable, taking all leading alphanumerical (letters, digits and
146 underscore) from the program name. Thus if the program is named
147 swi-2.0 it will try to load the file swi.rc from the SWI-Prolog
148 home directory. If the file does not exist, or the user has no
149 read-access to it, the script is silently not loaded.
150
151 -s file
152 Load file as a script. This option may be used from the shell
153 to make Prolog load a file before entering the toplevel. It is
154 also used to turn a file into an executable Prolog script on
155 Unix systems using the following first line
156
157 #!/usr/bin/pl option ... -s
158
159 -q Operate silently. This option suppresses all informational mes‐
160 sages, such as for compiling files.
161
162 -g goal
163 Goal is executed just before entering the top level. The default
164 is a predicate which prints the welcome message. The welcome
165 message can thus be suppressed by giving -g true. goal can be a
166 complex term. In this case, quotes are normally needed to pro‐
167 tect it from being expanded by the Unix shell.
168
169 -o output
170 Used in combination with -b or -c to determine the output file
171 for compilation.
172
173 -p alias=pathlist
174 Define a path alias for file_search_path/2. pathlist is a
175 "`":"'" separated list of values for the alias. See
176 file_search_path/2 in the SWI-Prolog Reference Manual.
177
178 -t goal
179 Use goal as an interactive top level instead of the default goal
180 prolog/0. goal can be a complex term. If the top level goal
181 succeeds, SWI-Prolog exits with status 0. If it fails, the exit
182 status is 1. This flag also determines the goal started by
183 break/0 and abort/0. If you want to stop the user from entering
184 interactive mode, start the application with `-g goal' and give
185 `halt' as the top level.
186
187 -x bootfile
188 Start from an intermediate code file resulting from a Prolog
189 compilation using the -b or -c option, or created using
190 qsave_program/[1,2].
191
192 [+|-]tty
193 Switches tty control (using ioctl(2)) on (+tty) or off (-tty).
194 Normally tty control is switched on. This default depends on the
195 installation. You may wish to switch tty control off if SWI-Pro‐
196 log is used from an editor such as GNU Emacs. If switched off,
197 get_single_char/1 and the tracer will wait for a carriage
198 return.
199
200 -- Stops scanning for more arguments.
201
203 SWI-Prolog has on-line help. This provides a fast lookup and browsing
204 facility to the SWI-Prolog Reference manual. The on-line manual can
205 show predicate definitions as well as entire sections of the manual.
206
207 help Equivalent to help(help/1).
208
209 help(+What)
210 Show a specified part of the manual. What is one of:
211
212 Name/Arity
213 give help on the specified predicate
214
215 Name give help on the named predicate with any arity or a C
216 interface function with that name.
217
218 Section
219 display the specified section of the SWI-Prolog Reference
220 Manual. Section numbers are dash separated numbers: e.g.
221 2-3 refers to section 2.3 of the manual.
222
223 If Prolog is used together with the GUI tool XPCE, these predi‐
224 cates start a graphical interface, providing a coherent inter‐
225 face to help/1, apropos/1 and explain/1.
226
228 This installation of SWI-Prolog has been configured using the configure
229 option --prefix=/usr. If the files listed below are not at the indi‐
230 cated place, the installation has probably been moved. Use
231
232 ?- current_prolog_flag(home, Home).
233
234 to find the local installation directory of SWI-Prolog.
235
236 .plrc
237
238 ~/.plrc
239 Personal initialisation files consulted by SWI-Prolog on
240 startup. If both exist .plrc is used.
241
242 /usr/lib/pl-5.6.35/bin/x86_64-linux-gnu/
243 Location for the executables.
244
245 /usr/lib/pl-5.6.35/include/
246 Location for the include files. If writable, SWI-Prolog.h is
247 also copied to /usr/include/SWI-Prolog.h.
248
249 /usr/lib/pl-5.6.35/library/
250 SWI-Prolog user libraries.
251
252 /usr/lib/pl-5.6.35/boot/
253 SWI-Prolog kernel parts written in Prolog. The startup file
254 /usr/lib/pl-5.6.35/boot32.prc may be recreated using the command
255 from the directory /usr/lib/pl-5.6.35:
256
257 bin/x86_64-linux-gnu/pl -O -o boot32.prc -b boot/init.pl
258
259 /usr/lib/pl-5.6.35/doc/packages
260 HTML and/or PDF documentation on the installed add-ons.
261
262 /usr/lib/pl-5.6.35/boot32.prc
263 Default startup file. This is a `intermediate code' file con‐
264 taining precompiled code from the boot directory. The -xboot‐
265 file option may be used to select a different file.
266
267 /usr/lib/pl-5.6.35/runtime/x86_64-linux-gnu/libpl.a
268 SWI-Prolog library for embedding. See also plld(1).
269
271 The SWI-Prolog web-home at http://www.swi-prolog.org
272
273 Jan Wielemaker SWI-Prolog Reference Manualat http://gollem.sci‐
274 ence.uva.nl/SWI-Prolog/Manual/
275
276 Documentation on the add-on packages in /usr/lib/pl-5.6.35/boot/doc
277
278 William F. Clocksin & Christopher S. Mellish, Programming in Prolog,
279 fourth edition, Springer Verlag, Berlin 1994.
280
281 plrc(1) and plld(1) and xpce(1)
282
284 The software is provided as is, without warranty of any kind, express
285 or implied, including but not limited to the warranties of mer‐
286 chantability, fitness for a particular purpose and non infringement. In
287 no event shall the author or his employer be liable for any claim, dam‐
288 ages or other liability, whether in an action of contract, tort or oth‐
289 erwise, arising from, out of or in connection with the software or the
290 use or other dealings in the software.
291
293 SWI-Prolog is distributed under the LGPL (Lesser GNU Public Licence).
294 The license terms are in the file COPYING or on the GNU website at
295 http://www.gnu.org.
296
298 Copyright (c) 1986-2007 University of Amsterdam.
299
301 Jan Wielemaker
302
303
304
305
306SWI-Prolog 5 Feb 8, 2006 pl(1L)