Six Ways to Implement Divisibility by Three in miniKanren

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Schreiber, Brett, Pfingsten, Brysen, Hemann, Jason
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917762005204992
author Schreiber, Brett
Pfingsten, Brysen
Hemann, Jason
author_facet Schreiber, Brett
Pfingsten, Brysen
Hemann, Jason
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_16259
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Six Ways to Implement Divisibility by Three in miniKanren
Schreiber, Brett
Pfingsten, Brysen
Hemann, Jason
Programming Languages
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.
title Six Ways to Implement Divisibility by Three in miniKanren
topic Programming Languages
url https://arxiv.org/abs/2408.16259