diff -r 2319cff107f0 -r 3f617d7a2691 CookBook/Package/Simple_Inductive_Package.thy --- a/CookBook/Package/Simple_Inductive_Package.thy Sun Mar 08 20:53:00 2009 +0000 +++ b/CookBook/Package/Simple_Inductive_Package.thy Tue Mar 10 13:20:46 2009 +0000 @@ -1,8 +1,62 @@ theory Simple_Inductive_Package -imports Main -uses ("simple_inductive_package.ML") +imports Main "../Base" +uses "simple_inductive_package.ML" begin +(* +simple_inductive + trcl :: "('a \ 'a \ bool) \ 'a \ 'a \ bool" +where + base: "trcl R x x" +| step: "trcl R x y \ R y z \ trcl R x z" + +thm trcl_def +thm trcl.induct +thm trcl.intros + +simple_inductive + even and odd +where + even0: "even 0" +| evenS: "odd n \ even (Suc n)" +| oddS: "even n \ odd (Suc n)" + +thm even_def odd_def +thm even.induct odd.induct +thm even0 +thm evenS +thm oddS +thm even_odd.intros + +simple_inductive + accpart for r :: "'a \ 'a \ bool" +where + accpartI: "(\y. r y x \ accpart r y) \ accpart r x" + +thm accpart_def +thm accpart.induct +thm accpartI + +locale rel = + fixes r :: "'a \ 'a \ bool" + +simple_inductive (in rel) accpart' +where + accpartI': "\x. (\y. r y x \ accpart' y) \ accpart' x" + + +context rel +begin + thm accpartI' + thm accpart'.induct +end + +thm rel.accpartI' +thm rel.accpart'.induct + + +lemma "True" by simp +*) use_chunks "simple_inductive_package.ML"