English

Optimized Execution of FreeCHR

Programming Languages 2025-08-26 v3

Abstract

Constraint Handling Rules (CHR) is a rule-based programming language that rewrites collections of constraints. It is typically embedded into a general-purpose language. There exists a plethora of implementation for numerous host languages. However, the existing implementations often re-invent the method of embedding, which impedes maintenance and weakens assertions of correctness. To formalize and thereby standardize the embedding of a ground subset of CHR into arbitrary host languages, we introduced the framework FreeCHR and proved it to be a valid representation of classical CHR. For the sake of simplicity, abstract implementations of our framework did not yet include a concrete matching algorithm nor optimizations. In this paper, we introduce an improved execution and matching algorithm for FreeCHR. We also provide empirical evaluation of the algorithm.

Keywords

Cite

@article{arxiv.2506.14485,
  title  = {Optimized Execution of FreeCHR},
  author = {Sascha Rechenberger and Thom Frühwirth},
  journal= {arXiv preprint arXiv:2506.14485},
  year   = {2025}
}

Comments

This is a preprint of a paper submitted to the 39th Workshop on (Constraint and Functional) Logic Programming (WLP 2025); minor changes throughout the paper, additional explanations in sections 3.3 to Def 1; re-arranged section 3, added appendix

R2 v1 2026-07-01T03:21:48.855Z