ContentsIndex
Syntax
Contents
Special Constants
Substitutions
Utilities
Pretty Printing
Synopsis
newtype Variable = Variable {
fromVariable :: String
}
newtype Head = Head {
fromHead :: String
}
newtype Label = Label {
fromLabel :: String
}
data Term
= MinTerm
| Var !Variable
| Lab !Label
| App !Head ![Term]
data Loc
= LVar !Variable
| LLab !Label
data Clause = Clause !Loc !Term
data Rule = (:=>) ![Clause] !Clause
data Intersection = Intersection !Label !Label !Label
intersectionLabel :: Label
intersectionHead :: Head
resultLabel :: Label
resultHead :: Head
simpleLoc :: Loc
newtype Subst = Subst [(Variable, Term)]
applySubstTerm :: Subst -> Term -> Term
applySubst :: Subst -> Clause -> Clause
isPlain :: Term -> Bool
succHead :: Head -> Head
pprTerm :: Term -> String
pprTerms :: [Term] -> String
pprClause :: Clause -> String
pprClauses :: [Clause] -> String
pprRule :: Rule -> String
pprGeneralRule :: Rule -> String
Documentation
newtype Variable
A string used for a variable name. Names starting with '!' are reserved for internal use.
Constructors
Variable
fromVariable :: String
Instances
Eq Variable
Show Variable
Ord Variable
newtype Head
A string used for a term head name.
Constructors
Head
fromHead :: String
Instances
Eq Head
Show Head
Ord Head
newtype Label
A string used for a label name (includes the '@'). Names starting with "@!" are reserved for internal use.
Constructors
Label
fromLabel :: String
Instances
Eq Label
Show Label
Ord Label
data Term

Terms. We often use the following definitions:

depth
The maximum number of App nestings in a Term. Note that foo, foo(X), and foo(@lab) have depth one, while foo(bar) has depth two, and X and @lab have depth zero.
ground term
A term without variables.
simple term
A term without labels.
pure term
A simple ground term.
plain term
A ground term of depth <= 1.
Constructors
MinTermUsed to easily define orderings.
Var !Variable
Lab !Label
App !Head ![Term]
Instances
Eq Term
Show Term
Ord Term
data Loc
Locations.
Constructors
LVar !Variable
LLab !Label
Instances
Eq Loc
Show Loc
Ord Loc
data Clause
A Clause is meant to be a pattern for matching Terms beloging to a Grammar.
Constructors
Clause !Loc !Term
data Rule
The Rules define the Term rewriting system. The implied meaning is "whenever the left hand side has a match in the Grammar, add the right hand side to the Grammar".
Constructors
(:=>) ![Clause] !Clause
data Intersection
A special IntersectionRule, defining a Label set as the intersection of two sets. This could be modeled by a set of Rules, once for each term head. See also intersect.
Constructors
Intersection !Label !Label !Label
Special Constants
intersectionLabel :: Label
A Label whose set over-approximates the intersection between sets. This is used internally: see also computeIntersection.
intersectionHead :: Head
A Head that is used in the set of intersectionLabel in order to over-approximate the intersection between sets. This is used internally: see also computeIntersection.
resultLabel :: Label
A Label where is stored the result fo the analisys, by convention.
resultHead :: Head
A flag that, if present in resultLabel, tells the analysis failed.
simpleLoc :: Loc
The Location implied in a SimpleRule.
Substitutions
newtype Subst
Constructors
Subst [(Variable, Term)]
Instances
Show Subst
applySubstTerm :: Subst -> Term -> Term
applySubst :: Subst -> Clause -> Clause
Apply Subst to a Clause. The Location in the result must be a Label.
Utilities
isPlain :: Term -> Bool
succHead :: Head -> Head
Pretty Printing
pprTerm :: Term -> String
Pretty print a Term.
pprTerms :: [Term] -> String
pprClause :: Clause -> String
Pretty print a Clause.
pprClauses :: [Clause] -> String
pprRule :: Rule -> String
Pretty print a Rule.
pprGeneralRule :: Rule -> String
Pretty print SimpleRules and FullRules , using user-friendly syntax.
Produced by Haddock version 0.6