Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.TypeChecking.Monad.MetaVars

Contents

- Query and manipulate interaction points.
- Freezing and unfreezing metas.

Synopsis

- dontAssignMetas :: TCM a -> TCM a
- getMetaStore :: TCM MetaStore
- modifyMetaStore :: (MetaStore -> MetaStore) -> TCM ()
- metasCreatedBy :: TCM a -> TCM (a, Set MetaId)
- lookupMeta :: MetaId -> TCM MetaVariable
- updateMetaVar :: MetaId -> (MetaVariable -> MetaVariable) -> TCM ()
- getMetaPriority :: MetaId -> TCM MetaPriority
- isSortMeta :: MetaId -> TCM Bool
- isSortMeta_ :: MetaVariable -> Bool
- getMetaType :: MetaId -> TCM Type
- getMetaTypeInContext :: MetaId -> TCM Type
- class IsInstantiatedMeta a where
- isInstantiatedMeta' :: MetaId -> TCM (Maybe Term)
- allMetas :: TermLike a => a -> [MetaId]
- createMetaInfo :: TCM MetaInfo
- createMetaInfo' :: RunMetaOccursCheck -> TCM MetaInfo
- setValueMetaName :: Term -> MetaNameSuggestion -> TCM ()
- getMetaNameSuggestion :: MetaId -> TCM MetaNameSuggestion
- setMetaNameSuggestion :: MetaId -> MetaNameSuggestion -> TCM ()
- updateMetaVarRange :: MetaId -> Range -> TCM ()
- modifyInteractionPoints :: (InteractionPoints -> InteractionPoints) -> TCM ()
- registerInteractionPoint :: Bool -> Range -> Maybe Nat -> TCM InteractionId
- findInteractionPoint_ :: Range -> InteractionPoints -> Maybe InteractionId
- connectInteractionPoint :: InteractionId -> MetaId -> TCM ()
- removeInteractionPoint :: InteractionId -> TCM ()
- getInteractionPoints :: TCM [InteractionId]
- getInteractionMetas :: TCM [MetaId]
- getInteractionIdsAndMetas :: TCM [(InteractionId, MetaId)]
- isInteractionMeta :: MetaId -> TCM (Maybe InteractionId)
- lookupInteractionPoint :: InteractionId -> TCM InteractionPoint
- lookupInteractionId :: InteractionId -> TCM MetaId
- lookupInteractionMeta :: InteractionId -> TCM (Maybe MetaId)
- lookupInteractionMeta_ :: InteractionId -> InteractionPoints -> Maybe MetaId
- newMeta :: MetaInfo -> MetaPriority -> Permutation -> Judgement a -> TCM MetaId
- newMeta' :: MetaInstantiation -> MetaInfo -> MetaPriority -> Permutation -> Judgement a -> TCM MetaId
- getInteractionRange :: InteractionId -> TCM Range
- getMetaRange :: MetaId -> TCM Range
- getInteractionScope :: InteractionId -> TCM ScopeInfo
- withMetaInfo' :: MetaVariable -> TCM a -> TCM a
- withMetaInfo :: Closure Range -> TCM a -> TCM a
- getInstantiatedMetas :: TCM [MetaId]
- getOpenMetas :: TCM [MetaId]
- isOpenMeta :: MetaInstantiation -> Bool
- listenToMeta :: Listener -> MetaId -> TCM ()
- unlistenToMeta :: Listener -> MetaId -> TCM ()
- getMetaListeners :: MetaId -> TCM [Listener]
- clearMetaListeners :: MetaId -> TCM ()
- withFreezeMetas :: TCM a -> TCM a
- freezeMetas :: TCM [MetaId]
- freezeMetas' :: (MetaId -> Bool) -> TCM [MetaId]
- unfreezeMetas :: TCM ()
- unfreezeMetas' :: (MetaId -> Bool) -> TCM ()
- isFrozen :: MetaId -> TCM Bool
- class UnFreezeMeta a where

# Documentation

dontAssignMetas :: TCM a -> TCM a #

