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

Safe HaskellNone
LanguageHaskell2010

Agda.Syntax.Internal

Contents

Synopsis

Documentation

type Args = [Arg Term] #

Type of argument lists.

data ConHead #

Store the names of the record fields in the constructor. This allows reduction of projection redexes outside of TCM. For instance, during substitution and application.

Constructors

ConHead 

Fields

  • conName :: QName

    The name of the constructor.

  • conInductive :: Induction

    Record constructors can be coinductive.

  • conFields :: [QName]

    The name of the record fields. Empty list for data constructors. Arg is not needed here since it is stored in the constructor args.

Instances

Eq ConHead # 

Methods

(==) :: ConHead -> ConHead -> Bool #

(/=) :: ConHead -> ConHead -> Bool #

Data ConHead # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConHead -> c ConHead #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ConHead #

toConstr :: ConHead -> Constr #

dataTypeOf :: ConHead -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ConHead) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConHead) #

gmapT :: (forall b. Data b => b -> b) -> ConHead -> ConHead #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConHead -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConHead -> r #

gmapQ :: (forall d. Data d => d -> u) -> ConHead -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ConHead -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConHead -> m ConHead #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConHead -> m ConHead #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConHead -> m ConHead #

Ord ConHead # 
Show ConHead # 
Pretty ConHead # 
KillRange ConHead # 
SetRange ConHead # 

Methods

setRange :: Range -> ConHead -> ConHead #

HasRange ConHead # 

Methods

getRange :: ConHead -> Range #

LensConName ConHead # 
PrettyTCM ConHead # 

Methods

prettyTCM :: ConHead -> TCM Doc #

NamesIn ConHead # 

Methods

namesIn :: ConHead -> Set QName #

class LensConName a where #

Minimal complete definition

getConName

Methods

getConName :: a -> QName #

setConName :: QName -> a -> a #

mapConName :: (QName -> QName) -> a -> a #

data Term #

Raw values.

Def is used for both defined and undefined constants. Assume there is a type declaration and a definition for every constant, even if the definition is an empty list of clauses.

Constructors

Var !Int Elims

x es neutral

Lam ArgInfo (Abs Term)

Terms are beta normal. Relevance is ignored

Lit Literal 
Def QName Elims

f es, possibly a delta/iota-redex

Con ConHead ConInfo Args

c vs or record { fs = vs }

Pi (Dom Type) (Abs Type)

dependent or non-dependent function space

Sort Sort 
Level Level 
MetaV !MetaId Elims 
DontCare Term

Irrelevant stuff in relevant position, but created in an irrelevant context. Basically, an internal version of the irrelevance axiom .irrAx : .A -> A.

Shared !(Ptr Term)

Explicit sharing

Instances

Data Term # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Term -> c Term #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Term #

toConstr :: Term -> Constr #

dataTypeOf :: Term -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Term) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Term) #

gmapT :: (forall b. Data b => b -> b) -> Term -> Term #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Term -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Term -> r #

gmapQ :: (forall d. Data d => d -> u) -> Term -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Term -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Term -> m Term #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Term -> m Term #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Term -> m Term #

Show Term # 

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

NFData Type # 

Methods

rnf :: Type -> () #

NFData Term # 

Methods

rnf :: Term -> () #

Pretty Type # 

Methods

pretty :: Type -> Doc #

prettyPrec :: Int -> Type -> Doc #

prettyList :: [Type] -> Doc #

Pretty Term # 

Methods

pretty :: Term -> Doc #

prettyPrec :: Int -> Term -> Doc #

prettyList :: [Term] -> Doc #

Pretty CompiledClauses # 
KillRange Substitution # 
KillRange Term # 
KillRange CompiledClauses # 
TermSize Term # 

Methods

termSize :: Term -> Int #

tsize :: Term -> Sum Int #

IsProjElim Elim # 
TelToArgs ListTel # 

Methods

telToArgs :: ListTel -> [Arg ArgName] #

TelToArgs Telescope # 
DeBruijn Term #

We can substitute Terms for variables.

Free Term # 

Methods

freeVars' :: IsVarSet c => Term -> FreeM c #

TermLike Type # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Type -> m Type #

foldTerm :: Monoid m => (Term -> m) -> Type -> m #

TermLike Term # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Term -> m Term #

foldTerm :: Monoid m => (Term -> m) -> Term -> m #

GetDefs Type # 

Methods

getDefs :: MonadGetDefs m => Type -> m () #

GetDefs Term # 

Methods

getDefs :: MonadGetDefs m => Term -> m () #

Free Type # 

Methods

freeVars' :: Type -> FreeT

Free Term # 

Methods

freeVars' :: Term -> FreeT

TeleNoAbs ListTel # 

Methods

teleNoAbs :: ListTel -> Term -> Term #

TeleNoAbs Telescope # 

Methods

teleNoAbs :: Telescope -> Term -> Term #

PrettyTCM Telescope # 

Methods

prettyTCM :: Telescope -> TCM Doc #

PrettyTCM Type # 

Methods

prettyTCM :: Type -> TCM Doc #

PrettyTCM Elim # 

Methods

prettyTCM :: Elim -> TCM Doc #

PrettyTCM Term # 

Methods

prettyTCM :: Term -> TCM Doc #

NamesIn Term # 

Methods

namesIn :: Term -> Set QName #

NamesIn CompiledClauses # 
IsSizeType Term # 
AddContext Telescope # 

Methods

addContext :: MonadTCM tcm => Telescope -> tcm a -> tcm a #

contextSize :: Telescope -> Nat #

UnFreezeMeta Type # 

Methods

unfreezeMeta :: Type -> TCM () #

UnFreezeMeta Term # 

Methods

unfreezeMeta :: Term -> TCM () #

IsInstantiatedMeta Term # 
MentionsMeta Type # 

Methods

mentionsMeta :: MetaId -> Type -> Bool #

MentionsMeta Elim # 

Methods

mentionsMeta :: MetaId -> Elim -> Bool #

MentionsMeta Term # 

Methods

mentionsMeta :: MetaId -> Term -> Bool #

InstantiateFull Substitution # 
InstantiateFull Term # 
InstantiateFull CompiledClauses # 
Normalise Type # 
Normalise Elim # 
Normalise Term # 
Simplify Type # 

Methods

simplify' :: Type -> ReduceM Type #

Simplify Elim # 

Methods

simplify' :: Elim -> ReduceM Elim #

Simplify Term # 

Methods

simplify' :: Term -> ReduceM Term #

Reduce Telescope # 
Reduce Type # 
Reduce Elim # 
Reduce Term # 
Instantiate Telescope # 
Instantiate Type # 
Instantiate Elim # 
Instantiate Term # 
SynEq Type #

Syntactic equality ignores sorts.

Methods

synEq :: Type -> Type -> SynEqM (Type, Type)

synEq' :: Type -> Type -> SynEqM (Type, Type)

SynEq Term #

Syntactic term equality ignores DontCare stuff.

Methods

synEq :: Term -> Term -> SynEqM (Term, Term)

synEq' :: Term -> Term -> SynEqM (Term, Term)

DropArgs Telescope #

NOTE: This creates telescopes with unbound de Bruijn indices.

Methods

dropArgs :: Int -> Telescope -> Telescope #

DropArgs CompiledClauses #

To drop the first n arguments in a compiled clause, we reduce the split argument indices by n and drop n arguments from the bodies. NOTE: this only works for non-recursive functions, we are not dropping arguments to recursive calls in bodies.

SubstWithOrigin Term # 
Match Term # 

Methods

match :: Term -> Term -> MaybeT TCM [WithOrigin Term] #

HasPolarity Type # 

Methods

polarities :: Nat -> Type -> TCM [Polarity] #

HasPolarity Term # 

Methods

polarities :: Nat -> Term -> TCM [Polarity] #

ComputeOccurrences Type # 
ComputeOccurrences Term # 
ToTerm Type # 

Methods

toTerm :: TCM (Type -> Term) #

toTermR :: TCM (Type -> ReduceM Term) #

ToTerm Term # 

Methods

toTerm :: TCM (Term -> Term) #

toTermR :: TCM (Term -> ReduceM Term) #

PrimTerm Type # 

Methods

primTerm :: Type -> TCM Term #

FoldRigid Type # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Type -> TCM m #

FoldRigid Term # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Term -> TCM m #

Occurs Type # 
Occurs Term # 
NoProjectedVar Term # 
ForcedVariables Term #

Assumes that the term is in normal form.

Methods

forcedVariables :: Term -> [Nat] #

AbsTerm Type # 

Methods

absTerm :: Term -> Type -> Type #

AbsTerm Term # 

Methods

absTerm :: Term -> Term -> Term #

IsPrefixOf Elims # 

Methods

isPrefixOf :: Elims -> Elims -> Maybe Elims #

IsPrefixOf Term # 

Methods

isPrefixOf :: Term -> Term -> Maybe Elims #

IsPrefixOf Args # 

Methods

isPrefixOf :: Args -> Args -> Maybe Elims #

UniverseBi Elims Pattern # 

Methods

universeBi :: Elims -> [Pattern] #

UniverseBi Elims Term # 

Methods

universeBi :: Elims -> [Term] #

UniverseBi Args Pattern # 

Methods

universeBi :: Args -> [Pattern] #

UniverseBi Args Term # 

Methods

universeBi :: Args -> [Term] #

Subst Term QName # 
Subst Term AsBinding # 
Subst Term DotPatternInst # 
Subst Term ProblemRest # 
Subst Term SizeConstraint # 
Subst Term SizeMeta # 
Reify Telescope Telescope # 
Reify Type Expr # 

Methods

reify :: Type -> TCM Expr #

reifyWhen :: Bool -> Type -> TCM Expr #

Reify Term Expr # 

Methods

reify :: Term -> TCM Expr #

reifyWhen :: Bool -> Term -> TCM Expr #

Match NLPType Type # 

Methods

