unification-sop-0.1.0.0

Copyright(C) 2018-19 Carlo Nucera
LicenseBSD-style (see the file LICENSE)
MaintainerCarlo Nucera <meditans@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

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).

Synopsis

Documentation

data Term a #

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

Instances
Eq (Term Char) # 
Instance details

Defined in Generic.Unification.Term

Methods

(==) :: Term Char -> Term Char -> Bool #

(/=) :: Term Char -> Term Char -> Bool #

Eq (Term Int) # 
Instance details

Defined in Generic.Unification.Term

Methods

(==) :: Term Int -> Term Int -> Bool #

(/=) :: Term Int -> Term Int -> Bool #

(Eq a, Generic a, HasDatatypeInfo a, All2 (Compose Eq Term) (Code a)) => Eq (Term a) # 
Instance details

Defined in Generic.Unification.Term

Methods

(==) :: Term a -> Term a -> Bool #

(/=) :: Term a -> Term a -> Bool #

Eq (Term String) # 
Instance details

Defined in Generic.Unification.Term

Show (Term Char) # 
Instance details

Defined in Generic.Unification.Term

Show (Term Int) # 
Instance details

Defined in Generic.Unification.Term

Methods

showsPrec :: Int -> Term Int -> ShowS #

show :: Term Int -> String #

showList :: [Term Int] -> ShowS #

(Show a, Generic a, HasDatatypeInfo a, All2 (Compose Show Term) (Code a)) => Show (Term a) # 
Instance details

Defined in Generic.Unification.Term

Methods

showsPrec :: Int -> Term a -> ShowS #

show :: Term a -> String #

showList :: [Term a] -> ShowS #

Show (Term String) # 
Instance details

Defined in Generic.Unification.Term

expandTerm :: Generic a => a -> Term a #