# This document describes the Terzo Loader. # It was written by Philip Wickline . # Comments, corrections, and suggestions are welcomed. Loader Commands --------------- The loader is a very simple interface to the lambda prolog module-reading and query engines. It accepts commands which consist of a initial command word, zero or more arguments, and a terminating period. White space is ignored, and strings, switch identifiers, and module identifiers are the only recognized datatypes. Strings and module identifiers are the same as defined for the lambda prolog language, and switch identifiers are the same as lcid's in the lambda prolog language (see the file lexical for details). In the following text arguments to commands will be surrounded by angle-brackets(<>). All loader commands begin with a hash mark (#). The possible loader commands are: #load . If is a absolute path, then the loader attempts to read as a loader script, just as if the contents of the file had been read from the standard input. If is not absolute, the loader appends each path contained in the path switch variable (see below) to and the attempts to read the resulting path and file, until a file is successfully found. #show . Displays the value of the switch designated by . Signals an error if does not exist. #show. Displays the value of all switches known to the system. #set ... . Each is a strings or switch identifier, and n >= 1. Sets the value of the switch to the string obtained by concatenating the string value of each . The string value of a string is simply the string itself, while the string value of a switch identifier is the value of that switch if the switch exists, and undefined otherwise. For example: Terzo> #show path. path /usr/local/lib/lProlog/ /stuff/ Terzo> #set path "/home/me/my_lProlog_files/ " path. Terzo> #show path. path /home/me/my_lProlog_files/ /usr/local/lib/lProlog/ /stuff/ #begin. Tells the loader to read zero or more modules declarations from the current input stream, until a matching #end statement is read. See #end. #end. Tells the loader to stop reading module declarations from the current input stream. See #begin. #query . is a comma separated list of module names, and is any term. Initiates the single query against the context formed by merging the modules in . #query . Starts an interactive read-query-print loop with the context formed by merging the modules in . #query. Starts an interactive read-query-print loop with the System module as the context. #quit. Exists the Terzo interpreter. Loader Switches --------------- The Loader switches are set and displayed with the #set and #show commands. They are: path The path variable is intended to contain a list of directories in which the loader should search for files when the the #load command is used. It is initially set to the value of the environment variable $TERZO_PATH, if it is set, and /usr/local/lib/Terzo/lib otherwise. print_sigs This variable controls whether or not a module's signature is printed when it is read. The valid values of this switch are "on" and "off". It is initially set to "off". primary_loader_prompt The value of this variable is printed as a primary prompt at the loader level. Initially set to "Terzo> ". secondary_loader_prompt The value of this variable is printed as a secondary prompt at the loader level. Initially set to " > ". print_abst_types This variable controls whether or not the types of bound variables are printed when printing abstractions. The only valid values of this switch are "on" and "off". Initially set to "off". print_types This variable controls whether or not the types of answer substitutions are printed with the substitution. The only valid values of this switch are "on" and "off". Initially set to "off". primary_query_prompt The value of this variable is printed as a primary prompt at the interactive query interpreter level. Initially set to "?- ". secondary_query_prompt The value of this variable is printed as a secondary prompt at the interactive query interpreter level. Initially set to " - ". off Evaluates to "off". Cannot be set. on Evaluates to "on". Cannot be set. all_solutions Controls whether or not all possible solutions to a query are searched for immediately, without prompting. The only valid values of this switch are "on" and "off". Initially set to "off". warn_positive_built_in If the value of this variable is set to "on" a warning is printed when a constant is declared in a module which has a positive occurrence of a built in type in its type. For instance, if mod1 has a constant f with type int -> int, then the following message will be printed when mod1 is elaborated: Warning: Positive occurrence of built-in kind "int" found in type of "f". This warning is intended to make it easier to spot constants which will cause trouble with the 'is' predicate. The only valid values of this switch are "on" and "off". Initially set to "on".