src/HOL/ATP_Linkup.thy
author wenzelm
Thu Dec 20 14:33:40 2007 +0100 (2007-12-20)
changeset 25728 71e33d95ac55
parent 25710 4cdf7de81e1b
child 25741 2d102ddaca8b
permissions -rw-r--r--
moved Pure/General/random_word.ML to Tools/random_word.ML;
wenzelm@21254
     1
(*  Title:      HOL/ATP_Linkup.thy
wenzelm@21254
     2
    ID:         $Id$
wenzelm@21254
     3
    Author:     Lawrence C Paulson
wenzelm@21254
     4
    Author:     Jia Meng, NICTA
wenzelm@21254
     5
*)
wenzelm@21254
     6
wenzelm@21254
     7
header{* The Isabelle-ATP Linkup *}
wenzelm@21254
     8
wenzelm@21254
     9
theory ATP_Linkup
haftmann@25591
    10
imports PreList Hilbert_Choice
wenzelm@25728
    11
   (*FIXME It must be a parent or a child of every other theory, to prevent theory-merge errors. FIXME*)
wenzelm@21254
    12
uses
wenzelm@21254
    13
  "Tools/polyhash.ML"
paulson@21977
    14
  "Tools/res_clause.ML"
wenzelm@21254
    15
  ("Tools/res_hol_clause.ML")
wenzelm@21254
    16
  ("Tools/res_axioms.ML")
paulson@21999
    17
  ("Tools/res_reconstruct.ML")
paulson@23519
    18
  ("Tools/watcher.ML")
wenzelm@21254
    19
  ("Tools/res_atp.ML")
wenzelm@21254
    20
  ("Tools/res_atp_provers.ML")
wenzelm@21254
    21
  ("Tools/res_atp_methods.ML")
wenzelm@25728
    22
  "~~/src/Tools/random_word.ML"
wenzelm@23444
    23
  "~~/src/Tools/Metis/metis.ML"
wenzelm@23444
    24
  ("Tools/metis_tools.ML")
wenzelm@21254
    25
begin
wenzelm@21254
    26
wenzelm@24819
    27
definition COMBI :: "'a => 'a"
wenzelm@24819
    28
  where "COMBI P == P"
wenzelm@24819
    29
wenzelm@24819
    30
definition COMBK :: "'a => 'b => 'a"
wenzelm@24819
    31
  where "COMBK P Q == P"
wenzelm@21254
    32
wenzelm@24819
    33
definition COMBB :: "('b => 'c) => ('a => 'b) => 'a => 'c"
wenzelm@24819
    34
  where "COMBB P Q R == P (Q R)"
wenzelm@21254
    35
wenzelm@24819
    36
definition COMBC :: "('a => 'b => 'c) => 'b => 'a => 'c"
wenzelm@24819
    37
  where "COMBC P Q R == P R Q"
wenzelm@21254
    38
wenzelm@24819
    39
definition COMBS :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"
wenzelm@24819
    40
  where "COMBS P Q R == P R (Q R)"
wenzelm@21254
    41
wenzelm@24819
    42
definition fequal :: "'a => 'a => bool"
wenzelm@24819
    43
  where "fequal X Y == (X=Y)"
wenzelm@21254
    44
wenzelm@21254
    45
lemma fequal_imp_equal: "fequal X Y ==> X=Y"
wenzelm@21254
    46
  by (simp add: fequal_def)
wenzelm@21254
    47
wenzelm@21254
    48
lemma equal_imp_fequal: "X=Y ==> fequal X Y"
wenzelm@21254
    49
  by (simp add: fequal_def)
wenzelm@21254
    50
wenzelm@21254
    51
text{*These two represent the equivalence between Boolean equality and iff.
wenzelm@21254
    52
They can't be converted to clauses automatically, as the iff would be
wenzelm@21254
    53
expanded...*}
wenzelm@21254
    54
wenzelm@21254
    55
