Agda-2.5.2: 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.

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

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 #

Pretty Elim # 

Methods

pretty :: Elim -> Doc #

prettyPrec :: Int -> Elim -> Doc #

Pretty Term # 

Methods

pretty :: Term -> Doc #

prettyPrec :: Int -> Term -> Doc #

KillRange Substitution # 
KillRange Term # 
TermSize Term # 

Methods

termSize :: Term -> Int #

tsize :: Term -> Sum Int #

IsProjElim Elim # 
GetDefs Type # 

Methods

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

GetDefs Term # 

Methods

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

TermLike Type # 

Methods

traverseTerm :: (Term -> Term) -> Type -> Type #

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

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

TermLike Term # 

Methods

traverseTerm :: (Term -> Term) -> Term -> Term #

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

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

Free Type # 

Methods

freeVars' :: Type -> FreeT

Free Term # 

Methods

freeVars' :: Term -> FreeT

DeBruijn Term #

We can substitute Terms for variables.

NamesIn Term # 

Methods

namesIn :: Term -> Set QName #

TeleNoAbs Telescope # 

Methods

teleNoAbs :: Telescope -> Term -> Term #

TeleNoAbs ListTel # 

Methods

teleNoAbs :: ListTel -> Term -> 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 # 
IsSizeType Term # 
DropArgs Telescope #

NOTE: This creates telescopes with unbound de Bruijn indices.

Methods

dropArgs :: Int -> Telescope -> Telescope #

MentionsMeta Type # 

Methods

mentionsMeta :: MetaId -> Type -> Bool #

MentionsMeta Elim # 

Methods

mentionsMeta :: MetaId -> Elim -> Bool #

MentionsMeta Term # 

Methods

mentionsMeta :: MetaId -> Term -> Bool #

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 #

InstantiateFull Substitution # 
InstantiateFull Term # 
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 # 
Match Term # 

Methods

match :: Term -> Term -> MaybeT TCM [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)

Injectible Term # 
Evaluate Term # 

Methods

evaluate :: Term -> Compile TCM Term #

HasPolarity Type # 

Methods

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

HasPolarity Term # 

Methods

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

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 # 
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 #

NoProjectedVar Term # 
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 #

ForcedVariables Term #

Assumes that the term is in normal form.

Methods

forcedVariables :: Term -> [Nat] #

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] #

Free' Term c # 

Methods

freeVars' :: Term -> FreeM c #

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 #

Subst Term (Problem' p) # 
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 #

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 #

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) #

Pretty Elim # 

Methods

pretty :: Elim -> Doc #

prettyPrec :: Int -> Elim -> Doc #

IsProjElim Elim # 
MentionsMeta Elim # 

Methods

mentionsMeta :: MetaId -> Elim -> Bool #

PrettyTCM Elim # 

Methods

prettyTCM :: Elim -> TCM Doc #

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] #

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 -> () #

