proposition: Lemma fr_O_dst_changed_field: forall from to v n g g', copy_compatible g -> no_dangling_dst g -> from <> to -> graph_has_gen g to -> forward_p_compatible (inr (v, Z.of_nat n)) [] g from -> forward_relation from to O (forward_p2forward_t (inr (v, Z.of_nat n)) [] g) g g' -> forall e, Znth (Z.of_nat n) (make_fields g' v) = inr e -> vgeneration (dst g' e) <> from.
proof: Proof. intros. simpl in *. destruct H3 as [? [? [? ?]]]. rewrite H7 in H4. simpl in H4. assert (make_fields g v = make_fields g' v) by (unfold make_fields; erewrite fr_raw_fields; eauto). rewrite <- H9 in *. clear H9. remember (Znth (Z.of_nat n) (make_fields g v)). destruct f; inversion H5. subst. clear H5. symmetry in Heqf. pose proof Heqf. apply make_fields_Znth_edge in Heqf. 2: assumption. simpl in H4. subst. rewrite Nat2Z.id in *. inversion H4; subst; try assumption; subst new_g; rewrite lgd_dst_new. - apply H in H12. 1: destruct H12; auto. specialize (H0 _ H3). apply H0. unfold get_edges. rewrite <- filter_sum_right_In_iff, <- H5. apply Znth_In. rewrite make_fields_eq_length. assumption. - unfold new_copied_v. simpl. auto. 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