src/HOL/Sledgehammer.thy
author blanchet
Wed Sep 01 00:03:15 2010 +0200 (2010-09-01)
changeset 38990 7fba3ccc755a
parent 38988 483879af0643
child 39036 dff91b90d74c
permissions -rw-r--r--
finish moving file
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@38047
    14
  ("Tools/ATP/atp_systems.ML")
blanchet@38025
    15
  ("~~/src/Tools/Metis/metis.ML")
blanchet@37574
    16
  ("Tools/Sledgehammer/clausifier.ML")
blanchet@37569
    17
  ("Tools/Sledgehammer/meson_tactic.ML")
blanchet@37578
    18
  ("Tools/Sledgehammer/metis_clauses.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@37410
    29
definition skolem_id :: "'a \<Rightarrow> 'a" where
blanchet@37410
    30
[no_atp]: "skolem_id = (\<lambda>x. x)"
blanchet@37399
    31
blanchet@36569
    32
definition COMBI :: "'a \<Rightarrow> 'a" where
blanchet@38606
    33
[no_atp]: "COMBI P = P"
wenzelm@24819
    34
blanchet@36569
    35
definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
blanchet@38606
    36
[no_atp]: "COMBK P Q = P"
wenzelm@21254
    37
blanchet@36569
    38
definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
blanchet@38606
    39
"COMBB P Q R = P (Q R)"
wenzelm@21254
    40
blanchet@36569
    41
definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@38606
    42
[no_atp]: "COMBC P Q R = P R Q"
wenzelm@21254
    43
blanchet@36569
    44
definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@38606
    45
[no_atp]: "COMBS P Q R = P R (Q R)"
wenzelm@21254
    46
blanchet@36569
    47
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
blanchet@38606
    48
"fequal X Y \<longleftrightarrow> (X = Y)"
blanchet@38606
    49
blanchet@38606
    50
lemma fequal_imp_equal [no_atp]: "\<not> fequal X Y \<or> X = Y"
blanchet@38606
    51
by (simp add: fequal_def)
wenzelm@21254
    52
blanchet@38606
    53
lemma equal_imp_fequal [no_atp]: "\<not> X = Y \<or> fequal X Y"
blanchet@38606
    54
by (simp add: fequal_def)
wenzelm@21254
    55
blanchet@38606
    56
lemma equal_imp_equal [no_atp]: "X = Y ==> X = Y"
blanchet@38606
    57
by auto
wenzelm@21254
    58
paulson@24827
    59
text{*Theorems for translation to combinators*}
paulson@24827
    60
blanchet@36569
    61
lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
paulson@24827
    62
apply (rule eq_reflection)
paulson@24827
    63
apply (rule ext) 
paulson@24827
    64
apply (simp add: COMBS_def) 
paulson@24827
    65
done
paulson@24827
    66
blanchet@36569
    67
lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
paulson@24827
    68
apply (rule eq_reflection)
paulson@24827
    69
apply (rule ext) 
paulson@24827
    70
apply (simp add: COMBI_def) 
paulson@24827
    71
done
paulson@24827
    72
blanchet@36569
    73
lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
paulson@24827
    74
apply (rule eq_reflection)
paulson@24827
    75
apply (rule ext) 
paulson@24827
    76
apply (simp add: COMBK_def) 
paulson@24827
    77
done
paulson@24827
    78
blanchet@36569
    79
lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
paulson@24827
    80
apply (rule eq_reflection)
paulson@24827
    81
apply (rule ext) 
paulson@24827
    82
apply (simp add: COMBB_def) 
paulson@24827
    83
done
paulson@24827
    84
blanchet@36569
    85
lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
paulson@24827
    86
apply (rule eq_reflection)
paulson@24827
    87
apply (rule ext) 
paulson@24827
    88
apply (simp add: COMBC_def) 
paulson@24827
    89
done
paulson@24827
    90
blanchet@38047
    91
use "Tools/ATP/atp_problem.ML"
blanchet@38047
    92
use "Tools/ATP/atp_systems.ML"
blanchet@38025
    93
setup ATP_Systems.setup
blanchet@38025
    94
blanchet@38025
    95
use "~~/src/Tools/Metis/metis.ML"
blanchet@37574
    96
use "Tools/Sledgehammer/clausifier.ML"
blanchet@37569
    97
use "Tools/Sledgehammer/meson_tactic.ML"
blanchet@37569
    98
setup Meson_Tactic.setup
blanchet@37571
    99
blanchet@37578
   100
use "Tools/Sledgehammer/metis_clauses.ML"
blanchet@37578
   101
use "Tools/Sledgehammer/metis_tactics.ML"
blanchet@37578
   102
blanchet@37571
   103
use "Tools/Sledgehammer/sledgehammer_util.ML"
blanchet@38988
   104
use "Tools/Sledgehammer/sledgehammer_filter.ML"
blanchet@38282
   105
use "Tools/Sledgehammer/sledgehammer_translate.ML"
blanchet@38988
   106
use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
blanchet@38023
   107
use "Tools/Sledgehammer/sledgehammer.ML"
blanchet@38023
   108
setup Sledgehammer.setup
blanchet@38988
   109
use "Tools/Sledgehammer/sledgehammer_minimize.ML"
blanchet@35866
   110
use "Tools/Sledgehammer/sledgehammer_isar.ML"
blanchet@35826
   111
setup Metis_Tactics.setup
wenzelm@23444
   112
wenzelm@21254
   113
end