Relational programming with memoization and negation
The relational paradigm allows to express programs as relations. Unlike functions, the relations do not distinguish input and output parameters, thus a single relational program can be used to solve several related problems. Relational interpreters are of particular interest. These interpreters can execute a program, check that the program satisfies a set of constraints or generate a program that has specified properties. In order to take advantages of the relational interpreter, the developer needs to define the semantics of the programming language as a relation. In this work, we present an implementation of two useful extensions of relational programming: tabling and constructive negation. Tabling helps to traverse the state space of the interpreter efficiently. Constructive negation allows to check that some state of the interpreter is unreachable. We show how this extensioncan be used on an example of a relational interpreter for a concurrent imperative programming language.