src/Provers/clasimp.ML
author obua
Thu, 16 Feb 2006 04:17:19 +0100
changeset 19067 c0321d7d6b3d
parent 18728 6790126ab5f6
child 21646 c07b5b0e8492
permissions -rw-r--r--
variable counter is now also cached
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
     1
(*  Title:      Provers/clasimp.ML
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
     2
    ID:         $Id$
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
     3
    Author:     David von Oheimb, TU Muenchen
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
     4
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
     5
Combination of classical reasoner and simplifier (depends on
16019
0e1405402d53 Simplifier already setup in Pure;
wenzelm
parents: 15570
diff changeset
     6
splitter.ML, classical.ML, blast.ML).
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
     7
*)
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
     8
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
     9
infix 4 addSIs2 addSEs2 addSDs2 addIs2 addEs2 addDs2 addsimps2 delsimps2
13603
57f364d1d3b2 Introduced addss', which adds asm_lr_simp_tac as a wrapper to the claset.
berghofe
parents: 13026
diff changeset
    10
  addSss addss addss' addIffs delIffs;
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    11
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    12
signature CLASIMP_DATA =
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    13
sig
8469
482c301041b4 include Splitter.split_modifiers;
wenzelm
parents: 8168
diff changeset
    14
  structure Splitter: SPLITTER
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    15
  structure Classical: CLASSICAL
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    16
  structure Blast: BLAST
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    17
  sharing type Classical.claset = Blast.claset
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    18
  val notE: thm
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    19
  val iffD1: thm
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    20
  val iffD2: thm
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    21
end
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    22
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    23
signature CLASIMP =
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    24
sig
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    25
  include CLASIMP_DATA
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    26
  type claset
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    27
  type clasimpset
17879
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    28
  val change_clasimpset: (clasimpset -> clasimpset) -> unit
10317
3205fe2f4ef5 added clasimpset: unit -> clasimpset;
wenzelm
parents: 10036
diff changeset
    29
  val clasimpset: unit -> clasimpset
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    30
  val addSIs2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    31
  val addSEs2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    32
  val addSDs2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    33
  val addIs2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    34
  val addEs2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    35
  val addDs2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    36
  val addsimps2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    37
  val delsimps2: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    38
  val addSss: claset * simpset -> claset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    39
  val addss: claset * simpset -> claset
13603
57f364d1d3b2 Introduced addss', which adds asm_lr_simp_tac as a wrapper to the claset.
berghofe
parents: 13026
diff changeset
    40
  val addss': claset * simpset -> claset
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    41
  val addIffs: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    42
  val delIffs: clasimpset * thm list -> clasimpset
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    43
  val AddIffs: thm list -> unit
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    44
  val DelIffs: thm list -> unit
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    45
  val CLASIMPSET: (clasimpset -> tactic) -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    46
  val CLASIMPSET': (clasimpset -> 'a -> tactic) -> 'a -> tactic
5483
2fc3f4450fe8 added clarsimp_tac and Clarsimp_tac
oheimb
parents: 5219
diff changeset
    47
  val clarsimp_tac: clasimpset -> int -> tactic
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    48
  val Clarsimp_tac: int -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    49
  val mk_auto_tac: clasimpset -> int -> int -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    50
  val auto_tac: clasimpset -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    51
  val Auto_tac: tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    52
  val auto: unit -> unit
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    53
  val force_tac: clasimpset  -> int -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    54
  val Force_tac: int -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    55
  val force: int -> unit
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    56
  val fast_simp_tac: clasimpset -> int -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    57
  val slow_simp_tac: clasimpset -> int -> tactic
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    58
  val best_simp_tac: clasimpset -> int -> tactic
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
    59
  val attrib: (clasimpset * thm list -> clasimpset) -> attribute
9506
e5857656b8f0 export get_local_clasimpset, clasimp_modifiers;
wenzelm
parents: 9440
diff changeset
    60
  val get_local_clasimpset: Proof.context -> clasimpset
