equal
deleted
inserted
replaced
95 if !trace then writeln ("NEW = " ^ Syntax.string_of_term ctxt new) |
95 if !trace then writeln ("NEW = " ^ Syntax.string_of_term ctxt new) |
96 else (); |
96 else (); |
97 val goal = Logic.mk_equals (old, new) |
97 val goal = Logic.mk_equals (old, new) |
98 val thm = Goal.prove ctxt [] [] goal |
98 val thm = Goal.prove ctxt [] [] goal |
99 (fn _ => resolve_tac ctxt @{thms iff_reflection} 1 THEN |
99 (fn _ => resolve_tac ctxt @{thms iff_reflection} 1 THEN |
100 simp_tac (put_simpset datatype_ss ctxt addsimps #free_iffs lcon_info) 1) |
100 simp_tac (put_simpset datatype_ss ctxt addsimps |
|
101 (map (Thm.transfer thy) (#free_iffs lcon_info))) 1) |
101 handle ERROR msg => |
102 handle ERROR msg => |
102 (warning (msg ^ "\ndata_free simproc:\nfailed to prove " ^ Syntax.string_of_term ctxt goal); |
103 (warning (msg ^ "\ndata_free simproc:\nfailed to prove " ^ Syntax.string_of_term ctxt goal); |
103 raise Match) |
104 raise Match) |
104 in SOME thm end |
105 in SOME thm end |
105 handle Match => NONE; |
106 handle Match => NONE; |