src/HOL/Tools/ATP/res_clasimpset.ML
author paulson
Tue, 28 Feb 2006 11:10:51 +0100
changeset 19156 bdaa8a980431
parent 19010 fef9e4881e83
child 19201 294448903a66
permissions -rw-r--r--
removal of theory blacklist
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16795
b400b53d8f7d relevance filtering is now optional
paulson
parents: 16741
diff changeset
     1
(*  ID:      $Id$
15789
4cb16144c81b added hearder lines and deleted some redundant material
paulson
parents: 15782
diff changeset
     2
    Author:     Claire Quigley
4cb16144c81b added hearder lines and deleted some redundant material
paulson
parents: 15782
diff changeset
     3
    Copyright   2004  University of Cambridge
4cb16144c81b added hearder lines and deleted some redundant material
paulson
parents: 15782
diff changeset
     4
*)
4cb16144c81b added hearder lines and deleted some redundant material
paulson
parents: 15782
diff changeset
     5
16156
2f6fc19aba1e Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents: 16061
diff changeset
     6
signature RES_CLASIMP = 
15919
b30a35432f5a Replaced reference to SPASS with general one - set SPASS_HOME in settings file.
quigley
parents: 15907
diff changeset
     7
  sig
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
     8
  val blacklist : string list ref (*Theorems forbidden in the output*)
16950
e7f0f41d513a Added flag ResClasimp.use_simpset to allow exclusion of simpset rules from ATP problem files
quigley
parents: 16906
diff changeset
     9
  val use_simpset: bool ref
17305
6cef3aedd661 axioms now included in tptp files, no /bin/cat and various tidying
paulson
parents: 17261
diff changeset
    10
  val get_clasimp_lemmas : 
18753
aa82bd41555d ResClasimp.get_clasimp_lemmas now takes all subgoals rather than only the first
paulson
parents: 18677
diff changeset
    11
         Proof.context -> term list -> 
17484
f6a225f97f0a simplification of the Isabelle-ATP code; hooks for batch generation of problems
paulson
parents: 17412
diff changeset
    12
         (ResClause.clause * thm) Array.array * ResClause.clause list 
15919
b30a35432f5a Replaced reference to SPASS with general one - set SPASS_HOME in settings file.
quigley
parents: 15907
diff changeset
    13
  end;
b30a35432f5a Replaced reference to SPASS with general one - set SPASS_HOME in settings file.
quigley
parents: 15907
diff changeset
    14
b30a35432f5a Replaced reference to SPASS with general one - set SPASS_HOME in settings file.
quigley
parents: 15907
diff changeset
    15
structure ResClasimp : RES_CLASIMP =
b30a35432f5a Replaced reference to SPASS with general one - set SPASS_HOME in settings file.
quigley
parents: 15907
diff changeset
    16
struct
17305
6cef3aedd661 axioms now included in tptp files, no /bin/cat and various tidying
paulson
parents: 17261
diff changeset
    17