15032
02aed07e01bf local_cla/simpset_of;
wenzelm
parents: 14981
diff changeset
    61
  val local_clasimpset_of: Proof.context -> clasimpset
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
    62
  val iff_add: attribute
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
    63
  val iff_add': attribute
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
    64
  val iff_del: attribute
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
    65
  val iff_modifiers: (Args.T list -> (Method.modifier * Args.T list)) list
9506
e5857656b8f0 export get_local_clasimpset, clasimp_modifiers;
wenzelm
parents: 9440
diff changeset
    66
  val clasimp_modifiers: (Args.T list -> (Method.modifier * Args.T list)) list
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18688
diff changeset
    67
  val setup: theory -> theory
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    68
end;
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    69
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    70
functor ClasimpFun(Data: CLASIMP_DATA): CLASIMP =
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    71
struct
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
    72
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    73
open Data;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    74
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    75
type claset = Classical.claset;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    76
type clasimpset = claset * simpset;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    77
17879
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    78
fun change_clasimpset_of thy f =
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    79
  let val (cs', ss') = f (Classical.get_claset thy, Simplifier.get_simpset thy) in
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    80
    Classical.change_claset_of thy (fn _ => cs');
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    81
    Simplifier.change_simpset_of thy (fn _ => ss')
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    82
  end;
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    83
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
    84
fun change_clasimpset f = change_clasimpset_of (Context.the_context ()) f;
10317
3205fe2f4ef5 added clasimpset: unit -> clasimpset;
wenzelm
parents: 10036
diff changeset
    85
fun clasimpset () = (Classical.claset (), Simplifier.simpset ());
3205fe2f4ef5 added clasimpset: unit -> clasimpset;
wenzelm
parents: 10036
diff changeset
    86
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    87
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    88
(* clasimpset operations *)
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    89
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    90
(*this interface for updating a clasimpset is rudimentary and just for
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    91
  convenience for the most common cases*)
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    92
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    93
fun pair_upd1 f ((a,b),x) = (f(a,x), b);
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    94
fun pair_upd2 f ((a,b),x) = (a, f(b,x));
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    95
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    96
fun op addSIs2   arg = pair_upd1 Classical.addSIs arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    97
fun op addSEs2   arg = pair_upd1 Classical.addSEs arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    98
fun op addSDs2   arg = pair_upd1 Classical.addSDs arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
    99
fun op addIs2    arg = pair_upd1 Classical.addIs arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   100
fun op addEs2    arg = pair_upd1 Classical.addEs arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   101
fun op addDs2    arg = pair_upd1 Classical.addDs arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   102
fun op addsimps2 arg = pair_upd2 Simplifier.addsimps arg;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   103
fun op delsimps2 arg = pair_upd2 Simplifier.delsimps arg;
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   104
9402
480a1b40fdd6 strengthened force_tac by using new first_best_tac
oheimb
parents: 8639
diff changeset
   105
(*not totally safe: may instantiate unknowns that appear also in other subgoals*)
480a1b40fdd6 strengthened force_tac by using new first_best_tac
oheimb
parents: 8639
diff changeset
   106
val safe_asm_full_simp_tac = Simplifier.generic_simp_tac true (true,true,true);
480a1b40fdd6 strengthened force_tac by using new first_best_tac
oheimb
parents: 8639
diff changeset
   107
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   108
(*Add a simpset to a classical set!*)
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   109
(*Caution: only one simpset added can be added by each of addSss and addss*)
11181
d04f57b91166 renamed addaltern to addafter, addSaltern to addSafter
oheimb
parents: 10821
diff changeset
   110
fun cs addSss ss = Classical.addSafter (cs, ("safe_asm_full_simp_tac",
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   111
                            CHANGED o safe_asm_full_simp_tac ss));
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   112
fun cs addss  ss = Classical.addbefore  (cs, ("asm_full_simp_tac",
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   113
                            CHANGED o Simplifier.asm_full_simp_tac ss));
13603
57f364d1d3b2 Introduced addss', which adds asm_lr_simp_tac as a wrapper to the claset.
berghofe
parents: 13026
diff changeset
   114
fun cs addss' ss = Classical.addbefore  (cs, ("asm_full_simp_tac",
57f364d1d3b2 Introduced addss', which adds asm_lr_simp_tac as a wrapper to the claset.
berghofe
parents: 13026
diff changeset
   115
                            CHANGED o Simplifier.asm_lr_simp_tac ss));
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   116
17084
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   117
(*Attach a suffix, provided we have a name to start with.*)
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   118
fun suffix_thm "" _ th = th
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   119
  | suffix_thm a b th = Thm.name_thm (a^b, th);
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   120
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   121
(* iffs: addition of rules to simpsets and clasets simultaneously *)
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   122
11344
57b7ad51971c streamlined addIffs/delIffs, added warnings
oheimb
parents: 11181
diff changeset
   123
