# Pruning and Memoization Bring Bottom-Up Enumeration to miniKanren

Original title: Towards Bottom-Up Enumeration in miniKanren via Pruning and Memoization

> Hacker News story 49161617 · language: en · submitted 2026-08-03
> Web version: https://zeli.app/story/49161617
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 24 · by [Jimmc414](<https://news.ycombinator.com/user?id=Jimmc414>) · 💬 1
[original](<https://arxiv.org/abs/2607.25373>) · [HN discussion](<https://news.ycombinator.com/item?id=49161617>)

## Summary

We present two small library combinators for miniKanren that bring bottom-up enumeration with observational deduplication, a standard tool in non-relational program-by-example synthesizers, into the relational setting. The prune combinator deduplicates answer streams by user-supplied keys, while defrel/bank memoizes relations against canonical fresh variables, enabling a single pruned stream to be built bottom-up and replayed at call sites. A weighted variant, defrel/bank-w, recovers best-first enumeration when the natural depth-first order misses compact representatives. On preliminary benchmarks, defrel/bank substantially outperforms depth-bounded baselines on most deep targets, though it loses on a small family where the canonical order is suboptimal.

## Key quote

> We present two small library combinators on top of plain miniKanren, designed to bring bottom-up enumeration with observational deduplication, the standard tool in non-relational program-by-example (PBE) synthesizers, into the relational setting.

---

## Cite

- Page: https://zeli.app/story/49161617
- Date: 2026-08-03
- Source: arxiv.org (https://arxiv.org/abs/2607.25373)
- Hacker News: https://news.ycombinator.com/item?id=49161617

## Other languages

- zh: https://zeli.app/zh/story/49161617 · markdown: https://zeli.app/zh/story/49161617.md
- de: https://zeli.app/de/story/49161617 · markdown: https://zeli.app/de/story/49161617.md
- es: https://zeli.app/es/story/49161617 · markdown: https://zeli.app/es/story/49161617.md
