equal
deleted
inserted
replaced
564 allow_consts = false, allow_pats = false } thm (lhs, rhs); |
564 allow_consts = false, allow_pats = false } thm (lhs, rhs); |
565 in (thm, tyco) end; |
565 in (thm, tyco) end; |
566 |
566 |
567 fun assert_eqn thy = error_thm (gen_assert_eqn thy true); |
567 fun assert_eqn thy = error_thm (gen_assert_eqn thy true); |
568 |
568 |
569 fun meta_rewrite thy = LocalDefs.meta_rewrite_rule (ProofContext.init thy); |
569 fun meta_rewrite thy = Local_Defs.meta_rewrite_rule (ProofContext.init thy); |
570 |
570 |
571 fun mk_eqn thy = error_thm (gen_assert_eqn thy false) o |
571 fun mk_eqn thy = error_thm (gen_assert_eqn thy false) o |
572 apfst (meta_rewrite thy); |
572 apfst (meta_rewrite thy); |
573 |
573 |
574 fun mk_eqn_warning thy = Option.map (fn (thm, _) => (thm, is_linear thm)) |
574 fun mk_eqn_warning thy = Option.map (fn (thm, _) => (thm, is_linear thm)) |
808 fun equations_of_cert thy (cert as Equations (cert_thm, propers)) = |
808 fun equations_of_cert thy (cert as Equations (cert_thm, propers)) = |
809 let |
809 let |
810 val tyscm = typscheme_of_cert thy cert; |
810 val tyscm = typscheme_of_cert thy cert; |
811 val thms = if null propers then [] else |
811 val thms = if null propers then [] else |
812 cert_thm |
812 cert_thm |
813 |> LocalDefs.expand [snd (get_head thy cert_thm)] |
813 |> Local_Defs.expand [snd (get_head thy cert_thm)] |
814 |> Thm.varifyT |
814 |> Thm.varifyT |
815 |> Conjunction.elim_balanced (length propers); |
815 |> Conjunction.elim_balanced (length propers); |
816 in (tyscm, map (pair NONE o dest_eqn thy o Thm.prop_of) thms ~~ (map SOME thms ~~ propers)) end |
816 in (tyscm, map (pair NONE o dest_eqn thy o Thm.prop_of) thms ~~ (map SOME thms ~~ propers)) end |
817 | equations_of_cert thy (Projection (t, tyco)) = |
817 | equations_of_cert thy (Projection (t, tyco)) = |
818 let |
818 let |