equal
deleted
inserted
replaced
72 end) cargs (bs, ts ~~ Ts)))) |
72 end) cargs (bs, ts ~~ Ts)))) |
73 | _ => fold (add_binders thy i) ts bs) |
73 | _ => fold (add_binders thy i) ts bs) |
74 | (u, ts) => add_binders thy i u (fold (add_binders thy i) ts bs)) |
74 | (u, ts) => add_binders thy i u (fold (add_binders thy i) ts bs)) |
75 | add_binders thy i (Abs (_, _, t)) bs = add_binders thy (i + 1) t bs |
75 | add_binders thy i (Abs (_, _, t)) bs = add_binders thy (i + 1) t bs |
76 | add_binders thy i _ bs = bs; |
76 | add_binders thy i _ bs = bs; |
77 |
|
78 fun mk_set T [] = Const (@{const_name Set.empty}, HOLogic.mk_setT T) |
|
79 | mk_set T (x :: xs) = |
|
80 Const ("insert", T --> HOLogic.mk_setT T --> HOLogic.mk_setT T) $ x $ |
|
81 mk_set T xs; |
|
82 |
77 |
83 fun split_conj f names (Const ("op &", _) $ p $ q) _ = (case head_of p of |
78 fun split_conj f names (Const ("op &", _) $ p $ q) _ = (case head_of p of |
84 Const (name, _) => |
79 Const (name, _) => |
85 if name mem names then SOME (f p q) else NONE |
80 if name mem names then SOME (f p q) else NONE |
86 | _ => NONE) |
81 | _ => NONE) |
214 val concl = incr_boundvars 1 (Logic.strip_assums_concl prem); |
209 val concl = incr_boundvars 1 (Logic.strip_assums_concl prem); |
215 val params = Logic.strip_params prem |
210 val params = Logic.strip_params prem |
216 in |
211 in |
217 (params, |
212 (params, |
218 if null avoids then |
213 if null avoids then |
219 map (fn (T, ts) => (mk_set T ts, T)) |
214 map (fn (T, ts) => (HOLogic.mk_set T ts, T)) |
220 (fold (add_binders thy 0) (prems @ [concl]) []) |
215 (fold (add_binders thy 0) (prems @ [concl]) []) |
221 else case AList.lookup op = avoids name of |
216 else case AList.lookup op = avoids name of |
222 NONE => [] |
217 NONE => [] |
223 | SOME sets => |
218 | SOME sets => |
224 map (apfst (incr_boundvars 1)) (mk_avoids params name sets), |
219 map (apfst (incr_boundvars 1)) (mk_avoids params name sets), |