proposition: Lemma svfl_graph_has_v_inv: forall from to v l g1 g2, graph_has_gen g1 to -> scan_vertex_for_loop from to v l g1 g2 -> forall v2, graph_has_v g2 v2 -> graph_has_v g1 v2 \/ (vgeneration v2 = to /\ gen_v_num g1 to <= vindex v2 < gen_v_num g2 to).
proof: Proof. intros ? ? ? ?. induction l; intros; inversion H0; subst. 1: left; assumption. assert (graph_has_gen g3 to) by (rewrite <- fr_graph_has_gen; eauto). specialize (IHl _ _ H2 H7 _ H1). destruct IHl. - eapply (fr_O_graph_has_v_inv from to _ g1 g3) in H4; eauto. destruct H4. 1: left; assumption. right. clear -H1 H4. unfold new_copied_v in H4. subst. destruct H1. unfold gen_v_num. simpl in *. red in H0. lia. - right. destruct H3. split. 1: assumption. destruct H5. split; auto. eapply fr_O_gen_v_num_to in H4; [lia | 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