126 | _ => th; |
126 | _ => th; |
127 |
127 |
128 fun try_rewrite th = temp_rewrite th handle THM _ => temp_use th; |
128 fun try_rewrite th = temp_rewrite th handle THM _ => temp_use th; |
129 *} |
129 *} |
130 |
130 |
131 attribute_setup temp_unlift = {* Scan.succeed (Thm.rule_attribute (K temp_unlift)) *} "" |
131 attribute_setup temp_unlift = {* Scan.succeed (Thm.rule_attribute (K temp_unlift)) *} |
132 attribute_setup temp_rewrite = {* Scan.succeed (Thm.rule_attribute (K temp_rewrite)) *} "" |
132 attribute_setup temp_rewrite = {* Scan.succeed (Thm.rule_attribute (K temp_rewrite)) *} |
133 attribute_setup temp_use = {* Scan.succeed (Thm.rule_attribute (K temp_use)) *} "" |
133 attribute_setup temp_use = {* Scan.succeed (Thm.rule_attribute (K temp_use)) *} |
134 attribute_setup try_rewrite = {* Scan.succeed (Thm.rule_attribute (K try_rewrite)) *} "" |
134 attribute_setup try_rewrite = {* Scan.succeed (Thm.rule_attribute (K try_rewrite)) *} |
135 |
135 |
136 |
136 |
137 (* Update classical reasoner---will be updated once more below! *) |
137 (* Update classical reasoner---will be updated once more below! *) |
138 |
138 |
139 declare tempI [intro!] |
139 declare tempI [intro!] |
308 fun merge_act_box_tac ctxt i = |
308 fun merge_act_box_tac ctxt i = |
309 REPEAT_DETERM (EVERY [etac @{thm box_conjE_act} i, atac i, |
309 REPEAT_DETERM (EVERY [etac @{thm box_conjE_act} i, atac i, |
310 eres_inst_tac ctxt [(("'a", 0), "state * state")] @{thm box_thin} i]) |
310 eres_inst_tac ctxt [(("'a", 0), "state * state")] @{thm box_thin} i]) |
311 *} |
311 *} |
312 |
312 |
313 method_setup merge_box = {* Scan.succeed (K (SIMPLE_METHOD' merge_box_tac)) *} "" |
313 method_setup merge_box = {* Scan.succeed (K (SIMPLE_METHOD' merge_box_tac)) *} |
314 method_setup merge_temp_box = {* Scan.succeed (SIMPLE_METHOD' o merge_temp_box_tac) *} "" |
314 method_setup merge_temp_box = {* Scan.succeed (SIMPLE_METHOD' o merge_temp_box_tac) *} |
315 method_setup merge_stp_box = {* Scan.succeed (SIMPLE_METHOD' o merge_stp_box_tac) *} "" |
315 method_setup merge_stp_box = {* Scan.succeed (SIMPLE_METHOD' o merge_stp_box_tac) *} |
316 method_setup merge_act_box = {* Scan.succeed (SIMPLE_METHOD' o merge_act_box_tac) *} "" |
316 method_setup merge_act_box = {* Scan.succeed (SIMPLE_METHOD' o merge_act_box_tac) *} |
317 |
317 |
318 (* rewrite rule to push universal quantification through box: |
318 (* rewrite rule to push universal quantification through box: |
319 (sigma |= [](! x. F x)) = (! x. (sigma |= []F x)) |
319 (sigma |= [](! x. F x)) = (! x. (sigma |= []F x)) |
320 *) |
320 *) |
321 lemmas all_box = allT [temp_unlift, symmetric, standard] |
321 lemmas all_box = allT [temp_unlift, symmetric, standard] |
604 (simpset_of ctxt addsimps [@{thm Init_stp}, @{thm Init_act}]) [] [@{thm squareE}]))); |
604 (simpset_of ctxt addsimps [@{thm Init_stp}, @{thm Init_act}]) [] [@{thm squareE}]))); |
605 *} |
605 *} |
606 |
606 |
607 method_setup invariant = {* |
607 method_setup invariant = {* |
608 Method.sections Clasimp.clasimp_modifiers >> (K (SIMPLE_METHOD' o inv_tac)) |
608 Method.sections Clasimp.clasimp_modifiers >> (K (SIMPLE_METHOD' o inv_tac)) |
609 *} "" |
609 *} |
610 |
610 |
611 method_setup auto_invariant = {* |
611 method_setup auto_invariant = {* |
612 Method.sections Clasimp.clasimp_modifiers >> (K (SIMPLE_METHOD' o auto_inv_tac)) |
612 Method.sections Clasimp.clasimp_modifiers >> (K (SIMPLE_METHOD' o auto_inv_tac)) |
613 *} "" |
613 *} |
614 |
614 |
615 lemma unless: "|- []($P --> P` | Q`) --> (stable P) | <>Q" |
615 lemma unless: "|- []($P --> P` | Q`) --> (stable P) | <>Q" |
616 apply (unfold dmd_def) |
616 apply (unfold dmd_def) |
617 apply (clarsimp dest!: BoxPrime [temp_use]) |
617 apply (clarsimp dest!: BoxPrime [temp_use]) |
618 apply merge_box |
618 apply merge_box |