# HG changeset patch # User paulson # Date 973243473 -3600 # Node ID 99bd3e902979bb5426d69c127ed93295811ddaff # Parent 5f5c1c0aba1c3e4b444845607f9b60ad4a5d2c64 advanced induction examples diff -r 5f5c1c0aba1c -r 99bd3e902979 doc-src/TutorialI/Inductive/Advanced.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-src/TutorialI/Inductive/Advanced.thy Fri Nov 03 10:24:33 2000 +0100 @@ -0,0 +1,48 @@ +(* ID: $Id$ *) +theory Advanced = Main: + +datatype 'f "term" = Apply 'f "'f term list" + +consts terms :: "'f set \ 'f term set" +inductive "terms F" +intros +step[intro]: "\\t \ set term_list. t \ terms F; f \ F\ + \ (Apply f term_list) \ terms F" + + +lemma "F\G \ terms F \ terms G" +apply clarify +apply (erule terms.induct) +apply blast +done + +consts term_type :: "('f \ 't list * 't) \ ('f term * 't)set" +inductive "term_type sig" +intros +step[intro]: "\\et \ set term_type_list. et \ term_type sig; + sig f = (map snd term_type_list, rtype)\ + \ (Apply f (map fst term_type_list), rtype) \ term_type sig" + +consts term_type' :: "('f \ 't list * 't) \ ('f term * 't)set" +inductive "term_type' sig" +intros +step[intro]: "\term_type_list \ lists(term_type' sig); + sig f = (map snd term_type_list, rtype)\ + \ (Apply f (map fst term_type_list), rtype) \ term_type' sig" +monos lists_mono + + +lemma "term_type sig \ term_type' sig" +apply clarify +apply (erule term_type.induct) +apply auto +done + +lemma "term_type' sig \ term_type sig" +apply clarify +apply (erule term_type'.induct) +apply auto +done + +end +