Sidekick_base.Ty
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).
View.
A view is the shape of the root node of a term.
include Sidekick_sigs.EQ_ORD_HASH
with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.EQ with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.ORD with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.HASH with type t := Sidekick_core_logic__.Types_.term
include Sidekick_sigs.WITH_SET_MAP_TBL
with type t := Sidekick_core_logic__.Types_.term
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 := Sidekick_core_logic__.Types_.term
module Weak_set = Sidekick_core.Term.Weak_set
module Weak_map = Sidekick_core.Term.Weak_map
val view : Sidekick_core_logic__.Types_.term -> view
val iter_dag :
?seen:unit Tbl.t ->
iter_ty:bool ->
f:(Sidekick_core_logic__.Types_.term -> unit) ->
Sidekick_core_logic__.Types_.term ->
unit
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
val iter_shallow :
f:(bool -> Sidekick_core_logic__.Types_.term -> unit) ->
Sidekick_core_logic__.Types_.term ->
unit
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 map_shallow :
store ->
f:
(bool ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term) ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term
val free_vars_iter : Sidekick_core_logic__.Types_.term -> var Iter.t
Is the term closed (all bound variables are paired with a binder)? time: O(1)
Does the term contain free variables? time: O(1)
Return the type of this term.
module Store = Sidekick_core.Term.Store
val type_ : store -> Sidekick_core_logic__.Types_.term
val type_of_univ : store -> int -> Sidekick_core_logic__.Types_.term
val var_str :
store ->
string ->
ty:Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term
val bvar_i :
store ->
int ->
ty:Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term
val const :
store ->
Sidekick_core_logic__.Types_.const ->
Sidekick_core_logic__.Types_.term
val app :
store ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term
val app_l :
store ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term list ->
Sidekick_core_logic__.Types_.term
val app_fold :
store ->
f:Sidekick_core_logic__.Types_.term ->
acc0:Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term list ->
Sidekick_core_logic__.Types_.term
val arrow :
store ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term
val arrow_l :
store ->
Sidekick_core_logic__.Types_.term list ->
Sidekick_core_logic__.Types_.term ->
Sidekick_core_logic__.Types_.term
module DB = Sidekick_core.Term.DB
De bruijn indices
include module type of struct include Sidekick_core_logic.T_builtins end
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 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_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
type t = Types_.ty
type data = Types_.data
include Sidekick_sigs.EQ_ORD_HASH_PRINT 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
include Sidekick_sigs.PRINT with type t := t
val pp : t Sidekick_sigs.printer
val const_decoders : Sidekick_core.Const.decoders
val is_uninterpreted : t -> bool
val is_real : t -> bool
val is_int : t -> bool