src/HOL/Sledgehammer.thy
author blanchet
Fri Jun 25 16:15:03 2010 +0200 (2010-06-25)
changeset 37574 b8c1f4c46983
parent 37571 76e23303c7ff
child 37577 5379f41a1322
permissions -rw-r--r--
renamed "Sledgehammer_Fact_Preprocessor" to "Clausifier";
the new name reflects that it's not used only by Sledgehammer (but also by "meson" and "metis") and that it doesn't only clausify facts (but also goals)
blanchet@35827
     1
(*  Title:      HOL/Sledgehammer.thy
wenzelm@21254
     2
    Author:     Lawrence C Paulson
wenzelm@21254
     3
    Author:     Jia Meng, 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@35865
    13
  "~~/src/Tools/Metis/metis.ML"
blanchet@37574
    14
  ("Tools/Sledgehammer/clausifier.ML")
blanchet@37569
    15
  ("Tools/Sledgehammer/meson_tactic.ML")
blanchet@37571
    16
  ("Tools/Sledgehammer/sledgehammer_util.ML")
blanchet@37571
    17
  ("Tools/Sledgehammer/sledgehammer_fol_clause.ML")
blanchet@35825
    18
  ("Tools/Sledgehammer/sledgehammer_hol_clause.ML")
blanchet@35825
    19
  ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
blanchet@37509
    20
  ("Tools/Sledgehammer/sledgehammer_tptp_format.ML")
wenzelm@32327
    21
  ("Tools/ATP_Manager/atp_manager.ML")
blanchet@36377
    22
  ("Tools/ATP_Manager/atp_systems.ML")
blanchet@37571
    23
  ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
blanchet@36375
    24
  ("Tools/Sledgehammer/sledgehammer_fact_minimizer.ML")
blanchet@35866
    25
  ("Tools/Sledgehammer/sledgehammer_isar.ML")
blanchet@35825
    26
  ("Tools/Sledgehammer/metis_tactics.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@36569
    33
[no_atp]: "COMBI P \<equiv> P"
wenzelm@24819
    34
blanchet@36569
    35
definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
blanchet@36569
    36
[no_atp]: "COMBK P Q \<equiv> P"
wenzelm@21254
    37
blanchet@36569
    38
definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
blanchet@36569
    39
"COMBB P Q R \<equiv> P (Q R)"
wenzelm@21254
    40
blanchet@36569
    41
definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
blanchet@36569
    42
[no_atp]: "COMBC P Q R \<equiv> 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@36569
    45
[no_atp]: "COMBS P Q R \<equiv> P R (Q R)"
wenzelm@21254
    46
blanchet@36569
    47
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
blanchet@36569
    48
"fequal X Y \<equiv> (X = Y)"
wenzelm@21254
    49
blanchet@36569
    50
lemma fequal_imp_equal [no_atp]: "fequal X Y \<Longrightarrow> X = Y"
wenzelm@21254
    51
  by (simp add: fequal_def)
wenzelm@21254
    52
blanchet@36569
    53
lemma equal_imp_fequal [no_atp]: "X = Y \<Longrightarrow> fequal X Y"
wenzelm@21254
    54
  by (simp add: fequal_def)
wenzelm@21254
    55
paulson@24827
    56
text{*Theorems for translation to combinators*}
paulson@24827
    57
blanchet@36569
    58
lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
paulson@24827
    59
apply (rule eq_reflection)
paulson@24827
    60
apply (rule ext) 
paulson@24827
    61
apply (simp add: COMBS_def) 
paulson@24827
    62
done
paulson@24827
    63
blanchet@36569
    64
lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
paulson@24827
    65
apply (rule eq_reflection)
paulson@24827
    66
apply (rule ext) 
paulson@24827
    67
apply (simp add: COMBI_def) 
paulson@24827
    68
done
paulson@24827
    69
blanchet@36569
    70
lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
paulson@24827
    71
apply (rule eq_reflection)
paulson@24827
    72
apply (rule ext) 
paulson@24827
    73
apply (simp add: COMBK_def) 
paulson@24827
    74
done
paulson@24827
    75
blanchet@36569
    76
lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
paulson@24827
    77
apply (rule eq_reflection)
paulson@24827
    78
apply (rule ext) 
paulson@24827
    79
apply (simp add: COMBB_def) 
paulson@24827
    80
done
paulson@24827
    81
blanchet@36569
    82
lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
paulson@24827
    83
apply (rule eq_reflection)
paulson@24827
    84
apply (rule ext) 
paulson@24827
    85
apply (simp add: COMBC_def) 
paulson@24827
    86
done
paulson@24827
    87
blanchet@37574
    88
use "Tools/Sledgehammer/clausifier.ML"
blanchet@37574
    89
setup Clausifier.setup
blanchet@37569
    90
use "Tools/Sledgehammer/meson_tactic.ML"
blanchet@37569
    91
setup Meson_Tactic.setup
blanchet@37571
    92
blanchet@37571
    93
use "Tools/Sledgehammer/sledgehammer_util.ML"
blanchet@37571
    94
use "Tools/Sledgehammer/sledgehammer_fol_clause.ML"
blanchet@35825
    95
use "Tools/Sledgehammer/sledgehammer_hol_clause.ML"
blanchet@35825
    96
use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
blanchet@37509
    97
use "Tools/Sledgehammer/sledgehammer_tptp_format.ML"
blanchet@35867
    98
use "Tools/ATP_Manager/atp_manager.ML"
blanchet@36377
    99
use "Tools/ATP_Manager/atp_systems.ML"
blanchet@36376
   100
setup ATP_Systems.setup
blanchet@37571
   101
use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
blanchet@36375
   102
use "Tools/Sledgehammer/sledgehammer_fact_minimizer.ML"
blanchet@35866
   103
use "Tools/Sledgehammer/sledgehammer_isar.ML"
blanchet@35825
   104
use "Tools/Sledgehammer/metis_tactics.ML"
blanchet@35826
   105
setup Metis_Tactics.setup
wenzelm@23444
   106
wenzelm@21254
   107
end