definition
ntree_rec :: "[[i, i, i] ==> i, i] ==> i"where "ntree_rec(b) ≡ Vrecursor(λpr. ntree_case(λx h. b(x, h, λi ∈ domain(h). pr`(h`i))))"
definition
ntree_copy :: "i ==> i"where "ntree_copy(z) ≡ ntree_rec(λx h r. Branch(x,r), z)"
text‹ \medskip‹ntree› ›
lemma ntree_unfold: "ntree(A) = A × (∪n ∈ nat. n -> ntree(A))" by (blast intro: ntree.intros [unfolded ntree.con_defs]
elim: ntree.cases [unfolded ntree.con_defs])
lemma ntree_induct [consumes 1, case_names Branch, induct set: ntree]: assumes t: "t ∈ ntree(A)" and step: "∧x n h. [x ∈ A; n ∈ nat; h ∈ n -> ntree(A); ∀i ∈ n. P(h`i) \==> P(Branch(x,h))" shows"P(t)" 🍋‹A nicer induction rule than the standard one.› using t apply induct apply (erule UN_E) apply (assumption | rule step)+ apply (fast elim: fun_weaken_type) apply (fast dest: apply_type) done
lemma ntree_induct_eqn [consumes 1]: assumes t: "t ∈ ntree(A)" and f: "f ∈ ntree(A)->B" and g: "g ∈ ntree(A)->B" and step: "∧x n h. [x ∈ A; n ∈ nat; h ∈ n -> ntree(A); f O h = g O h]==> f ` Branch(x,h) = g ` Branch(x,h)" shows"f`t=g`t" 🍋‹Induction on 🍋‹ntree(A)›to prove an equation› using t apply induct apply (assumption | rule step)+ apply (insert f g) apply (rule fun_extension) apply (assumption | rule comp_fun)+ apply (simp add: comp_fun_apply) done
text‹ \medskip Lemmas to justify using ‹Ntree›in other recursive type definitions. ›
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.