μKanren: Running the Little Things Backwards
summary
Implements μKanren in Clojure from first principles: builds logic variables, walk/unify, mzero/unit streams, call/fresh, bind/mplus and lazy closures to avoid stack overflow. Demonstrates lazy streams with interleaving so two infinite solutions (fives and sixes) alternate, and shows append relation running backwards to produce six distinct splits of [1 2 3 4 5]. Delivers working code (run/fresh macros, take n) and reproduces the paper’s microKanren behavior within a short live-coding session.
AI-written summary · about
chapters (28)
- 0:00Introduction
- 1:48Relational Programming
- 2:14Concatenation
- 4:32State State
- 5:41State Lists
- 7:33Fundamental Operations
- 8:07Conjunction
- 9:17Functions
- 10:39Compilers
- 11:04Questionmarks
- 11:38Function walk
- 13:24Bindings
- 14:28Unified Values
- 15:03Unified Lists
- 22:36recursive concatenation
- 22:47bind
- 25:37add function
- 26:36infinity of answers
- 27:02infinite loop
- 28:38unwrap
- 32:00infinity list
- 32:12closing conference
- 33:34append a
- 34:05destruction
- 34:40terminating clause
- 35:10head and tail
- 36:26closure
- 39:06conclusion
related talks
46mminiKanren
40mminiKanren Philosophy
20mKanren Light
43mAn Imperishable Wonderland of Infinite Fun
14mMicroKanren in J
17mλKanren: Higher-order Logic Programming with Shallow Embedding
29mTowards Bottom-Up Enumeration in miniKanren via Pruning and Memoization
38mFun with Functional Programming in Clojure
