src/Provers/clasimp.ML
changeset 18529 540da2415751
parent 18448 6e805f389355
child 18630 69fe387b3b6e
equal deleted inserted replaced
18528:85e7f80023fc 18529:540da2415751
    16   structure Blast: BLAST
    16   structure Blast: BLAST
    17   sharing type Classical.claset = Blast.claset
    17   sharing type Classical.claset = Blast.claset
    18   val notE: thm
    18   val notE: thm
    19   val iffD1: thm
    19   val iffD1: thm
    20   val iffD2: thm
    20   val iffD2: thm
    21   val cla_make_elim: thm -> thm
       
    22 end
    21 end
    23 
    22 
    24 signature CLASIMP =
    23 signature CLASIMP =
    25 sig
    24 sig
    26   include CLASIMP_DATA
    25   include CLASIMP_DATA
   138     val n = nprems_of th;
   137     val n = nprems_of th;
   139     val (elim, intro) = if n = 0 then decls1 else decls2;
   138     val (elim, intro) = if n = 0 then decls1 else decls2;
   140     val zero_rotate = zero_var_indexes o rotate_prems n;
   139     val zero_rotate = zero_var_indexes o rotate_prems n;
   141   in
   140   in
   142     (elim (intro (cs, [suffix_thm name "_iff2" (zero_rotate (th RS Data.iffD2))]),
   141     (elim (intro (cs, [suffix_thm name "_iff2" (zero_rotate (th RS Data.iffD2))]),
   143            [suffix_thm name "_iff1" (Data.cla_make_elim (zero_rotate (th RS Data.iffD1)))])
   142            [suffix_thm name "_iff1" (Tactic.make_elim (zero_rotate (th RS Data.iffD1)))])
   144       handle THM _ => (elim (cs, [suffix_thm name "_iff1" (zero_rotate (th RS Data.notE))])
   143       handle THM _ => (elim (cs, [suffix_thm name "_iff1" (zero_rotate (th RS Data.notE))])
   145         handle THM _ => intro (cs, [th])),
   144         handle THM _ => intro (cs, [th])),
   146      simp (ss, [th]))
   145      simp (ss, [th]))
   147   end;
   146   end;
   148 
   147 
   149 fun delIff delcs delss ((cs, ss), th) =
   148 fun delIff delcs delss ((cs, ss), th) =
   150   let val zero_rotate = zero_var_indexes o rotate_prems (nprems_of th) in
   149   let val zero_rotate = zero_var_indexes o rotate_prems (nprems_of th) in
   151     (delcs (cs, [zero_rotate (th RS Data.iffD2),
   150     (delcs (cs, [zero_rotate (th RS Data.iffD2),
   152         Data.cla_make_elim (zero_rotate (th RS Data.iffD1))])
   151         Tactic.make_elim (zero_rotate (th RS Data.iffD1))])
   153       handle THM _ => (delcs (cs, [zero_rotate (th RS Data.notE)])
   152       handle THM _ => (delcs (cs, [zero_rotate (th RS Data.notE)])
   154         handle THM _ => delcs (cs, [th])),
   153         handle THM _ => delcs (cs, [th])),
   155      delss (ss, [th]))
   154      delss (ss, [th]))
   156   end;
   155   end;
   157 
   156