proposition: Lemma fr_general_prop_bootstrap: forall depth from to p g g' (P: nat -> LGraph -> LGraph -> Prop), (forall to g, P to g g) -> (forall to g1 g2 g3, P to g1 g2 -> P to g2 g3 -> P to g1 g3) -> (forall to g e v, P to g (labeledgraph_gen_dst g e v)) -> (forall to g v, P to g (lgraph_copy_v g v to)) -> forward_relation from to depth p g g' -> P to g g'.
proof: Proof. induction depth; intros. - inversion H3; subst; try (specialize (H to g'); assumption); try solve [auto]. + subst new_g. apply H1. + subst new_g. remember (lgraph_copy_v g (dst g e) to) as g1. remember (labeledgraph_gen_dst g1 e (new_copied_v g to)) as g2. cut (P to g1 g2). 2: subst; apply H1. intros. apply (H0 to g g1 g2). 2: assumption. subst g1. apply H2. - assert (forall l from to g1 g2, forward_loop from to depth l g1 g2 -> P to g1 g2). { induction l; intros; inversion H4. 1: apply H. subst. specialize (IHl _ _ _ _ H11). specialize (IHdepth _ _ _ _ _ _ H H0 H1 H2 H8). apply (H0 _ _ _ _ IHdepth IHl). } clear IHdepth. inversion H3; subst; try (specialize (H to g'); assumption). + cut (P to g new_g). * intros. apply (H0 to g new_g g'). 1: assumption. apply (H4 _ _ _ _ _ H9). * subst new_g. apply H2. + inv H3; eauto. + subst new_g. apply H1. + cut (P to g new_g). * intros. apply (H0 to g new_g g'). 1: assumption. apply (H4 _ _ _ _ _ H9). * subst new_g. remember (lgraph_copy_v g (dst g e) to) as g1. remember (labeledgraph_gen_dst g1 e (new_copied_v g to)) as g2. cut (P to g1 g2). 2: subst; apply H1. intros. apply (H0 to g g1 g2). 2: assumption. subst g1. apply H2. + subst new_g. inv H3; eauto. 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