Library topsy_hmInit_frag_old

Load seplog_header.

Open Local Scope sep_scope.
Open Local Scope Z_scope.

Require Import topsy_hm_old.
Require Import frag_examples_old.

Definition hmInit (adr: loc) (size:nat) :=
  hmStart <- (nat_e adr);
  hmStart -.> next *<- (nat_e adr) +e (nat_e size) -e (int_e 2);
  hmStart -.> status *<- Free;
  hmEnd <-* (hmStart -.> next);
  hmEnd -.> next *<- (int_e 0);
  hmEnd -.> status *<- Allocated.

Close Local Scope Z_scope.

Open Local Scope heap_scope.

Definition hmInit_specif := forall startp sizep,
   startp > 0 ->
   sizep > 4 ->
   {{ Array startp sizep}}
   
   hmInit startp sizep
   
   {{Heap_List ((startp, sizep - 4, Free)::nil) startp 0}}.

Lemma hmInit_verif : hmInit_specif.