proposition: Lemma heap_struct_rep_split: forall sh l heap_p i1 i2, 0 <= i1 < MAX_SPACES -> 0 <= i2 < MAX_SPACES -> i1 <> i2 -> Zlength l = MAX_SPACES -> exists B, heap_struct_rep sh l heap_p = data_at sh space_type (Znth i1 l) (space_address heap_p (Z.to_nat i1)) * data_at sh space_type (Znth i2 l) (space_address heap_p (Z.to_nat i2)) * B.
proof: Proof. intros. destruct H, H0. destruct (Z_dec i1 i2) as [[? | ?] | ?]. 3: contradiction. - destruct (heap_struct_rep_split_lt sh l heap_p i1 i2) as [B ?]; try rep_lia. exists B. assumption. - destruct (heap_struct_rep_split_lt sh l heap_p i2 i1) as [B ?]; try rep_lia. exists B. rewrite H5. f_equal. rewrite sepcon_comm. 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