next up previous contents
Next: 4.1 Procedure level Up: RFM Manual: Compiling RELFUN Previous: 3.2.7 Footening

4 The classifier


The classifier's task is to extract information (e.g. about the kinds of clauses and variables) from the program (database) that enables the code generator (vertical compiler) to produce efficient RFM (WAM) instructions. This information, often implicit in compilers, is here explicitely represented in the declarative intermediate language Classified Clauses; for this the classifier extends normal RELFUN source clauses with numerous declarations on different levels of description. The following short introduction is based on the current implementation status of the Classified Clauses. A more detailed introduction of an earlier version is presented (in German) in [Kra90]. This section briefly describes the Classified Clauses by stepwise refinement; in section 4.7 the description grammar is given in an EBNF syntax.

In Classified Clauses we distinguish six levels of description, namely the database, procedure, clause, chunk, literal, and term levels. A database consists of an unordered set of procedures each consisting of an ordered set of clauses. All clauses of one procedure have the same name and arity. Name and arity yield the procedure name `name/arity'. For example, the clause foo(V,W) belongs to the procedure foo/2.

The Classified Clauses for a RELFUN program (database) are accordingly defined as follows:

classified_database ::= (dbgif {classified_procedure}*)

Harold Boley (