All Projects → mthom → shen-minikanren

mthom / shen-minikanren

Licence: other
An embedding of miniKanren in Shen.

Programming Languages

Shen
6 projects

Projects that are alternatives of or similar to shen-minikanren

clpsmt-miniKanren
CLP(SMT) on top of miniKanren
Stars: ✭ 31 (+29.17%)
Mutual labels:  minikanren
kanren
An extensible, lightweight relational/logic programming DSL written in pure Python
Stars: ✭ 111 (+362.5%)
Mutual labels:  minikanren
symbolic-pymc
Tools for the symbolic manipulation of PyMC models, Theano, and TensorFlow graphs.
Stars: ✭ 58 (+141.67%)
Mutual labels:  minikanren
gominikanren
a Go implementation of miniKanren, an embedded Domain Specific Language for logic programming.
Stars: ✭ 28 (+16.67%)
Mutual labels:  minikanren
leanTAP
A Declarative Theorem Prover for First-Order Classical Logic
Stars: ✭ 24 (+0%)
Mutual labels:  minikanren
ukanren-rs
Rust implementation of µKanren, a featherweight relational programming language.
Stars: ✭ 98 (+308.33%)
Mutual labels:  minikanren

shen-minikanren

A Shen implementation of miniKanren

shen-minikanren is a Shen implementation of miniKanren, an embedded DSL for logic programming. It was adapted with Will Byrd’s Scheme sources, which follow the definition of miniKanren given in the appendix of The Reasoned Schemer.

shen-minikanren integrates seamlessly into Shen’s type system. This form (example 1.54 in The Reasoned Schemer) type checks as:

(60+) (run* R
    (fresh (X Y)
	     (conde
	      ((=== split X)
	       (=== pea Y))
	      ((=== navy X) (=== bean Y))
	       (else mk-fail))
	      (=== [X Y] R)))
[[split pea] [navy bean]] : (list (walkable symbol))

The files that make up the implementation should be loaded into a Shen REPL in this order:

  • macros.shen (with tc -)
  • types.shen (with tc +)
  • minikanren.shen (with tc +)
  • prelude.shen (with tc +)

Examples are given in tests.shen and prelude.shen, all of which come from The Reasoned Schemer and Will Byrd’s sources.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].