419 (** Tactics that instantiate CTT-rules. |
419 (** Tactics that instantiate CTT-rules. |
420 Vars in the given terms will be incremented! |
420 Vars in the given terms will be incremented! |
421 The (rtac EqE i) lets them apply to equality judgements. **) |
421 The (rtac EqE i) lets them apply to equality judgements. **) |
422 |
422 |
423 fun NE_tac ctxt sp i = |
423 fun NE_tac ctxt sp i = |
424 TRY (rtac @{thm EqE} i) THEN |
424 TRY (resolve_tac ctxt @{thms EqE} i) THEN |
425 Rule_Insts.res_inst_tac ctxt [((("p", 0), Position.none), sp)] [] @{thm NE} i |
425 Rule_Insts.res_inst_tac ctxt [((("p", 0), Position.none), sp)] [] @{thm NE} i |
426 |
426 |
427 fun SumE_tac ctxt sp i = |
427 fun SumE_tac ctxt sp i = |
428 TRY (rtac @{thm EqE} i) THEN |
428 TRY (resolve_tac ctxt @{thms EqE} i) THEN |
429 Rule_Insts.res_inst_tac ctxt [((("p", 0), Position.none), sp)] [] @{thm SumE} i |
429 Rule_Insts.res_inst_tac ctxt [((("p", 0), Position.none), sp)] [] @{thm SumE} i |
430 |
430 |
431 fun PlusE_tac ctxt sp i = |
431 fun PlusE_tac ctxt sp i = |
432 TRY (rtac @{thm EqE} i) THEN |
432 TRY (resolve_tac ctxt @{thms EqE} i) THEN |
433 Rule_Insts.res_inst_tac ctxt [((("p", 0), Position.none), sp)] [] @{thm PlusE} i |
433 Rule_Insts.res_inst_tac ctxt [((("p", 0), Position.none), sp)] [] @{thm PlusE} i |
434 |
434 |
435 (** Predicate logic reasoning, WITH THINNING!! Procedures adapted from NJ. **) |
435 (** Predicate logic reasoning, WITH THINNING!! Procedures adapted from NJ. **) |
436 |
436 |
437 (*Finds f:Prod(A,B) and a:A in the assumptions, concludes there is z:B(a) *) |
437 (*Finds f:Prod(A,B) and a:A in the assumptions, concludes there is z:B(a) *) |
438 fun add_mp_tac ctxt i = |
438 fun add_mp_tac ctxt i = |
439 rtac @{thm subst_prodE} i THEN assume_tac ctxt i THEN assume_tac ctxt i |
439 resolve_tac ctxt @{thms subst_prodE} i THEN assume_tac ctxt i THEN assume_tac ctxt i |
440 |
440 |
441 (*Finds P-->Q and P in the assumptions, replaces implication by Q *) |
441 (*Finds P-->Q and P in the assumptions, replaces implication by Q *) |
442 fun mp_tac ctxt i = etac @{thm subst_prodE} i THEN assume_tac ctxt i |
442 fun mp_tac ctxt i = eresolve_tac ctxt @{thms subst_prodE} i THEN assume_tac ctxt i |
443 |
443 |
444 (*"safe" when regarded as predicate calculus rules*) |
444 (*"safe" when regarded as predicate calculus rules*) |
445 val safe_brls = sort (make_ord lessb) |
445 val safe_brls = sort (make_ord lessb) |
446 [ (true, @{thm FE}), (true,asm_rl), |
446 [ (true, @{thm FE}), (true,asm_rl), |
447 (false, @{thm ProdI}), (true, @{thm SumE}), (true, @{thm PlusE}) ] |
447 (false, @{thm ProdI}), (true, @{thm SumE}), (true, @{thm PlusE}) ] |