(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(** Explicit substitutions *)
(** {6 Explicit substitutions } *) (** Explicit substitutions for some type of terms ['a].
(** Assuming |Γ| = n, Γ ⊢ subs_id n : Γ *) val subs_id : int -> 'a subs
(** Assuming Γ ⊢ σ : Δ and Γ ⊢ t : A{σ}, then Γ ⊢ subs_cons t σ : Δ, A *) val subs_cons: 'a -> 'a subs -> 'a subs
(** Assuming Γ ⊢ σ : Δ and |Ξ| = n, then Γ, Ξ ⊢ subs_shft (n, σ) : Δ *) val subs_shft: int * 'a subs -> 'a subs
(** Assuming Γ ⊢ σ : Δ and |Ξ| = n, then Γ, Ξ ⊢ subs_liftn n σ : Δ, Ξ *) val subs_liftn: int -> 'a subs -> 'a subs
(** Unary variant of {!subst_liftn}. *) val subs_lift: 'a subs -> 'a subs
(** [expand_rel k subs] expands de Bruijn [k] in the explicit substitution [subs].Theresultiseither(Inl(lams,v))whenthevariableis substitutedbyvalue[v]under[lams]binders(i.e.v*has*tobe shiftedby[lams]),or(Inr(k',p))whenthevariablekisjustrelocated ask';pisNoneifthevariablepointsinsidesubsandSome(k)ifthe variablepointskbindingsbeyondsubs(cfargumentofESID).
*) val expand_rel: int -> 'a subs -> (int * 'a, int * int option) Util.union
(** Tests whether a substitution behaves like the identity *) val is_subs_id: 'a subs -> bool
Relocationsareaparticularkindofsubstitutionsthatonlycontain variables.Inparticular,[el_*]enjoysthesametypingrulesasthe equivalentsubstitutionfunction[subs_*].
*) type lift = private
| ELID
| ELSHFT of lift * int
| ELLFT of int * lift
(** For arbitrary Γ: Γ ⊢ el_id : Γ *) val el_id : lift
(** Assuming Γ ⊢ σ : Δ₁, Δ₂ and |Δ₂| = n, then Γ ⊢ el_shft n σ : Δ₁ *) val el_shft : int -> lift -> lift
(** Assuming Γ ⊢ σ : Δ and |Ξ| = n, then Γ, Ξ ⊢ el_liftn n σ : Δ, Ξ *) val el_liftn : int -> lift -> lift
(** Unary variant of {!el_liftn}. *) val el_lift : lift -> lift
(** Assuming Γ₁, A, Γ₂ ⊢ σ : Δ₁, A, Δ₂ and Δ₁, A, Δ₂ ⊢ n : A,
then Γ₁, A, Γ₂ ⊢ reloc_rel n σ : A *) val reloc_rel : int -> lift -> int
val is_lift_id : lift -> bool
(** Lift applied to substitution: [lift_subst mk_clos el s] computes a substitutionequivalenttoapplyingelthens.Argument mk_closisusedwhenaclosurehastobecreated,i.e.when elisappliedonanelementofs.
Thatis,ifΓ⊢e:ΔandΔ⊢σ:Ξ,thenΓ⊢lift_substmkeσ:Ξ.
*) val lift_subst : (lift -> 'a -> 'b) -> lift -> 'a subs -> 'b subs
val eq_lift : lift -> lift -> bool (** Equality for lifts *)
(** Debugging utilities *)
module Internal : sig type'a or_rel = REL of int | VAL of int * 'a
(** High-level representation of a substitution. The first component is a list thatassociatesavaluetoanindex,andthesecondcomponentisthe relocationshiftthatmustbeappliedtoanyvariablepointingoutsideof
the substitution. *) val repr : 'a subs -> 'a or_rel list * int end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.