equal
deleted
inserted
replaced
456 |
456 |
457 (* Fragile: it's a cong if it is not "R y x ==> cut f R x y = f y" *) |
457 (* Fragile: it's a cong if it is not "R y x ==> cut f R x y = f y" *) |
458 fun is_cong thm = |
458 fun is_cong thm = |
459 case (Thm.prop_of thm) |
459 case (Thm.prop_of thm) |
460 of (Const("==>",_)$(Const("Trueprop",_)$ _) $ |
460 of (Const("==>",_)$(Const("Trueprop",_)$ _) $ |
461 (Const("==",_) $ (Const ("Wellfounded_Recursion.cut",_) $ f $ R $ a $ x) $ _)) => false |
461 (Const("==",_) $ (Const (@{const_name "Wellfounded.cut"},_) $ f $ R $ a $ x) $ _)) => false |
462 | _ => true; |
462 | _ => true; |
463 |
463 |
464 |
464 |
465 fun dest_equal(Const ("==",_) $ |
465 fun dest_equal(Const ("==",_) $ |
466 (Const ("Trueprop",_) $ lhs) |
466 (Const ("Trueprop",_) $ lhs) |
659 val eq = Logic.strip_imp_concl tm |
659 val eq = Logic.strip_imp_concl tm |
660 in (ants,get_lhs eq) |
660 in (ants,get_lhs eq) |
661 end; |
661 end; |
662 |
662 |
663 fun restricted t = isSome (S.find_term |
663 fun restricted t = isSome (S.find_term |
664 (fn (Const("Wellfounded_Recursion.cut",_)) =>true | _ => false) |
664 (fn (Const(@{const_name "Wellfounded.cut"},_)) =>true | _ => false) |
665 t) |
665 t) |
666 |
666 |
667 fun CONTEXT_REWRITE_RULE (func, G, cut_lemma, congs) th = |
667 fun CONTEXT_REWRITE_RULE (func, G, cut_lemma, congs) th = |
668 let val globals = func::G |
668 let val globals = func::G |
669 val ss0 = Simplifier.theory_context (Thm.theory_of_thm th) empty_ss |
669 val ss0 = Simplifier.theory_context (Thm.theory_of_thm th) empty_ss |