equal
deleted
inserted
replaced
85 |
85 |
86 (**** translation between proof terms and pure terms ****) |
86 (**** translation between proof terms and pure terms ****) |
87 |
87 |
88 fun proof_of_term thy ty = |
88 fun proof_of_term thy ty = |
89 let |
89 let |
90 val thms = Global_Theory.all_thms_of thy; |
90 val thms = Global_Theory.all_thms_of thy true; |
91 val axms = Theory.all_axioms_of thy; |
91 val axms = Theory.all_axioms_of thy; |
92 |
92 |
93 fun mk_term t = (if ty then I else map_types (K dummyT)) |
93 fun mk_term t = (if ty then I else map_types (K dummyT)) |
94 (Term.no_dummy_patterns t); |
94 (Term.no_dummy_patterns t); |
95 |
95 |
185 |
185 |
186 val term_of_proof = term_of []; |
186 val term_of_proof = term_of []; |
187 |
187 |
188 fun cterm_of_proof thy prf = |
188 fun cterm_of_proof thy prf = |
189 let |
189 let |
190 val thm_names = map fst (Global_Theory.all_thms_of thy); |
190 val thm_names = map fst (Global_Theory.all_thms_of thy true); |
191 val axm_names = map fst (Theory.all_axioms_of thy); |
191 val axm_names = map fst (Theory.all_axioms_of thy); |
192 val thy' = thy |
192 val thy' = thy |
193 |> add_proof_syntax |
193 |> add_proof_syntax |
194 |> add_proof_atom_consts |
194 |> add_proof_atom_consts |
195 (map (Long_Name.append "axm") axm_names @ map (Long_Name.append "thm") thm_names); |
195 (map (Long_Name.append "axm") axm_names @ map (Long_Name.append "thm") thm_names); |
197 (cterm_of thy' (term_of_proof prf), proof_of_term thy true o Thm.term_of) |
197 (cterm_of thy' (term_of_proof prf), proof_of_term thy true o Thm.term_of) |
198 end; |
198 end; |
199 |
199 |
200 fun read_term thy topsort = |
200 fun read_term thy topsort = |
201 let |
201 let |
202 val thm_names = filter_out (fn s => s = "") (map fst (Global_Theory.all_thms_of thy)); |
202 val thm_names = filter_out (fn s => s = "") (map fst (Global_Theory.all_thms_of thy true)); |
203 val axm_names = map fst (Theory.all_axioms_of thy); |
203 val axm_names = map fst (Theory.all_axioms_of thy); |
204 val ctxt = thy |
204 val ctxt = thy |
205 |> add_proof_syntax |
205 |> add_proof_syntax |
206 |> add_proof_atom_consts |
206 |> add_proof_atom_consts |
207 (map (Long_Name.append "axm") axm_names @ map (Long_Name.append "thm") thm_names) |
207 (map (Long_Name.append "axm") axm_names @ map (Long_Name.append "thm") thm_names) |