let mk_const =
let module BitvHash = Hashtbl.Make(
struct
type t = Bitv.t
let equal = Bitv.equal
let hash = Hashtbl.hash
end)
in
let table = BitvHash.create 17 in
let _ = Tools.add_at_reset (fun () -> BitvHash.clear table) in
fun b ->
try
BitvHash.find table b
with
Not_found ->
let hsh = Hashtbl.hash b in
let op = (Bv(Const(b)), hsh) in
BitvHash.add table b op; op