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

Safe HaskellNone
LanguageHaskell2010

Agda.TypeChecking.Substitute.Class

Contents

Synopsis

Application

class Apply t where #

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

Methods

apply :: t -> Args -> t #

applyE :: t -> Elims -> t #

Instances
Apply Permutation # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply Clause # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Clause -> Args -> Clause #

applyE :: Clause -> Elims -> Clause #

Apply Sort # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Sort -> Args -> Sort #

applyE :: Sort -> Elims -> Sort #

Apply Term # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Term -> Args -> Term #

applyE :: Term -> Elims -> Term #

Apply CompiledClauses # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply FunctionInverse # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply PrimFun # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply Defn # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Defn -> Args -> Defn #

applyE :: Defn -> Elims -> Defn #

Apply ProjLams # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply Projection # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply Definition # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply RewriteRule # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply DisplayTerm # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply t => Apply [t] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: [t] -> Args -> [t] #

applyE :: [t] -> Elims -> [t] #

Apply [NamedArg (Pattern' a)] #

Make sure we only drop variable patterns.

Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: [NamedArg (Pattern' a)] -> Args -> [NamedArg (Pattern' a)] #

applyE :: [NamedArg (Pattern' a)] -> Elims -> [NamedArg (Pattern' a)] #

Apply [Occurrence] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply [Polarity] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: [Polarity] -> Args -> [Polarity] #

applyE :: [Polarity] -> Elims -> [Polarity] #

Apply t => Apply (Maybe t) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Maybe t -> Args -> Maybe t #

applyE :: Maybe t -> Elims -> Maybe t #

DoDrop a => Apply (Drop a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Drop a -> Args -> Drop a #

applyE :: Drop a -> Elims -> Drop a #

Apply t => Apply (Blocked t) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Blocked t -> Args -> Blocked t #

applyE :: Blocked t -> Elims -> Blocked t #

Subst Term a => Apply (Tele a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Tele a -> Args -> Tele a #

applyE :: Tele a -> Elims -> Tele a #

Apply a => Apply (Case a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Case a -> Args -> Case a #

applyE :: Case a -> Elims -> Case a #

Apply a => Apply (WithArity a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: WithArity a -> Args -> WithArity a #

applyE :: WithArity a -> Elims -> WithArity a #

(Apply a, Apply b) => Apply (a, b) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: (a, b) -> Args -> (a, b) #

applyE :: (a, b) -> Elims -> (a, b) #

Apply v => Apply (Map k v) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: Map k v -> Args -> Map k v #

applyE :: Map k v -> Elims -> Map k v #

Apply v => Apply (HashMap k v) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: HashMap k v -> Args -> HashMap k v #

applyE :: HashMap k v -> Elims -> HashMap k v #

(Apply a, Apply b, Apply c) => Apply (a, b, c) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

apply :: (a, b, c) -> Args -> (a, b, c) #

applyE :: (a, b, c) -> Elims -> (a, b, c) #

applys :: Apply t => t -> [Term] -> t #

Apply to some default arguments.

apply1 :: Apply t => t -> Term -> t #

Apply to a single default argument.

Abstraction

class Abstract t where #

(abstract args v) apply args --> v[args].

Minimal complete definition

abstract

Methods

abstract :: Telescope -> t -> t #

Instances
Abstract Permutation # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract Clause # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Clause -> Clause #

Abstract Sort # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Sort -> Sort #

Abstract Telescope # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract Type # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Type -> Type #

Abstract Term # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Term -> Term #

Abstract CompiledClauses # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract FunctionInverse # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract PrimFun # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract Defn # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Defn -> Defn #

Abstract ProjLams # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract Projection # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract Definition # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract RewriteRule #

tel ⊢ (Γ ⊢ lhs ↦ rhs : t) becomes tel, Γ ⊢ lhs ↦ rhs : t) we do not need to change lhs, rhs, and t since they live in Γ. See 'Abstract Clause'.

Instance details

Defined in Agda.TypeChecking.Substitute

Abstract t => Abstract [t] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> [t] -> [t] #

Abstract [Occurrence] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Abstract [Polarity] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> [Polarity] -> [Polarity] #

Abstract t => Abstract (Maybe t) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Maybe t -> Maybe t #

DoDrop a => Abstract (Drop a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Drop a -> Drop a #

Abstract a => Abstract (Case a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Case a -> Case a #

Abstract a => Abstract (WithArity a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> WithArity a -> WithArity a #

Abstract v => Abstract (Map k v) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> Map k v -> Map k v #

Abstract v => Abstract (HashMap k v) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

abstract :: Telescope -> HashMap k v -> HashMap k v #

Substitution and raisingshiftingweakening

class DeBruijn t => Subst t a | a -> t where #

Apply a substitution.

Minimal complete definition

applySubst

Methods

applySubst :: Substitution' t -> a -> a #

Instances
Subst TTerm TAlt # 
Instance details

Defined in Agda.Compiler.Treeless.Subst

Subst TTerm TTerm # 
Instance details

Defined in Agda.Compiler.Treeless.Subst

Subst DeBruijnPattern DeBruijnPattern # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term () # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' Term -> () -> () #

Subst Term String # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Range # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term QName # 
Instance details

Defined in Agda.TypeChecking.Substitute.Class

Subst Term Name # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term EqualityView # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term ConPatternInfo # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Pattern # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term LevelAtom # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term PlusLevel # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Level # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Sort # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Term # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term ProblemEq # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Candidate # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term DisplayTerm # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term DisplayForm # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term Constraint # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term AbsurdPattern # 
Instance details

Defined in Agda.TypeChecking.Rules.LHS.Problem

Subst Term DotPattern # 
Instance details

Defined in Agda.TypeChecking.Rules.LHS.Problem

Subst Term AsBinding # 
Instance details

Defined in Agda.TypeChecking.Rules.LHS.Problem

Subst Term SizeConstraint # 
Instance details

Defined in Agda.TypeChecking.SizedTypes.Solve

Subst Term SizeMeta # 
Instance details

Defined in Agda.TypeChecking.SizedTypes.Solve

Subst NLPat RewriteRule # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst NLPat NLPType # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst NLPat NLPat # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst SplitPattern SplitPattern # 
Instance details

Defined in Agda.TypeChecking.Coverage.Match

Subst t a => Subst t [a] # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> [a] -> [a] #

Subst t a => Subst t (Maybe a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Maybe a -> Maybe a #

Subst t a => Subst t (Dom a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Dom a -> Dom a #

Subst t a => Subst t (Arg a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Arg a -> Arg a #

Subst t a => Subst t (Abs a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Abs a -> Abs a #

Subst t a => Subst t (Elim' a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Elim' a -> Elim' a #

Subst t a => Subst t (Tele a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Tele a -> Tele a #

Subst t a => Subst t (Blocked a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Blocked a -> Blocked a #

Subst a a => Subst a (Substitution' a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term a => Subst Term (Type' a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Subst Term (Problem a) # 
Instance details

Defined in Agda.TypeChecking.Rules.LHS.Problem

(Subst t a, Subst t b) => Subst t (a, b) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> (a, b) -> (a, b) #

(Ord k, Subst t a) => Subst t (Map k a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Map k a -> Map k a #

Subst t a => Subst t (Named name a) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> Named name a -> Named name a #

Subst Term (SizeExpr' NamedRigid SizeMeta) #

Only for raise.

Instance details

Defined in Agda.TypeChecking.SizedTypes.Solve

(Subst t a, Subst t b, Subst t c) => Subst t (a, b, c) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> (a, b, c) -> (a, b, c) #

(Subst t a, Subst t b, Subst t c, Subst t d) => Subst t (a, b, c, d) # 
Instance details

Defined in Agda.TypeChecking.Substitute

Methods

applySubst :: Substitution' t -> (a, b, c, d) -> (a, b, c, d) #

raise :: Subst t a => Nat -> a -> a #

raiseFrom :: Subst t a => Nat -> Nat -> a -> a #

subst :: Subst t a => Int -> t -> a -> a #

Replace de Bruijn index i by a Term in something.

strengthen :: Subst t a => Empty -> a -> a #

substUnder :: Subst t a => Nat -> t -> a -> a #

Replace what is now de Bruijn index 0, but go under n binders. substUnder n u == subst n (raise n u).

Identity instances

Explicit substitutions

singletonS :: DeBruijn a => Int -> a -> Substitution' a #

To replace index n by term u, do applySubst (singletonS n u). Γ, Δ ⊢ u : A --------------------------------- Γ, Δ ⊢ singletonS |Δ| u : Γ, A, Δ

inplaceS :: Subst a a => Int -> a -> Substitution' a #

Single substitution without disturbing any deBruijn indices. Γ, A, Δ ⊢ u : A --------------------------------- Γ, A, Δ ⊢ inplace |Δ| u : Γ, A, Δ

liftS :: Int -> Substitution' a -> Substitution' a #

Lift a substitution under k binders.

dropS :: Int -> Substitution' a -> Substitution' a #

        Γ ⊢ ρ : Δ, Ψ
     -------------------
     Γ ⊢ dropS |Ψ| ρ : Δ
  

composeS :: Subst a a => Substitution' a -> Substitution' a -> Substitution' a #

applySubst (ρ composeS σ) v == applySubst ρ (applySubst σ v)

(++#) :: DeBruijn a => [a] -> Substitution' a -> Substitution' a infixr 4 #

prependS :: DeBruijn a => Empty -> [Maybe a] -> Substitution' a -> Substitution' a #

     Γ ⊢ ρ : Δ  Γ ⊢ reverse vs : Θ
     ----------------------------- (treating Nothing as having any type)
       Γ ⊢ prependS vs ρ : Δ, Θ
  

strengthenS :: Empty -> Int -> Substitution' a #

Γ ⊢ (strengthenS ⊥ |Δ|) : Γ,Δ

lookupS :: Subst a a => Substitution' a -> Nat -> a #

Functions on abstractions

absApp :: Subst t a => Abs a -> t -> a #

Instantiate an abstraction. Strict in the term.

lazyAbsApp :: Subst t a => Abs a -> t -> a #

Instantiate an abstraction. Lazy in the term, which allow it to be (throwImpossible (Impossible "srcfullAgdaTypeCheckingSubstitute/Class.hs" 233)) in the case where the variable shouldn't be used but we cannot use noabsApp. Used in Apply.

noabsApp :: Subst t a => Empty -> Abs a -> a #

Instantiate an abstraction that doesn't use its argument.

absBody :: Subst t a => Abs a -> a #

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

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

underAbs :: Subst t a => (a -> b -> b) -> a -> Abs b -> Abs b #

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 Term a => Int -> (a -> Term -> Term) -> a -> Term -> Term #

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.