equal
deleted
inserted
replaced
169 |
169 |
170 fun minimal_pats vs ct = |
170 fun minimal_pats vs ct = |
171 if has_all_vars vs (Thm.term_of ct) then |
171 if has_all_vars vs (Thm.term_of ct) then |
172 (case Thm.term_of ct of |
172 (case Thm.term_of ct of |
173 _ $ _ => |
173 _ $ _ => |
174 (case pairself (minimal_pats vs) (Thm.dest_comb ct) of |
174 (case apply2 (minimal_pats vs) (Thm.dest_comb ct) of |
175 ([], []) => [[ct]] |
175 ([], []) => [[ct]] |
176 | (ctss, ctss') => union (eq_set (op aconvc)) ctss ctss') |
176 | (ctss, ctss') => union (eq_set (op aconvc)) ctss ctss') |
177 | _ => []) |
177 | _ => []) |
178 else [] |
178 else [] |
179 |
179 |
187 |
187 |
188 val pat = SMT_Util.mk_const_pat @{theory} @{const_name pat} SMT_Util.destT1 |
188 val pat = SMT_Util.mk_const_pat @{theory} @{const_name pat} SMT_Util.destT1 |
189 fun mk_pat ct = Thm.apply (SMT_Util.instT' ct pat) ct |
189 fun mk_pat ct = Thm.apply (SMT_Util.instT' ct pat) ct |
190 |
190 |
191 fun mk_clist T = |
191 fun mk_clist T = |
192 pairself (Thm.cterm_of @{theory}) (SMT_Util.symb_cons_const T, SMT_Util.symb_nil_const T) |
192 apply2 (Thm.cterm_of @{theory}) (SMT_Util.symb_cons_const T, SMT_Util.symb_nil_const T) |
193 fun mk_list (ccons, cnil) f cts = fold_rev (Thm.mk_binop ccons o f) cts cnil |
193 fun mk_list (ccons, cnil) f cts = fold_rev (Thm.mk_binop ccons o f) cts cnil |
194 val mk_pat_list = mk_list (mk_clist @{typ pattern}) |
194 val mk_pat_list = mk_list (mk_clist @{typ pattern}) |
195 val mk_mpat_list = mk_list (mk_clist @{typ "pattern symb_list"}) |
195 val mk_mpat_list = mk_list (mk_clist @{typ "pattern symb_list"}) |
196 fun mk_trigger ctss = mk_mpat_list (mk_pat_list mk_pat) ctss |
196 fun mk_trigger ctss = mk_mpat_list (mk_pat_list mk_pat) ctss |
197 |
197 |