Module Vars
Occur checks
val closedn : int -> Constr.constr -> boolclosedn n Mis true iffMis a (de Bruijn) closed term under n binders
val closed0 : Constr.constr -> boolclosed0 Mis true iffMis a (de Bruijn) closed term
val noccurn : int -> Constr.constr -> boolnoccurn n Mreturns true iffRel ndoes NOT occur in termM
val noccur_between : int -> int -> Constr.constr -> boolnoccur_between n m Mreturns true iffRel pdoes NOT occur in termMfor n <= p < n+m
val noccur_with_meta : int -> int -> Constr.constr -> boolChecking function for terms containing existential- or meta-variables. The function
noccur_with_metadoes not consider meta-variables applied to some terms (intended to be its local context) (for existential variables, it is necessarily the case)
Relocation and substitution
val exliftn : Esubst.lift -> Constr.constr -> Constr.constrexliftn el cliftscwith arbitrary complex liftingel
val liftn : int -> int -> Constr.constr -> Constr.constrliftn n k clifts bynindices greater than or equal tokincNote that with respect to substitution calculi's terminology,nis the _shift_ andkis the _lift_.
val lift : int -> Constr.constr -> Constr.constrlift n clifts bynthe positive indexes inc
val liftn_rel_context : int -> int -> Constr.rel_context -> Constr.rel_contextSame as
liftnfor a context
val lift_rel_context : int -> Constr.rel_context -> Constr.rel_contextSame as
liftfor a context
type substl= Constr.constr list
type instance= Constr.constr arraytype instance_list= Constr.constr list
val subst_of_rel_context_instance : Constr.rel_context -> instance -> substlLet
Γbe a context interleaving declarationsx₁:T₁..xn:Tnand definitionsy₁:=c₁..yp:=cpin some contextΓ₀. Letu₁..unbe an instance ofΓ, i.e. an instance inΓ₀of thexi. Then,subst_of_rel_context_instance_list Γ u₁..unreturns the corresponding substitution ofΓ, i.e. the appropriate interleavingσof theu₁..unwith thec₁..cp, all of them inΓ₀, so that a derivationΓ₀, Γ, Γ₁|- t:Tcan be instantiated into a derivationΓ₀, Γ₁ |- t[σ]:T[σ]usingsubstnl σ |Γ₁| t. Note that the instanceu₁..unis represented starting withu₁, as if usable inapplistwhile the substitution is represented the other way round, i.e. ending with eitheru₁orc₁, as if usable forsubstl.
val subst_of_rel_context_instance_list : Constr.rel_context -> instance_list -> substlval adjust_rel_to_rel_context : ('a, 'b) Context.Rel.pt -> int -> intTake an index in an instance of a context and returns its index wrt to the full context (e.g. 2 in
x:A;y:=b;z:Cis 3, i.e. a reference to z)
val substnl : substl -> int -> Constr.constr -> Constr.constrsubstnl [a₁;...;an] k csubstitutes in parallela₁,...,anfor respectivelyRel(k+1),...,Rel(k+n)inc; it relocates accordingly indexes inan,...,a1andc. In terms of typing, if Γ ⊢ an..a₁ : Δ and Γ, Δ, Γ' ⊢ c : T with |Γ'|=k, then Γ, Γ' ⊢substnl [a₁;...;an] k c:substnl [a₁;...;an] k T.
val substl : substl -> Constr.constr -> Constr.constrsubstl σ cis a short-hand forsubstnl σ 0 c
val subst1 : Constr.constr -> Constr.constr -> Constr.constrsubstl a cis a short-hand forsubstnl [a] 0 c
val substnl_decl : substl -> int -> Constr.rel_declaration -> Constr.rel_declarationsubstnl_decl [a₁;...;an] k Ωsubstitutes in parallela₁, ...,anfor respectivelyRel(k+1), ...,Rel(k+n)in a declarationΩ; it relocates accordingly indexes ina₁,...,anandc. In terms of typing, if Γ ⊢ an..a₁ : Δ and Γ, Δ, Γ', Ω ⊢ with |Γ'|=k, then Γ, Γ',substnl_decl [a₁;...;an]k Ω ⊢.
val substl_decl : substl -> Constr.rel_declaration -> Constr.rel_declarationsubstl_decl σ Ωis a short-hand forsubstnl_decl σ 0 Ω
val subst1_decl : Constr.constr -> Constr.rel_declaration -> Constr.rel_declarationsubst1_decl a Ωis a short-hand forsubstnl_decl [a] 0 Ω
val substnl_rel_context : substl -> int -> Constr.rel_context -> Constr.rel_contextsubstnl_rel_context [a₁;...;an] k Ωsubstitutes in parallela₁, ...,anfor respectivelyRel(k+1), ...,Rel(k+n)in a contextΩ; it relocates accordingly indexes ina₁,...,anandc. In terms of typing, if Γ ⊢ an..a₁ : Δ and Γ, Δ, Γ', Ω ⊢ with |Γ'|=k, then Γ, Γ',substnl_rel_context [a₁;...;an]k Ω ⊢.
val substl_rel_context : substl -> Constr.rel_context -> Constr.rel_contextsubstl_rel_context σ Ωis a short-hand forsubstnl_rel_context σ 0 Ω
val subst1_rel_context : Constr.constr -> Constr.rel_context -> Constr.rel_contextsubst1_rel_context a Ωis a short-hand forsubstnl_rel_context [a] 0 Ω
val esubst : (int -> 'a -> Constr.constr) -> 'a Esubst.subs -> Constr.constr -> Constr.constresubst lift σ csubstitutescwith arbitrary complex substitutionσ, usingliftto lift subterms where necessary.
val replace_vars : (Names.Id.t * Constr.constr) list -> Constr.constr -> Constr.constrreplace_vars k [(id₁,c₁);...;(idn,cn)] tsubstitutesVar idjbycjint.
val substn_vars : int -> Names.Id.t list -> Constr.constr -> Constr.constrsubstn_vars k [id₁;...;idn] tsubstitutesVar idjbyRel j+k-1int. If two names are identical, the one of least index is kept. In terms of typing, if Γ,xn:Un,...,x₁:U₁,Γ' ⊢ t:T, together with idj:Tj and Γ,xn:Un,...,x₁:U₁,Γ' ⊢ Tj[idj+1..idn:=xj+1..xn] ≡ Uj, then Γ\{id₁,...,idn},xn:Un,...,x₁:U₁,Γ' ⊢substn_vars (|Γ'|+1) [id₁;...;idn] t:substn_vars (|Γ'|+1) [id₁;...;idn] T.
val subst_vars : Names.Id.t list -> Constr.constr -> Constr.constrsubst_vars [id1;...;idn] tis a short-hand forsubstn_vars [id1;...;idn] 1 t: it substitutesVar idjbyRel jint. If two names are identical, the one of least index is kept.
val subst_var : Names.Id.t -> Constr.constr -> Constr.constrsubst_var id tis a short-hand forsubstn_vars [id] 1 t: it substitutesVar idbyRel 1int.
val smash_rel_context : Constr.rel_context -> Constr.rel_contextExpand lets in context
Substitution of universes
val subst_univs_level_constr : UVars.sort_level_subst -> Constr.constr -> Constr.constrval subst_univs_level_context : UVars.sort_level_subst -> Constr.rel_context -> Constr.rel_contextval subst_instance_constr : UVars.Instance.t -> Constr.constr -> Constr.constrInstance substitution for polymorphism.
val subst_instance_context : UVars.Instance.t -> Constr.rel_context -> Constr.rel_contextval univ_instantiate_constr : UVars.Instance.t -> Constr.constr UVars.univ_abstracted -> Constr.constrIgnores the constraints carried by
univ_abstracted.
val map_constr_relevance : (Sorts.relevance -> Sorts.relevance) -> Constr.t -> Constr.tModifies the relevances in the head node (not in subterms)
val sort_and_universes_of_constr : Constr.constr -> Sorts.QVar.Set.t * Univ.Level.Set.tval universes_of_constr : Constr.constr -> Univ.Level.Set.t
Low-level cached lift type
val make_substituend : Constr.constr -> substituendval lift_substituend : int -> substituend -> Constr.constr