equal
deleted
inserted
replaced
268 (*** Prove the case theorems ***) |
268 (*** Prove the case theorems ***) |
269 |
269 |
270 (*Each equation has the form |
270 (*Each equation has the form |
271 case(f_con1,...,f_conn)(coni(args)) = f_coni(args) *) |
271 case(f_con1,...,f_conn)(coni(args)) = f_coni(args) *) |
272 fun mk_case_eqn (((_,T,_), name, args, _), case_free) = |
272 fun mk_case_eqn (((_,T,_), name, args, _), case_free) = |
273 FOLogic.mk_Trueprop |
273 \<^make_judgment> |
274 (FOLogic.mk_eq |
274 (FOLogic.mk_eq |
275 (case_tm $ |
275 (case_tm $ |
276 (list_comb (Const (Sign.intern_const thy1 name,T), |
276 (list_comb (Const (Sign.intern_const thy1 name,T), |
277 args)), |
277 args)), |
278 list_comb (case_free, args))); |
278 list_comb (case_free, args))); |
318 (*Each equation has the form |
318 (*Each equation has the form |
319 REC(coni(args)) = f_coni(args, REC(rec_arg), ...) |
319 REC(coni(args)) = f_coni(args, REC(rec_arg), ...) |
320 where REC = recursor(f_con1,...,f_conn) and rec_arg is a recursive |
320 where REC = recursor(f_con1,...,f_conn) and rec_arg is a recursive |
321 constructor argument.*) |
321 constructor argument.*) |
322 fun mk_recursor_eqn (((_,T,_), name, args, _), recursor_case) = |
322 fun mk_recursor_eqn (((_,T,_), name, args, _), recursor_case) = |
323 FOLogic.mk_Trueprop |
323 \<^make_judgment> |
324 (FOLogic.mk_eq |
324 (FOLogic.mk_eq |
325 (recursor_tm $ |
325 (recursor_tm $ |
326 (list_comb (Const (Sign.intern_const thy2 name,T), |
326 (list_comb (Const (Sign.intern_const thy2 name,T), |
327 args)), |
327 args)), |
328 subst_rec (Term.betapplys (recursor_case, args)))); |
328 subst_rec (Term.betapplys (recursor_case, args)))); |