KillRange a => KillRange (Elim' a) # 

Methods

killRange :: KillRangeT (Elim' a) #

GetDefs a => GetDefs (Elim' a) # 

Methods

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

TermLike a => TermLike (Elim' a) # 

Methods

traverseTerm :: (Term -> Term) -> Elim' a -> Elim' a #

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

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

Free a => Free (Elim' a) # 

Methods

freeVars' :: Elim' a -> FreeT

NamesIn a => NamesIn (Elim' a) # 

Methods

namesIn :: Elim' a -> Set QName #

PrettyTCM (Elim' NLPat) # 

Methods

prettyTCM :: Elim' NLPat -> TCM Doc #

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

Methods

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

Match a => Match (Elim' a) # 

Methods

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

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)

Injectible a => Injectible (Elim' a) # 
Evaluate a => Evaluate (Elim' a) # 

Methods

evaluate :: Elim' a -> Compile TCM (Elim' a) #

HasPolarity a => HasPolarity (Elim' a) # 

Methods

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

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 () #

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

Methods

raiseNLPFrom :: Int -> Int -> Elim' a -> Elim' a #

raiseNLP :: Int -> Elim' a -> Elim' a #

AbsTerm a => AbsTerm (Elim' a) # 

Methods

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

Free' a c => Free' (Elim' a) c # 

Methods

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

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 #

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 :: Integral n => Abs a -> n #

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 #

GetDefs a => GetDefs (Abs a) # 

Methods

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

TermLike a => TermLike (Abs a) # 

Methods

traverseTerm :: (Term -> Term) -> Abs a -> Abs a #

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

foldTerm :: Monoid m => (Term -> 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)

Evaluate a => Evaluate (Abs a) # 

Methods

evaluate :: Abs a -> Compile TCM (Abs a) #

HasPolarity a => HasPolarity (Abs a) # 

Methods

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

(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 () #

ComputeOccurrences a => ComputeOccurrences (Abs a) # 
RaiseNLP a => RaiseNLP (Abs a) # 

Methods

raiseNLPFrom :: Int -> Int -> Abs a -> Abs a #

raiseNLP :: Int -> Abs a -> Abs a #

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

Methods

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

Free' a c => Free' (Abs a) c # 

Methods

freeVars' :: Abs a -> FreeM c #

Suggest (Abs a) (Abs b) # 

Methods

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

(Match a b, RaiseNLP 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 -> () #

Pretty Type # 

Methods

pretty :: Type -> Doc #

prettyPrec :: Int -> Type -> Doc #

Decoration Type' # 

Methods

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

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

GetDefs Type # 

Methods

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

TermLike Type # 

Methods

traverseTerm :: (Term -> Term) -> Type -> Type #

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

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

Free Type # 

Methods

freeVars' :: Type -> FreeT

TeleNoAbs Telescope # 

Methods

teleNoAbs :: Telescope -> Term -> Term #

TeleNoAbs ListTel # 

Methods

teleNoAbs :: ListTel -> Term -> Term #

AddContext Telescope # 

Methods

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

contextSize :: Telescope -> Nat #

UnFreezeMeta Type # 

Methods

unfreezeMeta :: Type -> TCM () #

DropArgs Telescope #

NOTE: This creates telescopes with unbound de Bruijn indices.

Methods

dropArgs :: Int -> Telescope -> Telescope #

MentionsMeta Type # 

Methods

mentionsMeta :: MetaId -> Type -> Bool #

PrettyTCM Telescope # 

Methods

prettyTCM :: Telescope -> TCM Doc #

PrettyTCM Type # 

Methods

prettyTCM :: Type -> TCM Doc #

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)

HasPolarity Type # 

Methods

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

FoldRigid Type # 

Methods

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

Occurs Type # 
ComputeOccurrences Type # 
ToTerm Type # 

Methods

toTerm :: TCM (Type -> Term) #

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

PrimTerm Type # 

Methods

primTerm :: Type -> TCM Term #

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 # 
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 #

NamesIn a => NamesIn (Type' a) # 

Methods

namesIn :: Type' a -> Set QName #

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 #

IsSizeType a => IsSizeType (Type' a) # 
PrettyTCM (Type' NLPat) # 

Methods

prettyTCM :: Type' NLPat -> TCM Doc #

InstantiateFull a => InstantiateFull (Type' a) # 

Methods

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

Free' a c => Free' (Type' a) c # 

Methods

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

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 #

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) #

TeleNoAbs Telescope # 

Methods

teleNoAbs :: Telescope -> Term -> Term #

AddContext Telescope # 

Methods

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

contextSize :: Telescope -> Nat #

DropArgs Telescope #

NOTE: This creates telescopes with unbound de Bruijn indices.

Methods

dropArgs :: Int -> Telescope -> Telescope #

PrettyTCM Telescope # 

Methods

prettyTCM :: Telescope -> TCM Doc #

Reduce Telescope # 
Instantiate Telescope # 
Reify Telescope Telescope # 
Show a => Show (Tele a) # 

Methods

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

show :: Tele a -> String #

showList :: [Tele a] -> ShowS #

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

Methods

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

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

Null (Tele a) # 

Methods

empty :: Tele a #

null :: Tele a -> Bool #

Sized (Tele a) #

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

Methods

size :: Integral n => Tele a -> n #

KillRange a => KillRange (Tele a) # 

Methods

killRange :: KillRangeT (Tele a) #

Free a => Free (Tele a) # 

Methods

freeVars' :: Tele a -> FreeT

NamesIn a => NamesIn (Tele a) # 

Methods

namesIn :: Tele a -> Set QName #

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) # 
Free' a c => Free' (Tele a) c # 

Methods

freeVars' :: Tele a -> FreeM c #

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 #

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

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 #

KillRange Sort # 
TermSize Sort # 

Methods

termSize :: Sort -> Int #

tsize :: Sort -> Sum Int #

GetDefs Sort # 

Methods

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

Free Sort # 

Methods

freeVars' :: Sort -> FreeT

NamesIn Sort # 

Methods

namesIn :: Sort -> Set QName #

UnFreezeMeta Sort # 

Methods

unfreezeMeta :: Sort -> TCM () #

MentionsMeta Sort # 

Methods

mentionsMeta :: MetaId -> Sort -> Bool #

PrettyTCM Sort # 

Methods

prettyTCM :: Sort -> TCM Doc #

InstantiateFull Sort # 
Normalise Sort # 
Simplify Sort # 

Methods

simplify' :: Sort -> ReduceM Sort #

Reduce Sort # 
Instantiate Sort # 
Match Sort # 

Methods

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

SynEq Sort # 

Methods

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

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

FoldRigid Sort # 

Methods

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

Occurs Sort # 
AbsTerm Sort # 

Methods

absTerm :: Term -> Sort -> Sort #

Free' Sort c # 

Methods

freeVars' :: Sort -> FreeM c #

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

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 #

KillRange Level # 
TermSize Level # 

Methods

termSize :: Level -> Int #

tsize :: Level -> Sum Int #

GetDefs Level # 

Methods

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

TermLike Level # 

Methods

traverseTerm :: (Term -> Term) -> Level -> Level #

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

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

Free Level # 

Methods

freeVars' :: Level -> FreeT

DeBruijn Level # 
NamesIn Level # 

Methods

namesIn :: Level -> Set QName #

UnFreezeMeta Level # 

Methods

unfreezeMeta :: Level -> TCM () #

IsInstantiatedMeta Level # 
MentionsMeta Level # 

Methods

mentionsMeta :: MetaId -> Level -> Bool #

PrettyTCM Level # 

Methods

prettyTCM :: Level -> TCM Doc #

InstantiateFull Level # 
Normalise Level # 
Simplify Level # 
Reduce Level # 
Instantiate Level # 
Match Level # 

Methods

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

SynEq Level # 

Methods

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

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

HasPolarity Level # 

Methods

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

FoldRigid Level # 

Methods

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

Occurs Level # 
ComputeOccurrences Level # 
AbsTerm Level # 

Methods

absTerm :: Term -> Level -> Level #

Free' Level c # 

Methods

freeVars' :: Level -> FreeM c #

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

Show PlusLevel # 
NFData PlusLevel # 

Methods

rnf :: PlusLevel -> () #

Pretty PlusLevel # 
KillRange PlusLevel # 
TermSize PlusLevel # 
GetDefs PlusLevel # 

Methods

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

TermLike PlusLevel # 

Methods

traverseTerm :: (Term -> Term) -> PlusLevel -> PlusLevel #

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

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

Free PlusLevel # 

Methods

freeVars' :: PlusLevel -> FreeT

DeBruijn PlusLevel # 
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] #

FoldRigid PlusLevel # 

Methods

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

Occurs PlusLevel # 
ComputeOccurrences PlusLevel # 
AbsTerm PlusLevel # 

Methods

absTerm :: Term -> PlusLevel -> PlusLevel #

Free' PlusLevel c # 

Methods

freeVars' :: PlusLevel -> FreeM c #

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

Show LevelAtom # 
NFData LevelAtom # 

Methods

rnf :: LevelAtom -> () #

Pretty LevelAtom # 
KillRange LevelAtom # 
TermSize LevelAtom # 
GetDefs LevelAtom # 

Methods

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

TermLike LevelAtom # 

Methods

traverseTerm :: (Term -> Term) -> LevelAtom -> LevelAtom #

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

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

Free LevelAtom # 

Methods

freeVars' :: LevelAtom -> FreeT

DeBruijn LevelAtom # 
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] #

FoldRigid LevelAtom # 

Methods

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

Occurs LevelAtom # 
ComputeOccurrences LevelAtom # 
AbsTerm LevelAtom # 

Methods

absTerm :: Term -> LevelAtom -> LevelAtom #

Free' LevelAtom c # 

Methods

freeVars' :: LevelAtom -> FreeM c #

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.

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 #

(*>) :: 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_ # 
HasOptions NLM # 
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

traverseTerm :: (Term -> Term) -> Blocked a -> Blocked a #

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

Show Clause # 
Pretty Clause # 

Methods

pretty :: Clause -> Doc #

prettyPrec :: Int -> Clause -> Doc #

Null Clause #

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

Methods

empty :: Clause #

null :: Clause -> Bool #

KillRange Clause # 
HasRange Clause # 

Methods

getRange :: Clause -> Range #

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

NamesIn Clause # 

Methods

namesIn :: Clause -> Set QName #

DropArgs Clause #

NOTE: does not work for recursive functions.

Methods

dropArgs :: Int -> Clause -> Clause #

DropArgs FunctionInverse # 
PrettyTCM Clause # 

Methods

prettyTCM :: Clause -> TCM Doc #

InstantiateFull Clause # 
InstantiateFull FunctionInverse # 
NormaliseProjP Clause # 
Occurs Clause # 
ComputeOccurrences Clause # 
Free' Clause c # 

Methods

freeVars' :: Clause -> FreeM c #

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.

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' # 

Methods

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

UniverseBi Elims Pattern # 

Methods

universeBi :: Elims -> [Pattern] #

UniverseBi Args Pattern # 

Methods

universeBi :: Args -> [Pattern] #

LabelPatVars Pattern DeBruijnPattern Int # 
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 #

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

Methods

namesIn :: Pattern' a -> Set QName #

PrettyTCM a => PrettyTCM (Pattern' a) # 

Methods

prettyTCM :: Pattern' a -> TCM Doc #

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) # 
UniverseBi ([Type], [Clause]) Pattern # 

Methods

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

type Pattern #

Arguments

 = Pattern' PatVarName

The PatVarName is a name suggestion.

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.

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

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

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 substitution, lifts from the empty context. 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 # 
Show a => Show (Substitution' a) # 
Pretty a => Pretty (Substitution' a) # 
Null (Substitution' a) # 
TermSize a => TermSize (Substitution' a) # 
(Show 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.

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 # 
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 #

GetDefs MetaId # 

Methods

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

HasFresh MetaId # 
UnFreezeMeta MetaId # 

Methods

unfreezeMeta :: MetaId -> TCM () #

IsInstantiatedMeta MetaId # 
PrettyTCM MetaId # 

Methods

prettyTCM :: MetaId -> TCM Doc #

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 #