equal
deleted
inserted
replaced
491 |
491 |
492 |
492 |
493 subsection {* Evaluation *} |
493 subsection {* Evaluation *} |
494 |
494 |
495 ML {* |
495 ML {* |
496 |
496 structure Eval_Rules = |
497 local |
497 Named_Thms(val name = @{binding eval} val description = "evaluation rules"); |
498 structure Data = Named_Thms(val name = @{binding eval} val description = "evaluation rules"); |
|
499 in |
|
500 |
498 |
501 fun eval_tac ths = |
499 fun eval_tac ths = |
502 Subgoal.FOCUS_PREMS (fn {context, prems, ...} => |
500 Subgoal.FOCUS_PREMS (fn {context, prems, ...} => |
503 DEPTH_SOLVE_1 (resolve_tac (ths @ prems @ Data.get context) 1)); |
501 DEPTH_SOLVE_1 (resolve_tac (ths @ prems @ Eval_Rules.get context) 1)); |
504 |
|
505 val eval_setup = |
|
506 Data.setup #> |
|
507 Method.setup @{binding eval} |
|
508 (Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (CHANGED o eval_tac ths ctxt))) |
|
509 "evaluation"; |
|
510 |
|
511 end; |
|
512 |
|
513 *} |
502 *} |
514 |
503 setup Eval_Rules.setup |
515 setup eval_setup |
504 |
|
505 method_setup eval = {* |
|
506 Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (CHANGED o eval_tac ths ctxt)) |
|
507 *} |
|
508 |
516 |
509 |
517 lemmas eval_rls [eval] = trueV falseV pairV lamV caseVtrue caseVfalse caseVpair caseVlam |
510 lemmas eval_rls [eval] = trueV falseV pairV lamV caseVtrue caseVfalse caseVpair caseVlam |
518 |
511 |
519 lemma applyV [eval]: |
512 lemma applyV [eval]: |
520 assumes "f ---> lam x. b(x)" |
513 assumes "f ---> lam x. b(x)" |