| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Mikan.Termination.Monad
Description
The monad for the termination checker.
The termination monad TerM is an extension of
the type checking monad TCM by an environment
with information needed by the termination checker.
Synopsis
- data Target
- type Guarded = Order
- data TerEnv = TerEnv {
- terCutOff :: !CutOff
- terCurrent :: QName
- terMutual :: MutualNames
- terUserNames :: Set QName
- terHaveInlinedWith :: !Bool
- terTarget :: !Target
- terMaskResult :: !Bool
- terPatterns :: [DeBruijnPattern]
- terPatternsRaise :: !Int
- terGuarded :: !Guarded
- defaultTerEnv :: TerEnv
- class (Functor m, Monad m) => MonadTer (m :: Type -> Type) where
- newtype TerM a = TerM {}
- runTer :: TerEnv -> TerM a -> TCM a
- runTerDefault :: TerM a -> TCM a
- terGetCurrent :: TerM QName
- terSetCurrent :: QName -> TerM a -> TerM a
- terGetCutOff :: TerM CutOff
- terGetMutual :: TerM MutualNames
- terGetUserNames :: TerM (Set QName)
- terGetTarget :: TerM Target
- terSetTarget :: Target -> TerM a -> TerM a
- terGetHaveInlinedWith :: TerM Bool
- terSetHaveInlinedWith :: TerM a -> TerM a
- terGetMaskResult :: TerM Bool
- terSetMaskResult :: Bool -> TerM a -> TerM a
- terGetPatterns :: TerM [DeBruijnPattern]
- terSetPatterns :: [DeBruijnPattern] -> TerM a -> TerM a
- terRaise :: TerM a -> TerM a
- terGetGuarded :: TerM Guarded
- terModifyGuarded :: (Order -> Order) -> TerM a -> TerM a
- terSetGuarded :: Order -> TerM a -> TerM a
- terUnguarded :: TerM a -> TerM a
- isProjectionButNotCoinductive :: MonadTCM tcm => QName -> tcm Bool
- elimNotCoinductive :: MonadTCM tcm => Elim' t -> tcm Bool
- isCoinductiveProjection :: MonadTCM tcm => Bool -> QName -> tcm Bool
- patternDepth :: Pattern' a -> Int
- unusedVar :: DeBruijnPattern
- data CallPath = CallPath {}
- callInfos :: CallPath -> [CallInfo]
Documentation
The target of the function we are checking.
Constructors
| TargetDef QName | The target of recursion is a |
| TargetRecord | We are termination-checking a record. |
| TargetOther | None of the above two or unknown. |
The termination environment.
Constructors
| TerEnv | |
Fields
| |
defaultTerEnv :: TerEnv Source #
An empty termination environment.
Values are set to a safe default meaning that with these initial values the termination checker will not miss termination errors it would have seen with better settings of these values.
Values that do not have a safe default are set to
IMPOSSIBLE.
class (Functor m, Monad m) => MonadTer (m :: Type -> Type) where Source #
Termination monad service class.
Termination monad.
Instances
runTerDefault :: TerM a -> TCM a Source #
Run TerM computation in default environment (created from options).
Modifiers and accessors for the termination environment in the monad.
terSetHaveInlinedWith :: TerM a -> TerM a Source #
terSetPatterns :: [DeBruijnPattern] -> TerM a -> TerM a Source #
terUnguarded :: TerM a -> TerM a Source #
elimNotCoinductive :: MonadTCM tcm => Elim' t -> tcm Bool Source #
Is the given elimination anything but a coinductive projection?
isCoinductiveProjection :: MonadTCM tcm => Bool -> QName -> tcm Bool Source #
Check whether a projection belongs to a coinductive record and is actually recursive. E.g. @ isCoinductiveProjection (Stream.head) = return False
isCoinductiveProjection (Stream.tail) = return True @
De Bruijn pattern stuff
patternDepth :: Pattern' a -> Int Source #
How long is the path to the deepest atomic pattern?
unusedVar :: DeBruijnPattern Source #
A dummy pattern used to mask a pattern that cannot be used for structural descent.
Call paths
Call paths.
Constructors
| CallPath | |
Fields | |
PrettyTCM
Orphan instances
| PrettyTCM CallMatrix Source # | |
Methods prettyTCM :: MonadPretty m => CallMatrix -> m Doc Source # | |
| PrettyTCM cinfo => PrettyTCM (Call cinfo) Source # | |
| PrettyTCM cinfo => PrettyTCM (CallGraph cinfo) Source # | |
| PrettyTCM cinfo => PrettyTCM (CMSet cinfo) Source # | |
| PrettyTCM cinfo => PrettyTCM (CallMatrixAug cinfo) Source # | |
Methods prettyTCM :: MonadPretty m => CallMatrixAug cinfo -> m Doc Source # | |