@PL@(1L)

NAME
@PL@ - SWI-Prolog @PLVERSION@

SYNOPSIS
@PL@ [-help|-v|-arch|-dump-runtime-variables]
@PL@ [options]
@PL@ [options] [-o output] -c file ...
@PL@ [options] [-o output] -b initfile ...

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.

LICENSE INFORMATION
SWI-Prolog is distributed under the GNU-2 (Gnu Public License, version 2). See the file COPYING for details. In addition, we offer commercial licenses for those who want to use SWI-Prolog with proprietary software. See the SWI-Prolog home page at ftp://swi.psy.uva.nl/pub/SWI-Prolog/ for details.

OPTIONS

-help
    Gives a summary of the most important options.

-v  Displays version and architecture information.

-arch
    Prints the architecture identifier.

-dump-runtime-variables
    Dump information that is generally useful for installation scripts in a form compatible with the sh (bourne) shell. This option is used by plld (1) to fetch necessary information about Prolog. It is normally invoked as eval `@PL@ -dump-runtime-variables`, which assigns the following shell variables:

    CC  The C- compiler used to compile SWI-Prolog.

    PLBASE
        The home directory of SWI-Prolog. This is the same value as returned by the current_prolog_flag home.

    PLARCH
        The architecture identifier used. Together with PLBASE this defines the location of various components. For example, the library for embedding is in $PLBASE/runtime/$PLARCH/libpl.a

    PLLIBS
        The required libraries for linking libpl.a

    PLLDFLAGS
        Flags that need to be passed to the C-linker for linking embedded executables.

    PLVERSION
        Numeric representation of the SWI-Prolog version.

    PLSHARED
        Has the value yes if Prolog supports linking shared libraries using load_foreign_library/[1,2] and no otherwise.

    PLTHREADS
        Has the value yes if Prolog was compiled for multi-threading and no otherwise.

-Asize[km]
    Sets the argument stack size to 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 -L option.

-Gsize[km]
    Sets the global stack size to 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 -L option.

-Lsize[km]
    Sets the local stack size to 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 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. -L0 sets the limit to the highest possible value.

-O  Optimised compilation. See please/3 in the SWI-Prolog Reference Manual.

-Tsize
    Sets the trail stack size to size K bytes. The default is 4096. See -L for more details.

-b initfile ... -c file ...
    Boot compilation. initfile ... are compiled by the C written bootstrap compiler, file ... by the normal Prolog compiler into an intermediate code file. This option is for system maintenance and is given for reference only.

-c file ...
    Compiles file ... into an intermediate code file.

-d level
    Set debug level to level. This option is for system maintenance and is given for reference only.

-f file
    Use file as initialisation file instead of `.plrc'. `-f none' stops SWI-Prolog from searching for an initialisation file.

-F file
    Select startup script from the SWI-Prolog home directory. file Specifies the base-name of the script. The extension is .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 swi-2.0 it will try to load the file 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.

-g goal
    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 -g true. goal can be a complex term. In this case, quotes are normally needed to protect it from being expanded by the Unix shell.

-o output
    Used in combination with -b or -c to determine the output file for compilation.

-p alias=pathlist
    Define a path alias for file_search_path/2. pathlist is a "`":"'" separated list of values for the alias. See file_search_path/2 in the SWI-Prolog Reference Manual.

-t goal
    Use goal as an interactive top level instead of the default goal prolog/0. 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 break/0 and abort/0. If you want to stop the user from entering interactive mode, start the application with `-g goal' and give `halt' as the top level.

-x bootfile
    Start from an intermediate code file resulting from a Prolog compilation using the -b or -c option, or created using qsave_program/[1,2].

[+|-]tty
    Switches tty control (using ioctl(2)) on (+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, get_single_char/1 and the tracer will wait for a carriage return.

--  Stops scanning for more arguments.

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.

help
    Equivalent to help(help/1).

help(+What)
    Show a specified part of the manual. What is one of:

    Name/Arity
        give help on the specified predicate

    Name
        give help on the named predicate with any arity or a C interface function with that name.

    Section
        display the specified section of the SWI-Prolog Reference Manual. Section numbers are dash separated numbers: e.g. 2-3 refers to section 2.3 of the manual.

    If Prolog is used together with the GUI tool XPCE, these predicates start a graphical interface, providing a coherent interface to help/1, apropos/1 and explain/1.

FILES
This installation of SWI-Prolog has been configured using the configure option --prefix=@prefix@. If the files listed below are not at the indicated place, the installation has probably been moved. Use

?- current_prolog_flag(home, Home).

to find the local installation directory of SWI-Prolog.

.plrc

~/.plrc
    Personal initialisation files consulted by SWI-Prolog on startup. If both exist .plrc is used.

@prefix@/lib/@PL@-@PLVERSION@/bin/@ARCH@/
    Location for the executables.

@prefix@/lib/@PL@-@PLVERSION@/include/
    Location for the include files. If writeable, SWI-Prolog.h is also copied to @prefix@/include/SWI-Prolog.h.

@prefix@/lib/@PL@-@PLVERSION@/library/
    SWI-Prolog user libraries.

@prefix@/lib/@PL@-@PLVERSION@/boot/
    SWI-Prolog kernel parts written in Prolog. The startup file @prefix@/lib/@PL@-@PLVERSION@/boot32.prc may be recreated using the command from the directory @prefix@/lib/@PL@-@PLVERSION@:

@prefix@/lib/@PL@-@PLVERSION@/doc/packages
    HTML and/or PDF documentation on the installed add-ons.

    bin/@ARCH@/@PL@ -O -o boot32.prc -b boot/init.pl

@prefix@/lib/@PL@-@PLVERSION@/boot32.prc
    Default startup file. This is a `intermediate code' file containing precompiled code from the boot directory. The -xbootfile option may be used to select a different file.

@prefix@/lib/@PL@-@PLVERSION@/runtime/@ARCH@/libpl.a
    SWI-Prolog library for embedding. See also plld(1).

SEE ALSO

The SWI-Prolog web-home at http://www.swi.psy.uva.nl/projects/SWI-Prolog/

Jan Wielemaker SWI-Prolog 4.0 Reference Manualat http://www.swi.psy.uva.nl/projects/SWI-Prolog/Manual/

Documentation on the add-on packages in @prefix@/lib/@PL@-@PLVERSION@/boot/doc

William F. Clocksin & Christopher S. Mellish, Programming in Prolog, fourth edition, Springer Verlag, Berlin 1994.

plrc(1) and plld(1) and xpce(1)

WARRANTY
The software is provided 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.

COPYING
SWI-Prolog is distributed under the General Public Licence version 2, also known as the GPL-2 licence. The license terms are in the file COPYING or on the GNU website at http://www.gnu.org.

In a nutshell, you can modify and use SWI-Prolog as long as you clearly indicate changes, don't change copyright messages and distribute the complete source of your work with every binary copy or make the source in some other form available for free to your users

Especially if you do not wish to distribute the source of your work you may wish to consider optaining a commercial license. Please visit the SWI-Prolog home-page for details.

COPYRIGHT
Copyright (c) 1993-2001 University of Amsterdam.

AUTHOR
Jan Wielemaker