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 |