This paper explores options for implementing the relation n ≡ 0 \ (mod \ 3) within miniKanren using miniKanren numbers and its arithmetic suite. We examine different approaches starting from straightforward implementations to more optimized versions. The implementations discussed include brute-force arithmetic methods, divisibility tricks, and derivation from a finite automaton. Our contributions include an in-depth look at the process of implementing a miniKanren relation and observations on benchmarking defrels. This study aims to provide practical insights for miniKanren programmers on both performance and implementation techniques.
No takes yet. Share an insight, caveat, or question.
Schreiber et al. (2024) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: