305 in |
305 in |
306 fun GEN v th = |
306 fun GEN v th = |
307 let val gth = forall_intr v th |
307 let val gth = forall_intr v th |
308 val {prop=Const("all",_)$Abs(x,ty,rst),sign,...} = rep_thm gth |
308 val {prop=Const("all",_)$Abs(x,ty,rst),sign,...} = rep_thm gth |
309 val P' = Abs(x,ty, HOLogic.dest_Trueprop rst) (* get rid of trueprop *) |
309 val P' = Abs(x,ty, HOLogic.dest_Trueprop rst) (* get rid of trueprop *) |
310 val tsig = #tsig(Sign.rep_sg sign) |
310 val tsig = Sign.tsig_of sign |
311 val theta = Pattern.match tsig (P,P') |
311 val theta = Pattern.match tsig (P,P') |
312 val allI2 = instantiate (certify sign theta) allI |
312 val allI2 = instantiate (certify sign theta) allI |
313 val thm = Thm.implies_elim allI2 gth |
313 val thm = Thm.implies_elim allI2 gth |
314 val {prop = tp $ (A $ Abs(_,_,M)),sign,...} = rep_thm thm |
314 val {prop = tp $ (A $ Abs(_,_,M)),sign,...} = rep_thm thm |
315 val prop' = tp $ (A $ Abs(x,ty,M)) |
315 val prop' = tp $ (A $ Abs(x,ty,M)) |
710 val QeqQ1 = pbeta_reduce (tych Q) |
710 val QeqQ1 = pbeta_reduce (tych Q) |
711 val Q1 = #2(D.dest_eq(cconcl QeqQ1)) |
711 val Q1 = #2(D.dest_eq(cconcl QeqQ1)) |
712 val mss' = MetaSimplifier.add_prems(mss, map ASSUME ants1) |
712 val mss' = MetaSimplifier.add_prems(mss, map ASSUME ants1) |
713 val Q1eeqQ2 = MetaSimplifier.rewrite_cterm (false,true,false) (prover used') mss' Q1 |
713 val Q1eeqQ2 = MetaSimplifier.rewrite_cterm (false,true,false) (prover used') mss' Q1 |
714 handle U.ERR _ => Thm.reflexive Q1 |
714 handle U.ERR _ => Thm.reflexive Q1 |
715 val Q2 = #2 (Logic.dest_equals (#prop(rep_thm Q1eeqQ2))) |
715 val Q2 = #2 (Logic.dest_equals (Thm.prop_of Q1eeqQ2)) |
716 val Q3 = tych(list_comb(list_mk_aabs(vstrl,Q2),vstrl)) |
716 val Q3 = tych(list_comb(list_mk_aabs(vstrl,Q2),vstrl)) |
717 val Q2eeqQ3 = Thm.symmetric(pbeta_reduce Q3 RS eq_reflection) |
717 val Q2eeqQ3 = Thm.symmetric(pbeta_reduce Q3 RS eq_reflection) |
718 val thA = Thm.transitive(QeqQ1 RS eq_reflection) Q1eeqQ2 |
718 val thA = Thm.transitive(QeqQ1 RS eq_reflection) Q1eeqQ2 |
719 val QeeqQ3 = Thm.transitive thA Q2eeqQ3 handle THM _ => |
719 val QeeqQ3 = Thm.transitive thA Q2eeqQ3 handle THM _ => |
720 ((Q2eeqQ3 RS meta_eq_to_obj_eq) |
720 ((Q2eeqQ3 RS meta_eq_to_obj_eq) |
776 *-------------------------------------------------------------*) |
776 *-------------------------------------------------------------*) |
777 val func_name = #1(dest_Const func) |
777 val func_name = #1(dest_Const func) |
778 fun is_func (Const (name,_)) = (name = func_name) |
778 fun is_func (Const (name,_)) = (name = func_name) |
779 | is_func _ = false |
779 | is_func _ = false |
780 val rcontext = rev cntxt |
780 val rcontext = rev cntxt |
781 val cncl = HOLogic.dest_Trueprop o #prop o rep_thm |
781 val cncl = HOLogic.dest_Trueprop o Thm.prop_of |
782 val antl = case rcontext of [] => [] |
782 val antl = case rcontext of [] => [] |
783 | _ => [S.list_mk_conj(map cncl rcontext)] |
783 | _ => [S.list_mk_conj(map cncl rcontext)] |
784 val TC = genl(S.list_mk_imp(antl, A)) |
784 val TC = genl(S.list_mk_imp(antl, A)) |
785 val dummy = print_cterms "func:" [cterm_of sign func] |
785 val dummy = print_cterms "func:" [cterm_of sign func] |
786 val dummy = print_cterms "TC:" |
786 val dummy = print_cterms "TC:" |