let of_atom a =
try
AtomTbl.find heap a
with
Not_found ->
let i = Dynarray.length index in
let ai = (a, i) in
AtomTbl.add heap a ai;
Dynarray.add index ai;
assert(Dynarray.get index i == ai);
ai