src/HOL/Sledgehammer.thy
author blanchet
Mon Oct 04 21:50:32 2010 +0200 (2010-10-04)
changeset 39942 1ae333bfef14
parent 39894 35ae5cf8c96a
child 39946 78faa9b31202
permissions -rw-r--r--
remove Meson from Sledgehammer
blanchet@35827
     1
(*  Title:      HOL/Sledgehammer.thy
blanchet@38027
     2
    Author:     Lawrence C. Paulson, Cambridge University Computer Laboratory
blanchet@38028
     3
    Author:     Jia Meng, Cambridge University Computer Laboratory and NICTA
blanchet@35865
     4
    Author:     Fabian Immler, TU Muenchen
blanchet@35865
     5
    Author:     Jasmin Blanchette, TU Muenchen
wenzelm@21254
     6
*)
wenzelm@21254
     7
blanchet@35827
     8
header {* Sledgehammer: Isabelle--ATP Linkup *}
wenzelm@21254
     9
blanchet@35827
    10
theory Sledgehammer
haftmann@33593
    11
imports Plain Hilbert_Choice
wenzelm@21254
    12
uses
blanchet@38047
    13
  ("Tools/ATP/atp_problem.ML")
blanchet@39452
    14
  ("Tools/ATP/atp_proof.ML")
blanchet@38047
    15
  ("Tools/ATP/atp_systems.ML")
blanchet@38025
    16
  ("~~/src/Tools/Metis/metis.ML")
blanchet@39494
    17
  ("Tools/Sledgehammer/metis_translate.ML")
blanchet@39495
    18
  ("Tools/Sledgehammer/metis_reconstruct.ML")
blanchet@37578
    19
  ("Tools/Sledgehammer/metis_tactics.ML")
blanchet@37571
    20
  ("Tools/Sledgehammer/sledgehammer_util.ML")
blanchet@38988
    21
  ("Tools/Sledgehammer/sledgehammer_filter.ML")
blanchet@38282
    22
  ("Tools/Sledgehammer/sledgehammer_translate.ML")
blanchet@38988
    23
  ("Tools/Sledgehammer/sledgehammer_reconstruct.ML")
blanchet@38023
    24
  ("Tools/Sledgehammer/sledgehammer.ML")
blanchet@38988
    25
  ("Tools/Sledgehammer/sledgehammer_minimize.ML")
blanchet@35866
    26
  ("Tools/Sledgehammer/sledgehammer_isar.ML")
wenzelm@21254
    27
begin
wenzelm@21254
    28
blanchet@39036
    29
lemma TruepropI: "P \<equiv> Q \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
blanchet@39036
    30
by simp
blanchet@39036
    31
blanchet@39355
    32
definition skolem :: "'a \<Rightarrow> 'a" where
blanchet@39355
    33
[no_atp]: "skolem = (\<lambda>x. x)"
blanchet@37399
    34
blanchet@36569
    35
definition COMBI :: "'a \<Rightarrow> 'a" where
blanchet@38606
    36
[no_atp]: "COMBI P = P"
wenzelm@24819
    37
blanchet@36569
    38
definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
blanchet@38606
    39
[no_atp]: "COMBK P Q = P"
wenzelm@21254
    40
blanchet@36569
    41
definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
blanchet@38606
    42
"COMBB P Q R = P (Q R)"
wenzelm@21254
    43
blanchet@36569
    44
definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@38606
    45
[no_atp]: "COMBC P Q R = P R Q"
wenzelm@21254
    46
blanchet@36569
    47
definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@38606
    48
[no_atp]: "COMBS P Q R = P R (Q R)"
wenzelm@21254
    49
blanchet@36569
    50
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
blanchet@38606
    51
"fequal X Y \<longleftrightarrow> (X = Y)"
blanchet@38606
    52
blanchet@38606
    53
lemma fequal_imp_equal [no_atp]: "\<not> fequal X Y \<or> X = Y"
blanchet@38606
    54
