module type UTIL =sig
..end
include TermInner.UTIL_REPR
val build : t_ TermInner.view -> t_
val const : TermInner.id -> t_
val builtin : t_ TermInner.Builtin.t -> t_
val app_builtin : t_ TermInner.Builtin.t -> t_ list -> t_
val var : t_ TermInner.var -> t_
val app : t_ -> t_ list -> t_
val app_const : ID.t -> t_ list -> t_
val fun_ : t_ TermInner.var -> t_ -> t_
val mu : t_ TermInner.var -> t_ -> t_
val let_ : t_ TermInner.var -> t_ -> t_ -> t_
val match_with : t_ -> t_ TermInner.cases -> t_
val ite : t_ -> t_ -> t_ -> t_
val forall : t_ TermInner.var -> t_ -> t_
val exists : t_ TermInner.var -> t_ -> t_
val eq : t_ -> t_ -> t_
val neq : t_ -> t_ -> t_
val imply : t_ -> t_ -> t_
val imply_l : t_ list -> t_ -> t_
val true_ : t_
val false_ : t_
val and_ : t_ list -> t_
val or_ : t_ list -> t_
val not_ : t_ -> t_
val undefined_self : t_ -> t_
val undefined_atom : ty:t_ -> t_
val data_test : ID.t -> t_ -> t_
val data_select : ID.t -> int -> t_ -> t_
val unparsable : ty:t_ -> t_
val and_nodup : t_ list -> t_
val asserting : t_ -> t_ list -> t_
val assuming : t_ -> t_ list -> t_
val guard : t_ -> t_ TermInner.Builtin.guard -> t_
val mk_bind : TermInner.Binder.t -> t_ TermInner.var -> t_ -> t_
val mk_bind_l : TermInner.Binder.t -> t_ TermInner.var list -> t_ -> t_
val ty_type : t_
val ty_kind : t_
val ty_prop : t_
val ty_unitype : t_
val ty_builtin : TermInner.TyBuiltin.t -> t_
val ty_const : TermInner.id -> t_
val ty_app : t_ -> t_ list -> t_
val ty_arrow : t_ -> t_ -> t_
val ty_arrow_l : t_ list -> t_ -> t_
val ty_var : t_ TermInner.var -> t_
val ty_meta : t_ MetaVar.t -> t_
val ty_forall : t_ TermInner.var -> t_ -> t_
val fun_l : t_ TermInner.var list -> t_ -> t_
val forall_l : t_ TermInner.var list -> t_ -> t_
val exists_l : t_ TermInner.var list -> t_ -> t_
val ty_forall_l : t_ TermInner.var list -> t_ -> t_
val let_l : (t_ TermInner.var * t_) list -> t_ -> t_
val close_forall : t_ -> t_
close_forall t
universally quantifies over free variables of t
val hash_fun : t_ CCHash.hash_fun
val hash : t_ -> int
val hash_fun_alpha_eq : t_ CCHash.hash_fun
val hash_alpha_eq : t_ -> int
val equal : t_ -> t_ -> bool
module Tbl:CCHashtbl.S
with type key = t_
module Map:CCMap.S
with type key = t_
val remove_dup : t_ list -> t_ list
val fold : f:('acc -> 'b_acc -> t_ -> 'acc) ->
bind:('b_acc -> t_ Var.t -> 'b_acc) -> 'acc -> 'b_acc -> t_ -> 'acc
f
: used to update the regular accumulator (that is returned)bind
: updates the binding accumulator with the bound variableval iter : f:('b_acc -> t_ -> unit) ->
bind:('b_acc -> t_ Var.t -> 'b_acc) -> 'b_acc -> t_ -> unit
f
: called on immediate subterms and on the regular accumulatorbind
: updates the binding accumulator with the bound variableval map' : f:('b_acc -> t_ -> 'a) ->
bind:('b_acc -> t_ Var.t -> 'b_acc * 'a Var.t) ->
'b_acc -> t_ -> 'a TermInner.view
T.build
in the special case of terms.f
: maps a term to a termbind
: updates the binding accumulator and returns a new variableval map : f:('b_acc -> t_ -> t_) ->
bind:('b_acc -> t_ Var.t -> 'b_acc * t_ Var.t) -> 'b_acc -> t_ -> t_
TermInner.UTIL.map'
for termsval map_pol : f:('b_acc -> Polarity.t -> t_ -> t_) ->
bind:('b_acc -> t_ Var.t -> 'b_acc * t_ Var.t) ->
'b_acc -> Polarity.t -> t_ -> t_
TermInner.UTIL.map
but also keeping the subterm polarityval approx_infinite_quant_pol : [ `Eq | `Exists | `Forall ] ->
Polarity.t -> [ `Keep | `Unsat_means_unknown of t_ ]
q
under the polarity pol
: either
`Unsat_means_unknown replacement
means that we lost completeness,
and should return replacement
instead`Keep
means to keep the quantifier as isval size : t_ -> int
typesubst =
(t_, t_) Var.Subst.t
typerenaming =
(t_, t_ Var.t) Var.Subst.t
val equal_with : subst:subst -> t_ -> t_ -> bool
val deref : subst:subst -> t_ -> t_
deref ~subst t
dereferences t
as long as it is a variable
bound in subst
.val rename_var : subst -> t_ Var.t -> subst * t_ Var.t
Subst.rename_var
but wraps the renamed var in a termtype
apply_error = {
|
ae_msg : |
|
ae_term : |
|
ae_ty : |
|
ae_args : |
|
ae_args_ty : |
|
ae_subst : |
exception ApplyError of apply_error
val eval : ?rec_:bool -> subst:subst -> t_ -> t_
rec_
: if true, when replacing v
with t
because (v -> t) in subst
, we call eval subst t
instead of
assuming t
is preserved by subst (default false)val eval_renaming : subst:renaming -> t_ -> t_
val renaming_to_subst : renaming -> subst
val ty_apply : t_ -> terms:t_ list -> tys:t_ list -> t_
apply t ~terms ~tys
computes the type of f terms
for some
function f
, where f : t
and terms : ty
.ApplyError
if the arguments do not matchval ty_apply_full : t_ -> terms:t_ list -> tys:t_ list -> t_ * subst
ty_apply_full ty l
is like apply t l
, but it returns a pair
ty' , subst
such that subst ty' = apply t l
.ApplyError
if the arguments do not matchval ty_apply_mono : t_ -> tys:t_ list -> t_
apply t ~tys
computes the type of f terms
for some
function f
, where f : t
and terms : ty
.Invalid_argument
if t
is not monomorphic (i.e. not TyForall)ApplyError
if the arguments do not matchtypesignature =
TermInner.id -> t_ option
val ty : sigma:signature -> t_ -> t_ TermInner.or_error
val ty_exn : sigma:signature -> t_ -> t_
TermInner.UTIL.ty
but unsafe.Failure
in case of error at an applicationUndefined
in case some symbol is not definedexception UnifError of string * t_ * t_
val match_exn : ?subst2:subst -> t_ -> t_ -> subst
match_exn ~subst2 t1 t2
matches the pattern t1
against subst2 t2
.
Variables in subst2 t2
are not bound.
We assume t1
and subst2 t2
do not share variables, and we assume
that t1
is a mostly first-order pattern (no binders, but variables
in head position is accepted and will only match an application).UnifError
if they dont_ matchInvalid_argument
if t1
is not a valid patternval match_ : ?subst2:subst -> t_ -> t_ -> subst option