Core terms for Theoria's trusted kernel.
Terms use de Bruijn indices internally. User-facing names are retained only for diagnostics and pretty-printing; binding correctness is determined by indices.
Summary
Functions
Shifts de Bruijn indices by amount at and above cutoff.
Substitutes de Bruijn variable index with replacement.
Substitutes the outermost bound variable in body with replacement.
Types
@type t() :: Theoria.Term.Sort.t() | Theoria.Term.BVar.t() | Theoria.Term.Const.t() | Theoria.Term.App.t() | Theoria.Term.Lam.t() | Theoria.Term.Forall.t()
Functions
@spec app(t(), t()) :: Theoria.Term.App.t()
@spec arrow(t(), t()) :: Theoria.Term.Forall.t()
@spec bvar(non_neg_integer()) :: Theoria.Term.BVar.t()
@spec const(atom()) :: Theoria.Term.Const.t()
@spec forall(atom(), t(), t()) :: Theoria.Term.Forall.t()
@spec lam(atom(), t(), t()) :: Theoria.Term.Lam.t()
@spec shift(t(), integer(), non_neg_integer()) :: t()
Shifts de Bruijn indices by amount at and above cutoff.
@spec sort(non_neg_integer()) :: Theoria.Term.Sort.t()
@spec subst(t(), non_neg_integer(), t(), non_neg_integer()) :: t()
Substitutes de Bruijn variable index with replacement.
Substitutes the outermost bound variable in body with replacement.