T.TermTerm structure.
Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.
type t = Sidekick_base.Term.tval hash : t -> intval pp : t Sidekick_core.Fmt.printertype store = Sidekick_base.Term.storeA store used to create new terms. It is where the hashconsing table should live, along with other all-terms related store.
val as_bool : t -> bool optionas_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.
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 (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).
The store is passed in case a new term needs to be created.
Map function on immediate subterms. This should not be recursive.
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 = zthe DAG has the following nodes:
n1: 2
n2: f n1 n1
n3: g n2 n1
n4: = n3 n3