match :: Relevance -> Telescope -> Telescope -> NLPType -> Type -> NLM () #

Match NLPat Term # 

Methods

match :: Relevance -> Telescope -> Telescope -> NLPat -> Term -> NLM () #

PatternFrom Type NLPType # 
PatternFrom Term NLPat # 

Methods

patternFrom :: Relevance -> Int -> Term -> TCM NLPat #

Conversion TOM Type (MExp O) # 

Methods

convert :: Type -> TOM (MExp O) #

Conversion TOM Term (MExp O) # 

Methods

convert :: Term -> TOM (MExp O) #

Conversion TOM Args (MM (ArgList O) (RefInfo O)) # 

Methods

convert :: Args -> TOM (MM (ArgList O) (RefInfo O)) #

Subst Term (Problem' p) # 
Conversion MOT (Exp O) Type # 

Methods

convert :: Exp O -> MOT Type #

Conversion MOT (Exp O) Term # 

Methods

convert :: Exp O -> MOT Term #

Subst Term (SizeExpr' NamedRigid SizeMeta) #

Only for raise.

SgTel (Dom (ArgName, Type)) # 

Methods

sgTel :: Dom (ArgName, Type) -> Telescope #

SgTel (Dom Type) # 

Methods

sgTel :: Dom Type -> Telescope #

AddContext (Dom (String, Type)) # 

Methods

addContext :: MonadTCM tcm => Dom (String, Type) -> tcm a -> tcm a #

contextSize :: Dom (String, Type) -> Nat #

AddContext (Dom (Name, Type)) # 

Methods

addContext :: MonadTCM tcm => Dom (Name, Type) -> tcm a -> tcm a #

contextSize :: Dom (Name, Type) -> Nat #

AddContext (Dom Type) # 

Methods

addContext :: MonadTCM tcm => Dom Type -> tcm a -> tcm a #

contextSize :: Dom Type -> Nat #

AddContext (KeepNames Telescope) # 

Methods

addContext :: MonadTCM tcm => KeepNames Telescope -> tcm a -> tcm a #

contextSize :: KeepNames Telescope -> Nat #

SubstWithOrigin (Arg Term) # 
UniverseBi [Term] Term # 

Methods

universeBi :: [Term] -> [Term] #

SgTel (ArgName, Dom Type) # 

Methods

sgTel :: (ArgName, Dom Type) -> Telescope #

AddContext ([WithHiding Name], Dom Type) # 

Methods

addContext :: MonadTCM tcm => ([WithHiding Name], Dom Type) -> tcm a -> tcm a #

contextSize :: ([WithHiding Name], Dom Type) -> Nat #

AddContext ([Name], Dom Type) # 

Methods

addContext :: MonadTCM tcm => ([Name], Dom Type) -> tcm a -> tcm a #

contextSize :: ([Name], Dom Type) -> Nat #

AddContext (String, Dom Type) # 

Methods

addContext :: MonadTCM tcm => (String, Dom Type) -> tcm a -> tcm a #

contextSize :: (String, Dom Type) -> Nat #

AddContext (Name, Dom Type) # 

Methods

addContext :: MonadTCM tcm => (Name, Dom Type) -> tcm a -> tcm a #

contextSize :: (Name, Dom Type) -> Nat #

AddContext (KeepNames String, Dom Type) # 

Methods

addContext :: MonadTCM tcm => (KeepNames String, Dom Type) -> tcm a -> tcm a #

contextSize :: (KeepNames String, Dom Type) -> Nat #

UniverseBi ([Type], [Clause]) Pattern # 

Methods

universeBi :: ([Type], [Clause]) -> [Pattern] #

UniverseBi ([Type], [Clause]) Term # 

Methods

universeBi :: ([Type], [Clause]) -> [Term] #

data Elim' a #

Eliminations, subsuming applications and projections.

Constructors

Apply (Arg a)

Application.

Proj ProjOrigin QName

Projection. QName is name of a record projection.

Instances

Functor Elim' # 

Methods

fmap :: (a -> b) -> Elim' a -> Elim' b #

(<$) :: a -> Elim' b -> Elim' a #

Foldable Elim' # 

Methods

fold :: Monoid m => Elim' m -> m #

foldMap :: Monoid m => (a -> m) -> Elim' a -> m #

foldr :: (a -> b -> b) -> b -> Elim' a -> b #

foldr' :: (a -> b -> b) -> b -> Elim' a -> b #

foldl :: (b -> a -> b) -> b -> Elim' a -> b #

foldl' :: (b -> a -> b) -> b -> Elim' a -> b #

foldr1 :: (a -> a -> a) -> Elim' a -> a #

foldl1 :: (a -> a -> a) -> Elim' a -> a #

toList :: Elim' a -> [a] #

null :: Elim' a -> Bool #

length :: Elim' a -> Int #

elem :: Eq a => a -> Elim' a -> Bool #

maximum :: Ord a => Elim' a -> a #

minimum :: Ord a => Elim' a -> a #

sum :: Num a => Elim' a -> a #

product :: Num a => Elim' a -> a #

Traversable Elim' # 

Methods

traverse :: Applicative f => (a -> f b) -> Elim' a -> f (Elim' b) #

sequenceA :: Applicative f => Elim' (f a) -> f (Elim' a) #

mapM :: Monad m => (a -> m b) -> Elim' a -> m (Elim' b) #

sequence :: Monad m => Elim' (m a) -> m (Elim' a) #

IsProjElim Elim # 
PrettyTCM Elim # 

Methods

prettyTCM :: Elim -> TCM Doc #

MentionsMeta Elim # 

Methods

mentionsMeta :: MetaId -> Elim -> Bool #

Normalise Elim # 
Simplify Elim # 

Methods

simplify' :: Elim -> ReduceM Elim #

Reduce Elim # 
Instantiate Elim # 
IsPrefixOf Elims # 

Methods

isPrefixOf :: Elims -> Elims -> Maybe Elims #

UniverseBi Elims Pattern # 

Methods

universeBi :: Elims -> [Pattern] #

UniverseBi Elims Term # 

Methods

universeBi :: Elims -> [Term] #

Data a => Data (Elim' a) # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Elim' a -> c (Elim' a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Elim' a) #

toConstr :: Elim' a -> Constr #

dataTypeOf :: Elim' a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Elim' a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Elim' a)) #

gmapT :: (forall b. Data b => b -> b) -> Elim' a -> Elim' a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Elim' a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Elim' a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Elim' a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Elim' a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Elim' a -> m (Elim' a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Elim' a -> m (Elim' a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Elim' a -> m (Elim' a) #

