src/HOL/Matrix_LP/ComputeHOL.thy
author blanchet
Wed, 24 Sep 2014 15:45:55 +0200
changeset 58425 246985c6b20b
parent 55414 eab03e9cee8a
child 59582 0fbed69ff081
permissions -rw-r--r--
simpler proof
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25216
eb512c1717ea adapted Compute...
obua
parents: 23667
diff changeset
     1
theory ComputeHOL
37872
d83659570337 moved src/Tools/Compute_Oracle to src/HOL/Matrix/Compute_Oracle -- it actually depends on HOL anyway;
wenzelm
parents: 32491
diff changeset
     2
imports Complex_Main "Compute_Oracle/Compute_Oracle"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     3
begin
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     4
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     5
lemma Trueprop_eq_eq: "Trueprop X == (X == True)" by (simp add: atomize_eq)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     6
lemma meta_eq_trivial: "x == y \<Longrightarrow> x == y" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     7
lemma meta_eq_imp_eq: "x == y \<Longrightarrow> x = y" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     8
lemma eq_trivial: "x = y \<Longrightarrow> x = y" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
     9
lemma bool_to_true: "x :: bool \<Longrightarrow> x == True"  by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    10
lemma transmeta_1: "x = y \<Longrightarrow> y == z \<Longrightarrow> x = z" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    11
lemma transmeta_2: "x == y \<Longrightarrow> y = z \<Longrightarrow> x = z" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    12
lemma transmeta_3: "x == y \<Longrightarrow> y == z \<Longrightarrow> x = z" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    13
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    14
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    15
(**** compute_if ****)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    16
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    17
lemma If_True: "If True = (\<lambda> x y. x)" by ((rule ext)+,auto)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    18
lemma If_False: "If False = (\<lambda> x y. y)" by ((rule ext)+, auto)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    19
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    20
lemmas compute_if = If_True If_False
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    21
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    22
(**** compute_bool ****)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    23
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    24
lemma bool1: "(\<not> True) = False"  by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    25
lemma bool2: "(\<not> False) = True"  by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    26
lemma bool3: "(P \<and> True) = P" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    27
lemma bool4: "(True \<and> P) = P" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    28
lemma bool5: "(P \<and> False) = False" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    29
lemma bool6: "(False \<and> P) = False" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    30
lemma bool7: "(P \<or> True) = True" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    31
lemma bool8: "(True \<or> P) = True" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    32
lemma bool9: "(P \<or> False) = P" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    33
lemma bool10: "(False \<or> P) = P" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    34
lemma bool11: "(True \<longrightarrow> P) = P" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    35
lemma bool12: "(P \<longrightarrow> True) = True" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    36
lemma bool13: "(True \<longrightarrow> P) = P" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    37
lemma bool14: "(P \<longrightarrow> False) = (\<not> P)" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    38
lemma bool15: "(False \<longrightarrow> P) = True" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    39
lemma bool16: "(False = False) = True" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    40
lemma bool17: "(True = True) = True" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    41
lemma bool18: "(False = True) = False" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    42
lemma bool19: "(True = False) = False" by blast
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    43
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    44
lemmas compute_bool = bool1 bool2 bool3 bool4 bool5 bool6 bool7 bool8 bool9 bool10 bool11 bool12 bool13 bool14 bool15 bool16 bool17 bool18 bool19
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    45
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    46
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    47
(*** compute_pair ***)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    48
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    49
lemma compute_fst: "fst (x,y) = x" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    50
lemma compute_snd: "snd (x,y) = y" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    51
lemma compute_pair_eq: "((a, b) = (c, d)) = (a = c \<and> b = d)" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    52
55414
eab03e9cee8a renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents: 55413
diff changeset
    53
lemma case_prod_simp: "case_prod f (x,y) = f x y" by simp
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    54
55414
eab03e9cee8a renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents: 55413
diff changeset
    55
