Sidekick_base.Terminclude module type of struct include Sidekick_core.Term endinclude module type of struct include Sidekick_core_logic.Term endtype var = Sidekick_core_logic.Var.ttype bvar = Sidekick_core_logic.Bvar.ttype store = Sidekick_core_logic.Term.storeThe store for terms.
The store is responsible for allocating unique IDs to terms, and enforcing their hashconsing (so that syntactic equality is just a pointer comparison).
include Sidekick_sigs.EQ_ORD_HASH with type t := tinclude Sidekick_sigs.EQ with type t := tinclude Sidekick_sigs.ORD with type t := tinclude Sidekick_sigs.HASH with type t := tval hash : t -> intval pp_debug : t Sidekick_util.Fmt.printerval pp_debug_with_ids : t Sidekick_util.Fmt.printerinclude Sidekick_sigs.WITH_SET_MAP_TBL with type t := tmodule Set = Sidekick_core.Term.Setmodule Map = Sidekick_core.Term.Mapmodule Tbl = Sidekick_core.Term.Tblinclude Sidekick_sigs.WITH_WEAK with type t := tmodule Weak_set = Sidekick_core.Term.Weak_setmodule Weak_map = Sidekick_core.Term.Weak_mapval is_app : t -> boolval is_const : t -> boolval is_pi : t -> booliter_dag t ~f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.
For example, in:
let x = 2 in
let y = f x x in
let z = g y x in
z = zthe DAG has the following nodes:
n1: 2
n2: f n1 n1
n3: g n2 n1
n4: = n3 n3iter_shallow f e iterates on immediate subterms of e, calling f trdb e' for each subterm e', with trdb = true iff e' is directly under a binder.
val free_vars :
?init:Sidekick_core_logic__.Var.Set.t ->
t ->
Sidekick_core_logic__.Var.Set.tval is_type : t -> boolis_type t is true iff view t is Type _
val is_a_type : t -> boolis_a_type t is true if is_ty (ty t)
val is_closed : t -> boolIs the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> boolDoes the term contain free variables? time: O(1)
module Store = Sidekick_core.Term.Storemodule DB = Sidekick_core.Term.DBDe bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins endval bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval proof : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_not : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_eq : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval c_ite : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval true_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval false_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.tval bool_val :
Sidekick_core_logic.Term.store ->
bool ->
Sidekick_core_logic.Term.tval const_decoders : Sidekick_core_logic.Const.decodersval eq :
Sidekick_core_logic.Term.store ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.teq a b is a = b
val ite :
Sidekick_core_logic.Term.store ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.tite a b c is if a then b else c
val is_eq : Sidekick_core_logic.Term.t -> boolval is_bool : Sidekick_core_logic.Term.t -> boolval abs :
Sidekick_core_logic.Term.store ->
Sidekick_core_logic.Term.t ->
bool * Sidekick_core_logic.Term.tabs t returns an "absolute value" for the term, along with the sign of t.
The idea is that we want to turn not a into (false, a), or (a != b) into (false, a=b). For terms without a negation this should return (true, t).
val as_bool_val : Sidekick_core_logic.Term.t -> bool optionval open_eq :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Term.t * Sidekick_core_logic.Term.t) optionopen_eq (a=b) returns Some (a,b), None for other terms.
type term = Sidekick_core_logic.Term.tPrinting hook, responsible for printing certain subterms
module Hooks = Sidekick_core.Term.Hooksval default_hooks : Hooks.t Stdlib.refval pp : term Sidekick_util.Fmt.printerPrint using default_hooks
val pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printerPrint with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer = Sidekick_core.Term.Tracermodule Trace_reader = Sidekick_core.Term.Trace_readermodule Ref = Sidekick_core.Term.Refval view_as_cc :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Const.t,
Sidekick_core_logic.Term.t,
Sidekick_core_logic.Term.t list)
Sidekick_core.CC_view.t