equal
deleted
inserted
replaced
66 |
66 |
67 fun eq_brl ((b1,th1),(b2,th2)) = b1=b2 andalso Drule.eq_thm_prop (th1,th2); |
67 fun eq_brl ((b1,th1),(b2,th2)) = b1=b2 andalso Drule.eq_thm_prop (th1,th2); |
68 |
68 |
69 (*insert a thm in a discrimination net by its lhs*) |
69 (*insert a thm in a discrimination net by its lhs*) |
70 fun lhs_insert_thm (th,net) = |
70 fun lhs_insert_thm (th,net) = |
71 Net.insert_term((lhs_of (concl_of th), (false,th)), net, eq_brl) |
71 Net.insert_term eq_brl (lhs_of (concl_of th), (false,th)) net |
72 handle Net.INSERT => net; |
72 handle Net.INSERT => net; |
73 |
73 |
74 (*match subgoal i against possible theorems in the net. |
74 (*match subgoal i against possible theorems in the net. |
75 Similar to match_from_nat_tac, but the net does not contain numbers; |
75 Similar to match_from_nat_tac, but the net does not contain numbers; |
76 rewrite rules are not ordered.*) |
76 rewrite rules are not ordered.*) |
245 |
245 |
246 (** Insertion of congruences and rewrites **) |
246 (** Insertion of congruences and rewrites **) |
247 |
247 |
248 (*insert a thm in a thm net*) |
248 (*insert a thm in a thm net*) |
249 fun insert_thm_warn (th,net) = |
249 fun insert_thm_warn (th,net) = |
250 Net.insert_term((concl_of th, th), net, Drule.eq_thm_prop) |
250 Net.insert_term Drule.eq_thm_prop (concl_of th, th) net |
251 handle Net.INSERT => |
251 handle Net.INSERT => |
252 (writeln"\nDuplicate rewrite or congruence rule:"; print_thm th; |
252 (writeln"\nDuplicate rewrite or congruence rule:"; print_thm th; |
253 net); |
253 net); |
254 |
254 |
255 val insert_thms = foldr insert_thm_warn; |
255 val insert_thms = foldr insert_thm_warn; |
271 |
271 |
272 (** Deletion of congruences and rewrites **) |
272 (** Deletion of congruences and rewrites **) |
273 |
273 |
274 (*delete a thm from a thm net*) |
274 (*delete a thm from a thm net*) |
275 fun delete_thm_warn (th,net) = |
275 fun delete_thm_warn (th,net) = |
276 Net.delete_term((concl_of th, th), net, Drule.eq_thm_prop) |
276 Net.delete_term Drule.eq_thm_prop (concl_of th, th) net |
277 handle Net.DELETE => |
277 handle Net.DELETE => |
278 (writeln"\nNo such rewrite or congruence rule:"; print_thm th; |
278 (writeln"\nNo such rewrite or congruence rule:"; print_thm th; |
279 net); |
279 net); |
280 |
280 |
281 val delete_thms = foldr delete_thm_warn; |
281 val delete_thms = foldr delete_thm_warn; |