src/Provers/simplifier.ML
author clasohm
Tue, 24 Oct 1995 14:45:35 +0100
changeset 1294 1358dc040edb
parent 1260 c76ac4a9dc2b
child 1512 ce37c64244c0
permissions -rw-r--r--
added calls of init_html and make_chart; added usage of qed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
     1
(*  Title:      Provers/simplifier.ML
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     2
    ID:         $Id$
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     3
    Author:     Tobias Nipkow
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     4
    Copyright   1993  TU Munich
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     5
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     6
Generic simplifier, suitable for most logics.
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     7
 
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
     8
*)
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
     9
983
6f80fed73e29 Precedence of infixes is now 4 (just above that of :=)
lcp
parents: 433
diff changeset
    10
infix 4 addsimps addeqcongs delsimps
6f80fed73e29 Precedence of infixes is now 4 (just above that of :=)
lcp
parents: 433
diff changeset
    11
        setsolver setloop setmksimps setsubgoaler;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
signature SIMPLIFIER =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
sig
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
  type simpset
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
    16
  val addeqcongs: simpset * thm list -> simpset
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
  val addsimps: simpset * thm list -> simpset
88
9df4dfedee01 added infix delsimps
nipkow
parents: 17
diff changeset
    18
  val delsimps: simpset * thm list -> simpset
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
  val asm_full_simp_tac: simpset -> int -> tactic
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
  val asm_simp_tac: simpset -> int -> tactic
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
  val empty_ss: simpset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
  val merge_ss: simpset * simpset -> simpset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
  val prems_of_ss: simpset -> thm list
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
  val rep_ss: simpset -> {simps: thm list, congs: thm list}
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
  val setsolver: simpset * (thm list -> int -> tactic) -> simpset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
  val setloop: simpset * (int -> tactic) -> simpset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
  val setmksimps: simpset * (thm -> thm list) -> simpset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
  val setsubgoaler: simpset * (simpset -> int -> tactic) -> simpset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
  val simp_tac: simpset -> int -> tactic
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    30
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    31
  val simpset: simpset ref
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    32
  val Addsimps: thm list -> unit
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    33
  val Delsimps: thm list -> unit
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    34
  val Simp_tac: int -> tactic
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    35
  val Asm_simp_tac: int -> tactic
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    36
  val Asm_full_simp_tac: int -> tactic
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    39
functor SimplifierFun():SIMPLIFIER =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
datatype simpset =
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    43
  Simpset of {mss: meta_simpset,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    44
              simps: thm list,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    45
              congs: thm list,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    46
              subgoal_tac: simpset -> int -> tactic,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    47
              finish_tac: thm list -> int -> tactic,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    48
              loop_tac: int -> tactic};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
val empty_ss =
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    51
  Simpset{mss=empty_mss,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    52
          simps= [],
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    53
          congs= [],
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    54
          subgoal_tac= K(K no_tac),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    55
          finish_tac= K(K no_tac),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    56
          loop_tac= K no_tac};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
    58
val simpset = ref empty_ss;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    60
fun (Simpset{mss,simps,congs,subgoal_tac,finish_tac,...}) setloop loop_tac =
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    61
  Simpset{mss=mss,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    62
          simps= simps,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    63
          congs= congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    64
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    65
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    66
          loop_tac= DETERM o loop_tac};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    68
fun (Simpset{mss,simps,congs,subgoal_tac,loop_tac,...}) setsolver finish_tac =
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    69
  Simpset{mss=mss,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    70
          simps= simps,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    71
          congs= congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    72
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    73
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    74
          loop_tac=loop_tac};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    76
fun (Simpset{mss,simps,congs,finish_tac,loop_tac,...}) setsubgoaler
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    77
    subgoal_tac =
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    78
  Simpset{mss=mss,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    79
          simps= simps,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    80
          congs= congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    81
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    82
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    83
          loop_tac=loop_tac};
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    84
     
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    85
fun (Simpset{mss,simps,congs,subgoal_tac,finish_tac,loop_tac}) setmksimps
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    86
    mk_simps =
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    87
  Simpset{mss=Thm.set_mk_rews(mss,mk_simps),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    88
          simps= simps,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    89
          congs= congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    90
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    91
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    92
          loop_tac=loop_tac};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    94
