🤖 AI Summary
Existing embeddings of miniKanren in Haskell suffer from three key limitations: (1) disregard for type information, (2) reliance on explicit determinism annotations, and (3) implicit threading of generator state—resulting in inelegant, type-unsafe transformations. This paper introduces the first typed, tagless, final-style embedding of miniKanren in Haskell, leveraging Haskell’s higher-kinded type system and type classes to natively support type-safe, composable relational programming within the host language. Our approach eliminates redundant annotations and implicit state passing entirely, enabling efficient, formally verifiable functional transformations without altering the original semantics. Empirical evaluation demonstrates that the new embedding preserves the performance advantages of prior implementations while significantly improving code concision, maintainability, and runtime efficiency.
📝 Abstract
Relational programming enables program synthesis through a verifier-to-solver approach. An earlier paper introduced a functional conversion that mitigated some of the inherent performance overhead. However, the conversion was inelegant: it was oblivious to types, demanded determinism annotations, and implicit generator threading. In this paper, we address these issues by providing a typed tagless-final embedding of miniKanren into Haskell. This improvement significantly reduces boilerplate while preserving, and sometimes enhancing, earlier speedups.