proposition: Lemma hsr_single_explicit: forall sh l heap_p i, 0 <= i < MAX_SPACES -> Zlength l = MAX_SPACES -> heap_struct_rep sh l heap_p = data_at sh space_type (Znth i l) (space_address heap_p (Z.to_nat i)) * (@data_at CompSpecs sh (tarray space_type (@Zlength (@reptype CompSpecs space_type) (@sublist (@reptype CompSpecs space_type) (i + 1) MAX_SPACES l))) (@sublist (@reptype CompSpecs space_type) (i + 1) MAX_SPACES l) (offset_val (@sizeof CompSpecs space_type) (offset_val (SPACE_STRUCT_SIZE * i) heap_p)) * @data_at CompSpecs sh (tarray space_type i) (@sublist (@reptype CompSpecs space_type) 0 i l) heap_p).
proof: Proof. intros. rewrite heap_struct_rep_eq. rewrite (data_at_tarray_space sh MAX_SPACES i) by rep_lia. rewrite (sublist_next i MAX_SPACES l) by rep_lia. replace (MAX_SPACES - i) with (Zlength (sublist (i + 1) MAX_SPACES l) + 1) by (rewrite Zlength_sublist; rep_lia). rewrite data_at_tarray_split_1 by reflexivity. unfold space_address. rewrite Z2Nat.id by lia. rewrite sepcon_comm, !sepcon_assoc. reflexivity. Qed.
imports: VST.veric.compcert_rmaps VST.msl.shares VST.msl.wand_frame VST.concurrency.conclib CertiGraph.lib.List_ext CertiGraph.msl_ext.log_normalize CertiGraph.msl_ext.ramification_lemmas CertiGraph.graph.graph_model CertiGraph.CertiGC.GCGraph CertiGraph.CertiGC.env_graph_gc CertiGraph.msl_ext.iter_sepcon Coq.Lists.List