proposition: Lemma fr_O_no_dangling_dst: forall from to p g g' roots, forward_p_compatible p roots g from -> graph_has_gen g to -> roots_graph_compatible roots g -> copy_compatible g -> forward_relation from to O (forward_p2forward_t p roots g) g g' -> no_dangling_dst g -> no_dangling_dst g'.
proof: Proof. intros. inversion H3; subst; try assumption. - destruct p; simpl in H5. + destruct (Znth z roots) eqn:? ; [destruct s|]; simpl in H5; inversion H5. subst v0. clear H5. apply lcv_no_dangling_dst; auto. red in H1. rewrite Forall_forall in H1. apply H1. rewrite <- filter_sum_right_In_iff. rewrite <- Heqr. apply Znth_In. assumption. + destruct p. simpl in H. destruct H as [? [? [? ?]]]. rewrite H8 in H5. simpl in H5. destruct (Znth z (make_fields g v0)); [destruct s|]; simpl in H5; inversion H5. - subst new_g. apply lgd_no_dangling_dst_copied_vert; auto. destruct p; simpl in H5. + destruct (Znth z roots); [destruct s|]; simpl in H5; inversion H5. + destruct p. simpl in H. destruct H as [? [? [? ?]]]. rewrite H7 in H5. simpl in H5. destruct (Znth z (make_fields g v)) eqn:? ; [destruct s|]; simpl in H5; inversion H5. subst e0. clear H5. specialize (H4 _ H). apply H4. unfold get_edges. rewrite <- filter_sum_right_In_iff, <- Heqf. apply Znth_In. rewrite make_fields_eq_length. assumption. - subst new_g. apply lgd_no_dangling_dst. 1: apply lcv_graph_has_v_new; auto. apply lcv_no_dangling_dst; auto. destruct p; simpl in H5. + destruct (Znth z roots); [destruct s|]; simpl in H5; inversion H5. + destruct p. simpl in H. destruct H as [? [? [? ?]]]. rewrite H8 in H5. simpl in H5. destruct (Znth z (make_fields g v)) eqn:? ; [destruct s|]; simpl in H5; inversion H5. subst e0. clear H5. specialize (H4 _ H). apply H4. unfold get_edges. rewrite <- filter_sum_right_In_iff, <- Heqf. apply Znth_In. rewrite make_fields_eq_length. 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