Hint Resolve listrep_valid_pointer : valid_pointer.
(** Specification of the [reverse] function.  It characterizes ** the precondition required for calling the function, ** and the postcondition guaranteed by the function. **)
Definition reverse_spec :=
DECLARE _reverse
WITH sigma : list val, p: val
PRE  [ _p OF (tptr t_struct_list) ]
PROP ()
LOCAL (temp _p p)
SEP (listrep sigma p)
POST [ (tptr t_struct_list) ]
EX q:val,
PROP () LOCAL (temp ret_temp q)
SEP (listrep(rev sigma) q).
(** The global function spec, characterizing the ** preconditions/postconditions of all the functions ** that your proved-correct program will call. ** Normally you include all the functions here, but ** in this tutorial example we include only one. *)
Definition Gprog : funspecs :=
ltac:(with_library prog [ reverse_spec ]).

(** For each function definition in the C program, prove that the ** function-body (in this case, f_reverse) satisfies its specification ** (in this case, reverse_spec). **)
Lemma body_reverse: semax_body Vprog Gprog
f_reverse reverse_spec.