RML(1)

NAME
rml - compiler and interpreter for RML specifications

SYNOPSIS
rml [-Ofol] [-no-Ofol] [-Ocps] [-no-Ocps] [-Ocode] [-no-Ocode] [-O] [-no-O] [-East] [-no-East] [-Efol] [-no-Efol] [-Ecps] [-no-Ecps] [-Eplain] [-Eswitch] [-Ediff] [-Esml] [-Tonly] [-f(no-)implicit-let] [-f(no-)reorder] [-W(no-)non-exhaustive] [-v] file.rml ...

rml -i file.rml ... [-- args...]

DESCRIPTION
rml compiles each named RML file to a C or SML file. The options allow optimizations to be turned on or off, and also allow inspection of intermediate data in the compiler.

When invoked with -i as its first option, rml will parse and typecheck the given RML modules. They are then loaded by the RML interpreter, after which relation Main.main will be invoked with a list of strings containing the remaining command-line options.

OPTIONS
Options and file name arguments may be freely mixed. Arguments are processed from left to right. The options offered by the rml compiler are the following:

-Ofol (-no-Ofol)
    Enables (disables) optimizations of the FOL (First-Order Logic) intermediate representation. Enabled by default.

-Ocps (-no-Ocps)
    Enables (disables) optimizations of the CPS (Continuation-Passing Style) intermediate representation. Enabled by default.

-Ocode (-no-Ocode)
    Enables (disables) optimizations of the low-level code intermediate representation. Enabled by default.

-O (-no-O)
    Enables (disables) all optimizations.

-East (-no-East)
    Enables (disables) output of the AST (Abstract Syntax Tree) intermediate representation. Disabled by default.

-Efol (-no-Efol)
    Enables (disables) output of the FOL intermediate representation. Disabled by default.

-Ecps (-no-Ecps)
    Enables (disables) output of the CPS intermediate representation. Disabled by default.

-Eplain
    Default. Chooses `plain' code generation style.

-Eswitch
    Chooses `switch' code generation style.

-Ediff
    Chooses `diff' code generation style.

-Esml
    Instead of emitting C code, the intermediate CPS form is output as executable SML code. This backend supports most of the RML language, except logical variables or higher-order relations. The generated code takes the form of a number of signatures and functors, all of which depend on the rml runtime structure.

-Tonly
    Only perform syntatic and semantics checks. Do not generate any code.

-fno-implicit-let (-fimplicit-let)
    Controls how a goal var = exp, where the left-hand-side variable is unbound, is interpreted. Under the old semantics, this was considered an implicit binding of that variable, whereas the new semantics considers it an error. Note that these ``implicit lets'' can easily be corrected by using the let var = exp goal instead. The default is to disallow ``implicit lets.''

-freorder (-fno-reorder)
    Controls whether declarations in modules are reordered according to their dependencies before the static semantics checker is run. Reordering allows the traditional define-before-use rule to be ignored. The default is to perform reordering.

-Wno-non-exhaustive (-Wnon-exhaustive)
    Controls whether warnings are generated for non-exhaustive pattern-matching constructs. The default is not to warn.

-v  Print the compiler's version and build information.

USAGE
Users are expected to use the rmlc compiler driver interface to the RML compilation tools.

FILES
file.rml
    the source file containing an RML module
file.c
    the generated C code
file.h
    the generated C header file
file.cps
    the intermediate CPS representation
file.fol
    the intermediate FOL representation
file.ast
    the intermediate AST representation
librml.a
    the RML runtime library
<rml.h>
    C include file for code using librml.a
file.sig
    the generated signature (-Esml)
file.sml
    the generated functor (-Esml)
rml.sig,rml.sml
    the runtime structure (-Esml)

SEE ALSO
cc(1), rmlc(1), librml(3x)

"The Definition of RML" for the official definition of the syntax and semantics of RML.

"Compiling Natural Semantics" for an explanation of the different intermediate representations and code generation styles.

NOTES
rml allows a module M1 using (via the with declaration) another module M2 to be compiled, even if M2 is not complete. This is because only the interface part of M2 is needed to typecheck and compile M1. Although modules with recursive dependencies may be compiled and linked, runtime tests will terminate any attempt to run the executable.

BUGS
It is imperative that the choice of code generation style is consistent with the choice of the <rml.h> include file (when compiling the generated C code) and librml.a runtime library. This is one of the reasons why the rmlc compiler driver is the recommended user interface to the RML system.

The rml interpreter implements the entire base language, but not all of the RML standard library.

AUTHOR
Mikael Pettersson (mpe@ida.liu.se, mikpe@sophia.inria.fr).