lemma iff_positive: "P | Q | P=Q"
wenzelm@21254
    56
by blast
wenzelm@21254
    57
wenzelm@21254
    58
lemma iff_negative: "~P | ~Q | P=Q"
wenzelm@21254
    59
by blast
wenzelm@21254
    60
paulson@24827
    61
text{*Theorems for translation to combinators*}
paulson@24827
    62
paulson@24827
    63
lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
paulson@24827
    64
apply (rule eq_reflection)
paulson@24827
    65
apply (rule ext) 
paulson@24827
    66
apply (simp add: COMBS_def) 
paulson@24827
    67
done
paulson@24827
    68
paulson@24827
    69
lemma abs_I: "(%x. x) == COMBI"
paulson@24827
    70
apply (rule eq_reflection)
paulson@24827
    71
apply (rule ext) 
paulson@24827
    72
apply (simp add: COMBI_def) 
paulson@24827
    73
done
paulson@24827
    74
paulson@24827
    75
lemma abs_K: "(%x. y) == COMBK y"
paulson@24827
    76
apply (rule eq_reflection)
paulson@24827
    77
apply (rule ext) 
paulson@24827
    78
apply (simp add: COMBK_def) 
paulson@24827
    79
done
paulson@24827
    80
paulson@24827
    81
lemma abs_B: "(%x. a (g x)) == COMBB a g"
paulson@24827
    82
apply (rule eq_reflection)
paulson@24827
    83
apply (rule ext) 
paulson@24827
    84
apply (simp add: COMBB_def) 
paulson@24827
    85
done
paulson@24827
    86
paulson@24827
    87
lemma abs_C: "(%x. (f x) b) == COMBC f b"
paulson@24827
    88
apply (rule eq_reflection)
paulson@24827
    89
apply (rule ext) 
paulson@24827
    90
apply (simp add: COMBC_def) 
paulson@24827
    91
done
paulson@24827
    92
paulson@24827
    93
paulson@21999
    94
use "Tools/res_axioms.ML"      --{*requires the combinators declared above*}
paulson@24827
    95
use "Tools/res_hol_clause.ML"
paulson@21999
    96
use "Tools/res_reconstruct.ML"
paulson@23519
    97
use "Tools/watcher.ML"
wenzelm@21254
    98
use "Tools/res_atp.ML"
wenzelm@21254
    99
wenzelm@21254
   100
setup ResAxioms.meson_method_setup
wenzelm@21254
   101
wenzelm@21254
   102
wenzelm@21254
   103
subsection {* Setup for Vampire, E prover and SPASS *}
wenzelm@21254
   104
wenzelm@21254
   105
use "Tools/res_atp_provers.ML"
wenzelm@21254
   106
wenzelm@21254
   107
oracle vampire_oracle ("string * int") = {* ResAtpProvers.vampire_o *}
wenzelm@21254
   108
oracle eprover_oracle ("string * int") = {* ResAtpProvers.eprover_o *}
wenzelm@21254
   109
oracle spass_oracle ("string * int") = {* ResAtpProvers.spass_o *}
wenzelm@21254
   110
wenzelm@21254
   111
use "Tools/res_atp_methods.ML"
paulson@24827
   112
setup ResAtpMethods.setup      --{*Oracle ATP methods: still useful?*}
paulson@25710
   113
setup ResReconstruct.setup     --{*Config parameters*}
paulson@24827
   114
setup ResAxioms.setup          --{*Sledgehammer*}
wenzelm@23444
   115
wenzelm@23444
   116
subsection {* The Metis prover *}
wenzelm@23444
   117
wenzelm@23444
   118
use "Tools/metis_tools.ML"
wenzelm@23444
   119
setup MetisTools.setup
wenzelm@23444
   120
paulson@24742
   121
setup {*
paulson@24742
   122
  Theory.at_end ResAxioms.clause_cache_endtheory
paulson@24742
   123
*}
paulson@24742
   124
wenzelm@21254
   125
end