package term-indexing

  1. Overview
  2. Docs

Module Subst.MakeSource

Parameters

module P : Intf.Signature
module M : Intf.Map with type key = int
module T : Intf.Term with type prim = P.t and type t = P.t Term.term

Signature

Sourcetype term = T.t

The type of terms

type var := int
Sourcetype t

The type of substitutions

Sourceval of_seq : (var * term) Seq.t -> t
Sourceval to_seq : t -> (var * term) Seq.t
Sourceval to_seq_keys : t -> var Seq.t
Sourceval pp : Format.formatter -> t -> unit
Sourceval empty : unit -> t

empty () is the empty substitution.

Sourceval is_empty : t -> bool

is_empty subst checks whether equal subst empty

Sourceval equal : t -> t -> bool
Sourceval ub : t -> Int_option.t

ub subst is an upper bound on the absolute value of variables appearing in subst (either in the domain or the range of the substitution).

Sourceval eval : var -> t -> term option

eval v subst returns Some t if v is mapped to the term t in subst or None if v is not in the domain of subst.

Sourceval eval_exn : var -> t -> term

Exception-raising variant of eval. Raises Not_found if v is not in the domain of subst.

Sourceval add : var -> term -> t -> t

add v t subst adds a mapping from v to t in subst. If v is already in the domain of subst, the previous mapping is replaced.

Raises Invalid_argument if t is a variable equal to v

Sourceval unsafe_add : var -> term -> t -> t

unsafe_add does as add but doen't check for validity of the mapping.

Sourceval lift : t -> term -> term

lift subst term applies the substitution subst to term. Note that lift does not perform an occur check: do not use with substitutions that are not well-founded.

Sourceval union : t -> t -> t

union s1 s2 computes the union of s1 and s2.

Raises Invalid_argument if s1 and s2 have overlapping domains.

Sourcemodule Unification : sig ... end

Unification contains facilities to perform first-order term unification