proposition: Lemma lacv_graph_has_v_inv: forall (g : LGraph) (v : VType) (to : nat) (x : VType), graph_has_gen g to -> graph_has_v (lgraph_add_copied_v g v to) x -> graph_has_v g x \/ x = new_copied_v g to.
proof: Proof. intros. destruct (V_EqDec x (new_copied_v g to)). - unfold equiv in e; right; assumption. - left. destruct H0. split. + rewrite lacv_graph_has_gen in H0; assumption. + assert (x <> (new_copied_v g to)) by intuition auto. clear c H0. unfold gen_has_index in *. unfold nth_gen, lgraph_add_copied_v in H1. simpl in H1. destruct x as [gen index]. simpl in *. unfold new_copied_v in H2. destruct (Nat.eq_dec gen to). * subst gen. rewrite cvmgil_eq in H1 by assumption. simpl in H1. change (nth to (g_gen (glabel g)) null_info) with (nth_gen g to) in H1. remember (number_of_vertices (nth_gen g to)). assert (index <> n) by (intro; apply H2; f_equal; assumption). lia. * rewrite cvmgil_not_eq in H1; 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