Six Ways to Implement Divisibility by Three in miniKanren

This paper explores options for implementing the relation \(n \equiv 0 \ (\text{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 inc...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:arXiv.org 2024-08
Hauptverfasser: Schreiber, Brett, Pfingsten, Brysen, Hemann, Jason
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:This paper explores options for implementing the relation \(n \equiv 0 \ (\text{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 \texttt{defrel}s. This study aims to provide practical insights for miniKanren programmers on both performance and implementation techniques.
ISSN:2331-8422