Elpi — Embeddable λProlog Interpreter

Elpi is an embeddable implementation of λProlog extended with Constraint Handling Rules (CHR). It is a logic programming language well suited to manipulate abstract syntax trees with binders and unification variables, the kind of data the elaborator of an interactive theorem prover works with. Elpi is designed to be embedded into larger applications written in OCaml as an extension language, and it comes with an API to drive the interpreter and a foreign function interface (FFI) to add built-in predicates and data types.

This manual describes Elpi’s syntax, its execution model (including CHR), every language feature, the standard library and built-in predicates, the debugging and tracing tools, and the OCaml API used to embed and extend the interpreter. It assumes familiarity with λProlog; the reference for standard λProlog is Programming with Higher-Order Logic, by Miller and Nadathur.

API