val use_simpset = ref false;   (*Performance is much better without simprules*)
16957
8dcd14e8db7a nameless theorems: better names, flag to omit them
paulson
parents: 16956
diff changeset
    18
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    19
(*In general, these produce clauses that are prolific (match too many equality or
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    20
  membership literals) and relate to seldom-used facts. Some duplicate other rules.
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    21
  FIXME: this blacklist needs to be maintained using theory data and added to using
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    22
  an attribute.*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    23
val blacklist = ref
18985
bc23b1d1ddea blacklist tweaks
paulson
parents: 18869
diff changeset
    24
  ["Datatype.not_None_eq",    (*Says everything is None or Some. Probably prolific.*)
bc23b1d1ddea blacklist tweaks
paulson
parents: 18869
diff changeset
    25
   "Datatype.not_Some_eq_D",  (*Says everything is None or Some. Probably prolific.*)
bc23b1d1ddea blacklist tweaks
paulson
parents: 18869
diff changeset
    26
   "Datatype.not_Some_eq",    (*Says everything is None or Some. Probably prolific.*)
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    27
   "Datatype.option.size_1",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    28
   "Datatype.option.size_2",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    29
   "Datatype.prod.size",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    30
   "Datatype.sum.size_1",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    31
   "Datatype.sum.size_2",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    32
   "Datatype.unit.size",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    33
   "Divides.dvd_0_left_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    34
   "Finite_Set.card_0_eq",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    35
   "Finite_Set.card_infinite",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    36
   "Finite_Set.Max_ge",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    37
   "Finite_Set.Max_in",
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    38
   "Finite_Set.Max_le_iff",
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    39
   "Finite_Set.Max_less_iff",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    40
   "Finite_Set.max.f_below_strict_below.below_f_conv", (*duplicates in Orderings.*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    41
   "Finite_Set.max.f_below_strict_below.strict_below_f_conv", (*duplicates in Orderings.*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    42
   "Finite_Set.Min_ge_iff",
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    43
   "Finite_Set.Min_gr_iff",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    44
   "Finite_Set.Min_in",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    45
   "Finite_Set.Min_le",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    46
   "Finite_Set.min_max.below_inf_sup_Inf_Sup.inf_Sup_absorb", 
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    47
   "Finite_Set.min_max.below_inf_sup_Inf_Sup.sup_Inf_absorb", 
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    48
   "Finite_Set.min.f_below_strict_below.below_f_conv",        (*duplicates in Orderings.*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    49
   "Finite_Set.min.f_below_strict_below.strict_below_f_conv", (*duplicates in Orderings.*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    50
   "Infinite_Set.atmost_one_unique",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    51
   "IntArith.zabs_less_one_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    52
   "IntDef.Integ.Abs_Integ_inject",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    53
   "IntDef.Integ.Abs_Integ_inverse",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    54
   "IntDiv.zdvd_0_left",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    55
   "IntDiv.zero_less_zpower_abs_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    56
   "List.append_eq_append_conv",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    57
   "List.Cons_in_lex",
18985
bc23b1d1ddea blacklist tweaks
paulson
parents: 18869
diff changeset
    58
   "List.hd_Cons_tl",   (*Says everything is [] or Cons. Probably prolific.*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    59
   "List.in_listsD",
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    60
   "List.in_listsI",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    61
   "List.lists.Cons",
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
    62
   "List.listsE",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    63
   "List.take_eq_Nil",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    64
   "Nat.less_one",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    65
   "Nat.less_one", (*not directional? obscure*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    66
   "Nat.not_gr0",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    67
   "Nat.one_eq_mult_iff", (*duplicate by symmetry*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    68
   "NatArith.of_nat_0_eq_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    69
   "NatArith.of_nat_eq_0_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    70
   "NatArith.of_nat_le_0_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    71
   "NatSimprocs.divide_le_0_iff_number_of",  (*seldom used; often prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    72
   "NatSimprocs.divide_le_0_iff_number_of",  (*too many clauses*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    73
   "NatSimprocs.divide_less_0_iff_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    74
   "NatSimprocs.divide_less_0_iff_number_of",   (*too many clauses*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    75
   "NatSimprocs.equation_minus_iff_1",  (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    76
   "NatSimprocs.equation_minus_iff_number_of", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    77
   "NatSimprocs.le_minus_iff_1", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    78
   "NatSimprocs.le_minus_iff_number_of",  (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    79
   "NatSimprocs.less_minus_iff_1", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    80
   "NatSimprocs.less_minus_iff_number_of", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    81
   "NatSimprocs.minus_equation_iff_number_of", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    82
   "NatSimprocs.minus_le_iff_1", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    83
   "NatSimprocs.minus_le_iff_number_of", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    84
   "NatSimprocs.minus_less_iff_1", (*not directional*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    85
   "NatSimprocs.mult_le_cancel_left_number_of", (*excessive case analysis*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    86
   "NatSimprocs.mult_le_cancel_right_number_of", (*excessive case analysis*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    87
   "NatSimprocs.mult_less_cancel_left_number_of", (*excessive case analysis*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    88
   "NatSimprocs.mult_less_cancel_right_number_of", (*excessive case analysis*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    89
   "NatSimprocs.zero_le_divide_iff_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    90
   "NatSimprocs.zero_le_divide_iff_number_of", (*excessive case analysis*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    91
   "NatSimprocs.zero_less_divide_iff_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    92
   "NatSimprocs.zero_less_divide_iff_number_of", (*excessive case analysis*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    93
   "OrderedGroup.abs_0_eq",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    94
   "OrderedGroup.abs_0_eq", (*duplicate by symmetry*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    95
   "OrderedGroup.diff_eq_0_iff_eq", (*prolific?*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    96
   "OrderedGroup.join_0_eq_0",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    97
   "OrderedGroup.meet_0_eq_0",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    98
   "OrderedGroup.pprt_eq_0",   (*obscure*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
    99
   "OrderedGroup.pprt_eq_id",   (*obscure*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   100
   "OrderedGroup.pprt_mono",   (*obscure*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   101
   "Parity.even_nat_power",   (*obscure, somewhat prolilfic*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   102
   "Parity.power_eq_0_iff_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   103
   "Parity.power_eq_0_iff_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   104
   "Parity.power_le_zero_eq_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   105
   "Parity.power_le_zero_eq_number_of",   (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   106
   "Parity.power_less_zero_eq_number_of",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   107
   "Parity.zero_le_power_eq_number_of",   (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   108
   "Parity.zero_less_power_eq_number_of",   (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   109
   "Power.zero_less_power_abs_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   110
   "Relation.diagI",
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   111
   "Relation.ImageI",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   112
   "Ring_and_Field.divide_cancel_left", (*fields are seldom used & often prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   113
   "Ring_and_Field.divide_cancel_right",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   114
   "Ring_and_Field.divide_divide_eq_left",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   115
   "Ring_and_Field.divide_divide_eq_right",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   116
   "Ring_and_Field.divide_eq_0_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   117
   "Ring_and_Field.divide_eq_1_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   118
   "Ring_and_Field.divide_eq_eq_1",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   119
   "Ring_and_Field.divide_le_0_1_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   120
   "Ring_and_Field.divide_le_eq_1_neg",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   121
   "Ring_and_Field.divide_le_eq_1_neg",  (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   122
   "Ring_and_Field.divide_le_eq_1_pos",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   123
   "Ring_and_Field.divide_le_eq_1_pos",  (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   124
   "Ring_and_Field.divide_less_0_1_iff",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   125
   "Ring_and_Field.divide_less_eq_1_neg",  (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   126
   "Ring_and_Field.divide_less_eq_1_pos",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   127
   "Ring_and_Field.divide_less_eq_1_pos",  (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   128
   "Ring_and_Field.eq_divide_eq_1",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   129
   "Ring_and_Field.eq_divide_eq_1", (*duplicate by symmetry*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   130
   "Ring_and_Field.field_mult_cancel_left",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   131
   "Ring_and_Field.field_mult_cancel_right",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   132
   "Ring_and_Field.inverse_le_iff_le_neg",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   133
   "Ring_and_Field.inverse_le_iff_le",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   134
   "Ring_and_Field.inverse_less_iff_less_neg",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   135
   "Ring_and_Field.inverse_less_iff_less",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   136
   "Ring_and_Field.le_divide_eq_1_neg",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   137
   "Ring_and_Field.le_divide_eq_1_neg", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   138
   "Ring_and_Field.le_divide_eq_1_pos",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   139
   "Ring_and_Field.le_divide_eq_1_pos", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   140
   "Ring_and_Field.less_divide_eq_1_neg",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   141
   "Ring_and_Field.less_divide_eq_1_neg", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   142
   "Ring_and_Field.less_divide_eq_1_pos",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   143
   "Ring_and_Field.less_divide_eq_1_pos", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   144
   "Ring_and_Field.one_eq_divide_iff",  (*duplicate by symmetry*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   145
   "Set.Diff_eq_empty_iff", (*redundant with paramodulation*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   146
   "Set.Diff_insert0",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   147
   "Set.disjoint_insert_1",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   148
   "Set.disjoint_insert_2",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   149
   "Set.empty_Union_conv", (*redundant with paramodulation*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   150
   "Set.insert_disjoint_1",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   151
   "Set.insert_disjoint_2",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   152
   "Set.Int_UNIV", (*redundant with paramodulation*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   153
   "Set.Inter_iff",              (*We already have InterI, InterE*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   154
   "Set.Inter_UNIV_conv_1",
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   155
   "Set.Inter_UNIV_conv_2",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   156
   "Set.psubsetE",    (*too prolific and obscure*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   157
   "Set.psubsetI",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   158
   "Set.singleton_insert_inj_eq'",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   159
   "Set.singleton_insert_inj_eq",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   160
   "Set.singletonD",  (*these two duplicate some "insert" lemmas*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   161
   "Set.singletonI",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   162
   "Set.Un_empty", (*redundant with paramodulation*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   163
   "Set.Union_empty_conv", (*redundant with paramodulation*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   164
   "Set.Union_iff",              (*We already have UnionI, UnionE*)
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   165
   "SetInterval.atLeastAtMost_iff", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   166
   "SetInterval.atLeastLessThan_iff", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   167
   "SetInterval.greaterThanAtMost_iff", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   168
   "SetInterval.greaterThanLessThan_iff", (*obscure and prolific*)
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   169
   "SetInterval.ivl_subset", (*excessive case analysis*)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   170
   "Sum_Type.InlI",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   171
   "Sum_Type.InrI"];
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   172
   
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   173
(*These might be prolific but are probably OK, and min and max are basic.
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   174
   "Orderings.max_less_iff_conj", 
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   175
   "Orderings.min_less_iff_conj",
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   176
   "Orderings.min_max.below_inf.below_inf_conv",
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   177
   "Orderings.min_max.below_sup.above_sup_conv",
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   178
Very prolific and somewhat obscure:
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   179
   "Set.InterD",
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   180
   "Set.UnionI",
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   181
*)
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   182
16956
5b413c866593 invents theorem names; also patches write_out_clasimp
paulson
parents: 16950
diff changeset
   183
(*The "name" of a theorem is its statement, if nothing else is available.*)
5b413c866593 invents theorem names; also patches write_out_clasimp
paulson
parents: 16950
diff changeset
   184
val plain_string_of_thm =
5b413c866593 invents theorem names; also patches write_out_clasimp
paulson
parents: 16950
diff changeset
   185
    setmp show_question_marks false 
5b413c866593 invents theorem names; also patches write_out_clasimp
paulson
parents: 16950
diff changeset
   186
      (setmp print_mode [] 
5b413c866593 invents theorem names; also patches write_out_clasimp
paulson
parents: 16950
diff changeset
   187
	(Pretty.setmp_margin 999 string_of_thm));
16957
8dcd14e8db7a nameless theorems: better names, flag to omit them
paulson
parents: 16956
diff changeset
   188
	
17828
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   189
(*Returns the first substring enclosed in quotation marks, typically omitting 
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   190
  the [.] of meta-level assumptions.*)
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   191
val firstquoted = hd o (String.tokens (fn c => c = #"\""))
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   192
	
16957
8dcd14e8db7a nameless theorems: better names, flag to omit them
paulson
parents: 16956
diff changeset
   193
fun fake_thm_name th = 
17828
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   194
    Context.theory_name (theory_of_thm th) ^ "." ^ firstquoted (plain_string_of_thm th);
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   195
17828
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   196
fun put_name_pair ("",th) = (fake_thm_name th, th)
16956
5b413c866593 invents theorem names; also patches write_out_clasimp
paulson
parents: 16950
diff changeset
   197
  | put_name_pair (a,th)  = (a,th);
16039
dfe264950511 Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents: 15956
diff changeset
   198
18677
01265301db7f blacklist experiments
paulson
parents: 18509
diff changeset
   199
(*Hashing to detect duplicate and variant clauses, e.g. from the [iff] attribute*)
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   200
18449
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   201
exception HASH_CLAUSE and HASH_STRING;
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   202
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   203
(*Catches (for deletion) theorems automatically generated from other theorems*)
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   204
fun insert_suffixed_names ht x = 
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   205
     (Polyhash.insert ht (x^"_iff1", ()); 
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   206
      Polyhash.insert ht (x^"_iff2", ()); 
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   207
      Polyhash.insert ht (x^"_dest", ())); 
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   208
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   209
fun make_banned_test xs = 
18449
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   210
  let val ht = Polyhash.mkTable (Polyhash.hash_string, op =)
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   211
                                (6000, HASH_STRING)
19156
bdaa8a980431 removal of theory blacklist
paulson
parents: 19010
diff changeset
   212
      fun banned s = isSome (Polyhash.peek ht s)
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   213
  in  app (fn x => Polyhash.insert ht (x,())) (!blacklist);
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   214
      app (insert_suffixed_names ht) (!blacklist @ xs); 
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   215
      banned
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   216
  end;
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   217
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   218
(*Create a hash table for clauses, of the given size*)
18449
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   219
fun mk_clause_table n =
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   220
      Polyhash.mkTable (ResClause.hash_clause, ResClause.clause_eq)
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   221
                       (n, HASH_CLAUSE);
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   222
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   223
(*Use a hash table to eliminate duplicates from xs*)
18449
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   224
fun make_unique ht xs = 
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   225
      (app (ignore o Polyhash.peekInsert ht) xs;  Polyhash.listItems ht);
16950
e7f0f41d513a Added flag ResClasimp.use_simpset to allow exclusion of simpset rules from ATP problem files
quigley
parents: 16906
diff changeset
   226
19156
bdaa8a980431 removal of theory blacklist
paulson
parents: 19010
diff changeset
   227
(*Write out the claset and simpset rules of the supplied theory.*)
18753
aa82bd41555d ResClasimp.get_clasimp_lemmas now takes all subgoals rather than only the first
paulson
parents: 18677
diff changeset
   228
fun get_clasimp_lemmas ctxt goals = 
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   229
  let val claset_thms =
18792
fb427f4a01f2 Changed codes that call relevance filter.
mengj
parents: 18753
diff changeset
   230
	  map put_name_pair (ResAxioms.claset_rules_of_ctxt ctxt)
18449
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   231
      val simpset_thms = 
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   232
	    if !use_simpset then 
18792
fb427f4a01f2 Changed codes that call relevance filter.
mengj
parents: 18753
diff changeset
   233
		map put_name_pair (ResAxioms.simpset_rules_of_ctxt ctxt)
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   234
	    else []
18509
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   235
      val banned = make_banned_test (map #1 (claset_thms@simpset_thms))
d2d96f12a1fc blacklist of prolific theorems (must be replaced by an attribute later
paulson
parents: 18449
diff changeset
   236
      fun ok (a,_) = not (banned a)
18449
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   237
      val claset_cls_thms = ResAxioms.clausify_rules_pairs (filter ok claset_thms)
e314fb38307d new hash table module in HOL/Too/s
paulson
parents: 18420
diff changeset
   238
      val simpset_cls_thms = ResAxioms.clausify_rules_pairs (filter ok simpset_thms)
18797
8559cc115673 tidying
paulson
parents: 18792
diff changeset
   239
      val cls_thms_list = make_unique (mk_clause_table 2200) 
18420
9470061ab283 hashing to eliminate the output of duplicate clauses
paulson
parents: 18144
diff changeset
   240
                                      (List.concat (simpset_cls_thms@claset_cls_thms))
19156
bdaa8a980431 removal of theory blacklist
paulson
parents: 19010
diff changeset
   241
      val relevant_cls_thms_list =
bdaa8a980431 removal of theory blacklist
paulson
parents: 19010
diff changeset
   242
          ReduceAxiomsN.relevance_filter (ProofContext.theory_of ctxt) cls_thms_list goals
17828
c82fb51ee18d simplifying the treatment of nameless theorems
paulson
parents: 17764
diff changeset
   243
  in  (* create array of put clausename, number pairs into it *)
18869
00741f7280f7 removal of ResClause.num_of_clauses and other simplifications
paulson
parents: 18797
diff changeset
   244
      (Array.fromList relevant_cls_thms_list, map #1 (relevant_cls_thms_list))
16061
8a139c1557bf A new structure and reduced indentation
paulson
parents: 16039
diff changeset
   245
  end;
15643
5829f30fc20a *** empty log message ***
quigley
parents:
diff changeset
   246
16950
e7f0f41d513a Added flag ResClasimp.use_simpset to allow exclusion of simpset rules from ATP problem files
quigley
parents: 16906
diff changeset
   247
15919
b30a35432f5a Replaced reference to SPASS with general one - set SPASS_HOME in settings file.
quigley
parents: 15907
diff changeset
   248
end;
16039
dfe264950511 Moved some of the clausify functions from ATP/res_clasimpset.ML to res_axioms.ML.
quigley
parents: 15956
diff changeset
   249
16156
2f6fc19aba1e Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents: 16061
diff changeset
   250
2f6fc19aba1e Fixed array containing clasimpset rules. Added flags to turn on and off reconstruction and full spass
quigley
parents: 16061
diff changeset
   251