package dedukti

  1. Overview
  2. Docs

Module Exsubst.ExSubstSource

This modules implements extended substitution of DB variables in a term. This is typically used to: 1) infer a "most general" typing substitution from constraints gathered while inferring the type of the LHS of a rule. 2) apply the substitution to the RHS of the rule before typechecking it.

Sourcetype t
Sourceval identity : t

Empty substitution

Sourceval is_identity : t -> bool

Checks emptyness

Sourceval add : t -> int -> int -> Term.term -> t

add sigma n t returns the substitution sigma with the extra mapping n -> t.

Sourceval apply : t -> int -> Term.term -> Term.term

apply sigma n t applies the subsitution sigma to t considered under n lambda abstractions.

Sourceval apply' : t -> int -> Term.term -> Term.term * bool

Same as apply, but outputting a boolean true if the term is modified by the substitution.

Sourceval apply2 : t -> int -> int -> Term.term -> Term.term

Special substitution function corresponding to given ExSubst.t instance sigma "in a smaller context": Assume sigma a substitution in a context Gamma = Gamma' ; Delta with |Delta|=i. Then this function represents the substitution sigma in the context Gamma'. All variables of Delta are ignored and substitutes of the variables of Gamma' are unshifted. This may therefore raise UnshiftExn in case substitutes of variables of Gamma' refers to variables of Delta.

Sourceval mk_idempotent : t -> t

mk_idempotent sigma successively applies sigma to its mapped terms until this operation has no effect anymore.

Sourceval pp : (int -> Basic.ident) -> t Basic.printer

Prints the substitution using given naming function

OCaml

Innovation. Community. Security.