| 7701 |      1 | (*  Title:      HOL/Recdef.thy
 | 
|  |      2 |     ID:         $Id$
 | 
| 10773 |      3 |     Author:     Konrad Slind and Markus Wenzel, TU Muenchen
 | 
| 5123 |      4 | 
 | 
| 7701 |      5 | TFL: recursive function definitions.
 | 
|  |      6 | *)
 | 
|  |      7 | 
 | 
| 10212 |      8 | theory Recdef = Wellfounded_Relations + Datatype
 | 
| 7701 |      9 | files
 | 
| 10773 |     10 |   ("../TFL/utils.ML")
 | 
|  |     11 |   ("../TFL/usyntax.ML")
 | 
|  |     12 |   ("../TFL/dcterm.ML")
 | 
|  |     13 |   ("../TFL/thms.ML")
 | 
|  |     14 |   ("../TFL/rules.ML")
 | 
|  |     15 |   ("../TFL/thry.ML")
 | 
|  |     16 |   ("../TFL/tfl.ML")
 | 
|  |     17 |   ("../TFL/post.ML")
 | 
| 11533 |     18 |   ("Tools/recdef_package.ML")
 | 
|  |     19 |   ("Tools/basic_codegen.ML")
 | 
|  |     20 |   ("Tools/inductive_codegen.ML"):
 | 
| 10773 |     21 | 
 | 
|  |     22 | lemma tfl_eq_True: "(x = True) --> x"
 | 
|  |     23 |   by blast
 | 
|  |     24 | 
 | 
|  |     25 | lemma tfl_rev_eq_mp: "(x = y) --> y --> x";
 | 
|  |     26 |   by blast
 | 
|  |     27 | 
 | 
|  |     28 | lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
 | 
|  |     29 |   by blast
 | 
| 6438 |     30 | 
 | 
| 10773 |     31 | lemma tfl_P_imp_P_iff_True: "P ==> P = True"
 | 
|  |     32 |   by blast
 | 
|  |     33 | 
 | 
|  |     34 | lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
 | 
|  |     35 |   by blast
 | 
|  |     36 | 
 | 
| 11165 |     37 | lemma tfl_disj_assoc: "(a \\<or> b) \\<or> c == a \\<or> (b \\<or> c)"
 | 
| 10773 |     38 |   by simp
 | 
|  |     39 | 
 | 
| 11165 |     40 | lemma tfl_disjE: "P \\<or> Q ==> P --> R ==> Q --> R ==> R"
 | 
| 10773 |     41 |   by blast
 | 
|  |     42 | 
 | 
| 11165 |     43 | lemma tfl_exE: "\\<exists>x. P x ==> \\<forall>x. P x --> Q ==> Q"
 | 
| 10773 |     44 |   by blast
 | 
|  |     45 | 
 | 
|  |     46 | use "../TFL/utils.ML"
 | 
|  |     47 | use "../TFL/usyntax.ML"
 | 
|  |     48 | use "../TFL/dcterm.ML"
 | 
|  |     49 | use "../TFL/thms.ML"
 | 
|  |     50 | use "../TFL/rules.ML"
 | 
|  |     51 | use "../TFL/thry.ML"
 | 
|  |     52 | use "../TFL/tfl.ML"
 | 
|  |     53 | use "../TFL/post.ML"
 | 
|  |     54 | use "Tools/recdef_package.ML"
 | 
| 11533 |     55 | use "Tools/basic_codegen.ML"
 | 
|  |     56 | use "Tools/inductive_codegen.ML"
 | 
| 6438 |     57 | setup RecdefPackage.setup
 | 
| 11533 |     58 | setup BasicCodegen.setup
 | 
|  |     59 | setup InductiveCodegen.setup
 | 
| 6438 |     60 | 
 | 
| 9855 |     61 | lemmas [recdef_simp] =
 | 
|  |     62 |   inv_image_def
 | 
|  |     63 |   measure_def
 | 
|  |     64 |   lex_prod_def
 | 
| 11284 |     65 |   same_fst_def
 | 
| 9855 |     66 |   less_Suc_eq [THEN iffD2]
 | 
|  |     67 | 
 | 
| 11165 |     68 | lemmas [recdef_cong] = if_cong image_cong
 | 
| 9855 |     69 | 
 | 
|  |     70 | lemma let_cong [recdef_cong]:
 | 
|  |     71 |     "M = N ==> (!!x. x = N ==> f x = g x) ==> Let M f = Let N g"
 | 
|  |     72 |   by (unfold Let_def) blast
 | 
|  |     73 | 
 | 
|  |     74 | lemmas [recdef_wf] =
 | 
|  |     75 |   wf_trancl
 | 
|  |     76 |   wf_less_than
 | 
|  |     77 |   wf_lex_prod
 | 
|  |     78 |   wf_inv_image
 | 
|  |     79 |   wf_measure
 | 
|  |     80 |   wf_pred_nat
 | 
| 10653 |     81 |   wf_same_fst
 | 
| 9855 |     82 |   wf_empty
 | 
|  |     83 | 
 | 
| 6438 |     84 | end
 |