Sidekick_base.Term
include module type of struct include Sidekick_core.Term end
include module type of struct include Sidekick_core_logic.Term end
type var = Sidekick_core_logic.Var.t
type bvar = Sidekick_core_logic.Bvar.t
type store = Sidekick_core_logic.Term.store
The 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 := t
include Sidekick_sigs.EQ with type t := t
include Sidekick_sigs.ORD with type t := t
include Sidekick_sigs.HASH with type t := t
val hash : t -> int
val pp_debug : t Sidekick_util.Fmt.printer
val pp_debug_with_ids : t Sidekick_util.Fmt.printer
include Sidekick_sigs.WITH_SET_MAP_TBL with type t := t
module Set = Sidekick_core.Term.Set
module Map = Sidekick_core.Term.Map
module Tbl = Sidekick_core.Term.Tbl
include Sidekick_sigs.WITH_WEAK with type t := t
module Weak_set = Sidekick_core.Term.Weak_set
module Weak_map = Sidekick_core.Term.Weak_map
val is_app : t -> bool
val is_const : t -> bool
val is_pi : t -> bool
iter_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 = z
the DAG has the following nodes:
n1: 2
n2: f n1 n1
n3: g n2 n1
n4: = n3 n3
iter_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.t
val is_type : t -> bool
is_type t
is true iff view t
is Type _
val is_a_type : t -> bool
is_a_type t
is true if is_ty (ty t)
val is_closed : t -> bool
Is the term closed (all bound variables are paired with a binder)? time: O(1)
val has_fvars : t -> bool
Does the term contain free variables? time: O(1)
module Store = Sidekick_core.Term.Store
module DB = Sidekick_core.Term.DB
De bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins end
val bool : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val proof : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val c_not : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val c_eq : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val c_ite : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val true_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val false_ : Sidekick_core_logic.Term.store -> Sidekick_core_logic.Term.t
val bool_val :
Sidekick_core_logic.Term.store ->
bool ->
Sidekick_core_logic.Term.t
val const_decoders : Sidekick_core_logic.Const.decoders
val eq :
Sidekick_core_logic.Term.store ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t ->
Sidekick_core_logic.Term.t
eq 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.t
ite a b c
is if a then b else c
val is_eq : Sidekick_core_logic.Term.t -> bool
val is_bool : Sidekick_core_logic.Term.t -> bool
val abs :
Sidekick_core_logic.Term.store ->
Sidekick_core_logic.Term.t ->
bool * Sidekick_core_logic.Term.t
abs 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 option
val open_eq :
Sidekick_core_logic.Term.t ->
(Sidekick_core_logic.Term.t * Sidekick_core_logic.Term.t) option
open_eq (a=b)
returns Some (a,b)
, None
for other terms.
type term = Sidekick_core_logic.Term.t
Printing hook, responsible for printing certain subterms
module Hooks = Sidekick_core.Term.Hooks
val default_hooks : Hooks.t Stdlib.ref
val pp : term Sidekick_util.Fmt.printer
Print using default_hooks
val pp_limit : max_depth:int -> max_nodes:int -> term Sidekick_util.Fmt.printer
Print with a limit on the number of nodes printed. An ellipsis is displayed otherwise.
module Tracer = Sidekick_core.Term.Tracer
module Trace_reader = Sidekick_core.Term.Trace_reader
module Ref = Sidekick_core.Term.Ref
val 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