Oregu / clj-quines

Clojure core.logic quines.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clojure core.logic quines.

This is translation to clojure core.logic for scheme relational interpreter in miniKanren. Using @webyrd quines repo as source. Introduction is in the video.

  • warmup.clj is to get feel of miniKanren/core.logic
  • numbers.clj — translated numbers.scm
  • interp.clj — Non-relational λ-calculus interpreter from quines.pdf (chapter 3).
  • core.clj — Relational λ-calculus interpreter (q.scm and mk.scm)

core.logic repo (logic source file), @frenchy64 logic tutorial, a core.logic primer.

Quine generator is fully functional now. See test examples. Had problems with noo goal and still not sure if it's correct, but it generates quines, twines and thrines.

(use 'clojure.core.logic 'quines.core)

; generate 3 quines
(run 3 [q]
  (eval-expo q '() q))

(pp)

; generate twine
(run 1 [x]
  (fresh [p q]
    (eval-expo p '() q)
    (eval-expo q '() p)
    (!= p q)
    (== x [p q])))

(pp)

About

Clojure core.logic quines.

License:MIT License


Languages

Language:Clojure 100.0%