File: pl.1

package info (click to toggle)
swi-prolog 3.1.0-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,772 kB
  • ctags: 12,869
  • sloc: ansic: 43,657; perl: 12,577; lisp: 4,359; sh: 1,534; makefile: 798; awk: 14
file content (412 lines) | stat: -rw-r--r-- 11,367 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
.\" -*- nroff -*-
.TH pl 1L "May 10, 1997" "SWI-Prolog 2.8"
.SH NAME
pl \- SWI-Prolog 3.1.0
.SH SYNOPSIS
.B pl
.RB [ \-help | \-v | \-arch | \-dump\-runtime\-variables ]
.br
.B pl
[options]
.br
.B pl
[options]
.RB [ "\-o \fIoutput" ]
.BI \-c " file ..."
.br
.B pl
[options]
.RB [ "\-o \fIoutput" ]
.BI \-b " initfile ..."
.SH DESCRIPTION
SWI-Prolog is an implementation of Prolog in the Edinburgh tradition.  It is
based on a restricted form of the WAM (RISC-WAM?).  It has a good collection
of built-in predicates, a large set of which it shares with C-Prolog, Quintus
Prolog and SICStus Prolog.  It has a fairly good performance, with a fast
compiler.  It includes a Quintus-like module system, a library autoload
facility, a garbage collector, on-line help, a trasparent and fast C interface
(in both directions), and a profiler.

SWI-Prolog runs on most Unix machines, as well as on the Microsoft Win32
platform.

.SH LICENSE INFORMATION
SWI-Prolog is distributed in source-form as well as in binary format for
some architectures.  The user is free to modify and redistribute the
sources, provided the copyright and authorship messages are left in place.
Modifications should be properly marked in the sources and if the modified
version is distributed, the user should indicate it concerns a modified
version and point to the location of the main source,
.br
.BI ftp://swi.psy.uva.nl/pub/SWI-Prolog/

SWI-Prolog may be used free of charge for personal and educational purposes,
as well as for research projects inside commercial organisations.  It is
however
.B not allowed to distribute commercial applications
in which SWI-Prolog is embedded without an additional license.  Please
contact
.BI prolog-request@swi.psy.uva.nl
for further information.


