proposition: Lemma forward_estc_unchanged: forall g h v to (Hi : 0 <= Z.of_nat to < Zlength (spaces h)) (Hh : has_space (Znth (Z.of_nat to) (spaces h)) (vertex_size g v)), vgeneration v <> to -> graph_has_gen g to -> graph_has_v g v -> raw_mark (vlabel g v) = false -> enough_space_to_copy g h (vgeneration v) to -> enough_space_to_copy (lgraph_copy_v g v to) (cut_heap h (Z.of_nat to) (vertex_size g v) Hi Hh) (vgeneration v) to.
proof: Proof. intros. unfold lgraph_copy_v. apply (lacv_estc _ _ _ _ v) in H3; [| assumption..]. assert (vertex_size g v = vertex_size (lgraph_add_copied_v g v to) v). { unfold vertex_size. rewrite lacv_vlabel_old. 1: reflexivity. intro. destruct v as [gen index]. simpl in H. unfold new_copied_v in H4. inversion H4. apply H. assumption. } remember (lgraph_add_copied_v g v to) as g'. pose proof Hh as Hh'. rewrite H4 in Hh'. replace (cut_heap h (Z.of_nat to) (vertex_size g v) Hi Hh) with (cut_heap h (Z.of_nat to) (vertex_size g' v) Hi Hh') by (apply cti_eq; symmetry; assumption). apply lmc_estc. - assumption. - subst g'. apply lacv_graph_has_v_old; assumption. - subst g'. rewrite lacv_vlabel_old; [| apply graph_has_v_not_eq]; assumption. Qed.
imports: Coq.ZArith.ZArith Coq.Program.Basics Coq.micromega.Lia compcert.lib.Integers compcert.common.Values VST.veric.base VST.veric.Clight_lemmas VST.veric.val_lemmas VST.veric.shares VST.msl.seplog VST.msl.shares VST.zlist.sublist VST.floyd.coqlib3 VST.floyd.functional_base VST.floyd.data_at_rec_lemmas VST.zlist.list_solver CertiGraph.lib.EquivDec_ext CertiGraph.lib.List_ext CertiGraph.graph.graph_model CertiGraph.graph.graph_gen