Instance CompSpecs : compspecs.Definition Vprog : varspecs.Fixpoint map2 {A B C: Type} (f: A -> B -> C) (al: list A) (bl: list B) : list C :=
 match al, bl with
  | a::al', b::bl' => f a b :: map2 f al' bl'
  | _, _ => nil
  end.Definition dotprod (fx fy : list float) : float :=
  fold_left Float.add (map2 Float.mul fx fy) Float.zero .

(* Specifications: *)
Lemma map2_app: forall (A B C: Type) (f: A -> B -> C) al al' bl bl', Zlength al = Zlength bl -> Zlength al' = Zlength bl' -> map2 f (al ++ al') (bl ++ bl') = map2 f al bl ++ map2 f al' bl'.
Lemma Zlength_map2: forall A B C (f: A -> B -> C) fy fz, Zlength fy = Zlength fz -> Zlength (map2 f fy fz) = Zlength fy.
Lemma Znth_map2: forall A B C (a: Inhabitant A) (b: Inhabitant B) (c: Inhabitant C) (f: A -> B -> C) (al: list A) (bl: list B) i, Zlength al = Zlength bl -> 0 <= i < Zlength al -> Znth i (map2 f al bl) = f (Znth i al) (Znth i bl).
Lemma body_dotprod: semax_body Vprog Gprog f_dotprod dotprod_spec.
Lemma body_add: semax_body Vprog Gprog f_add add_spec.