Safe Haskell | None |
---|---|
Language | Haskell98 |
- normalise :: Context -> Env -> TT Name -> TT Name
- normaliseTrace :: Bool -> Context -> Env -> TT Name -> TT Name
- normaliseC :: Context -> Env -> TT Name -> TT Name
- normaliseAll :: Context -> Env -> TT Name -> TT Name
- rt_simplify :: Context -> Env -> TT Name -> TT Name
- simplify :: Context -> Env -> TT Name -> TT Name
- specialise :: Context -> Env -> [(Name, Int)] -> TT Name -> (TT Name, [(Name, Int)])
- hnf :: Context -> Env -> TT Name -> TT Name
- convEq :: Context -> [Name] -> TT Name -> TT Name -> StateT UCs TC Bool
- convEq' :: Context -> [Name] -> TT Name -> TT Name -> TC Bool
- data Def
- data CaseInfo = CaseInfo {}
- data CaseDefs = CaseDefs {
- cases_totcheck :: !([Name], SC)
- cases_compiletime :: !([Name], SC)
- cases_inlined :: !([Name], SC)
- cases_runtime :: !([Name], SC)
- data Accessibility
- data Totality
- data PReason
- = Other [Name]
- | Itself
- | NotCovering
- | NotPositive
- | UseUndef Name
- | ExternalIO
- | BelieveMe
- | Mutual [Name]
- | NotProductive
- data MetaInformation
- data Context
- initContext :: Context
- ctxtAlist :: Context -> [(Name, Def)]
- uconstraints :: Context -> [UConstraint]
- next_tvar :: Context -> Int
- addToCtxt :: Name -> Term -> Type -> Context -> Context
- setAccess :: Name -> Accessibility -> Context -> Context
- setTotal :: Name -> Totality -> Context -> Context
- setMetaInformation :: Name -> MetaInformation -> Context -> Context
- addCtxtDef :: Name -> Def -> Context -> Context
- addTyDecl :: Name -> NameType -> Type -> Context -> Context
- addDatatype :: Datatype Name -> Context -> Context
- addCasedef :: Name -> ErasureInfo -> CaseInfo -> Bool -> SC -> Bool -> Bool -> [Type] -> [Int] -> [Either Term (Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> Type -> Context -> Context
- simplifyCasedef :: Name -> ErasureInfo -> Context -> Context
- addOperator :: Name -> Type -> Int -> ([Value] -> Maybe Value) -> Context -> Context
- lookupNames :: Name -> Context -> [Name]
- lookupTyName :: Name -> Context -> [(Name, Type)]
- lookupTyNameExact :: Name -> Context -> Maybe (Name, Type)
- lookupTy :: Name -> Context -> [Type]
- lookupTyExact :: Name -> Context -> Maybe Type
- lookupP :: Name -> Context -> [Term]
- lookupP_all :: Bool -> Name -> Context -> [Term]
- lookupDef :: Name -> Context -> [Def]
- lookupNameDef :: Name -> Context -> [(Name, Def)]
- lookupDefExact :: Name -> Context -> Maybe Def
- lookupDefAcc :: Name -> Bool -> Context -> [(Def, Accessibility)]
- lookupDefAccExact :: Name -> Bool -> Context -> Maybe (Def, Accessibility)
- lookupVal :: Name -> Context -> [Value]
- mapDefCtxt :: (Def -> Def) -> Context -> Context
- lookupTotal :: Name -> Context -> [Totality]
- lookupNameTotal :: Name -> Context -> [(Name, Totality)]
- lookupMetaInformation :: Name -> Context -> [MetaInformation]
- lookupTyEnv :: Name -> Env -> Maybe (Int, Type)
- isTCDict :: Name -> Context -> Bool
- isDConName :: Name -> Context -> Bool
- canBeDConName :: Name -> Context -> Bool
- isTConName :: Name -> Context -> Bool
- isConName :: Name -> Context -> Bool
- isFnName :: Name -> Context -> Bool
- data Value
- class Quote a where
- initEval :: EvalState
- uniqueNameCtxt :: Context -> Name -> [Name] -> Name
- uniqueBindersCtxt :: Context -> [Name] -> TT Name -> TT Name
- definitions :: Context -> Ctxt (Def, Accessibility, Totality, MetaInformation)
- isUniverse :: Term -> Bool
Documentation
normaliseC :: Context -> Env -> TT Name -> TT Name Source
Normalise fully type checked terms (so, assume all names/let bindings resolved)
rt_simplify :: Context -> Env -> TT Name -> TT Name Source
Simplify for run-time (i.e. basic inlining)
simplify :: Context -> Env -> TT Name -> TT Name Source
Like normalise, but we only reduce functions that are marked as okay to inline (and probably shouldn't reduce lets?) 20130908: now only used to reduce for totality checking. Inlining should be done elsewhere.
A definition is either a simple function (just an expression with a type), a constant, which could be a data or type constructor, an axiom or as an yet undefined function, or an Operator. An Operator is a function which explains how to reduce. A CaseOp is a function defined by a simple case tree
CaseDefs | |
|
data Accessibility Source
The result of totality checking
Reasons why a function may not be total
data MetaInformation Source
Contexts used for global definitions and for proof state. They contain universe constraints and existing definitions.
The initial empty context
uconstraints :: Context -> [UConstraint] Source
setMetaInformation :: Name -> MetaInformation -> Context -> Context Source
addCasedef :: Name -> ErasureInfo -> CaseInfo -> Bool -> SC -> Bool -> Bool -> [Type] -> [Int] -> [Either Term (Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> Type -> Context -> Context Source
simplifyCasedef :: Name -> ErasureInfo -> Context -> Context Source
lookupNames :: Name -> Context -> [Name] Source
lookupTyName :: Name -> Context -> [(Name, Type)] Source
Get the list of pairs of fully-qualified names and their types that match some name
lookupTyNameExact :: Name -> Context -> Maybe (Name, Type) Source
Get the pair of a fully-qualified name and its type, if there is a unique one matching the name used as a key.
lookupTyExact :: Name -> Context -> Maybe Type Source
Get the single type that matches some name precisely
lookupDefAcc :: Name -> Bool -> Context -> [(Def, Accessibility)] Source
lookupDefAccExact :: Name -> Bool -> Context -> Maybe (Def, Accessibility) Source
lookupTotal :: Name -> Context -> [Totality] Source
lookupMetaInformation :: Name -> Context -> [MetaInformation] Source
isDConName :: Name -> Context -> Bool Source
Check whether a resolved name is certainly a data constructor
canBeDConName :: Name -> Context -> Bool Source
Check whether any overloading of a name is a data constructor
isTConName :: Name -> Context -> Bool Source
A HOAS representation of values
uniqueNameCtxt :: Context -> Name -> [Name] -> Name Source
Create a unique name given context and other existing names
definitions :: Context -> Ctxt (Def, Accessibility, Totality, MetaInformation) Source
isUniverse :: Term -> Bool Source