451 |
451 |
452 |
452 |
453 (* Fragile: it's a cong if it is not "R y x ==> cut f R x y = f y" *) |
453 (* Fragile: it's a cong if it is not "R y x ==> cut f R x y = f y" *) |
454 fun is_cong thm = |
454 fun is_cong thm = |
455 case (Thm.prop_of thm) |
455 case (Thm.prop_of thm) |
456 of (Const("==>",_)$(Const("Trueprop",_)$ _) $ |
456 of (Const("==>",_)$(Const(@{const_name "Trueprop"},_)$ _) $ |
457 (Const("==",_) $ (Const (@{const_name Recdef.cut},_) $ f $ R $ a $ x) $ _)) => false |
457 (Const("==",_) $ (Const (@{const_name Recdef.cut},_) $ f $ R $ a $ x) $ _)) => false |
458 | _ => true; |
458 | _ => true; |
459 |
459 |
460 |
460 |
461 fun dest_equal(Const ("==",_) $ |
461 fun dest_equal(Const ("==",_) $ |
462 (Const ("Trueprop",_) $ lhs) |
462 (Const (@{const_name "Trueprop"},_) $ lhs) |
463 $ (Const ("Trueprop",_) $ rhs)) = {lhs=lhs, rhs=rhs} |
463 $ (Const (@{const_name "Trueprop"},_) $ rhs)) = {lhs=lhs, rhs=rhs} |
464 | dest_equal(Const ("==",_) $ lhs $ rhs) = {lhs=lhs, rhs=rhs} |
464 | dest_equal(Const ("==",_) $ lhs $ rhs) = {lhs=lhs, rhs=rhs} |
465 | dest_equal tm = S.dest_eq tm; |
465 | dest_equal tm = S.dest_eq tm; |
466 |
466 |
467 fun get_lhs tm = #lhs(dest_equal (HOLogic.dest_Trueprop tm)); |
467 fun get_lhs tm = #lhs(dest_equal (HOLogic.dest_Trueprop tm)); |
468 |
468 |
757 fun restrict_prover ss thm = |
757 fun restrict_prover ss thm = |
758 let val dummy = say "restrict_prover:" |
758 let val dummy = say "restrict_prover:" |
759 val cntxt = rev(Simplifier.prems_of_ss ss) |
759 val cntxt = rev(Simplifier.prems_of_ss ss) |
760 val dummy = print_thms "cntxt:" cntxt |
760 val dummy = print_thms "cntxt:" cntxt |
761 val thy = Thm.theory_of_thm thm |
761 val thy = Thm.theory_of_thm thm |
762 val Const("==>",_) $ (Const("Trueprop",_) $ A) $ _ = Thm.prop_of thm |
762 val Const("==>",_) $ (Const(@{const_name "Trueprop"},_) $ A) $ _ = Thm.prop_of thm |
763 fun genl tm = let val vlist = subtract (op aconv) globals |
763 fun genl tm = let val vlist = subtract (op aconv) globals |
764 (OldTerm.add_term_frees(tm,[])) |
764 (OldTerm.add_term_frees(tm,[])) |
765 in fold_rev Forall vlist tm |
765 in fold_rev Forall vlist tm |
766 end |
766 end |
767 (*-------------------------------------------------------------- |
767 (*-------------------------------------------------------------- |