equal
deleted
inserted
replaced
449 andalso no_abstr (Thm.prop_of eqn) |
449 andalso no_abstr (Thm.prop_of eqn) |
450 fun is_valid_abs_eq abs_eq = can (Code.assert_abs_eqn thy NONE) (mk_meta_eq abs_eq) |
450 fun is_valid_abs_eq abs_eq = can (Code.assert_abs_eqn thy NONE) (mk_meta_eq abs_eq) |
451 |
451 |
452 in |
452 in |
453 if is_valid_eq abs_eq_thm then |
453 if is_valid_eq abs_eq_thm then |
454 (ABS_EQ, Code.add_eqn (Code.Equation, true) abs_eq_thm thy) |
454 (ABS_EQ, Code.declare_default_eqns_global [(abs_eq_thm, true)] thy) |
455 else |
455 else |
456 let |
456 let |
457 val (rty_body, qty_body) = get_body_types (rty, qty) |
457 val (rty_body, qty_body) = get_body_types (rty, qty) |
458 in |
458 in |
459 if rty_body = qty_body then |
459 if rty_body = qty_body then |
460 (REP_EQ, Code.add_eqn (Code.Equation, true) (the opt_rep_eq_thm) thy) |
460 (REP_EQ, Code.declare_default_eqns_global [(the opt_rep_eq_thm, true)] thy) |
461 else |
461 else |
462 if is_some opt_rep_eq_thm andalso is_valid_abs_eq (the opt_rep_eq_thm) |
462 if is_some opt_rep_eq_thm andalso is_valid_abs_eq (the opt_rep_eq_thm) |
463 then |
463 then |
464 (REP_EQ, Code.add_eqn (Code.Abstract, true) (the opt_rep_eq_thm) thy) |
464 (REP_EQ, Code.declare_abstract_eqn_global (the opt_rep_eq_thm) thy) |
465 else |
465 else |
466 (NONE_EQ, thy) |
466 (NONE_EQ, thy) |
467 end |
467 end |
468 end |
468 end |
469 |
469 |