src/HOL/Library/Old_Recdef.thy
author wenzelm
Thu Mar 15 22:08:53 2012 +0100 (2012-03-15)
changeset 46950 d0181abdbdac
parent 46947 b8c7eb0c2f89
child 48891 c0eafbd55de3
permissions -rw-r--r--
declare command keywords via theory header, including strict checking outside Pure;
     1 (*  Title:      HOL/Library/Old_Recdef.thy
     2     Author:     Konrad Slind and Markus Wenzel, TU Muenchen
     3 *)
     4 
     5 header {* TFL: recursive function definitions *}
     6 
     7 theory Old_Recdef
     8 imports Wfrec
     9 keywords
    10   "recdef" "defer_recdef" :: thy_decl and
    11   "recdef_tc" :: thy_goal and
    12   "permissive" "congs" "hints"
    13 uses
    14   ("~~/src/HOL/Tools/TFL/casesplit.ML")
    15   ("~~/src/HOL/Tools/TFL/utils.ML")
    16   ("~~/src/HOL/Tools/TFL/usyntax.ML")
    17   ("~~/src/HOL/Tools/TFL/dcterm.ML")
    18   ("~~/src/HOL/Tools/TFL/thms.ML")
    19   ("~~/src/HOL/Tools/TFL/rules.ML")
    20   ("~~/src/HOL/Tools/TFL/thry.ML")
    21   ("~~/src/HOL/Tools/TFL/tfl.ML")
    22   ("~~/src/HOL/Tools/TFL/post.ML")
    23   ("~~/src/HOL/Tools/recdef.ML")
    24 begin
    25 
    26 subsection {* Lemmas for TFL *}
    27 
    28 lemma tfl_wf_induct: "ALL R. wf R -->  
    29        (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
    30 apply clarify
    31 apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
    32 done
    33 
    34 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
    35 apply clarify
    36 apply (rule cut_apply, assumption)
    37 done
    38 
    39 lemma tfl_wfrec:
    40      "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
    41 apply clarify
    42 apply (erule wfrec)
    43 done
    44 
    45 lemma tfl_eq_True: "(x = True) --> x"
    46   by blast
    47 
    48 lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
    49   by blast
    50 
    51 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
    52   by blast
    53 
    54 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
    55   by blast
    56 
    57 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
    58   by blast
    59 
    60 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
    61   by simp
    62 
    63 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
    64   by blast
    65 
    66 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
    67   by blast
    68 
    69 use "~~/src/HOL/Tools/TFL/casesplit.ML"
    70 use "~~/src/HOL/Tools/TFL/utils.ML"
    71 use "~~/src/HOL/Tools/TFL/usyntax.ML"
    72 use "~~/src/HOL/Tools/TFL/dcterm.ML"
    73 use "~~/src/HOL/Tools/TFL/thms.ML"
    74 use "~~/src/HOL/Tools/TFL/rules.ML"
    75 use "~~/src/HOL/Tools/TFL/thry.ML"
    76 use "~~/src/HOL/Tools/TFL/tfl.ML"
    77 use "~~/src/HOL/Tools/TFL/post.ML"
    78 use "~~/src/HOL/Tools/recdef.ML"
    79 setup Recdef.setup
    80 
    81 subsection {* Rule setup *}
    82 
    83 lemmas [recdef_simp] =
    84   inv_image_def
    85   measure_def
    86   lex_prod_def
    87   same_fst_def
    88   less_Suc_eq [THEN iffD2]
    89 
    90 lemmas [recdef_cong] =
    91   if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
    92   map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong 
    93 
    94 lemmas [recdef_wf] =
    95   wf_trancl
    96   wf_less_than
    97   wf_lex_prod
    98   wf_inv_image
    99   wf_measure
   100   wf_measures
   101   wf_pred_nat
   102   wf_same_fst
   103   wf_empty
   104 
   105 end