proposition: Lemma ti_size_gen: forall (g : LGraph) (h : heap) (gen : nat), graph_heap_compatible g h -> graph_has_gen g gen -> ti_size_spec h -> gen_size h gen = nth_gen_size gen.
proof: Proof. intros. red in H1. rewrite Forall_forall in H1. assert (0 <= (Z.of_nat gen) < Zlength (spaces h)). { split. 1: rep_lia. rewrite Zlength_correct. apply inj_lt. destruct H as [_ [_ ?]]. red in H0. lia. } assert (nth_gen_size_spec h gen). { apply H1. rewrite nat_inc_list_In_iff. destruct H as [_ [_ ?]]. red in H0. rewrite <- (spaces_size h), ZtoNat_Zlength. lia. } red in H3. destruct (Val.eq (space_start (nth_space h gen)) nullval). 2: assumption. rewrite nth_space_Znth in e. erewrite <- space_start_isnull_iff in e; eauto. unfold graph_has_gen in e. exfalso; apply e. rewrite Nat2Z.id. 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