From f4107b64d81dc000fe04b4145ac005a7c1311641 Mon Sep 17 00:00:00 2001 From: Corey Lewis Date: Wed, 12 Jun 2024 09:49:48 +1000 Subject: [PATCH] lib/monads: remove FIXMEs and hoare_gets These FIXMEs were recently added and apart from removing hoare_gets I no longer think that they are worth doing, as the lemmas they refer to are used in more proofs than I first thought. Signed-off-by: Corey Lewis --- lib/Monads/nondet/Nondet_More_VCG.thy | 3 --- lib/Monads/nondet/Nondet_VCG.thy | 12 +----------- lib/Monads/trace/Trace_More_VCG.thy | 3 --- lib/Monads/trace/Trace_VCG.thy | 6 +----- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/lib/Monads/nondet/Nondet_More_VCG.thy b/lib/Monads/nondet/Nondet_More_VCG.thy index 602816f4d0..6740e78210 100644 --- a/lib/Monads/nondet/Nondet_More_VCG.thy +++ b/lib/Monads/nondet/Nondet_More_VCG.thy @@ -154,7 +154,6 @@ lemma throwErrorE_E [wp]: "\Q e\ throwError e -, \Q\" by (simp add: validE_E_def) wp -\ \FIXME: remove these inv rules?\ lemma gets_inv [simp]: "\ P \ gets f \ \r. P \" by (simp add: gets_def, wp) @@ -163,8 +162,6 @@ lemma select_inv: "\ P \ select S \ \r. P \" by wpsimp -lemmas return_inv = hoare_return_drop_var - lemma assert_inv: "\P\ assert Q \\r. P\" unfolding assert_def diff --git a/lib/Monads/nondet/Nondet_VCG.thy b/lib/Monads/nondet/Nondet_VCG.thy index ad97f941be..9e0a7199d7 100644 --- a/lib/Monads/nondet/Nondet_VCG.thy +++ b/lib/Monads/nondet/Nondet_VCG.thy @@ -221,32 +221,22 @@ lemma hoare_FalseE[simp]: "\\\ f \Q\,\E\" by (simp add: valid_def validE_def) -\ \FIXME: remove?\ -lemma hoare_return_drop_var[iff]: +lemma return_inv[iff]: "\Q\ return x \\r. Q\" by (simp add: valid_def return_def) -\ \FIXME: remove?\ -lemma hoare_gets[intro]: - "\ \s. P s \ Q (f s) s \ \ \P\ gets f \Q\" - by (simp add:valid_def gets_def get_def bind_def return_def) - -\ \FIXME: remove?\ lemma hoare_modifyE_var: "\ \s. P s \ Q (f s) \ \ \P\ modify f \\_ s. Q s\" by(simp add: valid_def modify_def put_def get_def bind_def) -\ \FIXME: remove?\ lemma hoare_if: "\ P' \ \P\ f \Q\; \ P' \ \P\ g \Q\ \ \ \P\ if P' then f else g \Q\" by (simp add: valid_def) -\ \FIXME: remove?\ lemma hoare_pre_subst: "\ P = P'; \P\ f \Q\ \ \ \P'\ f \Q\" by (erule subst) -\ \FIXME: remove?\ lemma hoare_post_subst: "\ Q = Q'; \P\ f \Q\ \ \ \P\ f \Q'\" by (erule subst) diff --git a/lib/Monads/trace/Trace_More_VCG.thy b/lib/Monads/trace/Trace_More_VCG.thy index 38992c13ed..b3f0fa9992 100644 --- a/lib/Monads/trace/Trace_More_VCG.thy +++ b/lib/Monads/trace/Trace_More_VCG.thy @@ -154,7 +154,6 @@ lemma throwErrorE_E [wp]: "\Q e\ throwError e -, \Q\" by (simp add: validE_E_def) wp -\ \FIXME: remove these inv rules?\ lemma gets_inv [simp]: "\ P \ gets f \ \r. P \" by (simp add: gets_def, wp) @@ -163,8 +162,6 @@ lemma select_inv: "\ P \ select S \ \r. P \" by wpsimp -lemmas return_inv = hoare_return_drop_var - lemma assert_inv: "\P\ assert Q \\r. P\" unfolding assert_def diff --git a/lib/Monads/trace/Trace_VCG.thy b/lib/Monads/trace/Trace_VCG.thy index f5849c555a..4b8170b5d3 100644 --- a/lib/Monads/trace/Trace_VCG.thy +++ b/lib/Monads/trace/Trace_VCG.thy @@ -217,14 +217,10 @@ lemma hoare_FalseE[simp]: "\\\ f \Q\,\E\" by (simp add: valid_def validE_def) -lemma hoare_return_drop_var[iff]: +lemma return_inv[iff]: "\Q\ return x \\r. Q\" by (simp add: valid_def return_def mres_def) -lemma hoare_gets[intro]: - "\ \s. P s \ Q (f s) s \ \ \P\ gets f \Q\" - by (simp add:valid_def gets_def get_def bind_def return_def mres_def) - lemma hoare_modifyE_var: "\ \s. P s \ Q (f s) \ \ \P\ modify f \\_ s. Q s\" by(simp add: valid_def modify_def put_def get_def bind_def mres_def)