141 = |
141 = |
142 let fun h xs0 xs ys = subtract Thm.eq_thm xs0 (merge Thm.eq_thm (xs,ys)) in |
142 let fun h xs0 xs ys = subtract Thm.eq_thm xs0 (merge Thm.eq_thm (xs,ys)) in |
143 {inj = h inj0 inj1 inj2, emb = h emb0 emb1 emb2, |
143 {inj = h inj0 inj1 inj2, emb = h emb0 emb1 emb2, |
144 ret = h ret0 ret1 ret2, cong = h cg0 cg1 cg2, guess = g1 andalso g2, |
144 ret = h ret0 ret1 ret2, cong = h cg0 cg1 cg2, guess = g1 andalso g2, |
145 hints = subtract (op = : string*string -> bool) hints0 |
145 hints = subtract (op = : string*string -> bool) hints0 |
146 (union (op =) (hints1, hints2))} |
146 (union (op =) hints1 hints2)} |
147 end; |
147 end; |
148 |
148 |
149 local |
149 local |
150 val h = curry (merge Thm.eq_thm) |
150 val h = curry (merge Thm.eq_thm) |
151 in |
151 in |
152 fun merge_entries ({inj = inj1, emb = emb1, ret = ret1, cong = cg1, guess = g1, hints = hints1}, |
152 fun merge_entries ({inj = inj1, emb = emb1, ret = ret1, cong = cg1, guess = g1, hints = hints1}, |
153 {inj = inj2, emb = emb2, ret = ret2, cong = cg2, guess = g2, hints = hints2}) = |
153 {inj = inj2, emb = emb2, ret = ret2, cong = cg2, guess = g2, hints = hints2}) = |
154 {inj = h inj1 inj2, emb = h emb1 emb2, ret = h ret1 ret2, cong = h cg1 cg2, guess = g1 andalso g2, hints = union (op =) (hints1, hints2)} |
154 {inj = h inj1 inj2, emb = h emb1 emb2, ret = h ret1 ret2, cong = h cg1 cg2, guess = g1 andalso g2, hints = union (op =) hints1 hints2} |
155 end; |
155 end; |
156 |
156 |
157 fun add ((inja,injd), (emba,embd), (reta,retd), (cga,cgd), g, (hintsa, hintsd)) = |
157 fun add ((inja,injd), (emba,embd), (reta,retd), (cga,cgd), g, (hintsa, hintsd)) = |
158 Thm.declaration_attribute (fn key => fn context => context |> Data.map |
158 Thm.declaration_attribute (fn key => fn context => context |> Data.map |
159 (fn (ss, al) => |
159 (fn (ss, al) => |