equal
deleted
inserted
replaced
92 val simp_add_local: Proof.context attribute |
92 val simp_add_local: Proof.context attribute |
93 val simp_del_local: Proof.context attribute |
93 val simp_del_local: Proof.context attribute |
94 val change_simpset_of: (simpset * 'a -> simpset) -> 'a -> theory -> theory |
94 val change_simpset_of: (simpset * 'a -> simpset) -> 'a -> theory -> theory |
95 val simp_modifiers: (Args.T list -> (Method.modifier * Args.T list)) list |
95 val simp_modifiers: (Args.T list -> (Method.modifier * Args.T list)) list |
96 val setup: (theory -> theory) list |
96 val setup: (theory -> theory) list |
|
97 val easy_setup: thm -> thm list -> (theory -> theory) list |
97 end; |
98 end; |
98 |
99 |
99 structure Simplifier: SIMPLIFIER = |
100 structure Simplifier: SIMPLIFIER = |
100 struct |
101 struct |
101 |
102 |
512 |
513 |
513 (** theory setup **) |
514 (** theory setup **) |
514 |
515 |
515 val setup = [GlobalSimpset.init, LocalSimpset.init, setup_attrs, setup_methods]; |
516 val setup = [GlobalSimpset.init, LocalSimpset.init, setup_attrs, setup_methods]; |
516 |
517 |
|
518 fun easy_setup reflect trivs = |
|
519 let |
|
520 val trivialities = Drule.reflexive_thm :: trivs; |
|
521 |
|
522 fun unsafe_solver_tac prems = FIRST' [resolve_tac (trivialities @ prems), assume_tac]; |
|
523 val unsafe_solver = mk_solver "easy unsafe" unsafe_solver_tac; |
|
524 |
|
525 (*no premature instantiation of variables during simplification*) |
|
526 fun safe_solver_tac prems = FIRST' [match_tac (trivialities @ prems), eq_assume_tac]; |
|
527 val safe_solver = mk_solver "easy safe" safe_solver_tac; |
|
528 |
|
529 fun mksimps thm = |
|
530 if Logic.is_equals (Thm.concl_of thm) then [thm] |
|
531 else [thm RS reflect] handle THM _ => []; |
|
532 |
|
533 fun init_ss thy = |
|
534 (simpset_ref_of thy := |
|
535 empty_ss setsubgoaler asm_simp_tac |
|
536 setSSolver safe_solver |
|
537 setSolver unsafe_solver |
|
538 setmksimps mksimps; thy); |
|
539 in setup @ [init_ss] end; |
|
540 |
517 |
541 |
518 end; |
542 end; |
519 |
543 |
520 |
544 |
521 structure BasicSimplifier: BASIC_SIMPLIFIER = Simplifier; |
545 structure BasicSimplifier: BASIC_SIMPLIFIER = Simplifier; |