src/HOL/ATP_Linkup.thy
author haftmann
Mon, 09 Mar 2009 09:34:39 +0100
changeset 30378 e0247e990702
parent 29654 24e73987bfe2
child 31037 ac8669134e7a
permissions -rw-r--r--
dropped eq_pred
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/ATP_Linkup.thy
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     2
    Author:     Lawrence C Paulson
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     3
    Author:     Jia Meng, NICTA
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
     4
    Author:     Fabian Immler, TUM
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     5
*)
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     6
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
     7
header {* The Isabelle-ATP Linkup *}
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     8
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     9
theory ATP_Linkup
29654
24e73987bfe2 Plain, Main form meeting points in import hierarchy
haftmann
parents: 29611
diff changeset
    10
imports Divides Record Hilbert_Choice Plain
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    11
uses
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    12
  "Tools/polyhash.ML"
21977
7f7177a95189 first version of structured proof reconstruction
paulson
parents: 21453
diff changeset
    13
  "Tools/res_clause.ML"
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
    14
  ("Tools/res_axioms.ML")
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    15
  ("Tools/res_hol_clause.ML")
21999
0cf192e489e2 improvements to proof reconstruction. Some files loaded in a different order
paulson
parents: 21977
diff changeset
    16
  ("Tools/res_reconstruct.ML")
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    17
  ("Tools/res_atp.ML")
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
    18
  ("Tools/atp_manager.ML")
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
    19
  ("Tools/atp_wrapper.ML")
23444
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
    20
  "~~/src/Tools/Metis/metis.ML"
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
    21
  ("Tools/metis_tools.ML")
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    22
begin
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    23
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    24
definition COMBI :: "'a => 'a"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    25
  where "COMBI P == P"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    26
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    27
definition COMBK :: "'a => 'b => 'a"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    28
  where "COMBK P Q == P"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    29
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    30
definition COMBB :: "('b => 'c) => ('a => 'b) => 'a => 'c"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    31
  where "COMBB P Q R == P (Q R)"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    32
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    33
definition COMBC :: "('a => 'b => 'c) => 'b => 'a => 'c"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    34
  where "COMBC P Q R == P R Q"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    35
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    36
definition COMBS :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    37
  where "COMBS P Q R == P R (Q R)"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    38
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    39
definition fequal :: "'a => 'a => bool"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    40
  where "fequal X Y == (X=Y)"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    41
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    42
lemma fequal_imp_equal: "fequal X Y ==> X=Y"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    43
  by (simp add: fequal_def)
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    44
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    45
lemma equal_imp_fequal: "X=Y ==> fequal X Y"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    46
  by (simp add: fequal_def)
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    47
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    48
text{*These two represent the equivalence between Boolean equality and iff.
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    49
They can't be converted to clauses automatically, as the iff would be
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    50
expanded...*}
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    51
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    52
lemma iff_positive: "P | Q | P=Q"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    53
by blast
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    54
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    55
lemma iff_negative: "~P | ~Q | P=Q"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    56
by blast
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    57
24827
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    58
text{*Theorems for translation to combinators*}
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    59
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    60
lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    61
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    62
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    63
apply (simp add: COMBS_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    64
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    65
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    66
lemma abs_I: "(%x. x) == COMBI"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    67
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    68
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    69
apply (simp add: COMBI_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    70
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    71
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    72
lemma abs_K: "(%x. y) == COMBK y"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    73
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    74
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    75
apply (simp add: COMBK_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    76
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    77
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    78
lemma abs_B: "(%x. a (g x)) == COMBB a g"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    79
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    80
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    81
apply (simp add: COMBB_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    82
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    83
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    84
lemma abs_C: "(%x. (f x) b) == COMBC f b"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    85
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    86
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    87
apply (simp add: COMBC_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    88
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    89
27368
9f90ac19e32b established Plain theory and image
haftmann
parents: 27182
diff changeset
    90
28585
be3c44ac3e86 tuned comments;
wenzelm
parents: 28573
diff changeset
    91
subsection {* Setup of external ATPs *}
27368
9f90ac19e32b established Plain theory and image
haftmann
parents: 27182
diff changeset
    92
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
    93
use "Tools/res_axioms.ML" setup ResAxioms.setup
24827
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    94
use "Tools/res_hol_clause.ML"
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
    95
use "Tools/res_reconstruct.ML" setup ResReconstruct.setup
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    96
use "Tools/res_atp.ML"
28573
6403f0e16269 ** Update from Fabian **
wenzelm
parents: 28483
diff changeset
    97
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
    98
use "Tools/atp_manager.ML"
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
    99
use "Tools/atp_wrapper.ML"
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   100
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   101
text {* basic provers *}
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
   102
setup {* AtpManager.add_prover "spass" AtpWrapper.spass *}
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
   103
setup {* AtpManager.add_prover "vampire" AtpWrapper.vampire *}
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
   104
setup {* AtpManager.add_prover "e" AtpWrapper.eprover *}
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   105
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   106
text {* provers with stuctured output *}
28592
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
   107
setup {* AtpManager.add_prover "vampire_full" AtpWrapper.vampire_full *}
824f8390aaa2 renamed AtpThread to AtpWrapper;
wenzelm
parents: 28585
diff changeset
   108
setup {* AtpManager.add_prover "e_full" AtpWrapper.eprover_full *}
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   109
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   110
text {* on some problems better results *}
28594
ed3351ff3f1b tuned AtpWrapper interfaces;
wenzelm
parents: 28592
diff changeset
   111
setup {* AtpManager.add_prover "spass_no_tc" (AtpWrapper.spass_opts 40 false) *}
27182
9e4475b9d58c tuned setup;
wenzelm
parents: 26729
diff changeset
   112
28573
6403f0e16269 ** Update from Fabian **
wenzelm
parents: 28483
diff changeset
   113
text {* remote provers via SystemOnTPTP *}
29590
479a2fce65e6 modified remote script;
immler@in.tum.de
parents: 29588
diff changeset
   114
setup {* AtpManager.add_prover "remote_vampire"
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   115
  (AtpWrapper.remote_prover "-s Vampire---9.0") *}
29587
96599d8d8268 simplified usage of remote-script; added compatible remote-atps
immler@in.tum.de
parents: 28594
diff changeset
   116
setup {* AtpManager.add_prover "remote_spass"
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   117
  (AtpWrapper.remote_prover "-s SPASS---3.01") *}
29587
96599d8d8268 simplified usage of remote-script; added compatible remote-atps
immler@in.tum.de
parents: 28594
diff changeset
   118
setup {* AtpManager.add_prover "remote_e"
29593
7b73bd578db2 pass timeout to prover;
immler@in.tum.de
parents: 29590
diff changeset
   119
  (AtpWrapper.remote_prover "-s EP---1.0") *}
29587
96599d8d8268 simplified usage of remote-script; added compatible remote-atps
immler@in.tum.de
parents: 28594
diff changeset
   120
  
28573
6403f0e16269 ** Update from Fabian **
wenzelm
parents: 28483
diff changeset
   121
23444
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   122
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   123
subsection {* The Metis prover *}
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   124
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   125
use "Tools/metis_tools.ML"
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   126
setup MetisTools.setup
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   127
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
   128
end