src/HOL/Sledgehammer.thy
author blanchet
Thu Sep 16 16:12:02 2010 +0200 (2010-09-16)
changeset 39494 bf7dd4902321
parent 39452 70a57e40f795
child 39495 bb4fb9ffe2d1
permissions -rw-r--r--
rename "Metis_Clauses" to "Metis_Translate" for consistency with "Sledgehammer_Translate"
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@37574
    17
  ("Tools/Sledgehammer/clausifier.ML")
blanchet@37569
    18
  ("Tools/Sledgehammer/meson_tactic.ML")
blanchet@39494
    19
  ("Tools/Sledgehammer/metis_translate.ML")
blanchet@37578
    20
  ("Tools/Sledgehammer/metis_tactics.ML")
blanchet@37571
    21
  ("Tools/Sledgehammer/sledgehammer_util.ML")
blanchet@38988
    22
  ("Tools/Sledgehammer/sledgehammer_filter.ML")
blanchet@38282
    23
  ("Tools/Sledgehammer/sledgehammer_translate.ML")
blanchet@38988
    24
  ("Tools/Sledgehammer/sledgehammer_reconstruct.ML")
blanchet@38023
    25
  ("Tools/Sledgehammer/sledgehammer.ML")
blanchet@38988
    26
  ("Tools/Sledgehammer/sledgehammer_minimize.ML")
blanchet@35866
    27
  ("Tools/Sledgehammer/sledgehammer_isar.ML")
wenzelm@21254
    28
begin
wenzelm@21254
    29
blanchet@39036
    30
lemma TruepropI: "P \<equiv> Q \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
blanchet@39036
    31
by simp
blanchet@39036
    32
blanchet@39355
    33
definition skolem :: "'a \<Rightarrow> 'a" where
blanchet@39355
    34
[no_atp]: "skolem = (\<lambda>x. x)"
blanchet@37399
    35
blanchet@36569
    36
definition COMBI :: "'a \<Rightarrow> 'a" where
blanchet@38606
    37
[no_atp]: "COMBI P = P"
wenzelm@24819
    38
blanchet@36569
    39
definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
blanchet@38606
    40
[no_atp]: "COMBK P Q = P"
wenzelm@21254
    41
blanchet@36569
    42
definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
blanchet@38606
    43
"COMBB P Q R = P (Q R)"
wenzelm@21254
    44
blanchet@36569
    45
definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@38606
    46
[no_atp]: "COMBC P Q R = P R Q"
wenzelm@21254
    47
blanchet@36569
    48
definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@38606
    49
[no_atp]: "COMBS P Q R = P R (Q R)"
wenzelm@21254
    50
blanchet@36569
    51
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
blanchet@38606
    52
"fequal X Y \<longleftrightarrow> (X = Y)"
blanchet@38606
    53
blanchet@38606
    54
lemma fequal_imp_equal [no_atp]: "\<not> fequal X Y \<or> X = Y"
blanchet@38606
    55
by (simp add: fequal_def)
wenzelm@21254
    56
blanchet@38606
    57
lemma equal_imp_fequal [no_atp]: "\<not> X = Y \<or> fequal X Y"
blanchet@38606
    58
by (simp add: fequal_def)
wenzelm@21254
    59
blanchet@38606
    60
lemma equal_imp_equal [no_atp]: "X = Y ==> X = Y"
blanchet@38606
    61
by auto
wenzelm@21254
    62
paulson@24827
    63
text{*Theorems for translation to combinators*}
paulson@24827
    64
blanchet@36569
    65
lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
paulson@24827
    66
apply (rule eq_reflection)
paulson@24827
    67
apply (rule ext) 
paulson@24827
    68
apply (simp add: COMBS_def) 
paulson@24827
    69
done
paulson@24827
    70
blanchet@36569
    71
lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
paulson@24827
    72
apply (rule eq_reflection)
paulson@24827
    73
apply (rule ext) 
paulson@24827
    74
apply (simp add: COMBI_def) 
paulson@24827
    75
done
paulson@24827
    76
blanchet@36569
    77
lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
paulson@24827
    78
apply (rule eq_reflection)
paulson@24827
    79
apply (rule ext) 
paulson@24827
    80
apply (simp add: COMBK_def) 
paulson@24827
    81
done
paulson@24827
    82
blanchet@36569
    83
lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
paulson@24827
    84
apply (rule eq_reflection)
paulson@24827
    85
apply (rule ext) 
paulson@24827
    86
apply (simp add: COMBB_def) 
paulson@24827
    87
done
paulson@24827
    88
blanchet@36569
    89
lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
paulson@24827
    90
apply (rule eq_reflection)
paulson@24827
    91
apply (rule ext) 
paulson@24827
    92
apply (simp add: COMBC_def) 
paulson@24827
    93
done
paulson@24827
    94
blanchet@38047
    95
use "Tools/ATP/atp_problem.ML"
blanchet@39452
    96
use "Tools/ATP/atp_proof.ML"
blanchet@38047
    97
use "Tools/ATP/atp_systems.ML"
blanchet@38025
    98
setup ATP_Systems.setup
blanchet@38025
    99
blanchet@38025
   100
use "~~/src/Tools/Metis/metis.ML"
blanchet@37574
   101
use "Tools/Sledgehammer/clausifier.ML"
blanchet@37569
   102
use "Tools/Sledgehammer/meson_tactic.ML"
blanchet@37569
   103
setup Meson_Tactic.setup
blanchet@37571
   104
blanchet@39494
   105
use "Tools/Sledgehammer/metis_translate.ML"
blanchet@37578
   106
use "Tools/Sledgehammer/metis_tactics.ML"
blanchet@39322
   107
setup Metis_Tactics.setup
blanchet@37578
   108
blanchet@37571
   109
use "Tools/Sledgehammer/sledgehammer_util.ML"
blanchet@38988
   110
use "Tools/Sledgehammer/sledgehammer_filter.ML"
blanchet@38282
   111
use "Tools/Sledgehammer/sledgehammer_translate.ML"
blanchet@38988
   112
use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
blanchet@38023
   113
use "Tools/Sledgehammer/sledgehammer.ML"
blanchet@38023
   114
setup Sledgehammer.setup
blanchet@38988
   115
use "Tools/Sledgehammer/sledgehammer_minimize.ML"
blanchet@35866
   116
use "Tools/Sledgehammer/sledgehammer_isar.ML"
blanchet@39322
   117
setup Sledgehammer_Isar.setup
wenzelm@23444
   118
wenzelm@21254
   119
end