let d_num = function
  | Term.App((Sym.Arith(Sym.Num(q)), _), [], _) -> q
  | _ -> raise Not_found