src/HOL/Sledgehammer.thy
author blanchet
Mon Aug 09 12:05:48 2010 +0200 (2010-08-09)
changeset 38282 319c59682c51
parent 38047 9033c03cc214
child 38606 3003ddbd46d9
permissions -rw-r--r--
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
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/async_manager.ML")
blanchet@38047
    14
  ("Tools/ATP/atp_problem.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@37578
    19
  ("Tools/Sledgehammer/metis_clauses.ML")
blanchet@37578
    20
  ("Tools/Sledgehammer/metis_tactics.ML")
blanchet@37571
    21
  ("Tools/Sledgehammer/sledgehammer_util.ML")
blanchet@35825
    22
  ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
blanchet@38282
    23
  ("Tools/Sledgehammer/sledgehammer_translate.ML")
blanchet@37579
    24
  ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
blanchet@38023
    25
  ("Tools/Sledgehammer/sledgehammer.ML")
blanchet@38282
    26
  ("Tools/Sledgehammer/sledgehammer_fact_minimize.ML")
blanchet@35866
    27
  ("Tools/Sledgehammer/sledgehammer_isar.ML")
wenzelm@21254
    28
begin
wenzelm@21254
    29
blanchet@37410
    30
definition skolem_id :: "'a \<Rightarrow> 'a" where
blanchet@37410
    31
[no_atp]: "skolem_id = (\<lambda>x. x)"
blanchet@37399
    32
blanchet@36569
    33
definition COMBI :: "'a \<Rightarrow> 'a" where
blanchet@36569
    34
[no_atp]: "COMBI P \<equiv> P"
wenzelm@24819
    35
blanchet@36569
    36
definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
blanchet@36569
    37
[no_atp]: "COMBK P Q \<equiv> P"
wenzelm@21254
    38
blanchet@36569
    39
definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
blanchet@36569
    40
"COMBB P Q R \<equiv> P (Q R)"
wenzelm@21254
    41
blanchet@36569
    42
definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@36569
    43
[no_atp]: "COMBC P Q R \<equiv> P R Q"
wenzelm@21254
    44
blanchet@36569
    45
definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@36569
    46
[no_atp]: "COMBS P Q R \<equiv> P R (Q R)"
wenzelm@21254
    47
blanchet@36569
    48
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
blanchet@36569
    49
"fequal X Y \<equiv> (X = Y)"
wenzelm@21254
    50
blanchet@36569
    51
lemma fequal_imp_equal [no_atp]: "fequal X Y \<Longrightarrow> X = Y"
wenzelm@21254
    52
  by (simp add: fequal_def)
wenzelm@21254
    53
blanchet@36569
    54
lemma equal_imp_fequal [no_atp]: "X = Y \<Longrightarrow> fequal X Y"
wenzelm@21254
    55
  by (simp add: fequal_def)
wenzelm@21254
    56
paulson@24827
    57
text{*Theorems for translation to combinators*}
paulson@24827
    58
blanchet@36569
    59
lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
paulson@24827
    60
apply (rule eq_reflection)
paulson@24827
    61
apply (rule ext) 
paulson@24827
    62
apply (simp add: COMBS_def) 
paulson@24827
    63
done
paulson@24827
    64
blanchet@36569
    65
lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
paulson@24827
    66
apply (rule eq_reflection)
paulson@24827
    67
apply (rule ext) 
paulson@24827
    68
apply (simp add: COMBI_def) 
paulson@24827
    69
done
paulson@24827
    70
blanchet@36569
    71
lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
paulson@24827
    72
apply (rule eq_reflection)
paulson@24827
    73
apply (rule ext) 
paulson@24827
    74
apply (simp add: COMBK_def) 
paulson@24827
    75
done
paulson@24827
    76
blanchet@36569
    77
lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
paulson@24827
    78
apply (rule eq_reflection)
paulson@24827
    79
apply (rule ext) 
paulson@24827
    80
apply (simp add: COMBB_def) 
paulson@24827
    81
done
paulson@24827
    82
blanchet@36569
    83
lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
paulson@24827
    84
apply (rule eq_reflection)
paulson@24827
    85
apply (rule ext) 
paulson@24827
    86
apply (simp add: COMBC_def) 
paulson@24827
    87
done
paulson@24827
    88
blanchet@38047
    89
use "Tools/ATP/async_manager.ML"
blanchet@38047
    90
use "Tools/ATP/atp_problem.ML"
blanchet@38047
    91
use "Tools/ATP/atp_systems.ML"
blanchet@38025
    92
setup ATP_Systems.setup
blanchet@38025
    93
blanchet@38025
    94
use "~~/src/Tools/Metis/metis.ML"
blanchet@37574
    95
use "Tools/Sledgehammer/clausifier.ML"
blanchet@37569
    96
use "Tools/Sledgehammer/meson_tactic.ML"
blanchet@37569
    97
setup Meson_Tactic.setup
blanchet@37571
    98
blanchet@37578
    99
use "Tools/Sledgehammer/metis_clauses.ML"
blanchet@37578
   100
use "Tools/Sledgehammer/metis_tactics.ML"
blanchet@37578
   101
blanchet@37571
   102
use "Tools/Sledgehammer/sledgehammer_util.ML"
blanchet@35825
   103
use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
blanchet@38282
   104
use "Tools/Sledgehammer/sledgehammer_translate.ML"
blanchet@37579
   105
use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
blanchet@38023
   106
use "Tools/Sledgehammer/sledgehammer.ML"
blanchet@38023
   107
setup Sledgehammer.setup
blanchet@38282
   108
use "Tools/Sledgehammer/sledgehammer_fact_minimize.ML"
blanchet@35866
   109
use "Tools/Sledgehammer/sledgehammer_isar.ML"
blanchet@35826
   110
setup Metis_Tactics.setup
wenzelm@23444
   111
wenzelm@21254
   112
end