module DT_util:sig
..end
typeterm =
TermInner.Default.t
typedt =
(term, term) Model.DT.t
typesubst =
(term, term) Var.Subst.t
val ite : term Var.t ->
then_:dt -> else_:dt -> dt
val eval_subst : subst:subst -> dt -> dt
Assert_failure
if the substitution binds some of dt
's variablesval map_vars : subst:(term, term Var.t) Var.Subst.t ->
dt -> dt
val rename_vars : dt -> dt
dt
val apply : dt -> term -> dt
apply dt arg
returns the sub-tree of dt
for when dt
's variable
is equal to arg
.Invalid_argument
if the dt
is not a functionval apply_l : dt -> term list -> dt
dt
to a list of argumentsInvalid_argument
if the dt
is not a function with enough argumentsval join : dt -> dt -> dt
join a b
applies b
to every leaf of a
, grafting the
resulting sub-tree in place of the leaf, using Model.DT_util.apply
.
assumes the return type of a
is the same as the first
argument of b
.
val merge : dt -> dt -> dt
merge a b
concatenates the cases of a
and b
,
merging the common cases recursively, favoring a
over b
when needed. The new default/else is a.default
.
not commutative.
val merge_l : dt list -> dt
val reorder : term Var.t list -> dt -> dt
reorder vars dt
rebalances dt
so it has the given order of
variables. It is assumed that vars
is a permutation of DT.vars dt
Invalid_argument
if vars
is not a permutation of the
variables of dt
val remove_vars : term Var.t list -> dt -> dt
Model.DT_util.merge_l
to merge their sub-cases.
If those variables occur in tests in variables that come earlier
in DT.vars dt
, they will not be substituted properlyval remove_first_var : dt -> dt
Model.DT_util.remove_vars
.Invalid_argument
if the tree is constantexception Case_not_found of term
val find_cases : ?subst:subst ->
term ->
(term, term) Model.DT.cases ->
subst * dt
Case_not_found
if the term is not foundval to_term : dt -> term
val print : dt Model.printer