The Relational Abstract Machine (RAM) is the main computation engine for the Relational Computing project, and provides a new foundation for declarative programming based on rewriting and interpretation of Relation Expressions. The relation expressions are variable-free terms in a relation algebra with a fixed point operator.

It is used here as an intermediate compilation language for Horn Clause logic programming with Constrains and other extensions.


Emilio Jesús Gallego Arias and James Lipton. Logic Programming in Tabular Allegories Technical Report. Expected March 2012
Emilio Jesús Gallego Arias, James Lipton and Julio Mariño. Constraint Logic Programming in a Relational Machine Technical Report January 2012
Emilio Jesús Gallego Arias, James Lipton, Julio Mariño, and Pablo Nogueira. First-order unification using variable-free relational algebra. Logic Journal of IGPL, 19(6):790-820, 2011.
E. Chapman and J. Lipton. Some Notes on Programming with a Relational Machine in Relational Methods for Computer Science (
Paul Broome and J. Lipton. Combinatory Logic Programming: Computing in Relation Calculi , in Proceedings of the 1994 International Symposium on Logic Programming, M. Bruynooghe, ed., M.I.T. Press, pp. 269-285, 1994 (

Main components

The two first items form the RAM software, which can be obtained below.

Current Features of RAM

RAM is at alpha stage of development, but we have some basic features implemented:

Emilio Jesús Gallego Arias is currently working in new features, directed by James Lipton.


Version 1.0 is currently in development.

We use trac for our bug system and roadmap tracking. See it here.

Some old TODO notes can be viewed at this TODO file.


At the moment the machine is not usable as is. We are working hard on that and we will publish a stable release soon.

Previous versions:

If you want the most recent implementation, go to the RAM subversion repository. Be warned that RAM is alpha software and subversion trunk is likely to be severely broken.

RAM trunk has the following build requisites:

We test RAM in Debian Lenny.


Once compiled, type ./ramc -h to see a list of available options:

    [Ram version 0.3]
    Relational Abstract Machine Prolog Compiler
    (c) Emilio Jesús Gallego Arias 2008:

    Usage: ramc [OPTIONS] file
    -i       --interactive  interactive shell
    -h       --help         show help
    -r       --ralog        output ralog code
    -o FILE  --output=FILE  output filename, default r.out
    -v       --verbose      verbose level


We have a developer mailing list, you're welcome to post.


An example of a simple RAM execution is below:

    egallego@exodo5:~/babel/ram/trunk/src$ ./ramc -i samples/ 
    [Ram version: 0.3]
    Relational Abstract Machine Prolog Compiler
    Copyright (C) 2004-2008 Emilio Jes�s Gallego Arias

    This program is free software; you can redistribute it and/or 
    modify it under the terms of the GNU General Public License   
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.      

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    GNU General Public License for more details.                   

    :- append2([1,2], X, [1,2,3]).
    Query :
    [I1 . [K(_x1, [1|[2|[]]], [1|[2|[3|[]]]]) /\ [W . append2/3 . cnv(W)]] . I1]

    Result: K([3|[]], [1|[2|[]]], [1|[2|[3|[]]]])
    Meaning: X = [3]

    Final expression. Rewrite more? (y/n)? y

    Result: 0
    Meaning: No solution