.SH OPTIONS
.TP
.B \-help
Gives a summary of the most important options.
.TP
.B \-v
Displays version and architecture information.
.TP
.B \-arch
Prints the architecture identifier.
.TP
.B \-dump\-runtime\-variables
Dump information that is generally useful for installation scripts in
a form compatible with the
.B sh
(bourne) shell.  This option is used by
.B plld (1)
to fetch necessary information about Prolog.  It is normally invoked as
.I eval `pl -dump-runtime-variables`,
which assigns the following shell variables:
.RS
.TP
.B CC
The
.B C\-
compiler used to compile SWI-Prolog.
.TP
.B PLBASE
The home directory of SWI-Prolog.  This is the same value as returned
by the
.I feature home.
.TP
.B PLARCH
The architecture identifier used.  Together with 
.B PLBASE
this defines the location of various components.  For example,
the library for embedding is in
.B $PLBASE/runtime/$PLARCH/libpl.a
.TP
.B PLLIBS
The required libraries for linking
.B libpl.a
.TP
.B PLLDFLAGS
Flags that need to be passed to the C-linker for linking embedded executables.
.TP
.B PLVERSION
Numeric representation of the SWI-Prolog version.
.TP
.B PLSHARED
Has the value
.B yes
if Prolog supports linking shared libraries using
.B load_foreign_library/[1,2]
and
.B no
otherwise.
.RE
.TP
.BI \-A size [km]
Sets the argument stack size to
.I size.
The default is 1 Mbytes.  The argument-size determines the maximum
term-nesting of terms that can be compiled and executed.  Both the compiler
and virtual machine use `last-argument optimisation', so -for example- long
lists do not require the argument stack. See also the
.B \-L
option.
.TP
.BI \-G size [km]
Sets the global stack size to
.I size.
The default is 4 Mbytes.  The global stack is used to store compound
terms, floating point numbers, big integers and strings. See also the
.B \-L
option.
.TP
.BI \-H size [km]
Determines the size reserved for the
.I malloc()
heap.  The heap is used to store atoms, functors, predicates and their
clauses, records and flags.  The heap is also used for external packages
using
.B malloc().
This flag is only relevant on machines where the stacks are
allocated using the
.I mmap()
function.  Among these systems are
.B Linux, SunOS/Solaris
and
.B OSF/1.
By default, the Prolog stacks are allocated from the top of the
heap downwards.  Using the
.B \-H
option allocates the Prolog stack at the indicated distance from
the current top of the heap upwards.  See also
.I statistics/0.
.TP
.BI \-L size [km]
Sets the local stack size to
.I size.
The default unit is Kbytes.  The local stack is used to store environment
frames, choicepoints and foreign-language term-references.  Note that
SWI-Prolog does last-call optimisation to minimize the local stack
requirements. If the argument ends in
.B m ,
the argument is interpreted in Mbytes.
This flag sets the maximum value to which the stack is
allowed to grow (default 2048). A maximum is useful to prevent buggy
programs from claiming all the memory resources.
.B \-L0
sets the limit to the highest possible value.
.TP
.BI \-O
Optimised compilation. See
.B please/3
in the SWI-Prolog Reference Manual.
.TP
.BI \-T size
Sets the trail stack size to
.I size
K bytes. The default is 4096. See
.B \-L
for more details.
.TP
.BI \-b " initfile ... " -c " file ..."
Boot compilation.
.I "initfile ..."
are compiled by the C written bootstrap compiler,
.I "file ..."
by the normal Prolog compiler into an intermediate code file. This
option is for system maintenance and is given for reference only.
.TP
.BI \-c " file ..."
Compiles
.I "file ..."
into an intermediate code file.
.TP
.BI \-d " level"
Set debug level to
.IR level .
This option is for system maintenance and is given for reference only.
.TP
.BI \-f " file"
Use
.I "file"
as initialisation file instead of
.RB "`" .plrc "'. `" "-f none" "'"
stops SWI-Prolog from searching for an initialisation file.
.TP
.BI \-F " file"
Select startup script from the SWI-Prolog home directory.
.I file
Specifies the base-name of the script.  The extension is
.I .rc.
The default script is deduced from the basename of the executable,
taking all leading alphanumerical (letters, digits and underscore)
from the program name.  Thus if the proram is named
.I swi-2.0
it will try to load the file
.I swi.rc
from the SWI-Prolog home directory.  If the file does not exist, or
the user has no read-access to it, the script is silently not loaded.
.TP
.BI \-g " goal"
.I Goal
is executed just before entering the top level. The default is a
predicate which prints the welcome message. The welcome message
can thus be supressed by giving
.BR "\-g true" .
.I goal
can be a complex term. In this case, quotes are normally needed
to protect it from being expanded by the Unix shell.
.TP
.BI \-o " output"
Used in combination with
.B \-b
or
.B \-c
to determine the output file for compilation.
.TP
.BI \-p " alias" = pathlist
Define a path alias for
.BR file_search_path/2 .
.I pathlist
is a "`":"'" separated list of values for the alias. See
.B file_search_path/2
in the SWI-Prolog Reference Manual.
.TP
.BI \-r " restorefile"
Restore a saved state created by
.B save_program/[1,2]
or
.BR save/[1,2] .
Equivalent to
.BI restore( restorefile )
from Prolog.  Note that very few machines support this style of saved
states, but all machines support the states created using
.BI qsave_program/[1,2],
which may be started using the
.B \-x
flag.
.TP
.BI \-t " goal"
Use
.I goal
as an interactive top level instead of the default goal
.BR prolog/0 .
.I goal
can be a complex term. If the top level goal succeeds, SWI-Prolog
exits with status 0. If it fails, the exit status is 1. This flag
also determines the goal started by
.B break/0
and
.BR abort/0 .
If you want to stop the user from entering interactive mode, start
the application with
.RB "`" \-g
.IR goal "'"
and give
.RB "`" halt "'"
as the top level.
.TP
.BI \-x " bootfile"
Start from an intermediate code file resulting from a Prolog compilation
using the
.B \-b
or
.B \-c
option, or created using
.B qsave_program/[1,2].
.TP
.RB [ \+ | \- ] tty
Switches tty control (using 
.BR ioctl (2))
on
.RB ( \+tty ") or off ("  \-tty ")."
Normally tty control is switched on. This default depends on the
installation. You may wish to switch tty control off if SWI-Prolog is
used from an editor such as GNU Emacs. If switched off,
.B get_single_char/1
and the tracer will wait for a carriage return.
.TP
.B \-\-
Stops scanning for more arguments.
.SH ON-LINE HELP
SWI-Prolog has on-line help. This provides a fast lookup and browsing
facility to the SWI-Prolog Reference manual. The on-line manual can
show predicate definitions as well as entire sections of the manual.
.TP
.B help
Equivalent to
.BR help(help/1) .
.TP
.BI help( \+What )
Show a specified part of the manual.
.I What
is one of:
.RS
.TP
Name/Arity
give help on the specified predicate
.TP
Name
give help on the named predicate with any arity or a C interface
function with that name.
.TP
Section
display the specified section of the SWI-Prolog Reference Manual.
Section numbers are dash separated numbers: e.g.
.B 2-3
refers to section 2.3 of the manual.
.PP
If Prolog is used together with the
.BR GUI
tool
.BR XPCE,
these predicates start a graphical interface, providing a coherent interface
to
.BR help/1,
.BR apropos/1
and
.BR explain/1.
.RE
.SH FILES
This installation of SWI-Prolog has been configured using the configure
option
.BI \-\-prefix= /usr.
If the files listed below are not at the indicated place, the installation
has probably been moved.  Use
.TP
?- feature(home, Home).
.P
to find the local installation directory of SWI-Prolog.
.TP
.I .plrc
.TP
.I ~/.plrc
Personal initialisation files consulted by SWI-Prolog on startup.
If both exist
.I .plrc
is used.
.TP
.I /usr/lib/pl-3.1.0/bin/i586-linux/
Location for the executables.
.TP
.I /usr/lib/pl-3.1.0/include/
Location for the include files.  If writeable, SWI-Prolog.h is also
copied to /usr/include/SWI-Prolog.h.
.TP
.I /usr/include/SWI-Prolog.h
Include file for creating extensions in the
.B C
language and/or embedding SWI-Prolog.
.TP
.I /usr/lib/pl-3.1.0/library/
SWI-Prolog user libraries.
.TP
.I /usr/lib/pl-3.1.0/boot/
SWI-Prolog kernel parts written in Prolog.  The startup file
/usr/lib/pl-3.1.0/startup/startup may be recreated using
the command from the directory /usr/lib/pl-3.1.0:
.RS
.TP
bin/i586-linux/pl -O -o startup/startup -b boot/init.pl
.RE
.TP
.I /usr/lib/pl-3.1.0/startup/startup
Default startup file.  This is a `intermediate code' file containing
precompiled code from the boot directory.  The
.BI \-x bootfile
option may be used to select a different file.
.TP
.I /usr/lib/pl-3.1.0/runtime/i586-linux/libpl.a
SWI-Prolog library for embedding.  See also
.I plld(1).
.SH SEE ALSO
Jan\ Wielemaker
.IR "SWI-Prolog 2.8 Reference Manual" ,
University of Amsterdam, Dept. of Social Science and Informatics (SWI).
.PP
William\ F.\ Clocksin & Christopher\ S.\ Mellish,
.IR "Programming in Prolog" ,
fourth edition, Springer Verlag, Berlin 1994.
.PP
.IR chpl(1) " and " plld(1)
.SH WARRANTY
The software is provided
.B as is,
without warranty of any kind, express or implied, including but not
limited to the warranties of merchantability, fitness for a particular
purpose and noninfringement. In no event shall the author or his
employer be liable for any claim, damages or other liability, whether in
an action of contract, tort or otherwise, arising from, out of or in
connection with the software or the use or other dealings in the
software.
.SH COPYRIGHT
Copyright (c) 1993\-1997 University of Amsterdam, all rights reserved.
.SH AUTHOR
Jan Wielemaker