76 fun reif_eq ctxt (eq as Const (@{const_name HOL.eq}, Type (@{type_name fun}, [T, _])) $ lhs $ rhs) = |
76 fun reif_eq ctxt (eq as Const (@{const_name HOL.eq}, Type (@{type_name fun}, [T, _])) $ lhs $ rhs) = |
77 if Sign.of_sort (Proof_Context.theory_of ctxt) (T, cr_sort) then |
77 if Sign.of_sort (Proof_Context.theory_of ctxt) (T, cr_sort) then |
78 let |
78 let |
79 val thy = Proof_Context.theory_of ctxt; |
79 val thy = Proof_Context.theory_of ctxt; |
80 val fs = Misc_Legacy.term_frees eq; |
80 val fs = Misc_Legacy.term_frees eq; |
81 val cvs = Thm.cterm_of thy (HOLogic.mk_list T fs); |
81 val cvs = Thm.global_cterm_of thy (HOLogic.mk_list T fs); |
82 val clhs = Thm.cterm_of thy (reif_polex T fs lhs); |
82 val clhs = Thm.global_cterm_of thy (reif_polex T fs lhs); |
83 val crhs = Thm.cterm_of thy (reif_polex T fs rhs); |
83 val crhs = Thm.global_cterm_of thy (reif_polex T fs rhs); |
84 val ca = Thm.ctyp_of thy T; |
84 val ca = Thm.global_ctyp_of thy T; |
85 in (ca, cvs, clhs, crhs) end |
85 in (ca, cvs, clhs, crhs) end |
86 else error ("reif_eq: not an equation over " ^ Syntax.string_of_sort ctxt cr_sort) |
86 else error ("reif_eq: not an equation over " ^ Syntax.string_of_sort ctxt cr_sort) |
87 | reif_eq _ _ = error "reif_eq: not an equation"; |
87 | reif_eq _ _ = error "reif_eq: not an equation"; |
88 |
88 |
89 (* The cring tactic *) |
89 (* The cring tactic *) |