Relational Meta-Language (RML) and Tools
A System for Developing, Compiling and Debugging and Teaching
Structural Operational Semantics (SOS) and Natural Semantics Specifications
Natural Semantics is based on Plotkin's Structural Operational Semantics (SOS) and further developed at INRIA by Kahn.
Specifications consist of data type declarations (abstract syntax, environments, run-time values, types, etc.) and sets of inference rules.
The inference rules specify relations between objects, in a style akin to Gentzen s Sequent Calculus for Natural Deduction. (Hence the name Natural Semantics.)
- The Relational Meta-Language (RML) has been defined. It is strongly typed with a type system very much like that in Standard ML, has type-safe separate compilation and modules, and supports Natural Semantics-style inference rules. It has fewer non-declarative constructs than Prolog. The SML-like data types directly support structural-induction style specifications, which are central to Natural Semantics.
- The operational properties of RML were investigated and used to derive the initial implementation. A key component is the use of a Continuation-Passing Style (CPS) intermediate representation. CPS is easy to optimize, due to its declarative nature, but is also easily translated to low-level code, due to its simple operational semantics.
- Further observations lead to a refinement, whereby RML specifications are first translated to a First-Order Logic. High-level equivalences are used to rewrite this representation in order to reduce the amount of unnecessary non-determinism. This phase has proven to be essential for the practicality of the generated code.
- A compiler generating portable ANSI-C code has been implemented. The code runs unchanged on several different 32 and 64-bit architectures. Performance measurements indicate that this code runs several times faster than that generated by commercial Prolog compilers, and several orders of magnitude faster than TYPOL.
- Debugging facilities were added to the Relational Meta-Language (RML) system during 2002-2005 period.
- Mikael Pettersson:
Compiling Natural Semantics.
Lecture Notes in Computer Science, 1549. Springer Verlag; (November 15, 1999), ISBN: 3540659684.
- David Kågedal, Peter Fritzson: Generating a Modelica Compiler from Natural Semantics Specifications.
Summer Computer Simulation Conference '98, Reno, Nevada,USA, July 19-22, 1998.
- Peter Fritzson: Efficient Language Implementation by Natural Semantics
Book Draft. You can use it as an RML manual.
- Adrian Pop,
Debugging Natural Semantics Specifications,
Symposium on Automated and Analysis-Driven Debugging
September 19-21, 2005, Monterey, California.
Published in the ACM SIGSOFT/SIGPLAN.
Here we report usages of RML.
Please report bugs to help us improve.
Use our Bugzilla and choose MetaModelica as product when
Feel free to contact Adrian Pop if you have problems,
As this page is not updated very often and some things are not that
clear, if you run into problems just send me an email.
Last modified: 2010-04-14 by
Adrian Pop [firstname.lastname@example.org]