1pl(1L) pl(1L)
2
3
4
6 pl - SWI-Prolog 5.7.11
7
9 pl [--help|--version|--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 --version
44 Displays version and architecture information.
45
46 --arch Prints the architecture identifier.
47
48 --dump-runtime-variables[=format]
49 Dump information that is generally useful for installation
50 scripts in a form defined by format. Defines formats are sh
51 (default, bourne shell) and cmd (Windows CMD). This option is
52 used by plld (1) to fetch necessary information about Prolog.
53 It is normally invoked as eval `pl -dump-runtime-variables`,
54 which assigns the following shell variables:
55
56 CC The C- compiler used to compile SWI-Prolog.
57
58 PLBASE The home directory of SWI-Prolog. This is the same value
59 as returned by the current_prolog_flag home.
60
61 PLARCH The architecture identifier used. Together with PLBASE
62 this defines the location of various components. For
63 example, the library for embedding is in $PLBASE/run‐
64 time/$PLARCH/libpl.a
65
66 PLLIBS The required libraries for linking libpl.a
67
68 PLCFLAGS
69 Flags that need to be passed to the C-compiler to gener‐
70 ate compatible code.
71
72 PLLDFLAGS
73 Flags that need to be passed to the C-linker for linking
74 embedded executables.
75
76 PLSOEXT
77 Extension used by the hosting operating system for shared
78 objects. On most Unix systems this is "so"; on MS-Windows
79 it is "dll". AIX uses "o", HPUX "sl".
80
81 PLVERSION
82 Numeric representation of the SWI-Prolog version.
83
84 PLSHARED
85 Has the value yes if Prolog supports linking shared
86 libraries using load_foreign_library/[1,2] and no other‐
87 wise.
88
89 PLTHREADS
90 Has the value yes if Prolog was compiled for multi-
91 threading and no otherwise.
92
93 -Asize[kmg]
94 Sets the argument stack size to size. The default is 1 Mbytes.
95 The argument-size determines the maximum term-nesting of terms
96 that can be compiled and executed. Both the compiler and vir‐
97 tual machine use `last-argument optimisation', so -for example-
98 intptr_t lists do not require the argument stack. See also the
99 -L option.
100
101 -Gsize[kmg]
102 Sets the global stack size to size. The default is 4 Mbytes.
103 The global stack is used to store compound terms, floating point
104 numbers, big integers and strings. See also the -L option.
105
106 -Lsize[kmg]
107 Sets the local stack size to size. The default unit is Kbytes.
108 The local stack is used to store environment frames, choice‐
109 points and foreign-language term-references. Note that SWI-Pro‐
110 log does last-call optimisation to minimize the local stack
111 requirements. If the argument ends in m , the argument is inter‐
112 preted in Mbytes. A g suffix is interpreted in Gbytes (64-bit
113 machines only). This flag sets the maximum value to which the
114 stack is allowed to grow (default 2048). A maximum is useful to
115 prevent buggy programs from claiming all the memory resources.
116 -L0 sets the limit to the highest possible value.
117
118 -O Optimised compilation. See set_prolog_flag/3 in the SWI-Prolog
119 Reference Manual.
120
121 -Tsize[kmg]
122 Sets the trail stack size to size K bytes. The default is 4096.
123 See -L for more details.
124
125 -b initfile ... -c file ...
126 Boot compilation. initfile ... are compiled by the C written
127 bootstrap compiler, file ... by the normal Prolog compiler into
128 an intermediate code file. This option is for system maintenance
129 and is given for reference only.
130
131 -c file ...
132 Compiles file ... into an intermediate code file.
133
134 -d level
135 Set debug level to level. This option is for system maintenance
136 and is given for reference only.
137
138 -f file
139 Use file as initialisation file instead of `.plrc'. `-f none'
140 stops SWI-Prolog from searching for an initialisation file.
141
142 -F file
143 Select startup script from the SWI-Prolog home directory. file
144 Specifies the base-name of the script. The extension is .rc.
145 The default script is deduced from the basename of the exe‐
146 cutable, taking all leading alphanumerical (letters, digits and
147 underscore) from the program name. Thus if the program is named
148 swi-2.0 it will try to load the file swi.rc from the SWI-Prolog
149 home directory. If the file does not exist, or the user has no
150 read-access to it, the script is silently not loaded.
151
152 -s file
153 Load file as a script. This option may be used from the shell
154 to make Prolog load a file before entering the toplevel. It is
155 also used to turn a file into an executable Prolog script on
156 Unix systems using the following first line
157
158 #!/usr/bin/pl option ... -s
159
160 --quiet -q
161 Operate silently. This option suppresses all informational mes‐
162 sages, such as for compiling files.
163
164 -g goal
165 Goal is executed just before entering the top level. The default
166 is a predicate which prints the welcome message. The welcome
167 message can thus be suppressed by giving -g true. goal can be a
168 complex term. In this case, quotes are normally needed to pro‐
169 tect it from being expanded by the Unix shell.
170
171 -o output
172 Used in combination with -b or -c to determine the output file
173 for compilation.
174
175 -p alias=pathlist
176 Define a path alias for file_search_path/2. pathlist is a
177 "`":"'" separated list of values for the alias. See
178 file_search_path/2 in the SWI-Prolog Reference Manual.
179
180 -t goal
181 Use goal as an interactive top level instead of the default goal
182 prolog/0. goal can be a complex term. If the top level goal
183 succeeds, SWI-Prolog exits with status 0. If it fails, the exit
184 status is 1. This flag also determines the goal started by
185 break/0 and abort/0. If you want to stop the user from entering
186 interactive mode, start the application with `-g goal' and give
187 `halt' as the top level.
188
189 -x bootfile
190 Start from an intermediate code file resulting from a Prolog
191 compilation using the -b or -c option, or created using
192 qsave_program/[1,2].
193
194 [+|-]tty
195 Switches tty control (using ioctl(2)) on (+tty) or off (-tty).
196 Normally tty control is switched on. This default depends on the
197 installation. You may wish to switch tty control off if SWI-Pro‐
198 log is used from an editor such as GNU Emacs. If switched off,
199 get_single_char/1 and the tracer will wait for a carriage
200 return.
201
202 --nosignals
203 Disable handling of signals. Often used if SWI-Prolog is embed‐
204 ded in another application on Unix systems.
205
206 -- Stops scanning for more arguments.
207
209 SWI-Prolog has on-line help. This provides a fast lookup and browsing
210 facility to the SWI-Prolog Reference manual. The on-line manual can
211 show predicate definitions as well as entire sections of the manual.
212
213 help Equivalent to help(help/1).
214
215 help(+What)
216 Show a specified part of the manual. What is one of:
217
218 Name/Arity
219 give help on the specified predicate
220
221 Name give help on the named predicate with any arity or a C
222 interface function with that name.
223
224 Section
225 display the specified section of the SWI-Prolog Reference
226 Manual. Section numbers are dash separated numbers: e.g.
227 2-3 refers to section 2.3 of the manual.
228
229 If Prolog is used together with the GUI tool XPCE, these predi‐
230 cates start a graphical interface, providing a coherent inter‐
231 face to help/1, apropos/1 and explain/1.
232
234 The SWI-Prolog web-home at http://www.swi-prolog.org
235
236 Jan Wielemaker SWI-Prolog Reference Manualat http://gollem.sci‐
237 ence.uva.nl/SWI-Prolog/Manual/
238
239 William F. Clocksin & Christopher S. Mellish, Programming in Prolog,
240 fourth edition, Springer Verlag, Berlin 1994.
241
242 plrc(1) and plld(1) and xpce(1)
243
245 The software is provided as is, without warranty of any kind, express
246 or implied, including but not limited to the warranties of mer‐
247 chantability, fitness for a particular purpose and non infringement. In
248 no event shall the author or his employer be liable for any claim, dam‐
249 ages or other liability, whether in an action of contract, tort or oth‐
250 erwise, arising from, out of or in connection with the software or the
251 use or other dealings in the software.
252
254 SWI-Prolog is distributed under the LGPL (Lesser GNU Public Licence).
255 The license terms are in the file COPYING or on the GNU website at
256 http://www.gnu.org.
257
259 Copyright (c) 1986-2007 University of Amsterdam.
260
262 Jan Wielemaker
263
264
265
266
267SWI-Prolog 5 Feb 8, 2006 pl(1L)