Specification of Logic Programming Languages from Reusable Semantic Building Blocks


We present a Language Prototyping System that facilitates the modular development of interpreters from independent semantic building blocks. The abstract syntax is modelled as the fixpoint of a pattern functor which can be obtained as the sum of functors. For each functor we define an algebra whose carrier is the computational structure. This structure is obtained as the composition of several monad transformers applied to a base monad, where each monad transformer adds a new notion of computation. When the abstract syntax is composed from mutually recursive categories, we use many-sorted algebras. With this approach, the prototype interpreters are automatically obtained as a catamorphism over the defined algebras. As an example, in this paper, we independently specify an arithmetic evaluator and a simple logic programming language and combine both specifications to obtain a logic programming language with arithmetic capabilities.

Electronic Notes on Theoretical Computer Science, vol. 64