计算机科学 > 程序设计语言
[提交于 2024年8月29日]
标题:Six Ways to Implement Divisibility by Three in miniKanren
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Brett Schreiber[v1] 2024年8月29日 星期四 04:42:52 UTC