English

chrKanren: Constraint Handling Rules in a Relational Language

Programming Languages 2026-07-23 v1

Abstract

We present chrKanren, a dialect of the purely relational constraint logic programming language miniKanren which includes support for Constraint Handling Rules (CHR), a language for writing rule-based programs such as constraint solvers. We show how to integrate CHR's constraint propagation mechanism into the language of miniKanren search streams such that both processes remain complete. We also use chrKanren to illustrate novel applications of constraints in miniKanren, such as semantic unification of user-defined data structures and type-and-example-directed synthesis for relational interpreters in the style of MYTH.

Cite

@article{arxiv.2607.21204,
  title  = {chrKanren: Constraint Handling Rules in a Relational Language},
  author = {Rafaello Sanna and William E. Byrd and Nada Amin},
  journal= {arXiv preprint arXiv:2607.21204},
  year   = {2026}
}

Comments

In Proceedings ICLP 2026, arXiv:2607.17707. The source code for chrKanren is available as free software at https://github.com/rvs314/chrKanren