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