(*Takes (possibly conditional) theorems of the form A<->B to
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   124
        the Safe Intr     rule B==>A and
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   125
        the Safe Destruct rule A==>B.
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   126
  Also ~A goes to the Safe Elim rule A ==> ?R
11462
cf3e7f5ad0e1 removed the warning from [iff]
paulson
parents: 11344
diff changeset
   127
  Failing other cases, A is added as a Safe Intr rule*)
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   128
local
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   129
13026
e45ebbb2e18e iff: conditional rules declared as ``unsafe'';
wenzelm
parents: 12375
diff changeset
   130
fun addIff decls1 decls2 simp ((cs, ss), th) =
e45ebbb2e18e iff: conditional rules declared as ``unsafe'';
wenzelm
parents: 12375
diff changeset
   131
  let
17084
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   132
    val name = Thm.name_of_thm th;
13026
e45ebbb2e18e iff: conditional rules declared as ``unsafe'';
wenzelm
parents: 12375
diff changeset
   133
    val n = nprems_of th;
17084
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   134
    val (elim, intro) = if n = 0 then decls1 else decls2;
13026
e45ebbb2e18e iff: conditional rules declared as ``unsafe'';
wenzelm
parents: 12375
diff changeset
   135
    val zero_rotate = zero_var_indexes o rotate_prems n;
e45ebbb2e18e iff: conditional rules declared as ``unsafe'';
wenzelm
parents: 12375
diff changeset
   136
  in
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   137
    (elim (intro (cs, [suffix_thm name "_iff2" (zero_rotate (th RS iffD2))]),
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   138
           [suffix_thm name "_iff1" (Tactic.make_elim (zero_rotate (th RS iffD1)))])
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   139
      handle THM _ => (elim (cs, [suffix_thm name "_iff1" (zero_rotate (th RS notE))])
11902
db207d68392c iff: always rotate prems;
wenzelm
parents: 11496
diff changeset
   140
        handle THM _ => intro (cs, [th])),
db207d68392c iff: always rotate prems;
wenzelm
parents: 11496
diff changeset
   141
     simp (ss, [th]))
db207d68392c iff: always rotate prems;
wenzelm
parents: 11496
diff changeset
   142
  end;
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   143
12375
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   144
fun delIff delcs delss ((cs, ss), th) =
11902
db207d68392c iff: always rotate prems;
wenzelm
parents: 11496
diff changeset
   145
  let val zero_rotate = zero_var_indexes o rotate_prems (nprems_of th) in
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   146
    (delcs (cs, [zero_rotate (th RS iffD2),
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   147
        Tactic.make_elim (zero_rotate (th RS iffD1))])
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   148
      handle THM _ => (delcs (cs, [zero_rotate (th RS notE)])
12375
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   149
        handle THM _ => delcs (cs, [th])),
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   150
     delss (ss, [th]))
11902
db207d68392c iff: always rotate prems;
wenzelm
parents: 11496
diff changeset
   151
  end;
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   152
18630
69fe387b3b6e generic attributes;
wenzelm
parents: 18529
diff changeset
   153
fun modifier att (x, ths) =
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
   154
  fst (foldl_map (Library.apply [att]) (x, rev ths));
18630
69fe387b3b6e generic attributes;
wenzelm
parents: 18529
diff changeset
   155
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   156
val addXIs = modifier (ContextRules.intro_query NONE);
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   157
val addXEs = modifier (ContextRules.elim_query NONE);
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   158
val addXDs = modifier (ContextRules.dest_query NONE);
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   159
val delXs = modifier ContextRules.rule_del;
18630
69fe387b3b6e generic attributes;
wenzelm
parents: 18529
diff changeset
   160
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   161
in
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   162
10033
fc4e7432b2b1 added iff_add_global', iff_add_local' (syntax "iff?");
wenzelm
parents: 9952
diff changeset
   163
val op addIffs =
17084
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   164
  Library.foldl 
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   165
      (addIff (Classical.addSEs, Classical.addSIs)
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   166
              (Classical.addEs, Classical.addIs) 
fb0a80aef0be classical rules must have names for ATP integration
paulson
parents: 16019
diff changeset
   167
              Simplifier.addsimps);
15570
8d8c70b41bab Move towards standard functions.
skalberg
parents: 15531
diff changeset
   168
val op delIffs = Library.foldl (delIff Classical.delrules Simplifier.delsimps);
10033
fc4e7432b2b1 added iff_add_global', iff_add_local' (syntax "iff?");
wenzelm
parents: 9952
diff changeset
   169
17879
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
   170
fun AddIffs thms = change_clasimpset (fn css => css addIffs thms);
88844eea4ce2 functor: no Simplifier argument;
wenzelm
parents: 17084
diff changeset
   171
fun DelIffs thms = change_clasimpset (fn css => css delIffs thms);
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   172
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   173
fun addIffs_generic (x, ths) =
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   174
  Library.foldl (addIff (addXEs, addXIs) (addXEs, addXIs) #1) ((x, ()), ths) |> #1;
12375
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   175
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   176
fun delIffs_generic (x, ths) =
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   177
  Library.foldl (delIff delXs #1) ((x, ()), ths) |> #1;
12375
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   178
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   179
end;
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   180
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   181
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   182
(* tacticals *)
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   183
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   184
fun CLASIMPSET tacf state =
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   185
  Classical.CLASET (fn cs => Simplifier.SIMPSET (fn ss => tacf (cs, ss))) state;
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   186
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   187
fun CLASIMPSET' tacf i state =
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   188
  Classical.CLASET (fn cs => Simplifier.SIMPSET (fn ss => tacf (cs, ss) i)) state;
4888
7301ff9f412b added CLASIMPSET(') tacticals;
wenzelm
parents: 4884
diff changeset
   189
7301ff9f412b added CLASIMPSET(') tacticals;
wenzelm
parents: 4884
diff changeset
   190
12375
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   191
fun clarsimp_tac (cs, ss) =
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   192
  safe_asm_full_simp_tac ss THEN_ALL_NEW
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   193
  Classical.clarify_tac (cs addSss ss);
539a32568db3 iff?: refer to Pure/ContextRules;
wenzelm
parents: 11902
diff changeset
   194
10317
3205fe2f4ef5 added clasimpset: unit -> clasimpset;
wenzelm
parents: 10036
diff changeset
   195
fun Clarsimp_tac i = clarsimp_tac (clasimpset ()) i;
5483
2fc3f4450fe8 added clarsimp_tac and Clarsimp_tac
oheimb
parents: 5219
diff changeset
   196
2fc3f4450fe8 added clarsimp_tac and Clarsimp_tac
oheimb
parents: 5219
diff changeset
   197
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   198
(* auto_tac *)
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   199
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   200
fun blast_depth_tac cs m i thm =
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   201
    Blast.depth_tac cs m i thm
5554
3cae5d6510c2 removed addcongs2 and delcongs2
oheimb
parents: 5525
diff changeset
   202
      handle Blast.TRANS s => (warning ("Blast_tac: " ^ s); Seq.empty);
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   203
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   204
(* a variant of depth_tac that avoids interference of the simplifier
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   205
   with dup_step_tac when they are combined by auto_tac *)
5756
8ef5288c24b0 corrected auto_tac (applications of unsafe wrappers)
oheimb
parents: 5567
diff changeset
   206
local
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   207
fun slow_step_tac' cs = Classical.appWrappers cs
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   208
        (Classical.instp_step_tac cs APPEND' Classical.haz_step_tac cs);
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   209
in fun nodup_depth_tac cs m i state = SELECT_GOAL
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   210
   (Classical.safe_steps_tac cs 1 THEN_ELSE
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   211
        (DEPTH_SOLVE (nodup_depth_tac cs m 1),
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   212
         Classical.inst0_step_tac cs 1 APPEND COND (K (m=0)) no_tac
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   213
             (slow_step_tac' cs 1 THEN DEPTH_SOLVE (nodup_depth_tac cs (m-1) 1))
5756
8ef5288c24b0 corrected auto_tac (applications of unsafe wrappers)
oheimb
parents: 5567
diff changeset
   214
        )) i state;
8ef5288c24b0 corrected auto_tac (applications of unsafe wrappers)
oheimb
parents: 5567
diff changeset
   215
end;
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   216
9402
480a1b40fdd6 strengthened force_tac by using new first_best_tac
oheimb
parents: 8639
diff changeset
   217
(*Designed to be idempotent, except if blast_depth_tac instantiates variables
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   218
  in some of the subgoals*)
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   219
fun mk_auto_tac (cs, ss) m n =
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   220
    let val cs' = cs addss ss
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   221
        val maintac =
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   222
          blast_depth_tac cs m               (* fast but can't use wrappers *)
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   223
          ORELSE'
5756
8ef5288c24b0 corrected auto_tac (applications of unsafe wrappers)
oheimb
parents: 5567
diff changeset
   224
          (CHANGED o nodup_depth_tac cs' n); (* slower but more general *)
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   225
    in  EVERY [ALLGOALS (Simplifier.asm_full_simp_tac ss),
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   226
               TRY (Classical.safe_tac cs),
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   227
               REPEAT (FIRSTGOAL maintac),
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   228
               TRY (Classical.safe_tac (cs addSss ss)),
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   229
               prune_params_tac]
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   230
    end;
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   231
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   232
fun auto_tac css = mk_auto_tac css 4 2;
10317
3205fe2f4ef5 added clasimpset: unit -> clasimpset;
wenzelm
parents: 10036
diff changeset
   233
fun Auto_tac st = auto_tac (clasimpset ()) st;
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   234
fun auto () = by Auto_tac;
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   235
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   236
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   237
(* force_tac *)
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   238
4659
a78ecc7341e3 added smart_tac
oheimb
parents: 4652
diff changeset
   239
(* aimed to solve the given subgoal totally, using whatever tools possible *)
4717
1370ad043564 renamed smart_tac to force_tac, slight improvement of force_tac
oheimb
parents: 4659
diff changeset
   240
fun force_tac (cs,ss) = let val cs' = cs addss ss in SELECT_GOAL (EVERY [
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   241
        Classical.clarify_tac cs' 1,
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   242
        IF_UNSOLVED (Simplifier.asm_full_simp_tac ss 1),
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   243
        ALLGOALS (Classical.first_best_tac cs')]) end;
10317
3205fe2f4ef5 added clasimpset: unit -> clasimpset;
wenzelm
parents: 10036
diff changeset
   244
fun Force_tac i = force_tac (clasimpset ()) i;
4717
1370ad043564 renamed smart_tac to force_tac, slight improvement of force_tac
oheimb
parents: 4659
diff changeset
   245
fun force i = by (Force_tac i);
4659
a78ecc7341e3 added smart_tac
oheimb
parents: 4652
diff changeset
   246
5219
924359415f09 functorized Clasimp module;
wenzelm
parents: 4888
diff changeset
   247
9805
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   248
(* basic combinations *)
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   249
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   250
fun ADDSS tac (cs, ss) = let val cs' = cs addss ss in tac cs' end;
9591
590d36e059d1 added "fastsimp";
wenzelm
parents: 9506
diff changeset
   251
9805
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   252
val fast_simp_tac = ADDSS Classical.fast_tac;
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   253
val slow_simp_tac = ADDSS Classical.slow_tac;
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   254
val best_simp_tac = ADDSS Classical.best_tac;
9591
590d36e059d1 added "fastsimp";
wenzelm
parents: 9506
diff changeset
   255
590d36e059d1 added "fastsimp";
wenzelm
parents: 9506
diff changeset
   256
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   257
(* access clasimpset *)
8639
31bcb6b64d60 added change_global/local_css;
wenzelm
parents: 8469
diff changeset
   258
7153
wenzelm
parents: 7132
diff changeset
   259
fun get_local_clasimpset ctxt =
wenzelm
parents: 7132
diff changeset
   260
  (Classical.get_local_claset ctxt, Simplifier.get_local_simpset ctxt);
5926
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   261
15032
02aed07e01bf local_cla/simpset_of;
wenzelm
parents: 14981
diff changeset
   262
fun local_clasimpset_of ctxt =
02aed07e01bf local_cla/simpset_of;
wenzelm
parents: 14981
diff changeset
   263
  (Classical.local_claset_of ctxt, Simplifier.local_simpset_of ctxt);
02aed07e01bf local_cla/simpset_of;
wenzelm
parents: 14981
diff changeset
   264
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   265
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   266
(* attributes *)
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   267
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
   268
fun attrib f = Thm.declaration_attribute (fn th =>
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   269
 fn Context.Theory thy => (change_clasimpset_of thy (fn css => f (css, [th])); Context.Theory thy)
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   270
  | Context.Proof ctxt =>
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   271
      let
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   272
        val cs = Classical.get_local_claset ctxt;
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   273
        val ss = Simplifier.get_local_simpset ctxt;
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   274
        val (cs', ss') = f ((cs, ss), [th]);
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   275
        val ctxt' =
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   276
          ctxt
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   277
          |> Classical.put_local_claset cs'
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   278
          |> Simplifier.put_local_simpset ss';
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   279
      in Context.Proof ctxt' end);
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   280
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   281
fun attrib' f (x, th) = (f (x, [th]), th);
10033
fc4e7432b2b1 added iff_add_global', iff_add_local' (syntax "iff?");
wenzelm
parents: 9952
diff changeset
   282
18688
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   283
val iff_add = attrib (op addIffs);
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   284
val iff_add' = attrib' addIffs_generic;
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   285
val iff_del = attrib (op delIffs) o attrib' delIffs_generic;
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   286
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   287
val iff_att = Attrib.syntax (Scan.lift
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   288
 (Args.del >> K iff_del ||
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   289
  Scan.option Args.add -- Args.query >> K iff_add' ||
abf0f018b5ec generic attributes;
wenzelm
parents: 18630
diff changeset
   290
  Scan.option Args.add >> K iff_add));
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   291
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   292
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   293
(* method modifiers *)
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   294
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   295
val iffN = "iff";
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   296
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   297
val iff_modifiers =
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
   298
 [Args.$$$ iffN -- Scan.option Args.add -- Args.colon >> K ((I, iff_add): Method.modifier),
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
   299
  Args.$$$ iffN -- Scan.option Args.add -- Args.query_colon >> K (I, iff_add'),
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
   300
  Args.$$$ iffN -- Args.del -- Args.colon >> K (I, iff_del)];
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   301
8469
482c301041b4 include Splitter.split_modifiers;
wenzelm
parents: 8168
diff changeset
   302
val clasimp_modifiers =
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   303
  Simplifier.simp_modifiers @ Splitter.split_modifiers @
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   304
  Classical.cla_modifiers @ iff_modifiers;
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   305
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   306
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   307
(* methods *)
5926
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   308
7559
1d2c099e98f7 setup for refined facts handling;
wenzelm
parents: 7437
diff changeset
   309
fun clasimp_meth tac prems ctxt = Method.METHOD (fn facts =>
15032
02aed07e01bf local_cla/simpset_of;
wenzelm
parents: 14981
diff changeset
   310
  ALLGOALS (Method.insert_tac (prems @ facts)) THEN tac (local_clasimpset_of ctxt));
7132
5c31d06ead04 eliminated METHOD0 in favour of same_tac;
wenzelm
parents: 5985
diff changeset
   311
7559
1d2c099e98f7 setup for refined facts handling;
wenzelm
parents: 7437
diff changeset
   312
fun clasimp_meth' tac prems ctxt = Method.METHOD (fn facts =>
15032
02aed07e01bf local_cla/simpset_of;
wenzelm
parents: 14981
diff changeset
   313
  HEADGOAL (Method.insert_tac (prems @ facts) THEN' tac (local_clasimpset_of ctxt)));
5926
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   314
7559
1d2c099e98f7 setup for refined facts handling;
wenzelm
parents: 7437
diff changeset
   315
val clasimp_method = Method.bang_sectioned_args clasimp_modifiers o clasimp_meth;
1d2c099e98f7 setup for refined facts handling;
wenzelm
parents: 7437
diff changeset
   316
val clasimp_method' = Method.bang_sectioned_args clasimp_modifiers o clasimp_meth';
5926
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   317
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   318
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   319
fun auto_args m =
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   320
  Method.bang_sectioned_args' clasimp_modifiers (Scan.lift (Scan.option (Args.nat -- Args.nat))) m;
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   321
15531
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15032
diff changeset
   322
fun auto_meth NONE = clasimp_meth (CHANGED_PROP o auto_tac)
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15032
diff changeset
   323
  | auto_meth (SOME (m, n)) = clasimp_meth (CHANGED_PROP o (fn css => mk_auto_tac css m n));
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   324
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   325
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   326
(* theory setup *)
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   327
5926
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   328
val setup =
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18688
diff changeset
   329
 (Attrib.add_attributes
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
   330
   [("iff", iff_att, "declaration of Simplifier / Classical rules")] #>
9860
5c5efed691b9 added 'iff' declarations;
wenzelm
parents: 9805
diff changeset
   331
  Method.add_methods
9591
590d36e059d1 added "fastsimp";
wenzelm
parents: 9506
diff changeset
   332
   [("fastsimp", clasimp_method' fast_simp_tac, "combined fast and simp"),
9805
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   333
    ("slowsimp", clasimp_method' slow_simp_tac, "combined slow and simp"),
10b617bdd028 added "slowsimp", "bestsimp";
wenzelm
parents: 9772
diff changeset
   334
    ("bestsimp", clasimp_method' best_simp_tac, "combined best and simp"),
9591
590d36e059d1 added "fastsimp";
wenzelm
parents: 9506
diff changeset
   335
    ("force", clasimp_method' force_tac, "force"),
9772
c07777210a69 auto method: opt args;
wenzelm
parents: 9591
diff changeset
   336
    ("auto", auto_args auto_meth, "auto"),
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18688
diff changeset
   337
    ("clarsimp", clasimp_method' (CHANGED_PROP oo clarsimp_tac), "clarify simplified goal")]);
5926
58f9ca06b76b method setup;
wenzelm
parents: 5756
diff changeset
   338
4652
d24cca140eeb factored out common code of HOL/simpdata.ML and FOL/simpdata.ML concerning
oheimb
parents:
diff changeset
   339
end;