let is_num m = if M.cardinal m = 1 then match choose m with | (ConstInt n | ConstReal n), i -> Some (Num.mult_num (Num.Int i) n) | _ -> None else None