by (simp add: fequal_def)
wenzelm@21254
    55
blanchet@38606
    56
lemma equal_imp_fequal [no_atp]: "\<not> X = Y \<or> fequal X Y"
blanchet@38606
    57
by (simp add: fequal_def)
wenzelm@21254
    58
blanchet@38606
    59
lemma equal_imp_equal [no_atp]: "X = Y ==> X = Y"
blanchet@38606
    60
by auto
wenzelm@21254
    61
blanchet@39894
    62
lemma skolem_COMBK_iff: "P \<longleftrightarrow> skolem (COMBK P (i\<Colon>nat))"
blanchet@39894
    63
unfolding skolem_def COMBK_def by (rule refl)
blanchet@39894
    64
blanchet@39894
    65
lemmas skolem_COMBK_I = iffD1 [OF skolem_COMBK_iff]
blanchet@39894
    66
lemmas skolem_COMBK_D = iffD2 [OF skolem_COMBK_iff]
blanchet@39894
    67
paulson@24827
    68
text{*Theorems for translation to combinators*}
paulson@24827
    69
blanchet@36569
    70
lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
paulson@24827
    71
apply (rule eq_reflection)
paulson@24827
    72
apply (rule ext) 
paulson@24827
    73
apply (simp add: COMBS_def) 
paulson@24827
    74
done
paulson@24827
    75
blanchet@36569
    76
lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
paulson@24827
    77
apply (rule eq_reflection)
paulson@24827
    78
apply (rule ext) 
paulson@24827
    79
apply (simp add: COMBI_def) 
paulson@24827
    80
done
paulson@24827
    81
blanchet@36569
    82
lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
paulson@24827
    83
apply (rule eq_reflection)
paulson@24827
    84
apply (rule ext) 
paulson@24827
    85
apply (simp add: COMBK_def) 
paulson@24827
    86
done
paulson@24827
    87
blanchet@36569
    88
lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
paulson@24827
    89
apply (rule eq_reflection)
paulson@24827
    90
apply (rule ext) 
paulson@24827
    91
apply (simp add: COMBB_def) 
paulson@24827
    92
done
paulson@24827
    93
blanchet@36569
    94
lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
paulson@24827
    95
apply (rule eq_reflection)
paulson@24827
    96
apply (rule ext) 
paulson@24827
    97
apply (simp add: COMBC_def) 
paulson@24827
    98
done
paulson@24827
    99
blanchet@38047
   100
use "Tools/ATP/atp_problem.ML"
blanchet@39452
   101
use "Tools/ATP/atp_proof.ML"
blanchet@38047
   102
use "Tools/ATP/atp_systems.ML"
blanchet@38025
   103
setup ATP_Systems.setup
blanchet@38025
   104
blanchet@38025
   105
use "~~/src/Tools/Metis/metis.ML"
blanchet@39494
   106
use "Tools/Sledgehammer/metis_translate.ML"
blanchet@39495
   107
use "Tools/Sledgehammer/metis_reconstruct.ML"
blanchet@37578
   108
use "Tools/Sledgehammer/metis_tactics.ML"
blanchet@39322
   109
setup Metis_Tactics.setup
blanchet@37578
   110
blanchet@37571
   111
use "Tools/Sledgehammer/sledgehammer_util.ML"
blanchet@38988
   112
use "Tools/Sledgehammer/sledgehammer_filter.ML"
blanchet@38282
   113
use "Tools/Sledgehammer/sledgehammer_translate.ML"
blanchet@38988
   114
use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
blanchet@38023
   115
use "Tools/Sledgehammer/sledgehammer.ML"
blanchet@38023
   116
setup Sledgehammer.setup
blanchet@38988
   117
use "Tools/Sledgehammer/sledgehammer_minimize.ML"
blanchet@35866
   118
use "Tools/Sledgehammer/sledgehammer_isar.ML"
blanchet@39322
   119
setup Sledgehammer_Isar.setup
wenzelm@23444
   120
wenzelm@21254
   121
end