.\" -*- nroff -*- .TH swipl 1 "Apr 10, 2015" "SWI-Prolog 7" .SH NAME swipl \- SWI-Prolog 7.3.35 .SH SYNOPSIS .B swipl .RB [ \-\-help | \-\-version | \-\-arch | \-\-dump\-runtime\-variables ] .br .B swipl [options] .IR prolog-file " ... [--] [" arg " ...]" .br .B swipl [options] .RB [ "\-o \fIoutput" ] .BI \-c " file ..." .br .B swipl [options] .RB [ "\-o \fIoutput" ] .BI \-b " initfile ..." The first version provides information about the system and exits immediately. The second version is the primary way to call Prolog on one or more Prolog source file(s) and provide arguments to the application that can be requested using .BR "current_prolog_flag" "(argv, Argv)." The third version is used to create a .I saved state while the last version is used for boot-compilation of the Prolog parts of the system. .SH DESCRIPTION SWI-Prolog is a comprehensive and stable implementation of the Prolog language with a large set of libraries. Among its distinguishing features are mature support for multi-threading, a mature embedded web-server library, graphical development tools (debugger, profiler, cross-referencer, editor), an embedded efficient RDF store, support for XML/SGML/HTML and Unicode. More widely supported features are support for constraint programming, atom garbage collection, interfaces to databases (ODBC), C, C++ and Java (JPL). SWI-Prolog implements the ISO core standard. Many of its extensions are largely compatible to YAP and SICStus Prolog. This manual page only lists the commandline options. Full documentation is available on-line as well as in .BR HTML " and " PDF format from the WWW home page at .B http://www.swi-prolog.org .SH LICENSE INFORMATION SWI-Prolog is distributed under the LGPL (GNU Lesser General Public License) for maximal compatibility with the Free Software movement, while allowing for use with proprietary software components. See the SWI-Prolog home page at .B http://www.swi-prolog.org for details. .SH OPTIONS .TP .B \-\-help Gives a summary of the most important options. .TP .B \-\-version Displays version and architecture information. .TP .B \-\-arch Prints the architecture identifier. .TP .B \-\-dump\-runtime\-variables[=format] Dump information that is generally useful for installation scripts in a form defined by .IR format . Defines formats are .BR sh " (default, bourne shell) and " cmd " (Windows CMD)" . This option is used by .B swipl-ld (1) to fetch necessary information about Prolog. It is normally invoked as .I eval `swipl -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 current_prolog_flag 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/lib/$PLARCH/libswipl.a .TP .B PLLIB CC identifier to link to SWI-Prolog. Typically .B -lswipl .TP .B PLLIBS Additional libraries needed for linking PLLIB .TP .B PLCFLAGS Flags that need to be passed to the C-compiler to generate compatible code. .TP .B PLLDFLAGS Flags that need to be passed to the C-linker for linking embedded executables. .TP .B PLSOEXT Extension used by the hosting operating system for shared objects. On most Unix systems this is "so"; on MS-Windows it is "dll". AIX uses "o", HPUX "sl". .TP .B PLSOPATH Environment variable used by the hosting operating system to extend the search path for shared objects. For example, on ELF systems this is "LD_LIBRARY_PATH" and on MS-Windows it is "PATH". .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. .TP .B PLTHREADS Has the value .B yes if Prolog was compiled for multi-threading and .B no otherwise. .RE .TP .BI \-G size [kmg] Sets the global stack size to .I size. The default is 128 Mbytes (64-bit machines: 256 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 \-L size [kmg] 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. SWI-Prolog performs last-call optimisation to minimize the local stack requirements. If the argument ends in .B m , the argument is interpreted in Mbytes. A .B g suffix is interpreted in Gbytes (64-bit machines only). This flag sets the maximum value to which the stack is allowed to grow (default 128 Mbytes for the 32-bit version and 256 Mbytes for the 64-bit version). 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 set_prolog_flag/3 in the SWI-Prolog Reference Manual. .TP .BI \-T size [kmg] Sets the trail stack size to .I size K bytes. The default is 128 Mbytes (64-bit machines: 256 Mbytes). 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 "`" .swiplrc "'. `" "-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 program 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 \-s " file" Load .I file as a script. This option may be used from the shell to make Prolog load a file before entering the toplevel. It is also used to turn a file into an executable Prolog script on Unix systems using the following first line .RS .TP .BR #!/usr/bin/swipl " option ... " \-s .RE .TP .BI \-l " file" Load .I file as a script. This is a synonym for .I \-s that is compatible with several other Prolog implementations. If multiple .IR \-s " or " \-l arguments are provided, all specified files are loaded in the order in which they appear on the argument list. .TP .B \-\-quiet \-q Operate silently. This option suppresses all .I informational messages. .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 suppressed 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 \-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 \-\-nosignals Disable handling of signals. Often used if SWI-Prolog is embedded in another application on Unix systems. .TP .B \-\- Stops scanning for more arguments. .SH ENVIRONMENT VARIABLES .TP .I SWI_HOME_DIR Location for finding the startup file boot64.prc and the libraries. Normally discovered from the executable or configured default location. Providing the value through the environment may be needed if SWI-Prolog is embedded into another executable. .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 ?- current_prolog_flag(home, Home). .P to find the local installation directory of SWI-Prolog. .TP .I ~/.swiplrc Personal initialisation files consulted by SWI-Prolog on startup. If both exist .I .swiplrc is used. .TP .I /usr/lib/swipl-7.3.35/bin/amd64/ Location for the executables. .TP .I /usr/lib/swipl-7.3.35/include/ Location for the include files. If writable, SWI-Prolog.h is also copied to /usr/include/SWI-Prolog.h. .TP .I /usr/lib/swipl-7.3.35/library/ SWI-Prolog user libraries. .TP .I /usr/lib/swipl-7.3.35/boot/ SWI-Prolog kernel parts written in Prolog. The startup file /usr/lib/swipl-7.3.35/boot64.prc may be recreated using the command from the directory /usr/lib/swipl-7.3.35: .RS .TP bin/amd64/swipl \-O \-o boot64.prc \-b boot/init.pl .RE .TP .I /usr/lib/swipl-7.3.35/doc/packages HTML and/or PDF documentation on the installed add-ons. .TP .I /usr/lib/swipl-7.3.35/boot64.prc 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/swipl-7.3.35/runtime/amd64/libpl.a SWI-Prolog library for embedding. See also .I plld(1). .SH SEE ALSO .PP The SWI-Prolog web-home at .I http://www.swi-prolog.org .PP Jan\ Wielemaker .IR "SWI-Prolog Reference Manual" " at" .I http://www.swi-prolog.org/pldoc/index.html .PP Documentation on the add-on packages in .I /usr/lib/swipl-7.3.35/boot/doc .PP William\ F.\ Clocksin & Christopher\ S.\ Mellish, .IR "Programming in Prolog" , fourth edition, Springer Verlag, Berlin 1994. .PP .BR swipl-rc "(1) and " swipl-ld "(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 non infringement. 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 COPYING SWI-Prolog is distributed under the LGPL (GNU Lesser General Public License). The license terms are in the file .I COPYING or on the GNU website at .I http://www.gnu.org. .SH COPYRIGHT Copyright (c) 1986\-2015 University of Amsterdam, VU University Amsterdam .SH AUTHOR Jan Wielemaker