Modula-2 || Compiler & Tools || Library || Search Engine
Files to be consulted must end in `.pdb' (prolog database) and are to be given without suffix. The search path may be specified by the environment variable PROLOGPATH (like PATH a list of directories separated by colons). If not found this way the file will be searched for in /usr/local/lib/prolog.
If not overrided by option -s the file startup will be consulted at the beginning. Using PROLOGPATH it is possible to have an individual startup file:
After having read the startup file, prolog consults the given file arguments (without suffix) in that order, and starts (if not suppressed by -i) the interactive mode.
During interactive mode every goal is newline-terminated (a dot is not necessary). An empty line causes the interpreter to enter the meta mode, which allows either to leave the interpreter, to purge the database, or to continue. During goal proving interrupts (BREAK-key or ^C on some terminals) allow to abort current action, or to toggle tracing. Abortion can be time consuming due to space deallocation.
Modula--Prolog allows to implement Prolog clauses in Modula-2. Such a module containing Modula-2 implemented clauses can be linked to the interpreter this way:
The implementation module clauses.m2 (the name can be freely choosen) contains the clauses. MPImports serves as importing link between the interpreter module and the own module. It is imported by the interpreter and should consist of imports only.
Following clauses are implemented in MPUNIX which is imported by the default version of MPImports.m2:
shell(C) | when C is instantiated to an atom it is interpreted as an shell command |
listlength(L,I) | succeeds if L is a list with I elements |
listelement(L,I,V) | succeeds if the I-th elements of L equals to V. |
/usr/local/lib/prolog/startup.pdb | default startup file |
/usr/local/lib/prolog/lists.pdb | further utilities |
/usr/local/lib/prolog/sets.pdb | |
/usr/local/lib/prolog/utility.pdb | |
/usr/local/lib/prolog/libprolog.a | Modula--Prolog library |
/usr/local/lib/prolog/SYM | |
/usr/local/lib/prolog/REF |
This manual page is due to Andreas Borchert.
Modula-2 || Compiler & Tools || Library || Search Engine