let mk_num =
let table = Hashq.create 17 in
let _ = Tools.add_at_reset (fun () -> Hashq.clear table) in
fun q ->
try
Hashq.find table q
with
Not_found ->
let n = App(Arith(Num(q)), []) in
Hashq.add table q n; n