lemmas compute_pair = compute_fst compute_snd compute_pair_eq case_prod_simp
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    56
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    57
(*** compute_option ***)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    58
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    59
lemma compute_the: "the (Some x) = x" by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    60
lemma compute_None_Some_eq: "(None = Some x) = False" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    61
lemma compute_Some_None_eq: "(Some x = None) = False" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    62
lemma compute_None_None_eq: "(None = None) = True" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    63
lemma compute_Some_Some_eq: "(Some x = Some y) = (x = y)" by auto
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    64
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    65
definition case_option_compute :: "'b option \<Rightarrow> 'a \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a"
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    66
  where "case_option_compute opt a f = case_option a f opt"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    67
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    68
lemma case_option_compute: "case_option = (\<lambda> a f opt. case_option_compute opt a f)"
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    69
  by (simp add: case_option_compute_def)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    70
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    71
lemma case_option_compute_None: "case_option_compute None = (\<lambda> a f. a)"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    72
  apply (rule ext)+
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    73
  apply (simp add: case_option_compute_def)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    74
  done
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    75
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    76
lemma case_option_compute_Some: "case_option_compute (Some x) = (\<lambda> a f. f x)"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    77
  apply (rule ext)+
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    78
  apply (simp add: case_option_compute_def)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    79
  done
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    80
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    81
lemmas compute_case_option = case_option_compute case_option_compute_None case_option_compute_Some
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    82
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    83
lemmas compute_option = compute_the compute_None_Some_eq compute_Some_None_eq compute_None_None_eq compute_Some_Some_eq compute_case_option
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    84
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    85
(**** compute_list_length ****)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    86
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    87
lemma length_cons:"length (x#xs) = 1 + (length xs)"
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    88
  by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    89
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    90
lemma length_nil: "length [] = 0"
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    91
  by simp
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    92
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    93
lemmas compute_list_length = length_nil length_cons
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    94
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    95
(*** compute_case_list ***)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    96
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    97
definition case_list_compute :: "'b list \<Rightarrow> 'a \<Rightarrow> ('b \<Rightarrow> 'b list \<Rightarrow> 'a) \<Rightarrow> 'a"
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
    98
  where "case_list_compute l a f = case_list a f l"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
    99
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   100
lemma case_list_compute: "case_list = (\<lambda> (a::'a) f (l::'b list). case_list_compute l a f)"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   101
  apply (rule ext)+
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   102
  apply (simp add: case_list_compute_def)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   103
  done
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   104
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   105
lemma case_list_compute_empty: "case_list_compute ([]::'b list) = (\<lambda> (a::'a) f. a)"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   106
  apply (rule ext)+
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   107
  apply (simp add: case_list_compute_def)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   108
  done
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   109
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   110
lemma case_list_compute_cons: "case_list_compute (u#v) = (\<lambda> (a::'a) f. (f (u::'b) v))"
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   111
  apply (rule ext)+
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   112
  apply (simp add: case_list_compute_def)
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   113
  done
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   114
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   115
lemmas compute_case_list = case_list_compute case_list_compute_empty case_list_compute_cons
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   116
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   117
(*** compute_list_nth ***)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   118
(* Of course, you will need computation with nats for this to work \<dots> *)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   119
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   120
lemma compute_list_nth: "((x#xs) ! n) = (if n = 0 then x else (xs ! (n - 1)))"
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   121
  by (cases n, auto)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   122
  
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   123
(*** compute_list ***)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   124
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 46988
diff changeset
   125
lemmas compute_list = compute_case_list compute_list_length compute_list_nth
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   126
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   127
(*** compute_let ***)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   128
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   129
lemmas compute_let = Let_def
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   130
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   131
(***********************)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   132
(* Everything together *)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   133
(***********************)
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   134
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   135
lemmas compute_hol = compute_if compute_bool compute_pair compute_option compute_list compute_let
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   136
23667
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   137
ML {*
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   138
signature ComputeHOL =
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   139
sig
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   140
  val prep_thms : thm list -> thm list
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   141
  val to_meta_eq : thm -> thm
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   142
  val to_hol_eq : thm -> thm
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   143
  val symmetric : thm -> thm 
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   144
  val trans : thm -> thm -> thm
23664
9c486517354a added computing oracle support for HOL and numerals
obua
parents:
diff changeset
   145
end
23667
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   146
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   147
structure ComputeHOL : ComputeHOL =
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   148
struct
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   149
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   150
local
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   151
fun lhs_of eq = fst (Thm.dest_equals (cprop_of eq));
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   152
in
46984
0f1e85fcf5f4 tuned exception;
wenzelm
parents: 38273
diff changeset
   153
fun rewrite_conv [] ct = raise CTERM ("rewrite_conv", [ct])
23667
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   154
  | rewrite_conv (eq :: eqs) ct =
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   155
      Thm.instantiate (Thm.match (lhs_of eq, ct)) eq
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   156
      handle Pattern.MATCH => rewrite_conv eqs ct;
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   157
end
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   158
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   159
val convert_conditions = Conv.fconv_rule (Conv.prems_conv ~1 (Conv.try_conv (rewrite_conv [@{thm "Trueprop_eq_eq"}])))
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   160
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   161
val eq_th = @{thm "HOL.eq_reflection"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   162
val meta_eq_trivial = @{thm "ComputeHOL.meta_eq_trivial"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   163
val bool_to_true = @{thm "ComputeHOL.bool_to_true"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   164
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   165
fun to_meta_eq th = eq_th OF [th] handle THM _ => meta_eq_trivial OF [th] handle THM _ => bool_to_true OF [th]
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   166
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   167
fun to_hol_eq th = @{thm "meta_eq_imp_eq"} OF [th] handle THM _ => @{thm "eq_trivial"} OF [th] 
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   168
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   169
fun prep_thms ths = map (convert_conditions o to_meta_eq) ths
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   170
26424
a6cad32a27b0 eliminated theory ProtoPure;
wenzelm
parents: 25216
diff changeset
   171
fun symmetric th = @{thm "HOL.sym"} OF [th] handle THM _ => @{thm "Pure.symmetric"} OF [th]
23667
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   172
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   173
local
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   174
    val trans_HOL = @{thm "HOL.trans"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   175
    val trans_HOL_1 = @{thm "ComputeHOL.transmeta_1"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   176
    val trans_HOL_2 = @{thm "ComputeHOL.transmeta_2"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   177
    val trans_HOL_3 = @{thm "ComputeHOL.transmeta_3"}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   178
    fun tr [] th1 th2 = trans_HOL OF [th1, th2]
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   179
      | tr (t::ts) th1 th2 = (t OF [th1, th2] handle THM _ => tr ts th1 th2) 
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   180
in
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   181
  fun trans th1 th2 = tr [trans_HOL, trans_HOL_1, trans_HOL_2, trans_HOL_3] th1 th2
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   182
end
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   183
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   184
end
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   185
*}
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   186
a4e93948f72a removed legacy ML file;
wenzelm
parents: 23664
diff changeset
   187
end