Show a => Show (Elim' a) # 

Methods

showsPrec :: Int -> Elim' a -> ShowS #

show :: Elim' a -> String #

showList :: [Elim' a] -> ShowS #

NFData a => NFData (Elim' a) # 

Methods

rnf :: Elim' a -> () #

Pretty tm => Pretty (Elim' tm) # 

Methods

pretty :: Elim' tm -> Doc #

prettyPrec :: Int -> Elim' tm -> Doc #

prettyList :: [Elim' tm] -> Doc #

KillRange a => KillRange (Elim' a) # 

Methods

killRange :: KillRangeT (Elim' a) #

LensOrigin (Elim' a) #

This instance cheats on Proj, use with care. Projs are always assumed to be UserWritten, since they have no ArgInfo.

Methods

getOrigin :: Elim' a -> Origin #

setOrigin :: Origin -> Elim' a -> Elim' a #

mapOrigin :: (Origin -> Origin) -> Elim' a -> Elim' a #

Free a => Free (Elim' a) # 

Methods

freeVars' :: IsVarSet c => Elim' a -> FreeM c #

TermLike a => TermLike (Elim' a) # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Elim' a -> m (Elim' a) #

foldTerm :: Monoid m => (Term -> m) -> Elim' a -> m #

GetDefs a => GetDefs (Elim' a) # 

Methods

getDefs :: MonadGetDefs m => Elim' a -> m () #

Free a => Free (Elim' a) # 

Methods

freeVars' :: Elim' a -> FreeT

PrettyTCM (Elim' NLPat) # 

Methods

prettyTCM :: Elim' NLPat -> TCM Doc #

PrettyTCM (Elim' DisplayTerm) # 
NamesIn a => NamesIn (Elim' a) # 

Methods

namesIn :: Elim' a -> Set QName #

InstantiateFull a => InstantiateFull (Elim' a) # 

Methods

instantiateFull' :: Elim' a -> ReduceM (Elim' a) #

SynEq a => SynEq (Elim' a) # 

Methods

synEq :: Elim' a -> Elim' a -> SynEqM (Elim' a, Elim' a)

synEq' :: Elim' a -> Elim' a -> SynEqM (Elim' a, Elim' a)

SubstWithOrigin (Arg a) => SubstWithOrigin (Elim' a) # 
Match a => Match (Elim' a) # 

Methods

match :: Elim' a -> Elim' a -> MaybeT TCM [WithOrigin Term] #

HasPolarity a => HasPolarity (Elim' a) # 

Methods

polarities :: Nat -> Elim' a -> TCM [Polarity] #

ComputeOccurrences a => ComputeOccurrences (Elim' a) # 
FoldRigid a => FoldRigid (Elim' a) # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Elim' a -> TCM m #

Occurs a => Occurs (Elim' a) # 

Methods

occurs :: UnfoldStrategy -> OccursCtx -> MetaId -> Vars -> Elim' a -> TCM (Elim' a) #

metaOccurs :: MetaId -> Elim' a -> TCM () #

AbsTerm a => AbsTerm (Elim' a) # 

Methods

absTerm :: Term -> Elim' a -> Elim' a #

Reify i a => Reify (Elim' i) (Elim' a) # 

Methods

reify :: Elim' i -> TCM (Elim' a) #

reifyWhen :: Bool -> Elim' i -> TCM (Elim' a) #

Match a b => Match (Elim' a) (Elim' b) # 

Methods

match :: Relevance -> Telescope -> Telescope -> Elim' a -> Elim' b -> NLM () #

PatternFrom a NLPat => PatternFrom (Elim' a) (Elim' NLPat) # 

Methods

patternFrom :: Relevance -> Int -> Elim' a -> TCM (Elim' NLPat) #

type Elim = Elim' Term #

type Elims #

Arguments

 = [Elim]

eliminations ordered left-to-right.

type ArgName = String #

Names in binders and arguments.

data Abs a #

Binder. Abs: The bound variable might appear in the body. NoAbs is pseudo-binder, it does not introduce a fresh variable, similar to the const of Haskell.

Constructors

Abs

The body has (at least) one free variable. Danger: unAbs doesn't shift variables properly

Fields

NoAbs 

Fields

Instances

Functor Abs # 

Methods

fmap :: (a -> b) -> Abs a -> Abs b #

(<$) :: a -> Abs b -> Abs a #

Foldable Abs # 

Methods

fold :: Monoid m => Abs m -> m #

foldMap :: Monoid m => (a -> m) -> Abs a -> m #

foldr :: (a -> b -> b) -> b -> Abs a -> b #

foldr' :: (a -> b -> b) -> b -> Abs a -> b #

foldl :: (b -> a -> b) -> b -> Abs a -> b #

foldl' :: (b -> a -> b) -> b -> Abs a -> b #

foldr1 :: (a -> a -> a) -> Abs a -> a #

foldl1 :: (a -> a -> a) -> Abs a -> a #

toList :: Abs a -> [a] #

null :: Abs a -> Bool #

length :: Abs a -> Int #

elem :: Eq a => a -> Abs a -> Bool #

maximum :: Ord a => Abs a -> a #

minimum :: Ord a => Abs a -> a #

sum :: Num a => Abs a -> a #

product :: Num a => Abs a -> a #

Traversable Abs # 

Methods

traverse :: Applicative f => (a -> f b) -> Abs a -> f (Abs b) #

sequenceA :: Applicative f => Abs (f a) -> f (Abs a) #

mapM :: Monad m => (a -> m b) -> Abs a -> m (Abs b) #

sequence :: Monad m => Abs (m a) -> m (Abs a) #

Decoration Abs # 

Methods

traverseF :: Functor m => (a -> m b) -> Abs a -> m (Abs b) #

distributeF :: Functor m => Abs (m a) -> m (Abs a) #

Suggest String (Abs b) # 

Methods

suggest :: String -> Abs b -> String #

Suggest Name (Abs b) # 

Methods

suggest :: Name -> Abs b -> String #

Conversion MOT a b => Conversion MOT (Abs a) (Abs b) # 

Methods

convert :: Abs a -> MOT (Abs b) #

Data a => Data (Abs a) # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Abs a -> c (Abs a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Abs a) #

toConstr :: Abs a -> Constr #

dataTypeOf :: Abs a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Abs a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Abs a)) #

gmapT :: (forall b. Data b => b -> b) -> Abs a -> Abs a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Abs a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Abs a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Abs a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Abs a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Abs a -> m (Abs a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Abs a -> m (Abs a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Abs a -> m (Abs a) #

Show a => Show (Abs a) # 

Methods

showsPrec :: Int -> Abs a -> ShowS #

show :: Abs a -> String #

showList :: [Abs a] -> ShowS #

Sized a => Sized (Abs a) # 

Methods

size :: Abs a -> Int #

KillRange a => KillRange (Abs a) # 

Methods

killRange :: KillRangeT (Abs a) #

LensSort a => LensSort (Abs a) # 

Methods

lensSort :: Lens' Sort (Abs a) #

getSort :: Abs a -> Sort #

Free a => Free (Abs a) # 

Methods

freeVars' :: IsVarSet c => Abs a -> FreeM c #

TermLike a => TermLike (Abs a) # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Abs a -> m (Abs a) #

foldTerm :: Monoid m => (Term -> m) -> Abs a -> m #

GetDefs a => GetDefs (Abs a) # 

Methods

getDefs :: MonadGetDefs m => Abs a -> m () #

Free a => Free (Abs a) # 

Methods

freeVars' :: Abs a -> FreeT

NamesIn a => NamesIn (Abs a) # 

Methods

namesIn :: Abs a -> Set QName #

UnFreezeMeta a => UnFreezeMeta (Abs a) # 

Methods

unfreezeMeta :: Abs a -> TCM () #

IsInstantiatedMeta a => IsInstantiatedMeta (Abs a) #

Does not worry about raising.

MentionsMeta t => MentionsMeta (Abs t) # 

Methods

mentionsMeta :: MetaId -> Abs t -> Bool #

(Subst t a, InstantiateFull a) => InstantiateFull (Abs a) # 

Methods

instantiateFull' :: Abs a -> ReduceM (Abs a) #

(Subst t a, Normalise a) => Normalise (Abs a) # 

Methods

normalise' :: Abs a -> ReduceM (Abs a) #

(Subst t a, Simplify a) => Simplify (Abs a) # 

Methods

simplify' :: Abs a -> ReduceM (Abs a) #

(Subst t a, Reduce a) => Reduce (Abs a) # 

Methods

reduce' :: Abs a -> ReduceM (Abs a) #

reduceB' :: Abs a -> ReduceM (Blocked (Abs a)) #

Instantiate t => Instantiate (Abs t) # 

Methods

instantiate' :: Abs t -> ReduceM (Abs t) #

(Subst t a, SynEq a) => SynEq (Abs a) # 

Methods

synEq :: Abs a -> Abs a -> SynEqM (Abs a, Abs a)

synEq' :: Abs a -> Abs a -> SynEqM (Abs a, Abs a)

HasPolarity a => HasPolarity (Abs a) # 

Methods

polarities :: Nat -> Abs a -> TCM [Polarity] #

ComputeOccurrences a => ComputeOccurrences (Abs a) # 
(Subst t a, FoldRigid a) => FoldRigid (Abs a) # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Abs a -> TCM m #

(Occurs a, Subst t a) => Occurs (Abs a) # 

Methods

occurs :: UnfoldStrategy -> OccursCtx -> MetaId -> Vars -> Abs a -> TCM (Abs a) #

metaOccurs :: MetaId -> Abs a -> TCM () #

(Subst Term a, AbsTerm a) => AbsTerm (Abs a) # 

Methods

absTerm :: Term -> Abs a -> Abs a #

Suggest (Abs a) (Abs b) # 

Methods

suggest :: Abs a -> Abs b -> String #

(Match a b, Subst t1 a, Subst t2 b) => Match (Abs a) (Abs b) # 

Methods

match :: Relevance -> Telescope -> Telescope -> Abs a -> Abs b -> NLM () #

PatternFrom a b => PatternFrom (Abs a) (Abs b) # 

Methods

patternFrom :: Relevance -> Int -> Abs a -> TCM (Abs b) #

(Free i, Reify i a) => Reify (Abs i) (Name, a) # 

Methods

reify :: Abs i -> TCM (Name, a) #

reifyWhen :: Bool -> Abs i -> TCM (Name, a) #

data Type' a #

Types are terms with a sort annotation.

Constructors

El 

Fields

Instances

Functor Type' # 

Methods

fmap :: (a -> b) -> Type' a -> Type' b #

(<$) :: a -> Type' b -> Type' a #

Foldable Type' # 

Methods

fold :: Monoid m => Type' m -> m #

foldMap :: Monoid m => (a -> m) -> Type' a -> m #

foldr :: (a -> b -> b) -> b -> Type' a -> b #

foldr' :: (a -> b -> b) -> b -> Type' a -> b #

foldl :: (b -> a -> b) -> b -> Type' a -> b #

foldl' :: (b -> a -> b) -> b -> Type' a -> b #

foldr1 :: (a -> a -> a) -> Type' a -> a #

foldl1 :: (a -> a -> a) -> Type' a -> a #

toList :: Type' a -> [a] #

null :: Type' a -> Bool #

length :: Type' a -> Int #

elem :: Eq a => a -> Type' a -> Bool #

maximum :: Ord a => Type' a -> a #

minimum :: Ord a => Type' a -> a #

sum :: Num a => Type' a -> a #

product :: Num a => Type' a -> a #

Traversable Type' # 

Methods

traverse :: Applicative f => (a -> f b) -> Type' a -> f (Type' b) #

sequenceA :: Applicative f => Type' (f a) -> f (Type' a) #

mapM :: Monad m => (a -> m b) -> Type' a -> m (Type' b) #

sequence :: Monad m => Type' (m a) -> m (Type' a) #

NFData Type # 

Methods

rnf :: Type -> () #

Decoration Type' # 

Methods

traverseF :: Functor m => (a -> m b) -> Type' a -> m (Type' b) #

distributeF :: Functor m => Type' (m a) -> m (Type' a) #

Pretty Type # 

Methods

pretty :: Type -> Doc #

prettyPrec :: Int -> Type -> Doc #

prettyList :: [Type] -> Doc #

TelToArgs ListTel # 

Methods

telToArgs :: ListTel -> [Arg ArgName] #

TelToArgs Telescope # 
TermLike Type # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Type -> m Type #

foldTerm :: Monoid m => (Term -> m) -> Type -> m #

GetDefs Type # 

Methods

getDefs :: MonadGetDefs m => Type -> m () #

Free Type # 

Methods

freeVars' :: Type -> FreeT

TeleNoAbs ListTel # 

Methods

teleNoAbs :: ListTel -> Term -> Term #

TeleNoAbs Telescope # 

Methods

teleNoAbs :: Telescope -> Term -> Term #

PrettyTCM Telescope # 

Methods

prettyTCM :: Telescope -> TCM Doc #

PrettyTCM Type # 

Methods

prettyTCM :: Type -> TCM Doc #

AddContext Telescope # 

Methods

addContext :: MonadTCM tcm => Telescope -> tcm a -> tcm a #

contextSize :: Telescope -> Nat #

UnFreezeMeta Type # 

Methods

unfreezeMeta :: Type -> TCM () #

MentionsMeta Type # 

Methods

mentionsMeta :: MetaId -> Type -> Bool #

Normalise Type # 
Simplify Type # 

Methods

simplify' :: Type -> ReduceM Type #

Reduce Telescope # 
Reduce Type # 
Instantiate Telescope # 
Instantiate Type # 
SynEq Type #

Syntactic equality ignores sorts.

Methods

synEq :: Type -> Type -> SynEqM (Type, Type)

synEq' :: Type -> Type -> SynEqM (Type, Type)

DropArgs Telescope #

NOTE: This creates telescopes with unbound de Bruijn indices.

Methods

dropArgs :: Int -> Telescope -> Telescope #

HasPolarity Type # 

Methods

polarities :: Nat -> Type -> TCM [Polarity] #

ComputeOccurrences Type # 
ToTerm Type # 

Methods

toTerm :: TCM (Type -> Term) #

toTermR :: TCM (Type -> ReduceM Term) #

PrimTerm Type # 

Methods

primTerm :: Type -> TCM Term #

FoldRigid Type # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Type -> TCM m #

Occurs Type # 
AbsTerm Type # 

Methods

absTerm :: Term -> Type -> Type #

Reify Telescope Telescope # 
Reify Type Expr # 

Methods

reify :: Type -> TCM Expr #

reifyWhen :: Bool -> Type -> TCM Expr #

Match NLPType Type # 

Methods

match :: Relevance -> Telescope -> Telescope -> NLPType -> Type -> NLM () #

PatternFrom Type NLPType # 
Conversion TOM Type (MExp O) # 

Methods

convert :: Type -> TOM (MExp O) #

Conversion MOT (Exp O) Type # 

Methods

convert :: Exp O -> MOT Type #

Data a => Data (Type' a) # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type' a -> c (Type' a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Type' a) #

toConstr :: Type' a -> Constr #

dataTypeOf :: Type' a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Type' a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Type' a)) #

gmapT :: (forall b. Data b => b -> b) -> Type' a -> Type' a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type' a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type' a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Type' a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Type' a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type' a -> m (Type' a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type' a -> m (Type' a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type' a -> m (Type' a) #

Show a => Show (Type' a) # 

Methods

showsPrec :: Int -> Type' a -> ShowS #

show :: Type' a -> String #

showList :: [Type' a] -> ShowS #

KillRange a => KillRange (Type' a) # 

Methods

killRange :: KillRangeT (Type' a) #

SgTel (Dom (ArgName, Type)) # 

Methods

sgTel :: Dom (ArgName, Type) -> Telescope #

SgTel (Dom Type) # 

Methods

sgTel :: Dom Type -> Telescope #

LensSort (Type' a) # 

Methods

lensSort :: Lens' Sort (Type' a) #

getSort :: Type' a -> Sort #

Free a => Free (Type' a) # 

Methods

freeVars' :: IsVarSet c => Type' a -> FreeM c #

PrettyTCM (Type' NLPat) # 

Methods

prettyTCM :: Type' NLPat -> TCM Doc #

NamesIn a => NamesIn (Type' a) # 

Methods

namesIn :: Type' a -> Set QName #

IsSizeType a => IsSizeType (Type' a) # 
AddContext (Dom (String, Type)) # 

Methods

addContext :: MonadTCM tcm => Dom (String, Type) -> tcm a -> tcm a #

contextSize :: Dom (String, Type) -> Nat #

AddContext (Dom (Name, Type)) # 

Methods

addContext :: MonadTCM tcm => Dom (Name, Type) -> tcm a -> tcm a #

contextSize :: Dom (Name, Type) -> Nat #

AddContext (Dom Type) # 

Methods

addContext :: MonadTCM tcm => Dom Type -> tcm a -> tcm a #

contextSize :: Dom Type -> Nat #

AddContext (KeepNames Telescope) # 

Methods

addContext :: MonadTCM tcm => KeepNames Telescope -> tcm a -> tcm a #

contextSize :: KeepNames Telescope -> Nat #

InstantiateFull a => InstantiateFull (Type' a) # 

Methods

instantiateFull' :: Type' a -> ReduceM (Type' a) #

SgTel (ArgName, Dom Type) # 

Methods

sgTel :: (ArgName, Dom Type) -> Telescope #

AddContext ([WithHiding Name], Dom Type) # 

Methods

addContext :: MonadTCM tcm => ([WithHiding Name], Dom Type) -> tcm a -> tcm a #

contextSize :: ([WithHiding Name], Dom Type) -> Nat #

AddContext ([Name], Dom Type) # 

Methods

addContext :: MonadTCM tcm => ([Name], Dom Type) -> tcm a -> tcm a #

contextSize :: ([Name], Dom Type) -> Nat #

AddContext (String, Dom Type) # 

Methods

addContext :: MonadTCM tcm => (String, Dom Type) -> tcm a -> tcm a #

contextSize :: (String, Dom Type) -> Nat #

AddContext (Name, Dom Type) # 

Methods

addContext :: MonadTCM tcm => (Name, Dom Type) -> tcm a -> tcm a #

contextSize :: (Name, Dom Type) -> Nat #

AddContext (KeepNames String, Dom Type) # 

Methods

addContext :: MonadTCM tcm => (KeepNames String, Dom Type) -> tcm a -> tcm a #

contextSize :: (KeepNames String, Dom Type) -> Nat #

UniverseBi ([Type], [Clause]) Pattern # 

Methods

universeBi :: ([Type], [Clause]) -> [Pattern] #

UniverseBi ([Type], [Clause]) Term # 

Methods

universeBi :: ([Type], [Clause]) -> [Term] #

type Type = Type' Term #

class LensSort a where #

Minimal complete definition

lensSort

Methods

lensSort :: Lens' Sort a #

getSort :: a -> Sort #

Instances

LensSort a => LensSort (Dom a) # 

Methods

lensSort :: Lens' Sort (Dom a) #

getSort :: Dom a -> Sort #

LensSort (Type' a) # 

Methods

lensSort :: Lens' Sort (Type' a) #

getSort :: Type' a -> Sort #

LensSort a => LensSort (Abs a) # 

Methods

lensSort :: Lens' Sort (Abs a) #

getSort :: Abs a -> Sort #

data Tele a #

Sequence of types. An argument of the first type is bound in later types and so on.

Constructors

EmptyTel 
ExtendTel a (Abs (Tele a))

Abs is never NoAbs.

Instances

Functor Tele # 

Methods

fmap :: (a -> b) -> Tele a -> Tele b #

(<$) :: a -> Tele b -> Tele a #

Foldable Tele # 

Methods

fold :: Monoid m => Tele m -> m #

foldMap :: Monoid m => (a -> m) -> Tele a -> m #

foldr :: (a -> b -> b) -> b -> Tele a -> b #

foldr' :: (a -> b -> b) -> b -> Tele a -> b #

foldl :: (b -> a -> b) -> b -> Tele a -> b #

foldl' :: (b -> a -> b) -> b -> Tele a -> b #

foldr1 :: (a -> a -> a) -> Tele a -> a #

foldl1 :: (a -> a -> a) -> Tele a -> a #

toList :: Tele a -> [a] #

null :: Tele a -> Bool #

length :: Tele a -> Int #

elem :: Eq a => a -> Tele a -> Bool #

maximum :: Ord a => Tele a -> a #

minimum :: Ord a => Tele a -> a #

sum :: Num a => Tele a -> a #

product :: Num a => Tele a -> a #

Traversable Tele # 

Methods

traverse :: Applicative f => (a -> f b) -> Tele a -> f (Tele b) #

sequenceA :: Applicative f => Tele (f a) -> f (Tele a) #

mapM :: Monad m => (a -> m b) -> Tele a -> m (Tele b) #

sequence :: Monad m => Tele (m a) -> m (Tele a) #

TelToArgs Telescope # 
TeleNoAbs Telescope # 

Methods

teleNoAbs :: Telescope -> Term -> Term #

PrettyTCM Telescope # 

Methods

prettyTCM :: Telescope -> TCM Doc #

AddContext Telescope # 

Methods

addContext :: MonadTCM tcm => Telescope -> tcm a -> tcm a #

contextSize :: Telescope -> Nat #

Reduce Telescope # 
Instantiate Telescope # 
DropArgs Telescope #

NOTE: This creates telescopes with unbound de Bruijn indices.

Methods

dropArgs :: Int -> Telescope -> Telescope #

Reify Telescope Telescope # 
Data a => Data (Tele a) # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Tele a -> c (Tele a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tele a) #

toConstr :: Tele a -> Constr #

dataTypeOf :: Tele a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Tele a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tele a)) #

gmapT :: (forall b. Data b => b -> b) -> Tele a -> Tele a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tele a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tele a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tele a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tele a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tele a -> m (Tele a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tele a -> m (Tele a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tele a -> m (Tele a) #

Show a => Show (Tele a) # 

Methods

showsPrec :: Int -> Tele a -> ShowS #

show :: Tele a -> String #

showList :: [Tele a] -> ShowS #

Null (Tele a) # 

Methods

empty :: Tele a #

null :: Tele a -> Bool #

Pretty a => Pretty (Tele (Dom a)) # 

Methods

pretty :: Tele (Dom a) -> Doc #

prettyPrec :: Int -> Tele (Dom a) -> Doc #

prettyList :: [Tele (Dom a)] -> Doc #

Sized (Tele a) #

The size of a telescope is its length (as a list).

Methods

size :: Tele a -> Int #

KillRange a => KillRange (Tele a) # 

Methods

killRange :: KillRangeT (Tele a) #

Free a => Free (Tele a) # 

Methods

freeVars' :: IsVarSet c => Tele a -> FreeM c #

Free a => Free (Tele a) # 

Methods

freeVars' :: Tele a -> FreeT

NamesIn a => NamesIn (Tele a) # 

Methods

namesIn :: Tele a -> Set QName #

AddContext (KeepNames Telescope) # 

Methods

addContext :: MonadTCM tcm => KeepNames Telescope -> tcm a -> tcm a #

contextSize :: KeepNames Telescope -> Nat #

MentionsMeta a => MentionsMeta (Tele a) # 

Methods

mentionsMeta :: MetaId -> Tele a -> Bool #

(Subst t a, InstantiateFull a) => InstantiateFull (Tele a) # 

Methods

instantiateFull' :: Tele a -> ReduceM (Tele a) #

(Subst t a, Normalise a) => Normalise (Tele a) # 

Methods

normalise' :: Tele a -> ReduceM (Tele a) #

(Subst t a, Simplify a) => Simplify (Tele a) # 

Methods

simplify' :: Tele a -> ReduceM (Tele a) #

ComputeOccurrences a => ComputeOccurrences (Tele a) # 

data Sort #

Sorts.

Constructors

Type Level

Set ℓ.

Prop

Dummy sort.

Inf

Setω.

SizeUniv

SizeUniv, a sort inhabited by type Size.

DLub Sort (Abs Sort)

Dependent least upper bound. If the free variable occurs in the second sort, the whole thing should reduce to Inf, otherwise it's the normal lub.

Instances

Data Sort # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sort -> c Sort #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Sort #

toConstr :: Sort -> Constr #

dataTypeOf :: Sort -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Sort) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Sort) #

gmapT :: (forall b. Data b => b -> b) -> Sort -> Sort #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sort -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sort -> r #

gmapQ :: (forall d. Data d => d -> u) -> Sort -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Sort -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sort -> m Sort #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sort -> m Sort #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sort -> m Sort #

Show Sort # 

Methods

showsPrec :: Int -> Sort -> ShowS #

show :: Sort -> String #

showList :: [Sort] -> ShowS #

NFData Sort # 

Methods

rnf :: Sort -> () #

Pretty Sort # 

Methods

pretty :: Sort -> Doc #

prettyPrec :: Int -> Sort -> Doc #

prettyList :: [Sort] -> Doc #

KillRange Sort # 
TermSize Sort # 

Methods

termSize :: Sort -> Int #

tsize :: Sort -> Sum Int #

Free Sort # 

Methods

freeVars' :: IsVarSet c => Sort -> FreeM c #

GetDefs Sort # 

Methods

getDefs :: MonadGetDefs m => Sort -> m () #

Free Sort # 

Methods

freeVars' :: Sort -> FreeT

PrettyTCM Sort # 

Methods

prettyTCM :: Sort -> TCM Doc #

NamesIn Sort # 

Methods

namesIn :: Sort -> Set QName #

UnFreezeMeta Sort # 

Methods

unfreezeMeta :: Sort -> TCM () #

MentionsMeta Sort # 

Methods

mentionsMeta :: MetaId -> Sort -> Bool #

InstantiateFull Sort # 
Normalise Sort # 
Simplify Sort # 

Methods

simplify' :: Sort -> ReduceM Sort #

Reduce Sort # 
Instantiate Sort # 
SynEq Sort # 

Methods

synEq :: Sort -> Sort -> SynEqM (Sort, Sort)

synEq' :: Sort -> Sort -> SynEqM (Sort, Sort)

Match Sort # 

Methods

match :: Sort -> Sort -> MaybeT TCM [WithOrigin Term] #

FoldRigid Sort # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Sort -> TCM m #

Occurs Sort # 
AbsTerm Sort # 

Methods

absTerm :: Term -> Sort -> Sort #

Reify Sort Expr # 

Methods

reify :: Sort -> TCM Expr #

reifyWhen :: Bool -> Sort -> TCM Expr #

Match NLPat Sort # 

Methods

match :: Relevance -> Telescope -> Telescope -> NLPat -> Sort -> NLM () #

PatternFrom Sort NLPat # 

Methods

patternFrom :: Relevance -> Int -> Sort -> TCM NLPat #

newtype Level #

A level is a maximum expression of 0..n PlusLevel expressions each of which is a number or an atom plus a number.

The empty maximum is the canonical representation for level 0.

Constructors

Max [PlusLevel] 

Instances

Data Level # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Level -> c Level #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Level #

toConstr :: Level -> Constr #

dataTypeOf :: Level -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Level) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Level) #

gmapT :: (forall b. Data b => b -> b) -> Level -> Level #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Level -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Level -> r #

gmapQ :: (forall d. Data d => d -> u) -> Level -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Level -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Level -> m Level #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Level -> m Level #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Level -> m Level #

Show Level # 

Methods

showsPrec :: Int -> Level -> ShowS #

show :: Level -> String #

showList :: [Level] -> ShowS #

NFData Level # 

Methods

rnf :: Level -> () #

Pretty Level # 

Methods

pretty :: Level -> Doc #

prettyPrec :: Int -> Level -> Doc #

prettyList :: [Level] -> Doc #

KillRange Level # 
TermSize Level # 

Methods

termSize :: Level -> Int #

tsize :: Level -> Sum Int #

DeBruijn Level # 
Free Level # 

Methods

freeVars' :: IsVarSet c => Level -> FreeM c #

TermLike Level # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Level -> m Level #

foldTerm :: Monoid m => (Term -> m) -> Level -> m #

GetDefs Level # 

Methods

getDefs :: MonadGetDefs m => Level -> m () #

Free Level # 

Methods

freeVars' :: Level -> FreeT

PrettyTCM Level # 

Methods

prettyTCM :: Level -> TCM Doc #

NamesIn Level # 

Methods

namesIn :: Level -> Set QName #

UnFreezeMeta Level # 

Methods

unfreezeMeta :: Level -> TCM () #

IsInstantiatedMeta Level # 
MentionsMeta Level # 

Methods

mentionsMeta :: MetaId -> Level -> Bool #

InstantiateFull Level # 
Normalise Level # 
Simplify Level # 
Reduce Level # 
Instantiate Level # 
SynEq Level # 

Methods

synEq :: Level -> Level -> SynEqM (Level, Level)

synEq' :: Level -> Level -> SynEqM (Level, Level)

Match Level # 
HasPolarity Level # 

Methods

polarities :: Nat -> Level -> TCM [Polarity] #

ComputeOccurrences Level # 
FoldRigid Level # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Level -> TCM m #

Occurs Level # 
AbsTerm Level # 

Methods

absTerm :: Term -> Level -> Level #

Reify Level Expr # 

Methods

reify :: Level -> TCM Expr #

reifyWhen :: Bool -> Level -> TCM Expr #

Match NLPat Level # 

Methods

match :: Relevance -> Telescope -> Telescope -> NLPat -> Level -> NLM () #

data PlusLevel #

Constructors

ClosedLevel Integer

n, to represent Setₙ.

Plus Integer LevelAtom

n + ℓ.

Instances

Data PlusLevel # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PlusLevel -> c PlusLevel #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PlusLevel #

toConstr :: PlusLevel -> Constr #

dataTypeOf :: PlusLevel -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PlusLevel) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PlusLevel) #

gmapT :: (forall b. Data b => b -> b) -> PlusLevel -> PlusLevel #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PlusLevel -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PlusLevel -> r #

gmapQ :: (forall d. Data d => d -> u) -> PlusLevel -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PlusLevel -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PlusLevel -> m PlusLevel #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PlusLevel -> m PlusLevel #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PlusLevel -> m PlusLevel #

Show PlusLevel # 
NFData PlusLevel # 

Methods

rnf :: PlusLevel -> () #

Pretty PlusLevel # 
KillRange PlusLevel # 
TermSize PlusLevel # 
DeBruijn PlusLevel # 
Free PlusLevel # 

Methods

freeVars' :: IsVarSet c => PlusLevel -> FreeM c #

TermLike PlusLevel # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> PlusLevel -> m PlusLevel #

foldTerm :: Monoid m => (Term -> m) -> PlusLevel -> m #

GetDefs PlusLevel # 

Methods

getDefs :: MonadGetDefs m => PlusLevel -> m () #

Free PlusLevel # 

Methods

freeVars' :: PlusLevel -> FreeT

NamesIn PlusLevel # 

Methods

namesIn :: PlusLevel -> Set QName #

UnFreezeMeta PlusLevel # 

Methods

unfreezeMeta :: PlusLevel -> TCM () #

IsInstantiatedMeta PlusLevel # 
MentionsMeta PlusLevel # 
InstantiateFull PlusLevel # 
Normalise PlusLevel # 
Simplify PlusLevel # 
Reduce PlusLevel # 
Instantiate PlusLevel # 
SynEq PlusLevel # 
HasPolarity PlusLevel # 

Methods

polarities :: Nat -> PlusLevel -> TCM [Polarity] #

ComputeOccurrences PlusLevel # 
FoldRigid PlusLevel # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> PlusLevel -> TCM m #

Occurs PlusLevel # 
AbsTerm PlusLevel # 

Methods

absTerm :: Term -> PlusLevel -> PlusLevel #

data LevelAtom #

An atomic term of type Level.

Constructors

MetaLevel MetaId Elims

A meta variable targeting Level under some eliminations.

BlockedLevel MetaId Term

A term of type Level whose reduction is blocked by a meta.

NeutralLevel NotBlocked Term

A neutral term of type Level.

UnreducedLevel Term

Introduced by instantiate, removed by reduce.

Instances

Data LevelAtom # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LevelAtom -> c LevelAtom #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LevelAtom #

toConstr :: LevelAtom -> Constr #

dataTypeOf :: LevelAtom -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c LevelAtom) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LevelAtom) #

gmapT :: (forall b. Data b => b -> b) -> LevelAtom -> LevelAtom #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LevelAtom -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LevelAtom -> r #

gmapQ :: (forall d. Data d => d -> u) -> LevelAtom -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LevelAtom -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LevelAtom -> m LevelAtom #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LevelAtom -> m LevelAtom #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LevelAtom -> m LevelAtom #

Show LevelAtom # 
NFData LevelAtom # 

Methods

rnf :: LevelAtom -> () #

Pretty LevelAtom # 
KillRange LevelAtom # 
TermSize LevelAtom # 
DeBruijn LevelAtom # 
Free LevelAtom # 

Methods

freeVars' :: IsVarSet c => LevelAtom -> FreeM c #

TermLike LevelAtom # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> LevelAtom -> m LevelAtom #

foldTerm :: Monoid m => (Term -> m) -> LevelAtom -> m #

GetDefs LevelAtom # 

Methods

getDefs :: MonadGetDefs m => LevelAtom -> m () #

Free LevelAtom # 

Methods

freeVars' :: LevelAtom -> FreeT

NamesIn LevelAtom # 

Methods

namesIn :: LevelAtom -> Set QName #

UnFreezeMeta LevelAtom # 

Methods

unfreezeMeta :: LevelAtom -> TCM () #

IsInstantiatedMeta LevelAtom # 
MentionsMeta LevelAtom # 
InstantiateFull LevelAtom # 
Normalise LevelAtom # 
Simplify LevelAtom # 
Reduce LevelAtom # 
Instantiate LevelAtom # 
SynEq LevelAtom # 
HasPolarity LevelAtom # 

Methods

polarities :: Nat -> LevelAtom -> TCM [Polarity] #

ComputeOccurrences LevelAtom # 
FoldRigid LevelAtom # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> LevelAtom -> TCM m #

Occurs LevelAtom # 
AbsTerm LevelAtom # 

Methods

absTerm :: Term -> LevelAtom -> LevelAtom #

Blocked Terms

data NotBlocked #

Even if we are not stuck on a meta during reduction we can fail to reduce a definition by pattern matching for another reason.

Constructors

StuckOn Elim

The Elim is neutral and blocks a pattern match.

Underapplied

Not enough arguments were supplied to complete the matching.

AbsurdMatch

We matched an absurd clause, results in a neutral Def.

MissingClauses

We ran out of clauses, all considered clauses produced an actual mismatch. This can happen when try to reduce a function application but we are still missing some function clauses. See Agda.TypeChecking.Patterns.Match.

ReallyNotBlocked

Reduction was not blocked, we reached a whnf which can be anything but a stuck Def.

Instances

Data NotBlocked # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NotBlocked -> c NotBlocked #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NotBlocked #

toConstr :: NotBlocked -> Constr #

dataTypeOf :: NotBlocked -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c NotBlocked) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NotBlocked) #

gmapT :: (forall b. Data b => b -> b) -> NotBlocked -> NotBlocked #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NotBlocked -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NotBlocked -> r #

gmapQ :: (forall d. Data d => d -> u) -> NotBlocked -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NotBlocked -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NotBlocked -> m NotBlocked #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NotBlocked -> m NotBlocked #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NotBlocked -> m NotBlocked #

Show NotBlocked # 
Semigroup NotBlocked #

ReallyNotBlocked is the unit. MissingClauses is dominant. StuckOn{} should be propagated, if tied, we take the left.

Monoid NotBlocked # 

data Blocked t #

Something where a meta variable may block reduction.

Instances

Functor Blocked # 

Methods

fmap :: (a -> b) -> Blocked a -> Blocked b #

(<$) :: a -> Blocked b -> Blocked a #

Applicative Blocked #

Blocking by a meta is dominant.

Methods

pure :: a -> Blocked a #

(<*>) :: Blocked (a -> b) -> Blocked a -> Blocked b #

liftA2 :: (a -> b -> c) -> Blocked a -> Blocked b -> Blocked c #

(*>) :: Blocked a -> Blocked b -> Blocked b #

(<*) :: Blocked a -> Blocked b -> Blocked a #

Foldable Blocked # 

Methods

fold :: Monoid m => Blocked m -> m #

foldMap :: Monoid m => (a -> m) -> Blocked a -> m #

foldr :: (a -> b -> b) -> b -> Blocked a -> b #

foldr' :: (a -> b -> b) -> b -> Blocked a -> b #

foldl :: (b -> a -> b) -> b -> Blocked a -> b #

foldl' :: (b -> a -> b) -> b -> Blocked a -> b #

foldr1 :: (a -> a -> a) -> Blocked a -> a #

foldl1 :: (a -> a -> a) -> Blocked a -> a #

toList :: Blocked a -> [a] #

null :: Blocked a -> Bool #

length :: Blocked a -> Int #

elem :: Eq a => a -> Blocked a -> Bool #

maximum :: Ord a => Blocked a -> a #

minimum :: Ord a => Blocked a -> a #

sum :: Num a => Blocked a -> a #

product :: Num a => Blocked a -> a #

Traversable Blocked # 

Methods

traverse :: Applicative f => (a -> f b) -> Blocked a -> f (Blocked b) #

sequenceA :: Applicative f => Blocked (f a) -> f (Blocked a) #

mapM :: Monad m => (a -> m b) -> Blocked a -> m (Blocked b) #

sequence :: Monad m => Blocked (m a) -> m (Blocked a) #

Semigroup Blocked_ # 
Monoid Blocked_ # 
Show t => Show (Blocked t) # 

Methods

showsPrec :: Int -> Blocked t -> ShowS #

show :: Blocked t -> String #

showList :: [Blocked t] -> ShowS #

KillRange a => KillRange (Blocked a) # 
TermLike a => TermLike (Blocked a) # 

Methods

traverseTermM :: Monad m => (Term -> m Term) -> Blocked a -> m (Blocked a) #

foldTerm :: Monoid m => (Term -> m) -> Blocked a -> m #

PrettyTCM a => PrettyTCM (Blocked a) # 

Methods

prettyTCM :: Blocked a -> TCM Doc #

Instantiate a => Instantiate (Blocked a) # 

Methods

instantiate' :: Blocked a -> ReduceM (Blocked a) #

type Blocked_ = Blocked () #

Blocked t without the t.

stuckOn :: Elim -> NotBlocked -> NotBlocked #

When trying to reduce f es, on match failed on one elimination e ∈ es that came with info r :: NotBlocked. stuckOn e r produces the new NotBlocked info.

MissingClauses must be propagated, as this is blockage that can be lifted in the future (as more clauses are added).

StuckOn e0 is also propagated, since it provides more precise information as StuckOn e (as e0 is the original reason why reduction got stuck and usually a subterm of e). An information like StuckOn (Apply (Arg info (Var i []))) (stuck on a variable) could be used by the lhs/coverage checker to trigger a split on that (pattern) variable.

In the remaining cases for r, we are terminally stuck due to StuckOn e. Propagating AbsurdMatch does not seem useful.

Underapplied must not be propagated, as this would mean that f es is underapplied, which is not the case (it is stuck). Note that Underapplied can only arise when projection patterns were missing to complete the original match (in e). (Missing ordinary pattern would mean the e is of function type, but we cannot match against something of function type.)

Definitions

data Clause #

A clause is a list of patterns and the clause body.

The telescope contains the types of the pattern variables and the de Bruijn indices say how to get from the order the variables occur in the patterns to the order they occur in the telescope. The body binds the variables in the order they appear in the telescope.

clauseTel ~ permute clausePerm (patternVars namedClausePats)

Terms in dot patterns are valid in the clause telescope.

For the purpose of the permutation and the body dot patterns count as variables. TODO: Change this!

Constructors

Clause 

Fields

Instances

Data Clause # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Clause -> c Clause #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Clause #

toConstr :: Clause -> Constr #

dataTypeOf :: Clause -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Clause) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Clause) #

gmapT :: (forall b. Data b => b -> b) -> Clause -> Clause #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r #

gmapQ :: (forall d. Data d => d -> u) -> Clause -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Clause -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Clause -> m Clause #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Clause -> m Clause #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Clause -> m Clause #

Show Clause # 
Null Clause #

A null clause is one with no patterns and no rhs. Should not exist in practice.

Methods

empty :: Clause #

null :: Clause -> Bool #

Pretty Clause # 

Methods

pretty :: Clause -> Doc #

prettyPrec :: Int -> Clause -> Doc #

prettyList :: [Clause] -> Doc #

KillRange Clause # 
HasRange Clause # 

Methods

getRange :: Clause -> Range #

Free Clause # 

Methods

freeVars' :: IsVarSet c => Clause -> FreeM c #

GetDefs Clause # 

Methods

getDefs :: MonadGetDefs m => Clause -> m () #

FunArity Clause #

Get the number of initial Apply patterns in a clause.

Methods

funArity :: Clause -> Int #

Free Clause # 

Methods

freeVars' :: Clause -> FreeT

PrettyTCM Clause # 

Methods

prettyTCM :: Clause -> TCM Doc #

NamesIn Clause # 

Methods

namesIn :: Clause -> Set QName #

InstantiateFull Clause # 
InstantiateFull FunctionInverse # 
DropArgs Clause #

NOTE: does not work for recursive functions.

Methods

dropArgs :: Int -> Clause -> Clause #

DropArgs FunctionInverse # 
NormaliseProjP Clause # 
ComputeOccurrences Clause # 
Occurs Clause # 
Conversion TOM Clause (Maybe ([Pat O], MExp O)) # 

Methods

convert :: Clause -> TOM (Maybe ([Pat O], MExp O)) #

Conversion TOM [Clause] [([Pat O], MExp O)] # 

Methods

convert :: [Clause] -> TOM [([Pat O], MExp O)] #

FunArity [Clause] #

Get the number of common initial Apply patterns in a list of clauses.

Methods

funArity :: [Clause] -> Int #

PrettyTCM (QNamed Clause) # 
Reify (QNamed Clause) Clause # 
UniverseBi ([Type], [Clause]) Pattern # 

Methods

universeBi :: ([Type], [Clause]) -> [Pattern] #

UniverseBi ([Type], [Clause]) Term # 

Methods

universeBi :: ([Type], [Clause]) -> [Term] #

type PatVarName = ArgName #

Pattern variables.

data Pattern' x #

Patterns are variables, constructors, or wildcards. QName is used in ConP rather than Name since a constructor might come from a particular namespace. This also meshes well with the fact that values (i.e. the arguments we are matching with) use QName.

Constructors

VarP x
x
DotP Term
.t
ConP ConHead ConPatternInfo [NamedArg (Pattern' x)]

c ps The subpatterns do not contain any projection copatterns.

AbsurdP (Pattern' x)

() The argument is to keep track of the original pattern (before the absurd match).

LitP Literal

E.g. 5, "hello".

ProjP ProjOrigin QName

Projection copattern. Can only appear by itself.

Instances

Functor Pattern' # 

Methods

fmap :: (a -> b) -> Pattern' a -> Pattern' b #

(<$) :: a -> Pattern' b -> Pattern' a #

Foldable Pattern' # 

Methods

fold :: Monoid m => Pattern' m -> m #

foldMap :: Monoid m => (a -> m) -> Pattern' a -> m #

foldr :: (a -> b -> b) -> b -> Pattern' a -> b #

foldr' :: (a -> b -> b) -> b -> Pattern' a -> b #

foldl :: (b -> a -> b) -> b -> Pattern' a -> b #

foldl' :: (b -> a -> b) -> b -> Pattern' a -> b #

foldr1 :: (a -> a -> a) -> Pattern' a -> a #

foldl1 :: (a -> a -> a) -> Pattern' a -> a #

toList :: Pattern' a -> [a] #

null :: Pattern' a -> Bool #

length :: Pattern' a -> Int #

elem :: Eq a => a -> Pattern' a -> Bool #

maximum :: Ord a => Pattern' a -> a #

minimum :: Ord a => Pattern' a -> a #

sum :: Num a => Pattern' a -> a #

product :: Num a => Pattern' a -> a #

Traversable Pattern' # 

Methods

traverse :: Applicative f => (a -> f b) -> Pattern' a -> f (Pattern' b) #

sequenceA :: Applicative f => Pattern' (f a) -> f (Pattern' a) #

mapM :: Monad m => (a -> m b) -> Pattern' a -> m (Pattern' b) #

sequence :: Monad m => Pattern' (m a) -> m (Pattern' a) #

MapNamedArg Pattern' #

Modify the content of VarP, and the closest surrounding NamedArg.

Note: the mapNamedArg for Pattern' is not expressible simply by fmap or traverse etc., since ConP has NamedArg subpatterns, which are taken into account by mapNamedArg.

Methods

mapNamedArg :: (NamedArg a -> NamedArg b) -> NamedArg (Pattern' a) -> NamedArg (Pattern' b) #

UsableSizeVars DeBruijnPattern # 
UsableSizeVars MaskedDeBruijnPatterns # 
UniverseBi Elims Pattern # 

Methods

universeBi :: Elims -> [Pattern] #

UniverseBi Args Pattern # 

Methods

universeBi :: Args -> [Pattern] #

LabelPatVars Pattern DeBruijnPattern Int # 
PatternVars a (NamedArg (Pattern' a)) # 

Methods

patternVars :: NamedArg (Pattern' a) -> [Arg (Either a Term)] #

PatternVars a (Arg (Pattern' a)) # 

Methods

patternVars :: Arg (Pattern' a) -> [Arg (Either a Term)] #

PatternLike a (Pattern' a) # 

Methods

foldrPattern :: Monoid m => (Pattern' a -> m -> m) -> Pattern' a -> m #

traversePatternM :: Monad m => (Pattern' a -> m (Pattern' a)) -> (Pattern' a -> m (Pattern' a)) -> Pattern' a -> m (Pattern' a) #

Conversion TOM (Arg Pattern) (Pat O) # 

Methods

convert :: Arg Pattern -> TOM (Pat O) #

Data x => Data (Pattern' x) # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pattern' x -> c (Pattern' x) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Pattern' x) #

toConstr :: Pattern' x -> Constr #

dataTypeOf :: Pattern' x -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Pattern' x)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Pattern' x)) #

gmapT :: (forall b. Data b => b -> b) -> Pattern' x -> Pattern' x #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pattern' x -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pattern' x -> r #

gmapQ :: (forall d. Data d => d -> u) -> Pattern' x -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Pattern' x -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pattern' x -> m (Pattern' x) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pattern' x -> m (Pattern' x) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pattern' x -> m (Pattern' x) #

Show x => Show (Pattern' x) # 

Methods

showsPrec :: Int -> Pattern' x -> ShowS #

show :: Pattern' x -> String #

showList :: [Pattern' x] -> ShowS #

Pretty a => Pretty (Pattern' a) # 

Methods

pretty :: Pattern' a -> Doc #

prettyPrec :: Int -> Pattern' a -> Doc #

prettyList :: [Pattern' a] -> Doc #

KillRange a => KillRange (Pattern' a) # 
IsProjP (Pattern' a) # 
PrettyTCM a => PrettyTCM (Pattern' a) # 

Methods

prettyTCM :: Pattern' a -> TCM Doc #

NamesIn (Pattern' a) # 

Methods

namesIn :: Pattern' a -> Set QName #

InstantiateFull a => InstantiateFull (Pattern' a) # 
Normalise a => Normalise (Pattern' a) # 

Methods

normalise' :: Pattern' a -> ReduceM (Pattern' a) #

NormaliseProjP (Pattern' x) # 

Methods

normaliseProjP :: HasConstInfo m => Pattern' x -> m (Pattern' x) #

IsFlexiblePattern (Pattern' a) # 
UsableSizeVars [DeBruijnPattern] # 
UsableSizeVars (Masked DeBruijnPattern) # 
UniverseBi ([Type], [Clause]) Pattern # 

Methods

universeBi :: ([Type], [Clause]) -> [Pattern] #

type Pattern #

Arguments

 = Pattern' PatVarName

The PatVarName is a name suggestion.

data DBPatVar #

Type used when numbering pattern variables.

Constructors

DBPatVar 

Instances

Data DBPatVar # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DBPatVar -> c DBPatVar #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DBPatVar #

toConstr :: DBPatVar -> Constr #

dataTypeOf :: DBPatVar -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DBPatVar) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DBPatVar) #

gmapT :: (forall b. Data b => b -> b) -> DBPatVar -> DBPatVar #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DBPatVar -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DBPatVar -> r #

gmapQ :: (forall d. Data d => d -> u) -> DBPatVar -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DBPatVar -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DBPatVar -> m DBPatVar #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DBPatVar -> m DBPatVar #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DBPatVar -> m DBPatVar #

Show DBPatVar # 
Pretty DBPatVar # 
KillRange DBPatVar # 
PrettyTCM DBPatVar # 

Methods

prettyTCM :: DBPatVar -> TCM Doc #

InstantiateFull DBPatVar # 
Normalise DBPatVar # 
UsableSizeVars DeBruijnPattern # 
UsableSizeVars MaskedDeBruijnPatterns # 
LabelPatVars Pattern DeBruijnPattern Int # 
UsableSizeVars [DeBruijnPattern] # 
UsableSizeVars (Masked DeBruijnPattern) # 

data ConPatternInfo #

The ConPatternInfo states whether the constructor belongs to a record type (Just) or data type (Nothing). In the former case, the Bool says whether the record pattern orginates from the expansion of an implicit pattern. The Type is the type of the whole record pattern. The scope used for the type is given by any outer scope plus the clause's telescope (clauseTel).

Constructors

ConPatternInfo 

Fields

  • conPRecord :: Maybe ConOrigin

    Nothing if data constructor. Just if record constructor.

  • conPType :: Maybe (Arg Type)

    The type of the whole constructor pattern. Should be present (Just) if constructor pattern is is generated ordinarily by type-checking. Could be absent (Nothing) if pattern comes from some plugin (like Agsy). Needed e.g. for with-clause stripping.

Instances

Data ConPatternInfo # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConPatternInfo -> c ConPatternInfo #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ConPatternInfo #

toConstr :: ConPatternInfo -> Constr #

dataTypeOf :: ConPatternInfo -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ConPatternInfo) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatternInfo) #

gmapT :: (forall b. Data b => b -> b) -> ConPatternInfo -> ConPatternInfo #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConPatternInfo -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConPatternInfo -> r #

gmapQ :: (forall d. Data d => d -> u) -> ConPatternInfo -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ConPatternInfo -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConPatternInfo -> m ConPatternInfo #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConPatternInfo -> m ConPatternInfo #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConPatternInfo -> m ConPatternInfo #

Show ConPatternInfo # 
KillRange ConPatternInfo # 
InstantiateFull ConPatternInfo # 
Normalise ConPatternInfo # 

class PatternVars a b | b -> a where #

Extract pattern variables in left-to-right order. A DotP is also treated as variable (see docu for Clause).

Minimal complete definition

patternVars

Methods

patternVars :: b -> [Arg (Either a Term)] #

Instances

PatternVars a b => PatternVars a [b] # 

Methods

patternVars :: [b] -> [Arg (Either a Term)] #

PatternVars a (NamedArg (Pattern' a)) # 

Methods

patternVars :: NamedArg (Pattern' a) -> [Arg (Either a Term)] #

PatternVars a (Arg (Pattern' a)) # 

Methods

patternVars :: Arg (Pattern' a) -> [Arg (Either a Term)] #

properlyMatching :: DeBruijnPattern -> Bool #

Does the pattern perform a match that could fail?

Explicit substitutions

data Substitution' a #

Substitutions.

Constructors

IdS

Identity substitution. Γ ⊢ IdS : Γ

EmptyS Empty

Empty substitution, lifts from the empty context. First argument is IMPOSSIBLE. Apply this to closed terms you want to use in a non-empty context. Γ ⊢ EmptyS : ()

a :# (Substitution' a) infixr 4

Substitution extension, `cons'. Γ ⊢ u : Aρ Γ ⊢ ρ : Δ ---------------------- Γ ⊢ u :# ρ : Δ, A

Strengthen Empty (Substitution' a)

Strengthening substitution. First argument is IMPOSSIBLE. Apply this to a term which does not contain variable 0 to lower all de Bruijn indices by one. Γ ⊢ ρ : Δ --------------------------- Γ ⊢ Strengthen ρ : Δ, A

Wk !Int (Substitution' a)

Weakning substitution, lifts to an extended context. Γ ⊢ ρ : Δ ------------------- Γ, Ψ ⊢ Wk |Ψ| ρ : Δ

Lift !Int (Substitution' a)

Lifting substitution. Use this to go under a binder. Lift 1 ρ == var 0 :# Wk 1 ρ. Γ ⊢ ρ : Δ ------------------------- Γ, Ψρ ⊢ Lift |Ψ| ρ : Δ, Ψ

Instances

Functor Substitution' # 

Methods

fmap :: (a -> b) -> Substitution' a -> Substitution' b #

(<$) :: a -> Substitution' b -> Substitution' a #

Foldable Substitution' # 

Methods

fold :: Monoid m => Substitution' m -> m #

foldMap :: Monoid m => (a -> m) -> Substitution' a -> m #

foldr :: (a -> b -> b) -> b -> Substitution' a -> b #

foldr' :: (a -> b -> b) -> b -> Substitution' a -> b #

foldl :: (b -> a -> b) -> b -> Substitution' a -> b #

foldl' :: (b -> a -> b) -> b -> Substitution' a -> b #

foldr1 :: (a -> a -> a) -> Substitution' a -> a #

foldl1 :: (a -> a -> a) -> Substitution' a -> a #

toList :: Substitution' a -> [a] #

null :: Substitution' a -> Bool #

length :: Substitution' a -> Int #

elem :: Eq a => a -> Substitution' a -> Bool #

maximum :: Ord a => Substitution' a -> a #

minimum :: Ord a => Substitution' a -> a #

sum :: Num a => Substitution' a -> a #

product :: Num a => Substitution' a -> a #

Traversable Substitution' # 

Methods

traverse :: Applicative f => (a -> f b) -> Substitution' a -> f (Substitution' b) #

sequenceA :: Applicative f => Substitution' (f a) -> f (Substitution' a) #

mapM :: Monad m => (a -> m b) -> Substitution' a -> m (Substitution' b) #

sequence :: Monad m => Substitution' (m a) -> m (Substitution' a) #

KillRange Substitution # 
InstantiateFull Substitution # 
Data a => Data (Substitution' a) # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Substitution' a -> c (Substitution' a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Substitution' a) #

toConstr :: Substitution' a -> Constr #

dataTypeOf :: Substitution' a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Substitution' a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Substitution' a)) #

gmapT :: (forall b. Data b => b -> b) -> Substitution' a -> Substitution' a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Substitution' a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Substitution' a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Substitution' a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Substitution' a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Substitution' a -> m (Substitution' a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Substitution' a -> m (Substitution' a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Substitution' a -> m (Substitution' a) #

Show a => Show (Substitution' a) # 
Null (Substitution' a) # 
Pretty a => Pretty (Substitution' a) # 
TermSize a => TermSize (Substitution' a) # 
(Pretty a, PrettyTCM a, Subst a a) => PrettyTCM (Substitution' a) # 

Views

Absurd Lambda

absurdBody :: Abs Term #

Absurd lambdas are internally represented as identity with variable name "()".

Pointers and Sharing

ignoreSharing :: Term -> Term #

Remove top-level Shared data constructors.

shared_ :: Term -> Term #

Introduce sharing.

updateSharedFM :: (Monad m, Traversable f) => (Term -> m (f Term)) -> Term -> m (f Term) #

Typically m would be TCM and f would be Blocked.

updateSharedM :: Monad m => (Term -> m Term) -> Term -> m Term #

Smart constructors

var :: Nat -> Term #

An unapplied variable.

dontCare :: Term -> Term #

Add DontCare is it is not already a DontCare.

typeDontCare :: Type #

A dummy type.

topSort :: Type #

Top sort (Setomega).

sort :: Sort -> Type #

sSuc :: Sort -> Sort #

Get the next higher sort.

Telescopes.

mapAbsNamesM :: Applicative m => (ArgName -> m ArgName) -> Tele a -> m (Tele a) #

A traversal for the names in a telescope.

mapAbsNames :: (ArgName -> ArgName) -> Tele a -> Tele a #

type ListTel' a = [Dom (a, Type)] #

Telescope as list.

telFromList :: ListTel -> Telescope #

Convert a list telescope to a telescope.

telToList :: Telescope -> ListTel #

Convert a telescope to its list form.

class TelToArgs a where #

Drop the types from a telescope.

Minimal complete definition

telToArgs

Methods

telToArgs :: a -> [Arg ArgName] #

class SgTel a where #

Constructing a singleton telescope.

Minimal complete definition

sgTel

Methods

sgTel :: a -> Telescope #

Instances

SgTel (Dom (ArgName, Type)) # 

Methods

sgTel :: Dom (ArgName, Type) -> Telescope #

SgTel (Dom Type) # 

Methods

sgTel :: Dom Type -> Telescope #

SgTel (ArgName, Dom Type) # 

Methods

sgTel :: (ArgName, Dom Type) -> Telescope #

Handling blocked terms.

blocked :: MetaId -> a -> Blocked a #

notBlocked :: a -> Blocked a #

Simple operations on terms and types.

stripDontCare :: Term -> Term #

Removing a topmost DontCare constructor.

arity :: Type -> Nat #

Doesn't do any reduction.

notInScopeName :: ArgName -> ArgName #

Make a name that is not in scope.

class Suggest a b where #

Pick the better name suggestion, i.e., the one that is not just underscore.

Minimal complete definition

suggest

Methods

suggest :: a -> b -> String #

Instances

Suggest String String # 

Methods

suggest :: String -> String -> String #

Suggest String (Abs b) # 

Methods

suggest :: String -> Abs b -> String #

Suggest Name (Abs b) # 

Methods

suggest :: Name -> Abs b -> String #

Suggest (Abs a) (Abs b) # 

Methods

suggest :: Abs a -> Abs b -> String #

Eliminations.

unSpine :: Term -> Term #

Convert top-level postfix projections into prefix projections.

unSpine' :: (ProjOrigin -> Bool) -> Term -> Term #

Convert Proj projection eliminations according to their ProjOrigin into Def projection applications.

hasElims :: Term -> Maybe (Elims -> Term, Elims) #

A view distinguishing the neutrals Var, Def, and MetaV which can be projected.

argFromElim :: Elim' a -> Arg a #

Drop Apply constructor. (Unsafe!)

isApplyElim :: Elim' a -> Maybe (Arg a) #

Drop Apply constructor. (Safe)

allApplyElims :: [Elim' a] -> Maybe [Arg a] #

Drop Apply constructors. (Safe)

splitApplyElims :: [Elim' a] -> ([Arg a], [Elim' a]) #

Split at first non-Apply

class IsProjElim e where #

Minimal complete definition

isProjElim

Methods

isProjElim :: e -> Maybe (ProjOrigin, QName) #

dropProjElims :: IsProjElim e => [e] -> [e] #

Discard Proj f entries.

argsFromElims :: Elims -> Args #

Discards Proj f entries.

allProjElims :: Elims -> Maybe [(ProjOrigin, QName)] #

Drop Proj constructors. (Safe)

Null instances.

Show instances.

Sized instances and TermSize.

class TermSize a where #

The size of a term is roughly the number of nodes in its syntax tree. This number need not be precise for logical correctness of Agda, it is only used for reporting (and maybe decisions regarding performance).

Not counting towards the term size are:

  • sort and color annotations,
  • projections.

Minimal complete definition

tsize

Methods

termSize :: a -> Int #

tsize :: a -> Sum Int #

Instances

KillRange instances.

UniverseBi instances.

Simple pretty printing

pDom :: LensHiding a => a -> Doc -> Doc #

NFData instances

newtype MetaId #

A meta variable identifier is just a natural number.

Constructors

MetaId 

Fields

Instances

Enum MetaId # 
Eq MetaId # 

Methods

(==) :: MetaId -> MetaId -> Bool #

(/=) :: MetaId -> MetaId -> Bool #

Integral MetaId # 
Data MetaId # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MetaId -> c MetaId #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MetaId #

toConstr :: MetaId -> Constr #

dataTypeOf :: MetaId -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c MetaId) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MetaId) #

gmapT :: (forall b. Data b => b -> b) -> MetaId -> MetaId #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MetaId -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MetaId -> r #

gmapQ :: (forall d. Data d => d -> u) -> MetaId -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MetaId -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MetaId -> m MetaId #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MetaId -> m MetaId #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MetaId -> m MetaId #

Num MetaId # 
Ord MetaId # 
Real MetaId # 
Show MetaId #

Show non-record version of this newtype.

NFData MetaId # 

Methods

rnf :: MetaId -> () #

Pretty MetaId # 

Methods

pretty :: MetaId -> Doc #

prettyPrec :: Int -> MetaId -> Doc #

prettyList :: [MetaId] -> Doc #

GetDefs MetaId # 

Methods

getDefs :: MonadGetDefs m => MetaId -> m () #

HasFresh MetaId # 
PrettyTCM MetaId # 

Methods

prettyTCM :: MetaId -> TCM Doc #

UnFreezeMeta MetaId # 

Methods

unfreezeMeta :: MetaId -> TCM () #

IsInstantiatedMeta MetaId # 
FromTerm MetaId # 
ToTerm MetaId # 

Methods

toTerm :: TCM (MetaId -> Term) #

toTermR :: TCM (MetaId -> ReduceM Term) #

PrimTerm MetaId # 

Methods

primTerm :: MetaId -> TCM Term #

Unquote MetaId # 
Reify MetaId Expr # 

Methods

reify :: MetaId -> TCM Expr #

reifyWhen :: Bool -> MetaId -> TCM Expr #