Predefined file_search_path Facts

An example of a directory hierarchy that has a constant structure, but that may be installed at different parts of the file system, is the Quintus installation hierarchy. Several file_search_path/2 facts are defined in the system to support the flexibility of this installation.

The predefined file_search_path/2 facts are dynamic and multifile, so they can be redefined or expanded by users. In the Quintus Prolog Development System installed for a Sparc running Solaris, the following predefined file_search_path/2 facts exist to specify the location of certain Development System related directories:

     file_search_path(quintus,quintus-directory).
     file_search_path(runtime,runtime-directory).
     file_search_path(runtime,'').
     file_search_path(system,'sun4-5').
     file_search_path(system,sun4).
     file_search_path(system,'').
     file_search_path(helpsys,quintus('generic/q3.5/helpsys')).
     file_search_path(helpsys,package(helpsys)).
     file_search_path(qplib,quintus('generic/qplib3.5')).
     file_search_path(library,A) :-
             library_directory(A).
     file_search_path(messages,qplib(embed)).
     file_search_path(language,english).
     file_search_path(demo,quintus('generic/q3.5/demo/bench')).
     file_search_path(demo,quintus('generic/q3.5/demo/chat')).
     file_search_path(demo,quintus('generic/q3.5/demo/curses')).
     file_search_path(demo,quintus('generic/q3.5/demo/math')).
     file_search_path(demo,quintus('generic/q3.5/demo/menu')).
     file_search_path(demo,quintus('generic/q3.5/demo/search')).
     file_search_path(demo,quintus('generic/q3.5/demo/wafer')).
     file_search_path(demo,qplib('IPC/TCP/demo')).
     file_search_path(demo,qplib('IPC/RPC/demo')).
     file_search_path(demo,package(demo)).
     file_search_path(tutorial,quintus('generic/q3.5/tutorial')).
     file_search_path(tutorial,package(tutorial)).
     file_search_path(package,qplib(structs)).
     file_search_path(package,qplib(objects)).
     file_search_path(package,qplib(prologbeans)).
     file_search_path(package,quintus('qui3.5')).
     file_search_path(package,quintus('proxt3.5')).
     file_search_path(package,quintus('proxl3.5')).
     

quintus-directory is the root of the Quintus installation hierarchy. It is the directory where Quintus Prolog is installed, and is also returned by

     | ?- prolog_flag(quintus_directory, QuintusDir).
     

(see ref-lps-flg-cha, for discussion of prolog_flags). The Prolog flag host_type creates the system facts.

The path aliases predefined by the file_search_path/2 facts above have the following interpretation:


quintus
gives the absolute name of the quintus-directory; quintus-directory is the root of the Quintus installation hierarchy;
runtime
set to the value of the runtime prolog_flag/2; in the Development System, the current working directory is also added as a runtime path;
system
gives the name of the system specific directories; see ref-fdi-fsp-sys below for more discussion of the system specific directories;
helpsys
gives the location of the help-system files; only defined for the Development System;
qplib
gives the root directory of the Quintus libraries; see the library_directory/1 facts below;
library
defined in terms of the library_directory/1 facts for compatibility with previous releases;
package
lists Quintus Prolog packages, such as add-ons, for which general file search path facts are defined (e.g. library, helpsys, demo, and tutorial);
messages
gives the location of message files (e.g. QU_messages);
language
gives the name of the current language specific directory. One language specific directory exists under the embeddability directory in the library. This directory contains, for example, the file QU_messages.pl, which thus can be retrieved using the file specification messages(language('QU_messages'));
demo
gives the location of the Quintus Prolog demos;
tutorial
gives the location of the Quintus Prolog tutorials.

Windows note: The syslib file search path is provided to allow standard convention for Windows to be followed when searching for DLLs and libraries specified in load_foreign_executable/1. At startup time, Prolog asserts syslib file search path facts based upon the path specified in the environment variable PATH (as well as a couple of standard locations).

When running qld, the syslib file search path will be initialized to the path specified in the environment variable LIB in order to follow the Microsoft linker convention.

Therefore, the directive

          :- load_foreign_executable(syslib(kernel32)).
          

executed in the Development System will load kernel32.dll from a directory in the PATH environment variable, whereas if it is encountered by qld, the environment variable LIB will be used to locate the import library kernel32.lib.

The syslib file search paths can be modified by user code in the Development System or with the -f and -F options to qld if necessary.

The library directories defined by the system are:

     library_directory(qplib(library)).
     library_directory(qplib(tools)).
     library_directory(qplib('IPC/TCP')).
     library_directory(qplib('IPC/RPC')).
     library_directory(qplib(embed)).
     library_directory(package(library)).
     

Note that these file_search_path/2 and library_directory/1 tables, except for helpsys, are also defined in qpc and qld (see too-too-qpc and too-too-qld).