equal
deleted
inserted
replaced
446 |
446 |
447 (* forall_intr_frees: generalization over all suitable Free variables *) |
447 (* forall_intr_frees: generalization over all suitable Free variables *) |
448 |
448 |
449 fun forall_intr_frees th = |
449 fun forall_intr_frees th = |
450 let |
450 let |
451 val fixed = |
451 val fixed0 = |
452 Term_Subst.Frees.build |
452 Term_Subst.Frees.build |
453 (fold Term_Subst.add_frees (Thm.terms_of_tpairs (Thm.tpairs_of th)) #> |
453 (fold Term_Subst.add_frees (Thm.terms_of_tpairs (Thm.tpairs_of th)) #> |
454 fold Term_Subst.add_frees (Thm.hyps_of th)); |
454 fold Term_Subst.add_frees (Thm.hyps_of th)); |
455 val frees = |
455 val (_, frees) = |
456 Thm.fold_atomic_cterms (fn a => |
456 (th, (fixed0, [])) |-> Thm.fold_atomic_cterms (fn a => fn (fixed, frees) => |
457 (case Thm.term_of a of |
457 (case Thm.term_of a of |
458 Free v => not (Term_Subst.Frees.defined fixed v) ? insert (op aconvc) a |
458 Free v => |
459 | _ => I)) th []; |
459 if not (Term_Subst.Frees.defined fixed v) |
|
460 then (Term_Subst.Frees.add (v, ()) fixed, a :: frees) |
|
461 else (fixed, frees) |
|
462 | _ => (fixed, frees))); |
460 in fold Thm.forall_intr frees th end; |
463 in fold Thm.forall_intr frees th end; |
461 |
464 |
462 |
465 |
463 (* unvarify_global: global schematic variables *) |
466 (* unvarify_global: global schematic variables *) |
464 |
467 |