Module T.Term
Term 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.t
val equal : t -> t -> boolval compare : t -> t -> intval hash : t -> intval pp : t Sidekick_core.Fmt.printer
type 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 tisSome trueiftis the termtrue, and similarly forfalse. For other terms it isNone.
val abs : store -> t -> t * boolabs treturns an "absolute value" for the term, along with the sign oft.The idea is that we want to turn
not ainto(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.
val map_shallow : store -> (t -> t) -> t -> tMap function on immediate subterms. This should not be recursive.
val iter_dag : t -> (t -> unit) -> unititer_dag t fcallsfonce on each subterm oft,tincluded. It must not traversetas 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