next up previous contents
Next: 2 Builtins and Primitives Up: RELFUN Guide: Programming with Previous: Contents

1 Getting Started

This section describes the files and the procedure needed to start the RELFUN system.

To install RELFUN, first retrieve the file RELFUN.tar.gz from the url vega/relfun+/rfm-release/ and unpack it with gunzip -c RELFUN.tar.gz | tar xf -, thus creating the directory RELFUN with many subdirectories in your current directory (see the directory tree in appendix H).

Now you should switch to the main RELFUN directory in which you installed the system. In our environment in Kaiserslautern, you need to change to the directory /home/rfm/RELFUN (or at least make a link to it).

In case your LISP system loads the initial file init.lsp, you only need to start LISP. Otherwise you have to load RELFUN by yourself: (load "init.lsp").

Now the RELFUN system will be loaded. If the system was not yet compiled, type (compile-rfm), leave/restart the LISP system (and reload).

Alternatively, you can start the graphical RELFUN interface (see figure 1) by changing to the directory /home/rfm/RELFUN/RFM/tcl and typing drl.

The various parts of the RFM compilation laboratory are:

relfun: the RELFUN interpreter
codegenerator: the code generator, which is needed by the compiler
normalizer and
mode-interpreter are the `horizontal' parts of the compiler
gama: the GWAM, the WAM emulator which executes the output of the compiler, and the GAMA, an abstract machine assembler for the GWAM
index: the index-head codegenerator

Each part of the system resides in its own subdirectory, see appendix H.

Figure 1: The graphical RELFUN interface

Starting RELFUN from LISP:

If all parts of the system are loaded without errors, you should be able to start the RELFUN command loopgif by typing (relfun). To leave the top-level, simply type bye.

If you forgot what you can do, type help without a keyword to get an overview of the available commands, and help ;<command;> to get a detailed description of the command ;<command;>. The information you can get with this online help facility is the same collected in this manual within section 6. You can find this documentation in the directory docu/manual and the help files in docu/help.

Now you are ready to test the system by either

To execute a batch job, put a sequence of commands/goals into a batch file ;<batchfile;>.bat and type exec ;<batchfile;> at the top-level. You can find examples of batch files, including their database files and generated scripts, in the directory demo or its subdirectories.

To consult a database, simply type consult ;<database;>. This will assert the clauses in the file ;<database;> to the current database module. If you do not type an extension, .rf or .rfp will be used, depending on the current syntax mode (see below).

You can now ask for solutions of goals by typing them into the top-level. If a goal unifies with a clause head the clause will be invoked. If the goal returns a result, you can ask for more solutions by typing more or m until you get unknown. For a short introduction, see the file brief-intro.rfp (see section 8), or execute brief-intro.bat.

To restart the computation of a previously entered goal, type ori. This is especially useful if you have executed consult to assert some new clauses and you want to retry a lengthy goal. If you got some experience with the internals of RELFUN, you can spy the computed term conjunctions by executing spy. This will print the remaining goals instantiated in the current environment. You can control the depth of the conjunction printing with the command showdepth. For application programmers the (box-model) trace command will normally be more useful.

If the interpreter runs your program without errors, you can compile the database. To execute a goal as a compiled program, you have to switch to the emulator mode with emul and compile the database by executing compile. The goal should give the same result as in the interpreter mode. The inter command will return to the interpreter mode.

In the above description, we mentioned several file name extensions. Here is a complete list of all standard extensions currently used:

.rf is the default for loading databases in LISP-style syntax.
.rfp is the default for loading databases in PROLOG-style syntax.
.bat is the default if you execute a batch file.
.script is the choice if you do not specify an extension when generating a script of your session.
.tex will be assumed if you type help (with a parameter).gif

These extensions will be used if no other extension is provided. When typing path/file names, you should remember that these are converted to lower case if you do not quote them with double quotes.

next up previous contents
Next: 2 Builtins and Primitives Up: RELFUN Guide: Programming with Previous: Contents

Harold Boley (