Copyright | (C) 2018-19 Carlo Nucera |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Carlo Nucera <meditans@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Generic.Unification.Term
Description
This module defines the Term datatype, which represents a datatype with logical variables in it (similar to the ones you might write in prolog). Importantly, this is not done via the fixed point of a functor approach, like in the unification-fd library, but using the generic structure of the term. A key design decision in this module is that variables with different types do not conflict with each other, so that you might write (add the example).
Documentation
Term is the datatype which is inteded to be the equivalent of a prolog term. Picture taking a haskell value, and drill some holes in it in which you can put logical variables.
Constructors
Var Int | A logical variable |
Con a | A constant, determinate value |
Rec (SOP Term (Code a)) | The constructor, and recursive terms |
expandTerm :: Generic a => a -> Term a #