diff -r 6e0f56764ff8 -r dc95a56b1953 ProgTutorial/Package/Ind_General_Scheme.thy --- a/ProgTutorial/Package/Ind_General_Scheme.thy Wed Apr 29 00:36:14 2009 +0200 +++ b/ProgTutorial/Package/Ind_General_Scheme.thy Tue May 05 03:21:49 2009 +0200 @@ -1,11 +1,44 @@ theory Ind_General_Scheme -imports Ind_Interface +imports "../Base" Simple_Inductive_Package 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" + +simple_inductive + even and odd +where + even0: "even 0" +| evenS: "odd n \ even (Suc n)" +| oddS: "even n \ odd (Suc n)" + +simple_inductive + accpart :: "('a \ 'a \ bool) \ 'a \ bool" +where + accpartI: "(\y. R y x \ accpart R y) \ accpart R x" + +datatype trm = + Var "string" +| App "trm" "trm" +| Lam "string" "trm" + +simple_inductive + fresh :: "string \ trm \ bool" +where + fresh_var: "a\b \ fresh a (Var b)" +| fresh_app: "\fresh a t; fresh a s\ \ fresh a (App t s)" +| fresh_lam1: "fresh a (Lam a t)" +| fresh_lam2: "\a\b; fresh a t\ \ fresh a (Lam b t)" +(*>*) + + section {* The Code in a Nutshell\label{sec:nutshell} *} - text {* The inductive package will generate the reasoning infrastructure for mutually recursive predicates @{text "pred\<^isub>1\pred\<^isub>n"}. In what