proposition: Lemma do_gen_no_backward_edge: forall g1 g2 roots1 roots2 i, do_generation_relation i (S i) roots1 roots2 g1 g2 -> no_dangling_dst g2 -> graph_has_gen g1 (S i) -> gen_unmarked g1 (S i) -> firstn_gen_clear g1 i -> no_backward_edge g1 -> no_backward_edge g2.
proof: Proof. intros. unfold no_backward_edge in *. intros. destruct (Nat.eq_dec gen1 (S i)). - red. intros. destruct H6. simpl in *. eapply do_gen_firstn_gen_clear in H3; eauto. subst. specialize (H0 _ H6 _ H7). destruct H0. red in H8. intro. rewrite H9 in H8. red in H3. assert (gen2 < S i)%nat by lia. specialize (H3 _ H10). red in H3. rewrite H3 in H8. lia. - destruct H as [g3 [g4 [? [? ?]]]]. subst g2. apply gen2gen_no_edge_reset. assert (gen2gen_no_edge g3 gen1 gen2) by (eapply frr_gen2gen_no_edge; eauto). destruct H6 as [m [? ?]]. eapply (svwl_gen2gen_no_edge i _ _ g3); eauto. + rewrite <- frr_graph_has_gen; eauto. + eapply frr_gen_unmarked; 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