Switch off assignment of metas.

getMetaStore :: TCM MetaStore #

Get the meta store.

modifyMetaStore :: (MetaStore -> MetaStore) -> TCM () #

metasCreatedBy :: TCM a -> TCM (a, Set MetaId) #

Run a computation and record which new metas it created.

lookupMeta :: MetaId -> TCM MetaVariable #

Lookup a meta variable

updateMetaVar :: MetaId -> (MetaVariable -> MetaVariable) -> TCM () #

getMetaPriority :: MetaId -> TCM MetaPriority #

isSortMeta :: MetaId -> TCM Bool #

isSortMeta_ :: MetaVariable -> Bool #

getMetaType :: MetaId -> TCM Type #

getMetaTypeInContext :: MetaId -> TCM Type #

Given a meta, return the type applied to the current context.

class IsInstantiatedMeta a where #

Check whether all metas are instantiated. Precondition: argument is a meta (in some form) or a list of metas.

Minimal complete definition

isInstantiatedMeta

Methods

isInstantiatedMeta :: a -> TCM Bool #

Instances

IsInstantiatedMeta MetaId # |
Methods isInstantiatedMeta :: MetaId -> TCM Bool #
IsInstantiatedMeta LevelAtom # |
Methods isInstantiatedMeta :: LevelAtom -> TCM Bool #
IsInstantiatedMeta PlusLevel # |
Methods isInstantiatedMeta :: PlusLevel -> TCM Bool #
IsInstantiatedMeta Level # |
Methods isInstantiatedMeta :: Level -> TCM Bool #
IsInstantiatedMeta Term # |
Methods isInstantiatedMeta :: Term -> TCM Bool #
IsInstantiatedMeta a => IsInstantiatedMeta [a] # |
Methods isInstantiatedMeta :: [a] -> TCM Bool #
IsInstantiatedMeta a => IsInstantiatedMeta (Maybe a) # |
Methods isInstantiatedMeta :: Maybe a -> TCM Bool #
IsInstantiatedMeta a => IsInstantiatedMeta (Arg a) # |
Methods isInstantiatedMeta :: Arg a -> TCM Bool #
IsInstantiatedMeta a => IsInstantiatedMeta (Abs a) # | Does not worry about raising.
Methods isInstantiatedMeta :: Abs a -> TCM Bool #

isInstantiatedMeta' :: MetaId -> TCM (Maybe Term) #

allMetas :: TermLike a => a -> [MetaId] #

Returns every meta-variable occurrence in the given type, except for those in `Sort`s.

createMetaInfo :: TCM MetaInfo #

Create `MetaInfo` in the current environment.

createMetaInfo' :: RunMetaOccursCheck -> TCM MetaInfo #

setValueMetaName :: Term -> MetaNameSuggestion -> TCM () #

getMetaNameSuggestion :: MetaId -> TCM MetaNameSuggestion #

setMetaNameSuggestion :: MetaId -> MetaNameSuggestion -> TCM () #

updateMetaVarRange :: MetaId -> Range -> TCM () #

# Query and manipulate interaction points.

modifyInteractionPoints :: (InteractionPoints -> InteractionPoints) -> TCM () #

registerInteractionPoint :: Bool -> Range -> Maybe Nat -> TCM InteractionId #

Register an interaction point during scope checking. If there is no interaction id yet, create one.

findInteractionPoint_ :: Range -> InteractionPoints -> Maybe InteractionId #

Find an interaction point by `Range` by searching the whole map.

O(n): linear in the number of registered interaction points.

connectInteractionPoint :: InteractionId -> MetaId -> TCM () #

Hook up meta variable to interaction point.

removeInteractionPoint :: InteractionId -> TCM () #

Move an interaction point from the current ones to the old ones.

getInteractionPoints :: TCM [InteractionId] #

Get a list of interaction ids.

getInteractionMetas :: TCM [MetaId] #

Get all metas that correspond to interaction ids.

getInteractionIdsAndMetas :: TCM [(InteractionId, MetaId)] #

