Relational programming in Elixir based on miniKanren.
- 2015-06-30: Overhauled
CLP_Tree
module, addedsymbolo
,numbero
,booleano
,absento
operators. Fixed erros in the stream operators. Tidied up core. Made bigger mess inCLP_FD
. - 2015-03-10: The constraint solver being used is now passed as an optional parameter to the
run
interface rather than being set in the process dictionary. This makes ExKanren purely functional and enables experimenting with running goals in parallel. - 2014-09-17: Constraints over finite domains of integers now implemented
- 2014-09-09: Working through the cKanren paper, CLP(Tree) is now implemented
- Urgently need more thorough documentation
- Nominal logic
MiniKanren
defines the relational and non-relational 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
. use MiniKanren.CLP.Tree
will import the operator and some common relations that rely on it, and for convenience will alias MiniKanren.CLP.Tree
to CLP_Tree
.
MiniKanren.CLP.FD
provides operators for operations on finite domains of integers. use MiniKanren.CLP.FD
will import the operator and some common relations that rely on it, and for convenience will alias MiniKanren.CLP.FD
to CLP_FD
.
use MiniKanren
use MiniKanren.CLP.Tree
run_all(CLP_Tree, [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: