Definition string_of_Z (n : Z) : string :=
  match n with
  | 0%Z     => "0"
  | Z.pos _ => NilZero.string_of_uint (Nat.to_uint (Z.to_nat n))
  | Z.neg _ => "-" ++ NilZero.string_of_uint (Nat.to_uint (Z.to_nat (Z.abs n)))
  end.
