Skip to content

sausaw/ExKanren

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExKanren

Relational programming in Elixir based on miniKanren.

What's new

  • 2014-09-17: Constraints over finite domains of integers now impelemented
  • 2014-09-09: Working through the cKanren paper, CLP(Tree) is now implemented

TODO

  • Urgently need more thorough documentation
  • Nominal logic

Usage

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]

References

This code is based on reading and figuring out a bunch of papers &c:

About

Relational programming in Elixir

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published