Fixpoint prog_funct' {F V} (l: list (ident * globdef F V)) : list (ident * F) :=
 match l with nil => nil | (i,Gfun f)::r => (i,f):: prog_funct' r | _::r => prog_funct' r
 end.Definition prog_funct {F} (p: program F) := prog_funct' (prog_defs p).

Lemma nth_error_rev: forall T (vl: list T) (n: nat), (n < length vl)%nat -> nth_error (rev vl) n = nth_error vl (length vl - n - 1).