proposition: Lemma do_gen_stcte: forall g1 roots1 g2 roots2 i, safe_to_copy_to_except g1 i -> graph_has_gen g1 (S i) -> do_generation_relation i (S i) roots1 roots2 g1 g2 -> safe_to_copy_to_except g2 (S i).
proof: Proof. intros. unfold safe_to_copy_to_except in *. intros. destruct H1 as [g3 [g4 [? [? ?]]]]. destruct (Nat.eq_dec n i). - subst. red. unfold graph_gen_size, nth_gen. simpl. rewrite reset_nth_gen_info_same. simpl. unfold previous_vertices_size. simpl. destruct i. 1: contradiction. simpl. rewrite Z.sub_0_r. apply nth_gen_size_le_S. - subst g2. apply reset_stct; auto. destruct H5 as [m [? ?]]. rewrite graph_has_gen_reset in H4. assert (graph_has_gen g3 (S i)) by (erewrite <- frr_graph_has_gen; eauto). assert (graph_has_gen g3 n) by (erewrite svwl_graph_has_gen; eauto). eapply (svwl_stcg i (S i) _ g3); eauto. assert (graph_has_gen g1 n) by (erewrite frr_graph_has_gen; eauto). eapply (frr_stcg i (S i) _ g1); eauto. 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