proposition: Lemma Znth_update_rootpairs: forall rootpairs roots z, 0 <= z < Zlength rootpairs -> Zlength rootpairs = Zlength roots -> Znth z (update_rootpairs rootpairs roots) = {| rp_adr := rp_adr (Znth z rootpairs); rp_val := Znth z roots |}.
proof: Proof. induction rootpairs; destruct roots; simpl; intros; try list_solve. destruct a. destruct (zeq z 0). subst. rewrite !Znth_0_cons. simpl. auto. rewrite !Znth_pos_cons by rep_lia. rewrite (IHrootpairs roots (z-1)) by list_solve. f_equal. 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