54 *--------------------------------------------------------------------------*) |
54 *--------------------------------------------------------------------------*) |
55 fun tgoalw thy defs rules = |
55 fun tgoalw thy defs rules = |
56 case termination_goals rules of |
56 case termination_goals rules of |
57 [] => error "tgoalw: no termination conditions to prove" |
57 [] => error "tgoalw: no termination conditions to prove" |
58 | L => goalw_cterm defs |
58 | L => goalw_cterm defs |
59 (cterm_of (sign_of thy) |
59 (Thm.cterm_of (Theory.sign_of thy) |
60 (HOLogic.mk_Trueprop(USyntax.list_mk_conj L))); |
60 (HOLogic.mk_Trueprop(USyntax.list_mk_conj L))); |
61 |
61 |
62 fun tgoal thy = tgoalw thy []; |
62 fun tgoal thy = tgoalw thy []; |
63 |
63 |
64 (*--------------------------------------------------------------------------- |
64 (*--------------------------------------------------------------------------- |
90 end; |
90 end; |
91 |
91 |
92 (*lcp's version: takes strings; doesn't return "thm" |
92 (*lcp's version: takes strings; doesn't return "thm" |
93 (whose signature is a draft and therefore useless) *) |
93 (whose signature is a draft and therefore useless) *) |
94 fun define thy fid R eqs = |
94 fun define thy fid R eqs = |
95 let fun read thy = readtm (sign_of thy) (TVar(("DUMMY",0),[])) |
95 let fun read thy = readtm (Theory.sign_of thy) (TVar(("DUMMY",0),[])) |
96 in define_i thy fid (read thy R) (map (read thy) eqs) end |
96 in define_i thy fid (read thy R) (map (read thy) eqs) end |
97 handle Utils.ERR {mesg,...} => error mesg; |
97 handle Utils.ERR {mesg,...} => error mesg; |
98 |
98 |
99 (*--------------------------------------------------------------------------- |
99 (*--------------------------------------------------------------------------- |
100 * Postprocess a definition made by "define". This is a separate stage of |
100 * Postprocess a definition made by "define". This is a separate stage of |
192 * have already been added in thry.sml |
192 * have already been added in thry.sml |
193 *---------------------------------------------------------------------------*) |
193 *---------------------------------------------------------------------------*) |
194 val defaultTflCongs = eq_reflect_list [Thms.LET_CONG, if_cong]; |
194 val defaultTflCongs = eq_reflect_list [Thms.LET_CONG, if_cong]; |
195 |
195 |
196 fun simplify_defn (ss, tflCongs) (thy,(id,pats)) = |
196 fun simplify_defn (ss, tflCongs) (thy,(id,pats)) = |
197 let val dummy = deny (id mem (Sign.stamp_names_of (sign_of thy))) |
197 let val dummy = deny (id mem (Sign.stamp_names_of (Theory.sign_of thy))) |
198 ("Recursive definition " ^ id ^ |
198 ("Recursive definition " ^ id ^ |
199 " would clash with the theory of the same name!") |
199 " would clash with the theory of the same name!") |
200 val def = freezeT(get_def thy id) RS meta_eq_to_obj_eq |
200 val def = freezeT(get_def thy id) RS meta_eq_to_obj_eq |
201 val ss' = ss addsimps ((less_Suc_eq RS iffD2) :: wf_rel_defs) |
201 val ss' = ss addsimps ((less_Suc_eq RS iffD2) :: wf_rel_defs) |
202 val {theory,rules,TCs,full_pats_TCs,patterns} = |
202 val {theory,rules,TCs,full_pats_TCs,patterns} = |