fun (Simpset{mss,simps,congs,subgoal_tac,finish_tac,loop_tac}) addsimps rews =
88
9df4dfedee01 added infix delsimps
nipkow
parents: 17
diff changeset
    95
  let val rews' = flat(map (Thm.mk_rews_of_mss mss) rews) in
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    96
  Simpset{mss= Thm.add_simps(mss,rews'),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    97
          simps= rews' @ simps,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    98
          congs= congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
    99
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   100
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   101
          loop_tac=loop_tac}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   104
fun Addsimps rews = (simpset := !simpset addsimps rews);
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   105
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   106
fun (Simpset{mss,simps,congs,subgoal_tac,finish_tac,loop_tac}) delsimps rews =
88
9df4dfedee01 added infix delsimps
nipkow
parents: 17
diff changeset
   107
  let val rews' = flat(map (Thm.mk_rews_of_mss mss) rews) in
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   108
  Simpset{mss= Thm.del_simps(mss,rews'),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   109
          simps= foldl (gen_rem eq_thm) (simps,rews'),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   110
          congs= congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   111
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   112
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   113
          loop_tac=loop_tac}
88
9df4dfedee01 added infix delsimps
nipkow
parents: 17
diff changeset
   114
  end;
9df4dfedee01 added infix delsimps
nipkow
parents: 17
diff changeset
   115
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   116
fun Delsimps rews = (simpset := !simpset delsimps rews);
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   117
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   118
fun (Simpset{mss,simps,congs,subgoal_tac,finish_tac,loop_tac}) addeqcongs
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   119
    newcongs =
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   120
  Simpset{mss= Thm.add_congs(mss,newcongs),
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   121
          simps= simps,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   122
          congs= newcongs @ congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   123
          subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   124
          finish_tac=finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   125
          loop_tac=loop_tac};
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   126
     
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   127
fun merge_ss(Simpset{mss,simps,congs,subgoal_tac,finish_tac,loop_tac},
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   128
             Simpset{simps=simps2,congs=congs2,...}) =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
  let val simps' = gen_union eq_thm (simps,simps2)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
      val congs' = gen_union eq_thm (congs,congs2)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
      val mss' = Thm.set_mk_rews(empty_mss,Thm.mk_rews_of_mss mss)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
      val mss' = Thm.add_simps(mss',simps')
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
      val mss' = Thm.add_congs(mss',congs')
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   134
  in Simpset{mss=         mss',
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   135
             simps=       simps',
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   136
             congs=       congs',
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   137
             subgoal_tac= subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   138
             finish_tac=  finish_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   139
             loop_tac=    loop_tac}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   142
fun prems_of_ss(Simpset{mss,...}) = prems_of_mss mss;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   144
fun rep_ss(Simpset{simps,congs,...}) = {simps=simps,congs=congs};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   146
fun NEWSUBGOALS tac tacf =
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   147
  STATE(fn state0 =>
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   148
    tac THEN STATE(fn state1 => tacf(nprems_of state1 - nprems_of state0)));
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   149
217
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   150
fun gen_simp_tac mode =
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   151
  fn (Simpset{mss,simps,congs,subgoal_tac,finish_tac,loop_tac}) =>
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
  let fun solve_all_tac mss =
1260
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   153
        let val ss = Simpset{mss=mss,simps=simps,congs=congs,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   154
                             subgoal_tac=subgoal_tac,
c76ac4a9dc2b renamed SS to Simpset; fixed bug in merge_ss
clasohm
parents: 1243
diff changeset
   155
                             finish_tac=finish_tac, loop_tac=loop_tac}
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   156
            val solve1_tac =
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   157
              NEWSUBGOALS (subgoal_tac ss 1)
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   158
                          (fn n => if n<0 then all_tac else no_tac)
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   159
        in DEPTH_SOLVE(solve1_tac) end
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
      fun simp_loop i thm =
217
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   162
        tapply(asm_rewrite_goal_tac mode solve_all_tac mss i THEN
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   163
               (finish_tac (prems_of_mss mss) i  ORELSE  looper i),
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
               thm)
1
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   165
      and allsimp i n = EVERY(map (fn j => simp_loop_tac (i+j)) (n downto 0))
c6a6e3db5353 changed addcongs to addeqcongs in simplifier.ML
nipkow
parents: 0
diff changeset
   166
      and looper i = TRY(NEWSUBGOALS (loop_tac i) (allsimp i))
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
      and simp_loop_tac i = Tactic(simp_loop i)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
217
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   169
  in simp_loop_tac end;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
217
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   171
val asm_full_simp_tac = gen_simp_tac (true,true);
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   172
val asm_simp_tac = gen_simp_tac (false,true);
c972c57e7762 got rid of METAHYPS due to the change of the basic simplification routines
nipkow
parents: 146
diff changeset
   173
val simp_tac = gen_simp_tac (false,false);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   175
fun Asm_full_simp_tac i = asm_full_simp_tac (!simpset) i;
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   176
fun Asm_simp_tac i = asm_simp_tac (!simpset) i;
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   177
fun Simp_tac i = simp_tac (!simpset) i;
406
4d4e0442b106 simpset is hidden in a functor now.
nipkow
parents: 217
diff changeset
   178
1243
fa09705a5890 added global simpset
clasohm
parents: 983
diff changeset
   179
end;