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

Safe HaskellNone

Agda.TypeChecking.Substitute

Contents

Synopsis

Application

class Apply t whereSource

Apply something to a bunch of arguments. Preserves blocking tags (application can never resolve blocking).

Methods

apply :: t -> Args -> tSource

applyE :: t -> Elims -> tSource

canProject :: QName -> Term -> Maybe (Arg Term)Source

If $v$ is a record value, canProject f v returns its field f.

conApp :: ConHead -> Args -> Elims -> TermSource

Eliminate a constructed term.

defApp :: QName -> Elims -> Elims -> TermSource

defApp f us vs applies Def f us to further arguments vs, eliminating top projection redexes. If us is not empty, we cannot have a projection redex, since the record argument is the first one.

piApply :: Type -> Args -> TypeSource

The type must contain the right number of pis without have to perform any reduction.

Abstraction

abstractArgs :: Abstract a => Args -> a -> aSource

Explicit substitutions

Substitution and raisingshiftingweakening

class Subst t whereSource

Apply a substitution.

Methods

applySubst :: Substitution -> t -> tSource

raise :: Subst t => Nat -> t -> tSource

raiseFrom :: Subst t => Nat -> Nat -> t -> tSource

subst :: Subst t => Term -> t -> tSource

substUnder :: Subst t => Nat -> Term -> t -> tSource

Telescopes

data TelV a Source

Constructors

TelV 

Fields

theTel :: Tele (Dom a)
 
theCore :: a
 

Instances

Functor TelV 
Typeable1 TelV 
(Eq a, Subst a) => Eq (TelV a) 
(Ord a, Subst a) => Ord (TelV a) 
Show a => Show (TelV a) 

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

bindsToTel' :: (Name -> a) -> [Name] -> Dom Type -> ListTel' aSource

Turn a typed binding (x1 .. xn : A) into a telescope.

mkPi :: Dom (ArgName, Type) -> Type -> TypeSource

mkPi dom t = telePi (telFromList [dom]) t

telePi :: Telescope -> Type -> TypeSource

Uses free variable analysis to introduce noAbs bindings.

telePi_ :: Telescope -> Type -> TypeSource

Everything will be a Abs.

class TeleNoAbs a whereSource

Performs void (noAbs) abstraction over telescope.

Methods

teleNoAbs :: a -> Term -> TermSource

dLub :: Sort -> Abs Sort -> SortSource

Dependent least upper bound, to assign a level to expressions like forall i -> Set i.

dLub s1 i.s2 = omega if i appears in the rigid variables of s2.

Functions on abstractions

absApp :: Subst t => Abs t -> Term -> tSource

Instantiate an abstraction

absBody :: Subst t => Abs t -> tSource

mkAbs :: (Subst a, Free a) => ArgName -> a -> Abs aSource

reAbs :: (Subst a, Free a) => Abs a -> Abs aSource

underAbs :: Subst a => (a -> b -> b) -> a -> Abs b -> Abs bSource

underAbs k a b applies k to a and the content of abstraction b and puts the abstraction back. a is raised if abstraction was proper such that at point of application of k and the content of b are at the same context. Precondition: a and b are at the same context at call time.

underLambdas :: Subst a => Int -> (a -> Term -> Term) -> a -> Term -> TermSource

underLambdas n k a b drops n initial Lams from b, performs operation k on a and the body of b, and puts the Lams back. a is raised correctly according to the number of abstractions.

class GetBody a whereSource

Methods to retrieve the clauseBody.

Methods

getBody :: a -> Maybe TermSource

Returns the properly raised clause Body, and Nothing if NoBody.

getBodyUnraised :: a -> Maybe TermSource

Just grabs the body, without raising the de Bruijn indices. This is useful if you want to consider the body in context clauseTel.

Syntactic equality and order

Level stuff

Boring instances