Relational programming in Elixir based on miniKanren.
- 2014-09-17: Constraints over finite domains of integers now impelemented
- 2014-09-09: Working through the cKanren paper, CLP(Tree) is now implemented
- Urgently need more thorough documentation
- Nominal logic
MiniKanren
defines the pure and impure operators of miniKanren, and MiniKanren.Functions
implements some of the common relations. use MiniKanren
will import both MiniKanren
and MiniKanren.Functions
.
MiniKanren.CLP.Tree
provides the tree disequality operator neq
, and the runtime hooks needed to use disequality constraints. use MiniKanren.CLP.Tree
will import the operator and some common relations that rely on it and will set the process dictionary with the hooks needed to run CLP(Tree).
MiniKanren.CLP.FD
provides operators for finite domains of integers, and the runtime hooks needed to use them. use MiniKanren.CLP.FD
will import the operator and some common relations that rely on it and will set the process dictionary with the hooks needed to run CLP(FD).
use MiniKanren
use MiniKanren.CLP.Tree
run_all([out, x]) do
eq(x, [:good_night, :kittens, :good_night, :mittens,
:good_night, :clocks, :good_night, :socks])
rembero(:good_night, x, out)
end
# [:kittens, :mittens, :clocks, :socks]
This code is based on reading and figuring out a bunch of papers &c: