(* This file illustrates two approaches to C verification, described in Section III of this paper:  Modular Verification for Computer Security, by Andrew W. Appel, in IEEE Computer Security Foundations conference (CSF'16), June 2016. http://www.cs.princeton.edu/~appel/papers/modsec.pdf *)
Instance CompSpecs : compspecs. make_compspecs prog. Defined.
Definition Vprog : varspecs.  mk_varspecs prog. Defined.
Open Scope Z.

(* Specifications: *)
Theorem fold_min_general:
forall (al: list Z)(i: Z),
In i (al) ->
forall x, List.fold_right Z.min x al <= i.
Theorem fold_min:
forall (al: list Z)(i: Z),
In i (al) ->
List.fold_right Z.min (hd 0 al) al <= i.
Lemma Forall_fold_min:
forall (f: Z -> Prop) (x: Z) (al: list Z),
f x -> Forall f al -> f (fold_right Z.min x al).
Lemma fold_min_another:
forall x al y,
fold_right Z.min x (al ++ [y]) = Z.min (fold_right Z.min x al) y.
Lemma is_int_I32_Znth_map_Vint:
forall i s al,
0 <= i < Zlength al ->
is_int I32 s (Znth i (map Vint al)).