equal
deleted
inserted
replaced
7197 NONE => NONE |
7197 NONE => NONE |
7198 | SOME m => |
7198 | SOME m => |
7199 SOME (Thm.instantiate' [] (map (SOME o Thm.cterm_of ctxt o HOLogic.mk_numeral) [m, n]) |
7199 SOME (Thm.instantiate' [] (map (SOME o Thm.cterm_of ctxt o HOLogic.mk_numeral) [m, n]) |
7200 @{thm sqrt_numeral_simproc_aux}) |
7200 @{thm sqrt_numeral_simproc_aux}) |
7201 end |
7201 end |
|
7202 handle TERM _ => NONE |
7202 |
7203 |
7203 fun root_simproc (threshold1, threshold2) ctxt ct = |
7204 fun root_simproc (threshold1, threshold2) ctxt ct = |
7204 let |
7205 let |
7205 val [n, x] = |
7206 val [n, x] = |
7206 ct |> Thm.term_of |> strip_comb |> snd |> map (dest_comb #> snd #> HOLogic.dest_numeral) |
7207 ct |> Thm.term_of |> strip_comb |> snd |> map (dest_comb #> snd #> HOLogic.dest_numeral) |
7210 NONE => NONE |
7211 NONE => NONE |
7211 | SOME m => |
7212 | SOME m => |
7212 SOME (Thm.instantiate' [] (map (SOME o Thm.cterm_of ctxt o HOLogic.mk_numeral) [m, n, x]) |
7213 SOME (Thm.instantiate' [] (map (SOME o Thm.cterm_of ctxt o HOLogic.mk_numeral) [m, n, x]) |
7213 @{thm root_numeral_simproc_aux}) |
7214 @{thm root_numeral_simproc_aux}) |
7214 end |
7215 end |
|
7216 handle TERM _ => NONE |
|
7217 | Match => NONE |
7215 |
7218 |
7216 fun powr_simproc (threshold1, threshold2) ctxt ct = |
7219 fun powr_simproc (threshold1, threshold2) ctxt ct = |
7217 let |
7220 let |
7218 val eq_thm = Conv.try_conv (Conv.rewr_conv @{thm numeral_powr_inverse_eq}) ct |
7221 val eq_thm = Conv.try_conv (Conv.rewr_conv @{thm numeral_powr_inverse_eq}) ct |
7219 val ct = Thm.dest_equals_rhs (Thm.cprop_of eq_thm) |
7222 val ct = Thm.dest_equals_rhs (Thm.cprop_of eq_thm) |
7231 @{thm powr_numeral_simproc_aux} |
7234 @{thm powr_numeral_simproc_aux} |
7232 in |
7235 in |
7233 SOME (@{thm transitive} OF [eq_thm, thm]) |
7236 SOME (@{thm transitive} OF [eq_thm, thm]) |
7234 end |
7237 end |
7235 end |
7238 end |
|
7239 handle TERM _ => NONE |
|
7240 | Match => NONE |
7236 |
7241 |
7237 end |
7242 end |
7238 \<close> |
7243 \<close> |
7239 |
7244 |
7240 end |
7245 end |