From 164fe2dc77791f446f3e180be5db07f53e22116a Mon Sep 17 00:00:00 2001 From: Michael McInerney Date: Fri, 18 Aug 2023 00:36:41 +0930 Subject: [PATCH] lib: small changes Signed-off-by: Michael McInerney --- lib/ExtraCorres.thy | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/ExtraCorres.thy b/lib/ExtraCorres.thy index d8476f0125..dc80b3e22c 100644 --- a/lib/ExtraCorres.thy +++ b/lib/ExtraCorres.thy @@ -246,7 +246,7 @@ lemma in_whileLoop_corres: "\r'. \P' r' and C' r'\ B' r' \\r'. P' r'\" and cond: "\r r' s s'. \rrel r r'; (s, s') \ srel; P r s; P' r' s'\ \ C r s = C' r' s'" and result: "(rv', t') \ fst (whileLoop C' B' r' s')" - and nf: "nf \ (\r. no_fail (P r and C r) (B r))" + and nf: "\r. nf \ no_fail (P r and C r) (B r)" shows "\s r. (s, s') \ srel \ rrel r r' \ P r s \ P' r' s' \ (\rv t. (rv, t) \ fst (whileLoop C B r s) \ (t, t') \ srel \ rrel rv rv')" apply (rule in_whileLoop_induct[OF result]) @@ -305,11 +305,11 @@ lemma whileLoop_terminates_cross: and cond: "\r r' s s'. \rrel r r'; (s, s') \ srel; P r s; P' r' s'\ \ C r s = C' r' s'" and body_inv: "\r. \P r and C r\ B r \\r. P r\" "\r'. \P' r' and C' r'\ B' r' \\r'. P' r'\" - and abs_termination: "\r s. (P r s \ C r s) \ whileLoop_terminates C B r s" + and abs_termination: "\r s. \P r s; C r s\ \ whileLoop_terminates C B r s" and ex_abs: "ex_abs_underlying srel (P r) s'" and rrel: "rrel r r'" and P': "P' r' s'" - and nf: "nf \ (\r. no_fail (P r and C r) (B r))" + and nf: "\r. nf \ no_fail (P r and C r) (B r)" shows "whileLoop_terminates C' B' r' s'" proof - have helper: "\s. P r s \ C r s \ \r' s'. rrel r r' \ (s, s') \ srel \ P r s \ P' r' s' @@ -341,7 +341,7 @@ lemma corres_whileLoop_abs_ret: and body_inv: "\r. \P r and C r\ B r \\r. P r\" "\r'. \P' r' and C' r'\ B' r' \\r'. P' r'\" and abs_termination: "\r s. (P r s \ C r s) \ whileLoop_terminates C B r s" - and nf: "nf \ (\r. no_fail (P r and C r) (B r))" + and nf: "\r. nf \ no_fail (P r and C r) (B r)" shows "corres_underlying srel nf nf' rrel (P r) (P' r') (whileLoop C B r) (whileLoop C' B' r')" apply (rule corres_underlyingI) apply (frule in_whileLoop_corres[OF body_corres body_inv]; @@ -378,9 +378,7 @@ lemma corres_whileLoop_abs_ret: apply (rename_tac abs_r) apply (rule no_fail_pre) apply (rule_tac G="rrel abs_r conc_r" in no_fail_grab_asm) - apply (rule corres_u_nofail) - apply (fastforce dest: body_corres) - apply (fastforce dest: nf) + apply (fastforce intro: corres_u_nofail dest: body_corres nf) apply (fastforce simp: cond) apply (fastforce intro: wf_subset[OF whileLoop_terminates_wf[where C=C']]) done