rest-rewrite-0.4.3: Rewriting library with online termination checking
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.REST.Internal.Rewrite

Synopsis

Documentation

data Rewrite Source #

Rewrite t u s defines a rewrite rule \( t \rightarrow u \), with an optional name s.

Instances

Instances details
Generic Rewrite Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

Associated Types

type Rep Rewrite :: Type -> Type #

Methods

from :: Rewrite -> Rep Rewrite x #

to :: Rep Rewrite x -> Rewrite #

Show Rewrite Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

Eq Rewrite Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

Methods

(==) :: Rewrite -> Rewrite -> Bool #

(/=) :: Rewrite -> Rewrite -> Bool #

Ord Rewrite Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

Hashable Rewrite Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

Methods

hashWithSalt :: Int -> Rewrite -> Int #

hash :: Rewrite -> Int #

Monad m => RewriteRule m Rewrite RuntimeTerm Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

type Rep Rewrite Source # 
Instance details

Defined in Language.REST.Internal.Rewrite

type Subst = HashMap String RuntimeTerm Source #

Subst is a mapping from variable names to RuntimeTerms. Normally this would be generated by unifying the left-hand-side of a Rewrite with a term.

named :: Rewrite -> String -> Rewrite Source #

named r n assigns the name n to rule r, replacing any existing name

subst :: Subst -> MetaTerm -> RuntimeTerm Source #

subst s m replaces the variables in the MetaTerm m with RuntimeTerms in the substitution s. This function returns an error if any variables in m do not have a substituion

unify :: MetaTerm -> RuntimeTerm -> Subst -> Maybe Subst Source #

unify m r su extends the substitution su to generate a new substitution that unifies m and r. Returns Nothing if su cannot be extended to unify the terms.