equal
deleted
inserted
replaced
92 f name (map (attrib x) more_srcs) |
92 f name (map (attrib x) more_srcs) |
93 (map (fn (s, srcs) => (get x s, map (attrib x) srcs)) th_srcs) x; |
93 (map (fn (s, srcs) => (get x s, map (attrib x) srcs)) th_srcs) x; |
94 |
94 |
95 |
95 |
96 val have_theorems = |
96 val have_theorems = |
97 #1 oo gen_have_thmss PureThy.get_tthms Attrib.global_attribute PureThy.have_tthmss; |
97 #1 oo gen_have_thmss PureThy.get_thms Attrib.global_attribute PureThy.have_thmss; |
98 |
98 |
99 val have_lemmas = |
99 val have_lemmas = |
100 #1 oo gen_have_thmss PureThy.get_tthms Attrib.global_attribute |
100 #1 oo gen_have_thmss PureThy.get_thms Attrib.global_attribute |
101 (fn name => fn more_atts => PureThy.have_tthmss name (more_atts @ [Attribute.tag_lemma])); |
101 (fn name => fn more_atts => PureThy.have_thmss name (more_atts @ [Drule.tag_lemma])); |
102 |
102 |
103 |
103 |
104 val have_thmss = |
104 val have_thmss = |
105 gen_have_thmss (ProofContext.get_tthms o Proof.context_of) |
105 gen_have_thmss (ProofContext.get_thms o Proof.context_of) |
106 (Attrib.local_attribute o Proof.theory_of) Proof.have_tthmss; |
106 (Attrib.local_attribute o Proof.theory_of) Proof.have_thmss; |
107 |
107 |
108 val have_facts = ProofHistory.apply o have_thmss; |
108 val have_facts = ProofHistory.apply o have_thmss; |
109 val from_facts = ProofHistory.apply o (Proof.chain oo curry have_thmss ("", [])); |
109 val from_facts = ProofHistory.apply o (Proof.chain oo curry have_thmss ("", [])); |
110 |
110 |
111 |
111 |
141 fun qed_with (alt_name, alt_tags) prf = |
141 fun qed_with (alt_name, alt_tags) prf = |
142 let |
142 let |
143 val state = ProofHistory.current prf; |
143 val state = ProofHistory.current prf; |
144 val thy = Proof.theory_of state; |
144 val thy = Proof.theory_of state; |
145 val alt_atts = apsome (map (Attrib.global_attribute thy)) alt_tags; |
145 val alt_atts = apsome (map (Attrib.global_attribute thy)) alt_tags; |
146 val (thy', (kind, name, tthm)) = Method.qed alt_name alt_atts state; |
146 val (thy', (kind, name, thm)) = Method.qed alt_name alt_atts state; |
147 |
147 |
148 val prt_result = Pretty.block |
148 val prt_result = Pretty.block |
149 [Pretty.str (kind ^ " " ^ name ^ ":"), Pretty.fbrk, Attribute.pretty_tthm tthm]; |
149 [Pretty.str (kind ^ " " ^ name ^ ":"), Pretty.fbrk, Display.pretty_thm thm]; |
150 in Pretty.writeln prt_result; thy end; |
150 in Pretty.writeln prt_result; thy end; |
151 |
151 |
152 val qed = qed_with (None, None); |
152 val qed = qed_with (None, None); |
153 |
153 |
154 val kill_proof = Proof.theory_of o ProofHistory.current; |
154 val kill_proof = Proof.theory_of o ProofHistory.current; |