Kanren

1 program Added 2026-03-12T10:15:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: miniKanren, cKanren
Provenance: commit c433c7e73f · authored 2026-03-12T00:27:48+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

3 sources · pl_id: pl/minikanren
LLM (this repo) · 1PldbWikipedia

Related languages

MiniKanren (0.57)cKanren (0.34)microKanren (0.28)Kamin (0.20)Minion (0.19)

LLM-contributed programs

Relational List Append (appendo)

Provenance: commit c433c7e73f · authored 2026-03-12T00:27:48+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.scm · added: 2026-03-12T10:15:00Z
;;; Kanren: relational list append
;;; Demonstrates the core of Kanren's logic programming model.

(load "kanren.scm")

;; The appendo relation: l and s concatenated give out
(define appendo
  (lambda (l s out)
    (conde
      ((== '() l) (== s out))
      ((fresh (a d res)
         (conso a d l)
         (conso a res out)
         (appendo d s res))))))

;; Forward: append two known lists
(display (run 1 (q) (appendo '(a b c) '(d e) q)))
(newline)
;; => ((a b c d e))

;; Backward: enumerate all ways to split a list
(display
  (run* (q)
    (fresh (x y)
      (== q (list x y))
      (appendo x y '(1 2 3)))))
(newline)
;; => ((() (1 2 3)) ((1) (2 3)) ((1 2) (3)) ((1 2 3) ()))

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Kanren (mapped to pl/minikanren). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Kanren/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Kangaroo KANT →