411 |
411 |
412 val type_rls = |
412 val type_rls = |
413 @{thms canTs} @ @{thms icanTs} @ @{thms applyT2} @ @{thms ncanTs} @ @{thms incanTs} @ |
413 @{thms canTs} @ @{thms icanTs} @ @{thms applyT2} @ @{thms ncanTs} @ @{thms incanTs} @ |
414 @{thms precTs} @ @{thms letrecTs} @ @{thms letT} @ @{thms Subtype_canTs}; |
414 @{thms precTs} @ @{thms letrecTs} @ @{thms letT} @ @{thms Subtype_canTs}; |
415 |
415 |
416 fun bvars (Const(\<^const_name>\<open>Pure.all\<close>,_) $ Abs(s,_,t)) l = bvars t (s::l) |
416 fun bvars \<^Const_>\<open>Pure.all _ for \<open>Abs(s,_,t)\<close>\<close> l = bvars t (s::l) |
417 | bvars _ l = l |
417 | bvars _ l = l |
418 |
418 |
419 fun get_bno l n (Const(\<^const_name>\<open>Pure.all\<close>,_) $ Abs(s,_,t)) = get_bno (s::l) n t |
419 fun get_bno l n \<^Const_>\<open>Pure.all _ for \<open>Abs(s,_,t)\<close>\<close> = get_bno (s::l) n t |
420 | get_bno l n (Const(\<^const_name>\<open>Trueprop\<close>,_) $ t) = get_bno l n t |
420 | get_bno l n \<^Const_>\<open>Trueprop for t\<close> = get_bno l n t |
421 | get_bno l n (Const(\<^const_name>\<open>Ball\<close>,_) $ _ $ Abs(s,_,t)) = get_bno (s::l) (n+1) t |
421 | get_bno l n \<^Const_>\<open>Ball _ for _ \<open>Abs(s,_,t)\<close>\<close> = get_bno (s::l) (n+1) t |
422 | get_bno l n (Const(\<^const_name>\<open>mem\<close>,_) $ t $ _) = get_bno l n t |
422 | get_bno l n \<^Const_>\<open>mem _ for t _\<close> = get_bno l n t |
423 | get_bno l n (t $ s) = get_bno l n t |
423 | get_bno l n (t $ s) = get_bno l n t |
424 | get_bno l n (Bound m) = (m-length(l),n) |
424 | get_bno l n (Bound m) = (m-length(l),n) |
425 |
425 |
426 (* Not a great way of identifying induction hypothesis! *) |
426 (* Not a great way of identifying induction hypothesis! *) |
427 fun could_IH x = Term.could_unify(x,hd (Thm.prems_of @{thm rcallT})) orelse |
427 fun could_IH x = Term.could_unify(x,hd (Thm.prems_of @{thm rcallT})) orelse |
439 tac [((("g", 0), Position.none), x)] (nth rls (y - 1)) i ORELSE (try_IHs xs) |
439 tac [((("g", 0), Position.none), x)] (nth rls (y - 1)) i ORELSE (try_IHs xs) |
440 in try_IHs rnames end) |
440 in try_IHs rnames end) |
441 |
441 |
442 fun is_rigid_prog t = |
442 fun is_rigid_prog t = |
443 (case (Logic.strip_assums_concl t) of |
443 (case (Logic.strip_assums_concl t) of |
444 (Const(\<^const_name>\<open>Trueprop\<close>,_) $ (Const(\<^const_name>\<open>mem\<close>,_) $ a $ _)) => |
444 \<^Const_>\<open>Trueprop for \<open>\<^Const_>\<open>mem _ for a _\<close>\<close>\<close> => null (Term.add_vars a []) |
445 null (Term.add_vars a []) |
|
446 | _ => false) |
445 | _ => false) |
447 |
446 |
448 in |
447 in |
449 |
448 |
450 fun rcall_tac ctxt i = |
449 fun rcall_tac ctxt i = |