(* This file was originally generated by why.
   It can be modified; only the generated parts will be overwritten. *)

Require Export abs_spec_why.

(* Why obligation from file "/home/cmarche/recherche/why/examples-c/tutorial/abs.c", line 5, characters 6-8: *)
(*Why goal*) Lemma abs1_impl_po_1 : 
  forall (p: (pointer global)),
  forall (alloc: alloc_table),
  (valid alloc p).
Proof.
intuition.
Admitted.

(* Why obligation from file "/home/cmarche/recherche/why/examples-c/tutorial/abs.c", line 3, characters 12-19: *)
(*Why goal*) Lemma abs1_impl_po_2 : 
  forall (p: (pointer global)),
  forall (alloc: alloc_table),
  forall (intM_global: (memory Z global)),
  forall (HW_1: (valid alloc p)),
  forall (result: Z),
  forall (HW_2: result = (acc intM_global p)),
  forall (HW_3: result < 0),
  forall (HW_4: (valid alloc p)),
  forall (result0: Z),
  forall (HW_5: result0 = (acc intM_global p)),
  forall (HW_6: (valid alloc p)),
  forall (intM_global0: (memory Z global)),
  forall (HW_7: intM_global0 = (upd intM_global p (Zopp result0))),
  (* CADUCEUS_1 *) (acc intM_global0 p) >= 0.
Proof.
intuition.
subst; caduceus.
Save.

(* Why obligation from file "/home/cmarche/recherche/why/examples-c/tutorial/abs.c", line 3, characters 12-19: *)
(*Why goal*) Lemma abs1_impl_po_3 : 
  forall (p: (pointer global)),
  forall (alloc: alloc_table),
  forall (intM_global: (memory Z global)),
  forall (HW_1: (valid alloc p)),
  forall (result: Z),
  forall (HW_2: result = (acc intM_global p)),
  forall (HW_8: result >= 0),
  (* CADUCEUS_1 *) (acc intM_global p) >= 0.
Proof.
intuition.
Save.


(* Why obligation from file "/home/cmarche/recherche/why/examples-c/tutorial/abs.c", line 9, characters 12-19: *)
(*Why goal*) Lemma abs2_impl_po_1 : 
  forall (p: (pointer global)),
  forall (alloc: alloc_table),
  forall (intM_global: (memory Z global)),
  forall (HW_1: (* CADUCEUS_5 *) (valid alloc p)),
  forall (HW_2: (valid alloc p)),
  forall (result: Z),
  forall (HW_3: result = (acc intM_global p)),
  forall (HW_4: result < 0),
  forall (HW_5: (valid alloc p)),
  forall (result0: Z),
  forall (HW_6: result0 = (acc intM_global p)),
  forall (HW_7: (valid alloc p)),
  forall (intM_global0: (memory Z global)),
  forall (HW_8: intM_global0 = (upd intM_global p (Zopp result0))),
  (* CADUCEUS_6 *) (acc intM_global0 p) >= 0.
Proof.
intuition.
subst intM_global0.
caduceus.
Save.

(* Why obligation from file "/home/cmarche/recherche/why/examples-c/tutorial/abs.c", line 9, characters 12-19: *)
(*Why goal*) Lemma abs2_impl_po_2 : 
  forall (p: (pointer global)),
  forall (alloc: alloc_table),
  forall (intM_global: (memory Z global)),
  forall (HW_1: (* CADUCEUS_5 *) (valid alloc p)),
  forall (HW_2: (valid alloc p)),
  forall (result: Z),
  forall (HW_3: result = (acc intM_global p)),
  forall (HW_9: result >= 0),
  (* CADUCEUS_6 *) (acc intM_global p) >= 0.
Proof.
intuition.
Save.

