equal
deleted
inserted
replaced
470 unfolding MACHIN_TAG_def by (simp add: arctan_double power2_eq_square) |
470 unfolding MACHIN_TAG_def by (simp add: arctan_double power2_eq_square) |
471 |
471 |
472 ML \<open> |
472 ML \<open> |
473 fun machin_term_conv ctxt ct = |
473 fun machin_term_conv ctxt ct = |
474 let |
474 let |
475 val ctxt' = ctxt addsimps @{thms arctan_double' arctan_add_small} |
475 val ctxt' = ctxt |> Simplifier.add_simps @{thms arctan_double' arctan_add_small} |
476 in |
476 in |
477 case Thm.term_of ct of |
477 case Thm.term_of ct of |
478 Const (\<^const_name>\<open>MACHIN_TAG\<close>, _) $ _ $ |
478 Const (\<^const_name>\<open>MACHIN_TAG\<close>, _) $ _ $ |
479 (Const (\<^const_name>\<open>Transcendental.arctan\<close>, _) $ _) => |
479 (Const (\<^const_name>\<open>Transcendental.arctan\<close>, _) $ _) => |
480 Simplifier.rewrite ctxt' ct |
480 Simplifier.rewrite ctxt' ct |
492 in |
492 in |
493 SELECT_GOAL ( |
493 SELECT_GOAL ( |
494 Local_Defs.unfold_tac ctxt |
494 Local_Defs.unfold_tac ctxt |
495 @{thms tag_machin[THEN eq_reflection] numeral_horner_MACHIN_TAG[THEN eq_reflection]} |
495 @{thms tag_machin[THEN eq_reflection] numeral_horner_MACHIN_TAG[THEN eq_reflection]} |
496 THEN REPEAT (CHANGED (HEADGOAL (CONVERSION conv)))) |
496 THEN REPEAT (CHANGED (HEADGOAL (CONVERSION conv)))) |
497 THEN' Simplifier.simp_tac (ctxt addsimps @{thms arctan_add_small arctan_diff_small}) |
497 THEN' Simplifier.simp_tac (ctxt |> Simplifier.add_simps @{thms arctan_add_small arctan_diff_small}) |
498 end |
498 end |
499 \<close> |
499 \<close> |
500 |
500 |
501 method_setup machin = \<open>Scan.succeed (SIMPLE_METHOD' o machin_tac)\<close> |
501 method_setup machin = \<open>Scan.succeed (SIMPLE_METHOD' o machin_tac)\<close> |
502 |
502 |