Six Ways to Implement Divisibility by Three in miniKanren
Brett Schreiber, Brysen Pfingsten, Jason Hemann

TL;DR
This paper investigates six different methods to implement divisibility by three in miniKanren, comparing their performance and practicality for programmers using miniKanren's relational programming approach.
Contribution
It provides a comprehensive analysis of various implementation strategies for divisibility in miniKanren, including optimized and automaton-based methods.
Findings
Automated benchmarks compare different implementations.
Optimized methods outperform brute-force approaches.
Finite automaton derivation offers a novel implementation technique.
Abstract
This paper explores options for implementing the relation 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 \texttt{defrel}s. This study aims to provide practical insights for miniKanren programmers on both performance and implementation techniques.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Polynomial and algebraic computation · Teaching and Learning Programming
