package term-indexing
Install
Dune Dependency
Authors
Maintainers
Sources
md5=9ba5dcf909fde539e173daf8f13abffd
sha512=e84fb1104c420db346181416a1e95e60aeb1b757ed7456a6028a6dfd5096bb7888af7c1ad6ea1acb25e99318e86d1f75c82a072bbdc3ba8218e5b16778199dfe
doc/term-indexing/Term_indexing/Term/Make_hash_consed/index.html
Module Term.Make_hash_consed
Source
The following functor instantiates a module to manipulate hash-consed terms over the signature P
, using an implementation of persistent maps given by M
.
Parameters
module P : Intf.Signature
Signature
include Intf.Term_core with type prim = P.t with type t = P.t term
The type of primitives, i.e. the symbols. Each value of type prim
has a definite arity.
Pretty-printing of terms in s-exp format.
prim p ts
constructs a term with head equal to p
and subterms equal to ts
Raises Invalid_argument
if the length of ts
does not match the arity of p
.
destruct t ifprim ifvar
performs case analysis on the term t
is_var t
is equal to var v
if equal t (var v)
or None
if it is not the case
fold f acc term
folds f
over the subterms of t
get_subterm_fwd t fpth
is the subterm of t
at position defined by the forward path fpth
.
Raises Get_subterm_oob
if the path is out of bounds.
include Intf.Hashed with type t := t
pp fmt s
prints a representation of s
to the formatter fmt
.
ub t
is an upper bound on the absolute value of variables contained in t
. Equal to Int_option.none
if t
does not contain variables.
map_variables f t
replaces all variables var i
present in t
by f i
.
get_subterm t pth
is the subterm of t
at position defined by the path pth
.
Raise Get_subterm_oob
if the path is out of bounds.
subst ~term ~path f
replaces the subterm of term
at position path
by f (get_subterm term path)
.
fold_variables f acc t
folds f
over the variables of t
canon t gen
canonicalizes the term t
using the variable generator gen
. Returns the canonicalized term as well as a map from old to canonicalized variables.