51 fun read_term thy used s = |
51 fun read_term thy used s = |
52 #1 (Thm.read_def_cterm (thy, K NONE, K NONE) used true (s, HOLogic.typeT)); |
52 #1 (Thm.read_def_cterm (thy, K NONE, K NONE) used true (s, HOLogic.typeT)); |
53 |
53 |
54 fun cert_term thy _ t = Thm.cterm_of thy t handle TERM (msg, _) => error msg; |
54 fun cert_term thy _ t = Thm.cterm_of thy t handle TERM (msg, _) => error msg; |
55 |
55 |
56 fun err_in_cpodef name = |
56 fun err_in_cpodef msg name = |
57 error ("The error(s) above occurred in cpodef " ^ quote name); |
57 cat_error msg ("The error(s) above occurred in cpodef " ^ quote name); |
58 |
58 |
59 fun adm_const T = Const ("Adm.adm", (T --> HOLogic.boolT) --> HOLogic.boolT); |
59 fun adm_const T = Const ("Adm.adm", (T --> HOLogic.boolT) --> HOLogic.boolT); |
60 fun mk_adm (x, T, P) = adm_const T $ absfree (x, T, P); |
60 fun mk_adm (x, T, P) = adm_const T $ absfree (x, T, P); |
61 |
61 |
62 fun gen_prepare_pcpodef prep_term pcpo def name (t, vs, mx) raw_set opt_morphs thy = |
62 fun gen_prepare_pcpodef prep_term pcpo def name (t, vs, mx) raw_set opt_morphs thy = |
166 |> make_cpo admissible |
166 |> make_cpo admissible |
167 |> (fn (theory', (type_def, _, _)) => (theory', type_def)) |
167 |> (fn (theory', (type_def, _, _)) => (theory', type_def)) |
168 end; |
168 end; |
169 |
169 |
170 in (goal, if pcpo then pcpodef_result else cpodef_result) end |
170 in (goal, if pcpo then pcpodef_result else cpodef_result) end |
171 handle ERROR => err_in_cpodef name; |
171 handle ERROR msg => err_in_cpodef msg name; |
172 |
172 |
173 (* cpodef_proof interface *) |
173 (* cpodef_proof interface *) |
174 |
174 |
175 fun gen_pcpodef_proof prep_term pcpo ((def, name), typ, set, opt_morphs) thy = |
175 fun gen_pcpodef_proof prep_term pcpo ((def, name), typ, set, opt_morphs) thy = |
176 let |
176 let |