src/HOL/ATP_Linkup.thy
author paulson
Thu Oct 04 12:32:58 2007 +0200 (2007-10-04)
changeset 24827 646bdc51eb7d
parent 24819 7d8e0a47392e
child 24943 5f5679e2ec2f
permissions -rw-r--r--
combinator translation
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
paulson@24742
    10
imports Divides Record Hilbert_Choice Presburger Relation_Power SAT Recdef Extraction 
paulson@24742
    11
   (*It must be a parent or a child of every other theory, to prevent theory-merge errors.*)
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@23444
    22
  "~~/src/Tools/Metis/metis.ML"
wenzelm@23444
    23
  ("Tools/metis_tools.ML")
wenzelm@21254
    24
begin
wenzelm@21254
    25
wenzelm@24819
    26
definition COMBI :: "'a => 'a"
wenzelm@24819
    27
  where "COMBI P == P"
wenzelm@24819
    28
wenzelm@24819
    29
definition COMBK :: "'a => 'b => 'a"
wenzelm@24819
    30
  where "COMBK P Q == P"
wenzelm@21254
    31
wenzelm@24819
    32
definition COMBB :: "('b => 'c) => ('a => 'b) => 'a => 'c"
wenzelm@24819
    33
  where "COMBB P Q R == P (Q R)"
wenzelm@21254
    34
wenzelm@24819
    35
definition COMBC :: "('a => 'b => 'c) => 'b => 'a => 'c"
wenzelm@24819
    36
  where "COMBC P Q R == P R Q"
wenzelm@21254
    37
wenzelm@24819
    38
definition COMBS :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"
wenzelm@24819
    39
  where "COMBS P Q R == P R (Q R)"
wenzelm@21254
    40
wenzelm@24819
    41
definition COMBB' :: "('a => 'c) => ('b => 'a) => ('d => 'b) => 'd => 'c"
wenzelm@24819
    42
  where "COMBB' M P Q R == M (P (Q R))"
wenzelm@21254
    43
wenzelm@24819
    44
definition COMBC' :: "('a => 'b => 'c) => ('d => 'a) => 'b => 'd => 'c"
wenzelm@24819
    45
  where "COMBC' M P Q R == M (P R) Q"
wenzelm@21254
    46
wenzelm@24819
    47
definition COMBS' :: "('a => 'b => 'c) => ('d => 'a) => ('d => 'b) => 'd => 'c"
wenzelm@24819
    48
  where "COMBS' M P Q R == M (P R) (Q R)"
wenzelm@21254
    49
wenzelm@24819
    50
definition fequal :: "'a => 'a => bool"
wenzelm@24819
    51
  where "fequal X Y == (X=Y)"
wenzelm@21254
    52
wenzelm@21254
    53
lemma fequal_imp_equal: "fequal X Y ==> X=Y"
wenzelm@21254
    54
  by (simp add: fequal_def)
wenzelm@21254
    55
wenzelm@21254
    56
lemma equal_imp_fequal: "X=Y ==> fequal X Y"
wenzelm@21254
    57
  by (simp add: fequal_def)
wenzelm@21254
    58
wenzelm@21254
    59
text{*These two represent the equivalence between Boolean equality and iff.
wenzelm@21254
    60
They can't be converted to clauses automatically, as the iff would be
wenzelm@21254
    61
expanded...*}
wenzelm@21254
    62
wenzelm@21254
    63
lemma iff_positive: "P | Q | P=Q"
wenzelm@21254
    64
by blast
wenzelm@21254
    65
wenzelm@21254
    66
lemma iff_negative: "~P | ~Q | P=Q"
wenzelm@21254
    67
by blast
wenzelm@21254
    68
paulson@24827
    69
text{*Theorems for translation to combinators*}
paulson@24827
    70
paulson@24827
    71
lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
paulson@24827
    72
apply (rule eq_reflection)
paulson@24827
    73
apply (rule ext) 
paulson@24827
    74
apply (simp add: COMBS_def) 
paulson@24827
    75
done
paulson@24827
    76
paulson@24827
    77
lemma abs_I: "(%x. x) == COMBI"
paulson@24827
    78
apply (rule eq_reflection)
paulson@24827
    79
apply (rule ext) 
paulson@24827
    80
apply (simp add: COMBI_def) 
paulson@24827
    81
done
paulson@24827
    82
paulson@24827
    83
lemma abs_K: "(%x. y) == COMBK y"
paulson@24827
    84
apply (rule eq_reflection)
paulson@24827
    85
apply (rule ext) 
paulson@24827
    86
apply (simp add: COMBK_def) 
paulson@24827
    87
done
paulson@24827
    88
paulson@24827
    89
lemma abs_B: "(%x. a (g x)) == COMBB a g"
paulson@24827
    90
apply (rule eq_reflection)
paulson@24827
    91
apply (rule ext) 
paulson@24827
    92
apply (simp add: COMBB_def) 
paulson@24827
    93
done
paulson@24827
    94
paulson@24827
    95
lemma abs_C: "(%x. (f x) b) == COMBC f b"
paulson@24827
    96
apply (rule eq_reflection)
paulson@24827
    97
apply (rule ext) 
paulson@24827
    98
apply (simp add: COMBC_def) 
paulson@24827
    99
done
paulson@24827
   100
paulson@24827
   101
paulson@21999
   102
use "Tools/res_axioms.ML"      --{*requires the combinators declared above*}
paulson@24827
   103
use "Tools/res_hol_clause.ML"
paulson@21999
   104
use "Tools/res_reconstruct.ML"
paulson@23519
   105
use "Tools/watcher.ML"
wenzelm@21254
   106
use "Tools/res_atp.ML"
wenzelm@21254
   107
wenzelm@21254
   108
setup ResAxioms.meson_method_setup
wenzelm@21254
   109
wenzelm@21254
   110
wenzelm@21254
   111
subsection {* Setup for Vampire, E prover and SPASS *}
wenzelm@21254
   112
wenzelm@21254
   113
use "Tools/res_atp_provers.ML"
wenzelm@21254
   114
wenzelm@21254
   115
oracle vampire_oracle ("string * int") = {* ResAtpProvers.vampire_o *}
wenzelm@21254
   116
oracle eprover_oracle ("string * int") = {* ResAtpProvers.eprover_o *}
wenzelm@21254
   117
oracle spass_oracle ("string * int") = {* ResAtpProvers.spass_o *}
wenzelm@21254
   118
wenzelm@21254
   119
use "Tools/res_atp_methods.ML"
paulson@24827
   120
setup ResAtpMethods.setup      --{*Oracle ATP methods: still useful?*}
paulson@24827
   121
setup ResAxioms.setup          --{*Sledgehammer*}
wenzelm@23444
   122
wenzelm@23444
   123
subsection {* The Metis prover *}
wenzelm@23444
   124
wenzelm@23444
   125
use "Tools/metis_tools.ML"
wenzelm@23444
   126
setup MetisTools.setup
wenzelm@23444
   127
paulson@24742
   128
setup {*
paulson@24742
   129
  Theory.at_end ResAxioms.clause_cache_endtheory
paulson@24742
   130
*}
paulson@24742
   131
wenzelm@21254
   132
end