Quintus Prolog Manual


(PREV) (No Next)

n-1: Command Line Utilities

The reference pages for the Quintus supplied command line utilities follow, in alphabetical order.




     prolog(1)



     qcon(1)



     qgetpath(1)



     qld(1)



     qnm(1)



     qpc(1)



     qplm(1)



     qsetpath(1)



     qui(1)





Once these files are installed in library(q3.3), you can access them on-line by typing, for example,


        % man qpc



Refer to {manual(a-3)} for the location of these reference pages in the Quintus directory hierarchy.

n-1-0:

prolog - Quintus Prolog Development System

Synopsis:

          prolog [ +f ] [ +l file ] [ +L file ] 

          

               [ +p [path-name] ] [ +P [path-name] ] [+tty ]

               [ +z user's-arguments | + [emacs-arguments] ] 

          
Description:
Options:
Any argument which does not match options described in this section and does not start with a + is regarded as a user's argument. The user's arguments may be obtained using the prolog command unix(argv(ListOfArgs)). If a user's argument needs to begin with a +, it should be issued as ++ instead or given after the +z option. Double pluses will be translated into a single plus, so the user's code will not see the ++. Arguments beginning with + are reserved for prolog, and an unrecognized argument starting with a + is treated as an error.
+ emacs-arguments
Invoke Quintus Prolog with the Emacs interface. Any arguments following + are taken as arguments to the Emacs editor. If the environment variable QUINTUS_EDITOR_PATH is set then that Emacs invoked. Otherwise, by default, GNU emacs is assumed to be in the path as "emacs".
+f
Fast start. The initialization file $HOME/prolog.ini will not be read upon startup.
+l file
Load the specified file upon startup. file can be a Prolog or a QOF file, and it may be specified either as a string (eg. 'file', '~/prolog/file.pl) or as a file search path specification (eg. 'library(file)', 'home(language(file))'). Note, however, that the latter needs to be quoted to escape the shell interpretation of the parentheses. Giving the extension is not necessary; if both source (.pl) and QOF (.qof) files exist, the more recent of the two will be loaded.
+L file
Similar to +l but the user's environment variable PATH will be searched for the specified file.
+p [path-name]
Print the Prolog file search path definitions that begin with the string path-name (eg. library if "+p lib" is specified); path-name is optional, and if not given, all file search path definitions are printed; prolog exits after producing the required output to stdout.
+P [path-name]
Similar to +p, but the absolutized versions of the file search path definitions are printed.
+tty
Force the three standard stream associated with a Prolog process to act as tty streams. A tty stream is usually line buffered and handles prompt automatically.
+z user's-arguments
Any arguments following +z are taken as user's arguments. User's arguments can then be obtained through unix(argv(ListOfArgs)).
Environment:
HOME
Login home directory of user.
PAGER
A program to use for interactively delivering the help-system's output to the screen. The default is either more or pg depending on the host operating system.
PATH
Directories to search for the executables and saved-states.
QUINTUS_LISP_PATH
Full pathname for the emacslisp directories. The default is: <quintus-directory>/editor3.3/gnu.
QUINTUS_EDITOR_PATH
Full pathname of the GNU Emacs executable. By default the command "emacs" is looked for in your path.
SHELL
Default shell interpreter to be used for Prolog commands unix(shell) and unix(shell(<command>)).
Files:
file.pl
Prolog source file
file.qof
Quintus Object File (QOF) files
$HOME/prolog.ini
Quintus Prolog initialization file
/

Temporary files for loading foreign object files and for Emacs editor interface.
<quintus-directory>/license<quintus-version>
Location of license files
See Also:
qgetpath(1), qld(1), qpc(1), qsetpath(1), unix/1, QP_initialize()
{manual(g-3)}

qcon - QOF consolidator

Synopsis:

           qcon [ -wx ] -o output-filename    

          
Description:
Options:
-w
Normally, qcon issues warning messages for undefined procedures. This option instructs qcon to suppress such messages.
-x
This option instructs qcon to issue warnings regarding procedures that are either not called or not defined. -x overrides the -w option.
-o output-filename
This option is used to specify a name for the object file.
See Also:
qld(1), qnm(1), qpc(1), qsetpath(1)

qgetpath - Get parameters of Quintus utilities and runtime applications

Synopsis:
qgetpath [ -abhqr ] filename ...
Description:
Options:
-a
Display the <add-ons string> in the specified executables.
-r
Display the <runtime directory> in the specified executables.
-q
Display the <quintus directory> in the specified executables.
-h
Display the <host type> in the specified executables.
-b
Display the <banner message> in the specified executables
See Also:
prolog(1), qsetpath(1)

qld - QOF link editor

Synopsis:

          qld [-cCdDEghkNqrRsSvwWx] [ -o output ] [ -llibrary ]

          

              [ -L library-directory ] [ -a quintus-product ]

              [ -f path-name:path-spec ]

              [ -F path-name:path-spec ]

              [ -p path-name ]

              [ -P path-name ]

              filename ... [ -LD ld-options ]

          

          
Description:
Options:
-a quintus-product
Specifies that the libraries for a particular Quintus product which is sold separately are to be used. These Quintus products are normally installed in the 'quintus-directory'. List this directory to find the valid directory names for these products. This option is equivalent to one or more -L switches. Note that the libraries shipped with Quintus Prolog (qui, proxt, and proxl) are automatically available in the system, and, therefore, require no -a flag.
-c
If this option is specified, qld terminates after producing a machine object (".o") file. It does not call cc(1) to produce an executable image. If an output file name is not specified with the -o option, the file is named a.o. No foreign files, eg. foreign dependencies, are included in the output file. The resulting object file may be passed to qld again on a different command (with -N), or it may be passed directory to the linker.
-d
This flag is always used when qpc(1) calls qld. It causes all QOF files on which any of the specified files depends to be linked in as well, and any machine object files on which any of the linked QOF files depends to be passed to cc(1). A QOF file depends on another QOF file if the source for the first contains an embedded command to load the source of the second. A QOF file depends on an object file if its source contains an embedded load_foreign_files/2 or load_foreign_executable/1 command of the object file.
-f path-name:path-spec
Similar to the -L option, but path-name:path-spec defines a general file search path which instructs qld to look for a file in directory path-spec whenever a file specification of the form path-name(file-spec) is encountered in QOF file dependencies or on the command line. The path-name and the directory, path-spec, are separated by a colon (':'), and, therefore, path-name cannot contain a colon. If path-spec is given in the file search path form (as in "library:mylib(library)"), then the argument must be quoted to escape the shell's interpretation of the parentheses. path-spec may be '.' or null, in which case '.' is assumed. There may be a list of path definitions (ie. -f or -F options) for the same path-name. Qld searches the list, just like prolog and qpc, whenever it needs to expand a file search path specification. The -f options appends (like assertz in prolog and qpc) the new path to the end of the list of paths for path-name, while -F prepends (like asserta in prolog and qpc).
-g
This option is not used by qld, but is intended for the linker. If some of the specified object files or object dependency files are compiled with the debug flag, this option should be specified to preserve the debugging information in the executable.
-h
Hides or "locks" the predicates in the file so that they are not visible to the debugger. Such predicates will have predicate_property "locked" when they are linked or loaded into a Prolog system.
-k
With this option, the intermediate files are not deleted.
-llibrary
This option is not used by qld, but is intended for the linker, which is called to link with the specified library to product the executable.
-o output
The default output file names may be overridden using this option. For executable files, the default name is a.out. With the -r or -R options, the default name is a.qof. With the -c or -C options, the default name is a.o.
-p path-name
The files search path definitions for path-name are printed. If path-name is * then all file search path definitions are printed.
-q
Like the -r option but also adds a Kernel QOF file qprte.qof or qprel.qof. This option should very rarely be necessary.
-r
If this option is specified, qld terminates after linking together all the specified QOF files to make a new QOF file. No Kernel QOF file is not linked in. If an output file name is not specified with the -o option, the file is named a.qof. If -d is not used in conjunction with this option, then it is recommended that the output file, as specified by the -o option, be in the current working directory. This way, any dependencies of the output QOF file on other files will be correct. Otherwise, the dependencies would only be correct when absolute, as opposed to relative, paths had been specified in the sources. This matters only if this file is to be used in a future call to qld with the -d option specified.
-s
This option is not used by qld, but is intended for the linker, which is called to actually generate the executable. The -s option instructs the linker to strip the executable. NOTE: that once the executable is stripped then the dynamic foreign interface including the Prolog builtins load_foreign_files/2 and load_foreign_executables/1 cannot work.
-v
When this option is specified, qld echoes its activities, including calls to subcomponents and ld.sh
-w
This option suppresses warnings regarding undefined procedures.
-x
When this option is specified, qld gives warnings about the predicates which are not called, as well as those which are undefined. Also, a warning message will be printed if either of the user-definable predicates (portray/1 and user_error_handler/4) is undefined. (Such warnings are normally suppressed for these predicates.) The -x option overrides the -w option.
-C
Same as -c, except that the object dependencies of qof files are also linked into the created object file. The object file so produced can be directly passed to cc(1), ld(1), or qld (with the -N option) to generate the executable.
-D
If this option is used, qld links the specified files with the Quintus Kernel rather than the Quintus Runtime Kernel. The Development Kernel QOF file, <runtime directory> /qprel.qof, is linked with the specified QOF file, and the Development Kernel object file, <runtime directory>/qprel.o, is passed to cc(1). The -D option may not be used in conjunction with the -E option.
-E
This option tells qld to link the specified files with the Quintus Extended Runtime Kernel rather than the Quintus Runtime Kernel. The Extended Runtime Kernel is an add-on product available separately from Quintus that allows the Quintus Prolog compiler and dynamic foreign interface to be used in runtime systems. The Extended Runtime Kernel QOF file, <runtime directory>/qprex.qof, is linked with the specified QOF file, and the default Kernel object file, <runtime directory/qprte.o, is passed to cc(1). The -E option may not be used in conjuction with the -D option.
-F path-name:path-spec
Similar to -f, but the path is added at the front of the list of paths for path-name. Note that '-F library:library-directory' is identical to '-L library-directory'.
-L library-directory
File specifications of the form library(Filespec) are searched for in the library search paths when that file is linked. The initial search paths are the same as in the Development System (see prolog(1)). Additional directories may be prepended to the list of library search paths with this option. Note that the command line is parsed from left to right. Also note that the -L must be followed by a space; otherwise, qld assumes that the option specifies a library directory for the linker. Library directories may also be specified with the -f and -F options. Note that library-directory may be a path to a directory (eg. dir, ~/dir) or a file search path specification of the form "mylib(library)". In the latter case, the path-name "mylib" must be defined by a -f or -F option.
-Ldirectory
UNIX only. Same as the -L option of cc(1) and ld(1), and specifies a directory in which the linker looks for library files. This option is simply passed to the linker.
-LD
All remaining options are simply passed to the linker.
-N
Don't link in any Kernel files (qprel.qof/qprel.o, qprex.qof/qprte.o or qprte.qof/qprte.o) from the runtime directory. This option is only useful for producing an executable image from a machine object (".o") file that was created from QOF files using qld (see -C).
-P path-name
Similar to -p, but the absolutized versions of the file search paths are also printed.
-R
Similar to -r, but it does not include the resulting dependencies. This flag is mainly useful for clearing the dependencies from the QOF file (for example, when they get absolutized by save_program/[1,2] or save_modules/2).
-S
Use static object files instead of shared object files. Where a qof file contains a dependency on a shared object file with a .so extension, if an archive file exists with the same name but with a .a extension, then this is substituted for the shared object file in the call to the linker. Note that if the shared object file that is being substituted contains dependencies to other shared libraries then these have to be included in the qld command line. Running ldd(1) on a shared object file will indicate whether it has such dependencies.
-W
Windows NT only. Pass the argument -subsystem:windows, instead of -subsystem:console, to the linker so that a Windows based executable is generated rather than a Console-based executable.
Environment:
TMPDIR
Directory for creating temporary files. The default is / usr/tmp.
Files:
file.qof
Quintus Object File (QOF) files
$TMPDIR/

.{qof,o} intermediate QOF and object files
<runtime directory>/qcon
the QOF consolidator
<runtime directory>/qprel.o
Development Kernel object code
<runtime directory>/qprte.o
Runtime Kernel object code
<runtime directory>/qprel.qof
Development Kernel QOF code
<runtime directory>/qprte.qof
Runtime Kernel QOF code
<runtime directory>/qprex.qof
Extended Runtime Kernel QOF code
<runtime directory>/ld.sh
Front End script to ld(1) (UNIX only)
See Also:
cc(1), ld(1), qcon(1), qgetpath(1), qnm(1), qpc(1), qsetpath(1)

qnm - print QOF file information

Synopsis:

          qnm [-PADFMU] [ [-m module] [-n name] [-a arity]]    

          

            [-p proc#] [-o] filename ...

          

          
Description:
Options:
-P
Print information about all procedures that are defined or called in each QOF file.
Information for a procedure is preceded by a decimal number that is unique for that QOF file. This is followed by letter codes indicating the procedure state and properties. The letter codes are:
U
undefined
S
static
D
dynamic
M
multifile
F
foreign
V
volatile
L
locked
If the procedure is neither foreign nor multifile, the second letter is omitted.
The state and property information is followed by the module, name and arity of the procedure, in the format "module:name/arity". Procedure information is sorted alphabetically by procedure name. Internal procedure names and modules that have been made anonymous are printed as "$anon".
-A
Print all atoms referenced in each QOF file. Each atom is preceded by a number that is unique for that QOF file. Atoms are sorted alphabetically. Internal atoms that have been made anonymous are printed as "$anon".
-D
Print the names of all QOF or object files and UNIX library directories on which each QOF file depends.
-F
Print the number of source files contained in the QOF file.
-M
Print information about modules contained in the QOF file. This information consists of the name of each module, its export list, and its meta-predicates.
-U
Print information about all procedures that are called but not defined in each QOF file. Information about undefined procedures is in the same format as when using the -P flag.
-m module
Print information about procedures in module module. This option may be used in conjunction with the -n and -a options.
-n name
Print information about procedures named name. This option may be used in conjunction with the -m and -a options.
-a arity
Print information about procedures with arity arity. This option may be used in conjunction with the -m and -n options.
-p proc#
Print information about the procedure numbered proc#. Procedure numbers are as given by the -P option.
-o
Prepend to each output line the name of its QOF file. The -o flag may be used in addition to any valid combination of options.
See Also:
nm(1), qpc(1), qld(1)

qpc - Quintus Prolog compiler

Synopsis:

          qpc [-cvhDHMN] [-o output] [-i initialization-file]  

          

               [ -L library-directory ] [ -a quintus-product ]

               [ -f path-name:path-spec ]

               [ -F path-name:path-spec ]

               [ -p path-name ]

               filename ...  [ -QLD qld-options ]

          

          
Description:
Options:
-a quintus-product
Specifies that the libraries for a particular Quintus product which is sold separately are to be used. These Quintus products are normally installed in the 'quintus-directory'. List this directory to find the valid directory names for these products. This option is equivalent to one or more -L switches. Note that the libraries shipped with Quintus Prolog (qui, proxt, and proxl) are automatically available in the system, and, therefore, require no -a flag.
-c
The input files are simply compiled into QOF format, and no further processing takes place.
-f path-name:path_spec
Similar to the -L option, but path-name:path-spec defines a general file search which instructs qpc to look for a file in directory path-spec whenever a file specification of the form path-name(file-spec) is encountered (in embedded load commands, in QOF file dependencies, or on the command line). The path-name and the directory, path-spec, are separated by ':', and, therefore, path-name cannot contain a colon. If path-spec is given in the file search path form (as in "library:mylib(library)"), then the argument must be quoted to escape the shell's interpretation of the parentheses. path-spec may be '.' or null, in which case '.' is assumed. There may be a list of path definitions (ie. -f or -F options) for the same path-name. Qpc searches the list, just like prolog, whenever it needs to expand a file search path specification. The -f options appends (like assertz in prolog) the new path to the end of the list of paths for path-name, while -F prepends (like asserta in prolog). File search paths may also be defined using asserts in the Prolog source being compiled or in initializaiton files (see -i). The -f, -F, -L, and -a options given on the qpc command line, and file_search_path and library_directory definitions asserted in source files or initialization files, are passed on to qld(1).
-h
Hides or "locks" the predicates in the file so that they are not visible to the debugger. Such predicates will have predicate_property "locked" when they are linked or loaded into a Prolog system.
-i initialization-file
Specifies an initialization file. The initialization file may be a source (.pl) or QOF (.qof) file. Currently, source files cannot load foreign code; in other words, they cannot contain calls to load_foreign_files/2 or load_foreign_executable/1. The definitions in the initialization file apply during the compilation of all files specified to the right of the -i switch on the command line. The definitions in the initialization file apply only during compile time. Therefore, no QOF file is generated from an initialization file and its content is not included in any of the generated QOF files. The initialization file may be specified in the file search path form (eg. '-i "library(basics)"').
-o output
Specifies a name for the output file. If used with the -c option, the qof file will be produced into the given file. In this case, there may be several -o options for each qof file. If the -o names a directory, all qof files will be placed in the given directory. If the -c option is not used, the -o is passed onto qld.
-p path-name
This option is just passed to qld along with its argument, asking qld to print out the file search definition for path-name.
-v
When this option is specified, qpc echoes its activities, including the call to qld(1), to the standard output. This flag is also passed on to qld.
-D
This option is just passed to the linker qld indicating that the Quintus Development System should be linked in.
-F path-name:path-spec
Similar to -f, but the path is added at the front of the list of paths for path-name. Note that '-F library:library-directory' is identical to '-L library-directory'.
-H
Like -h but in this case the hiding (locking) is done also to any files that are compiled because of embedded load commands in the file.
-L library-directory
File specifications of the form library(Filespec) encountered in embedded load commands are searched for in the library search paths. The initial search paths are the same as in the Development System (see prolog(1)). Additional directories may be prepended to the list of library search paths with this option. Note that the command line is parsed from left to right. Also note that the -L must be followed by a space; otherwise, qpc assumes that the option specifies a library directory for ld(1). Library directories may also be specified with the -f and -F options. library-directory may be a path to a directory (eg. dir, ~/dir) or a file search path specification of the form "mylib(library)". In the latter case, the path-name "mylib" must be defined either in the Prolog source code being compiled or by -f or -F options.
-M
Specifies that files on the command line are not to be compiled if their corresponding QOF files are more recent than they are.
-N
Specifies that files specified in embedded load com- mands are not to be compiled. (By default they would be compiled unless their QOF files are already up-to- date.)
-QLD
All remaining options are simply passed to qld.
Environment:
TMPDIR
Directory for creating temporary files. The default is / usr/tmp
Files:
a.out
Executable output file
a.qof
Output QOF file if filename is '-'
file.pl
Prolog source file
file.qof
Quintus QOF file
$TMPDIR/

Compiler temporary files
<runtime directory>/qld
QOF link editor
<runtime directory>/qcon
QOF consolidator
See Also:
prolog(1), qcon(1), qgetpath(1), qld(1), qnm(1)

qplm - Quintus Prolog license manager

Synopsis:

          qplm -i SiteName

          

          qplm -a Product Users [ Expiration ] Code

          

          qplm -d User Product

          

          qplm -p

          
Description:
Options:
-i SiteName
Initializes the license files for SiteName, where SiteName is a number of arguments comprising the site or company name. This command must be executed before any products are added.
-a Product Users Expiration Code
Adds a products to the license file. The product is typically of the form <name>/<arch>/<version>, Users is the number of users allowed to use the product. Expiration is an optional argument specifying when the license will expire. The final Code argument is a 16 character code that is based on the SiteName, Product, Users and Expiration.
-d User Product
Deletes User from the list of users who use Product. When a user no longer uses Product, he or she can be removed from the license file with this option.
-p
Print the information in the license file. This prints the site name followed by all of the products licensed. This also prints the list of users using each product. For occasional users, the number of times they have used the product is also shown.
Example:
To initialize the license file:

              qplm -i Hallatrow Designers Inc.



           

To add a 2 user license for Prolog that expires on 17 May 1994,


    qplm -a prolog/hppa/3.3 2 94-05-17 thiscodewontwork



          
Files:
license.qof
Contains the site name and product codes
users.qof
Records the users using the products
The license files are maintained in the license<version> subdirectory of <quintus-directory>. The users.qof file must be writable by all users, therefore if the <quintus-directory> is stored on a read-only file system then the license subdirectory should be made into a symbolic link to a writable directory.
See Also:
prolog(1),

qsetpath - Set parameters of Quintus utilities and runtime applications

Synopsis:

          qsetpath [ -aadd-ons ] [ -rruntime-directory ]    

          

          [ -qquintus-directory ] [ -hhost-type ]

                    [ -bbanner-message ] filename ...

          

          
Description:
Options:
-aadd-ons
Set the add-ons identification string of the specified executables to <add-ons string>.
-rruntime-directory
Set the <runtime directory> of the specified executables to runtime-directory. The specified runtime- directory must be an absolute path.
-qquintus-directory
Set the <quintus directory> of the specified executables to quintus-directory. The specified quintus- directory must be an absolute path.
-h/host-type
Set the <host type> of the specified executables to host-type. There must be a "/" proceeding host-type. A host-type should be in the form of <machine type>, <machine type>-<major O.S. version>, or <machine type-<major O.S. version>.<minor O.S. version>.
-bbanner-message
Set the displayed banner message for the specified executables to banner-message.
Errors:
See Also::
prolog(1), qgetpath(1), qld(1)

qui - Quintus User Interface

Synopsis:

          qui [ +f ] [ +l file ] [ +L file ] 

          

              [ +p [path-name] ] [ +P [path-name] ]

                    [ X-window arguments ]

                    [ +z users arguments ] 

          
Description:
Options:
Any argument which does not match options described in this section and does not start with a + is regarded as a user's argument. The user's arguments may be obtained using the prolog command unix(argv(ListOfArgs)). If a user's argument needs to begin with a +, it should be issued as ++ instead or given after the +z option. Double pluses will be translated into a single plus, so the user's code will not see the ++. Arguments beginning with + are reserved for prolog, and an unrecognized argument starting with a + is treated as an error.
+f
Fast start. The initialization file $HOME/prolog.ini will not be read upon startup.
+l file
Load the specified file upon startup. file can be a Prolog or a QOF file, and it may be specified either as a string (eg. 'file', '~/prolog/file.pl') or as a file search path specification (eg. 'library(file)', 'home(language(file))'). Note, however, that the latter needs to be quoted to escape the shell interpretation of the parentheses. Giving the extension is not necessary; if both source (.pl) and QOF (.qof) files exist, the more recent of the two will be loaded.
+L file
Similar to +l but the user's environment variable PATH will be searched for the specified file.
+p [path-name]
Print the Prolog file search path definitions that begin with the string path-name (eg. library if "+p lib" is specified); path-name is optional, and if not given, all file search path definitions are printed; prolog exits after producing the required output to stdout.
+P [path-name]
Similar to +p, but the absolutized versions of the file search path definitions are printed.
X-Window arguments
Any arguments recognized as standard X options are passed to the X-Window system. Examples of these include -display displayname, -fg color, -bg color.
+z user's-arguments
Any arguments following +z are taken as user's arguments. User's arguments can then be obtained through unix(argv(ListOfArgs)).
Environment:
QUINTUS_EDITOR_PATH
Name of the GNU Emacs command. If set, this is invoked as the editor rather than the standard text editor built in to QUI.
QUINTUS_LISP_PATH
Full pathname for the emacs lisp directories. The default is: <quintus-directory>/editor3.3/gnu.
See Also:
prolog(1)
{manual(c-1)}


Copyright (C) 1997 AI International Ltd
contact: product support sales information