src/HOL/Imperative_HOL/ex/Linked_Lists.thy
changeset 57816 d8bbb97689d3
parent 56073 29e308b56d23
child 58249 180f1b3508ed
equal deleted inserted replaced
57815:f97643a56615 57816:d8bbb97689d3
   640   with init have refs_of_p: "refs_of' h2 p (p#refs)"
   640   with init have refs_of_p: "refs_of' h2 p (p#refs)"
   641     by (auto elim!: effect_refE simp add: refs_of'_def')
   641     by (auto elim!: effect_refE simp add: refs_of'_def')
   642   with init all_ref_present have q_is_new: "q \<notin> set (p#refs)"
   642   with init all_ref_present have q_is_new: "q \<notin> set (p#refs)"
   643     by (auto elim!: effect_refE intro!: Ref.noteq_I)
   643     by (auto elim!: effect_refE intro!: Ref.noteq_I)
   644   from refs_of_p refs_of_q q_is_new have a3: "\<forall>qrs prs. refs_of' h2 q qrs \<and> refs_of' h2 p prs \<longrightarrow> set prs \<inter> set qrs = {}"
   644   from refs_of_p refs_of_q q_is_new have a3: "\<forall>qrs prs. refs_of' h2 q qrs \<and> refs_of' h2 p prs \<longrightarrow> set prs \<inter> set qrs = {}"
   645     by (fastforce simp only: set_simps dest: refs_of'_is_fun)
   645     by (fastforce simp only: list.set dest: refs_of'_is_fun)
   646   from rev'_invariant [OF effect_rev' a1 a2 a3] have "list_of h3 (Ref.get h3 v) (List.rev xs)" 
   646   from rev'_invariant [OF effect_rev' a1 a2 a3] have "list_of h3 (Ref.get h3 v) (List.rev xs)" 
   647     unfolding list_of'_def by auto
   647     unfolding list_of'_def by auto
   648   with lookup show ?thesis
   648   with lookup show ?thesis
   649     by (auto elim: effect_lookupE)
   649     by (auto elim: effect_lookupE)
   650 qed
   650 qed