290 fun gen_cterm_match match |
290 fun gen_cterm_match match |
291 (ct1 as Cterm {t = t1, maxidx = maxidx1, sorts = sorts1, ...}, |
291 (ct1 as Cterm {t = t1, maxidx = maxidx1, sorts = sorts1, ...}, |
292 ct2 as Cterm {t = t2, maxidx = maxidx2, sorts = sorts2, ...}) = |
292 ct2 as Cterm {t = t2, maxidx = maxidx2, sorts = sorts2, ...}) = |
293 let |
293 let |
294 val thy_ref = merge_thys0 ct1 ct2; |
294 val thy_ref = merge_thys0 ct1 ct2; |
295 val (Tinsts, tinsts) = match (Theory.deref thy_ref) (t1, t2); |
295 val (Tinsts, tinsts) = match (Theory.deref thy_ref) (t1, t2) (Vartab.empty, Vartab.empty); |
296 val maxidx = Int.max (maxidx1, maxidx2); |
296 val maxidx = Int.max (maxidx1, maxidx2); |
297 val sorts = Sorts.union sorts1 sorts2; |
297 val sorts = Sorts.union sorts1 sorts2; |
298 fun mk_cTinst (ixn, (S, T)) = |
298 fun mk_cTinst (ixn, (S, T)) = |
299 (Ctyp {T = TVar (ixn, S), thy_ref = thy_ref, sorts = sorts}, |
299 (Ctyp {T = TVar (ixn, S), thy_ref = thy_ref, sorts = sorts}, |
300 Ctyp {T = T, thy_ref = thy_ref, sorts = sorts}); |
300 Ctyp {T = T, thy_ref = thy_ref, sorts = sorts}); |