(**********************************************************************)
(** A list length in Z, tail recursive.  *)
Definition Zlength := Zlength_aux 0.
Arguments Zlength [A] l.
Section Zlength_properties.
Variable A : Type.
Implicit Type l : list A.

(* Specifications: *)
Lemma Zlength_correct l : Zlength l = Z.of_nat (length l).
Lemma Zlength_nil : Zlength (A:=A) nil = 0.
Lemma Zlength_nil_inv l : Zlength l = 0 -> l = nil.
End Zlength_properties.