Get all metas that correspond to interaction ids.

isInteractionMeta :: MetaId -> TCM (Maybe InteractionId) #

Does the meta variable correspond to an interaction point?

Time: `O(n)` where `n` is the number of interaction metas.

lookupInteractionPoint :: InteractionId -> TCM InteractionPoint #

Get the information associated to an interaction point.

lookupInteractionId :: InteractionId -> TCM MetaId #

Get `MetaId` for an interaction point. Precondition: interaction point is connected.

lookupInteractionMeta :: InteractionId -> TCM (Maybe MetaId) #

Check whether an interaction id is already associated with a meta variable.

lookupInteractionMeta_ :: InteractionId -> InteractionPoints -> Maybe MetaId #

newMeta :: MetaInfo -> MetaPriority -> Permutation -> Judgement a -> TCM MetaId #

Generate new meta variable.

newMeta' :: MetaInstantiation -> MetaInfo -> MetaPriority -> Permutation -> Judgement a -> TCM MetaId #

Generate a new meta variable with some instantiation given. For instance, the instantiation could be a `PostponedTypeCheckingProblem`.

getInteractionRange :: InteractionId -> TCM Range #

Get the `Range` for an interaction point.

getMetaRange :: MetaId -> TCM Range #

Get the `Range` for a meta variable.

getInteractionScope :: InteractionId -> TCM ScopeInfo #

withMetaInfo' :: MetaVariable -> TCM a -> TCM a #

withMetaInfo :: Closure Range -> TCM a -> TCM a #

getInstantiatedMetas :: TCM [MetaId] #

getOpenMetas :: TCM [MetaId] #

isOpenMeta :: MetaInstantiation -> Bool #

listenToMeta :: Listener -> MetaId -> TCM () #

`listenToMeta l m`: register `l` as a listener to `m`. This is done when the type of l is blocked by `m`.

unlistenToMeta :: Listener -> MetaId -> TCM () #

Unregister a listener.

getMetaListeners :: MetaId -> TCM [Listener] #

Get the listeners to a meta.

clearMetaListeners :: MetaId -> TCM () #

# Freezing and unfreezing metas.

withFreezeMetas :: TCM a -> TCM a #

Freeze all so far unfrozen metas for the duration of the given computation.

freezeMetas :: TCM [MetaId] #

Freeze all meta variables and return the list of metas that got frozen.

freezeMetas' :: (MetaId -> Bool) -> TCM [MetaId] #

Freeze some meta variables and return the list of metas that got frozen.

unfreezeMetas :: TCM () #

Thaw all meta variables.

unfreezeMetas' :: (MetaId -> Bool) -> TCM () #

Thaw some metas, as indicated by the passed condition.

isFrozen :: MetaId -> TCM Bool #

class UnFreezeMeta a where #

Unfreeze meta and its type if this is a meta again. Does not unfreeze deep occurrences of metas.

Minimal complete definition

unfreezeMeta

Methods

unfreezeMeta :: a -> TCM () #

Instances

UnFreezeMeta MetaId # |
Methods unfreezeMeta :: MetaId -> TCM () #
UnFreezeMeta LevelAtom # |
Methods unfreezeMeta :: LevelAtom -> TCM () #
UnFreezeMeta PlusLevel # |
Methods unfreezeMeta :: PlusLevel -> TCM () #
UnFreezeMeta Level # |
Methods unfreezeMeta :: Level -> TCM () #
UnFreezeMeta Sort # |
Methods unfreezeMeta :: Sort -> TCM () #
UnFreezeMeta Type # |
Methods unfreezeMeta :: Type -> TCM () #
UnFreezeMeta Term # |
Methods unfreezeMeta :: Term -> TCM () #
UnFreezeMeta a => UnFreezeMeta [a] # |
Methods unfreezeMeta :: [a] -> TCM () #
UnFreezeMeta a => UnFreezeMeta (Abs a) # |
Methods unfreezeMeta :: Abs a -> TCM () #