uhc-util-0.1.6.6: UHC utilities

Safe HaskellNone
LanguageHaskell98

UHC.Util.CHR.GTerm

Synopsis

Documentation

data GTm Source

Terms

Constructors

GTm_Var String

variable (to be substituted)

GTm_Int Integer

int value (for arithmetic)

GTm_Str String

string value

GTm_Con String [GTm]

general term structure

GTm_Nil

special case: list nil

GTm_Cns GTm GTm

special case: list cons

class GTermAs cnstr guard bprio prio tm | cnstr -> guard bprio prio tm, guard -> cnstr bprio prio tm, bprio -> cnstr guard prio tm, prio -> cnstr guard bprio tm, tm -> cnstr guard bprio prio where Source

Term interpretation in context of CHR

Methods

asTm :: GTm -> GTermAsM tm Source

asTmList :: GTm -> GTermAsM ([tm], Maybe tm) Source

as list, if matches/possible. Only to be invoked for GTm_Cns

asHeadConstraint :: GTm -> GTermAsM cnstr Source

asBodyConstraint :: GTm -> GTermAsM cnstr Source

asGuard :: GTm -> GTermAsM guard Source

asHeadBacktrackPrio :: GTm -> GTermAsM bprio Source

asAltBacktrackPrio :: GTm -> GTermAsM bprio Source

asRulePrio :: GTm -> GTermAsM prio Source

gtermasFail :: GTm -> String -> GTermAsM a Source

Fail the interpretation

parseFile :: GTermAs c g bp rp tm => FilePath -> IO (Either PP_Doc ([Rule c g bp rp], [c])) Source

Parse a file as a CHR spec + queries