Skip to content

Oregu/featherweight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

μKanren

Haskell implementation of Jason Hemann (@jasonhemann) and Daniel P. Friedman's (@dfried00) "microKanren: A Minimal Functional Core for Relational Programming".

“In this paper, we present μKanren, a ‘featherweight’ implementation for a pure relational (logic) programming language.”

Original Scheme implementation: https://github.com/jasonhemann/microKanren

In action

appendo l s out =
  mplus
    (do l === LVal empty
        s === out)
    (do h  fresh
        t  fresh
        l === LVal (cons h t)
        res  fresh
        out === LVal (cons h res)
        appendo t s res)

See Example and ExampleM files.

To do

  • Implement appendo, custom unify
  • Logic as a state monad
  • Tests
  • Use Map for substitutions
  • Polymorphic substitutions
  • Reification (do not reifies for structs, like lcons)
  • Nominal
  • Benchmarks

Add examples

  • Membero
  • Oleg's numbers
  • Quines generator

About

μKanren implementation in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published