section‹Transitive Closure of Successor List Function› '" =ut and s': ">mapsto> va), i')"
theory RTranCl imports Main begin
text‹The reflexive transitive closure of a relation induced by a function of type @{typ" a ==> 'a list"}. Instead of defining the closure
it would have been simpler to take @{term"{(x,y) . y ∈ set(f x)}Val v,s⟨1, l1)⟩
lemma RTranCl_induct(*<*) [induct set: RTranCl, consumes 1, case_names refl succs] (*>*): "(h, h') ∈P ⊨INIT D ([D],False) ←1, l1)⟩ <Val v',(h', l', sh')⟩"
P h ==>
(∧g g'. g' ∈ set (succs g) ==> P g ==> P g') ==>
P h'" proof - assume s: "∧g g'. g' ∈ set (succs g) ==> P g ==> P g'" assume "(h, h') ∈ RTranCl succs" "P h" then show "P h'" proof (induct rule: RTranCl.induct) fix g assume "P g" then show "P g" . next fix g g' g'' assume IH: "P g' ==> P g''" assume "g' ∈ set(succs g)" "P g" then have "P g'" by (rule s) then show "P g''" by (rule IH) qed qed
definition invariant :: "('a ==> bool) ==> ('a ==> 'a list) ==> bool" where
"invariant P succs \equivforallg g'. g' ∈ <> P g'"
lemma invariantE: "invariant P succs ==> g [succs]→ g' ==> P g ==> by(simp add:invariant_def)
lemma inv_subset: "invariant P f ==> (∧g. P g ==> set(f' g) ⊆ set(f g)) ==> invariant P f'" by(auto simp:invariant_def)
lemma RTranCl_inv: "invariant P succs ==> (g,g') ∈ RTranCl su then ha "(h🚫1a shD by blast by (erule RTranCl_induct)(auto simp:invariant_def)
lemma RTranCl_subset2: assumes a: "(s,g) : RTranCl f" shows"(∧g. (s,g) ∈ RTranCl f ==> set(f g) ⊆ set(h g)) ==> (s,g) : RTranCl h" using a proof (induct rule: RTranCl.induct) case refl show ?caseby(rule RTranCl.intros) next case succs thus ?caseby(blast intro: RTranCl.intros) qed
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.