fact stringlengths 4 2k | type stringclasses 20
values | library stringclasses 8
values | imports listlengths 0 41 | filename stringlengths 11 62 | symbolic_name stringlengths 1 69 | docstring stringclasses 1
value |
|---|---|---|---|---|---|---|
corresK_returnOk [corresK_concrete_r]: "corres_underlyingK sr nf nf' (r (Inr a) (Inr b)) r \<top> \<top> (returnOk a) (returnOk b)" by (simp add: returnOk_def corres_underlyingK_def) | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corresK_returnOk | |
corres_assertE_str [corresK]: "corres_underlyingK sr nf nf' ((nf' \<longrightarrow> Q) \<and> P) (f \<oplus> dc) \<top> \<top> (assertE P) (assertE Q)" by (auto simp add: corres_underlying_def corres_underlyingK_def returnOk_def return_def assertE_def fail_def) lemmas corres_symb_exec_whenE_l_search[corresK_symb_exec_l... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corres_assertE_str | |
corresK_fail [corresK]: "corres_underlyingK sr nf True False r P P' f fail" by (simp add: corres_underlyingK_def) | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corresK_fail | |
corresK_fail_no_fail '[corresK]: "corres_underlyingK sr nf False True (\<lambda>_ _. False) (\<lambda>_. True) (\<lambda>_. True) f fail" apply (simp add: corres_underlyingK_def) by (fastforce intro!: corres_fail) | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corresK_fail_no_fail | |
corres_inst_eq_imp : "corres_inst_eq A B \<Longrightarrow> A \<longrightarrow> B" by (simp add: corres_inst_eq_def) lemmas corres_hoare_pre = hoare_pre[# \<open>-\<close> \<open>atomize (full), rule allI, rule corres_inst_eq_imp\<close>] method corresKwp uses wp = (determ \<open> (fails \<open>schematic_hoare_pre\<clos... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corres_inst_eq_imp | |
corres_inst_conj_lift [corresKwp_wp_comb]: "\<lbrakk>\<lbrace>R\<rbrace> f \<lbrace>Q\<rbrace>; \<lbrace>P'\<rbrace> f \<lbrace>Q'\<rbrace>; \<And>s. corres_inst_eq (R s) (P s)\<rbrakk> \<Longrightarrow> \<lbrace>\<lambda>s. P s \<and> P' s\<rbrace> f \<lbrace>\<lambda>rv s. Q rv s \<and> Q' rv s\<rbrace>" by (rule hoa... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corres_inst_conj_lift | |
corresK_convert : "A \<longrightarrow> corres_underlying sr nf nf' r P Q f f' \<Longrightarrow> corres_underlyingK sr nf nf' A r P Q f f'" by (auto simp add: corres_underlyingK_def) method corresK_convert = (((drule uncurry)+)?, drule corresK_convert corresK_drop) | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | corresK_convert | |
use_corresK ': "corres_underlyingK sr False nf' F r PP PP' f f' \<Longrightarrow> \<lbrace>P\<rbrace> f \<lbrace>Q\<rbrace> \<Longrightarrow> \<lbrace>K F and PP' and ex_abs_underlying sr (PP and P)\<rbrace> f' \<lbrace>\<lambda>rv' s'. \<exists>rv. r rv rv' \<and> ex_abs_underlying sr (Q rv) s'\<rbrace>" by (fastforce... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | use_corresK | |
use_corresK [wp]: "corres_underlyingK sr False nf' F r PP PP' f f' \<Longrightarrow> \<lbrace>P\<rbrace> f \<lbrace>\<lambda>rv s. \<forall>rv'. r rv rv' \<longrightarrow> Q rv' s\<rbrace> \<Longrightarrow> \<lbrace>K F and PP' and ex_abs_underlying sr (PP and P)\<rbrace> f' \<lbrace>\<lambda>rv'. ex_abs_underlying sr ... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | use_corresK | |
hoare_add_post ': "\<lbrakk>\<lbrace>P'\<rbrace> f \<lbrace>Q'\<rbrace>; \<lbrace>P''\<rbrace> f \<lbrace>\<lambda>rv s. Q' rv s \<longrightarrow> Q rv s\<rbrace>\<rbrakk> \<Longrightarrow> \<lbrace>P' and P''\<rbrace> f \<lbrace>Q\<rbrace>" by (fastforce simp add: valid_def) | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | hoare_add_post | |
use_corresK_frame : assumes corres: "corres_underlyingK sr False nf' F r PP P' f f'" assumes frame: "(\<forall>s s' rv rv'. (s,s') \<in> sr \<longrightarrow> r rv rv' \<longrightarrow> Q rv s \<longrightarrow> Q' rv' s' \<longrightarrow> QQ' rv' s')" assumes valid: "\<lbrace>P\<rbrace> f \<lbrace>Q\<rbrace>" assumes va... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | use_corresK_frame | |
use_corresK_frame_E_R : assumes corres: "corres_underlyingK sr False nf' F (lf \<oplus> r) PP P' f f'" assumes frame: "(\<forall>s s' rv rv'. (s,s') \<in> sr \<longrightarrow> r rv rv' \<longrightarrow> Q rv s \<longrightarrow> Q' rv' s' \<longrightarrow> QQ' rv' s')" assumes valid: "\<lbrace>P\<rbrace> f \<lbrace>Q\<r... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | use_corresK_frame_E_R | |
K_True : "K True = (\<lambda>_. True)" by simp | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | K_True | |
True_And : "((\<lambda>_. True) and P) = P" by simp method use_corresK uses frame = (corresK_convert?, drule use_corresK_frame use_corresK_frame_E_R, rule frame, (solves \<open>wp\<close> | defer_tac), (solves \<open>wp\<close> | defer_tac), (simp only: True_And K_True)?) experiment fixes sr nf' r P P' f f' F G Q Q' QQ... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | True_And | |
lift_args_corres : "corres_underlying sr nf nf' r (P x) (P' x) (f x) (f' x) \<Longrightarrow> x = x' \<Longrightarrow> corres_underlying sr nf nf' r (P x) (P' x') (f x) (f' x')" by simp method lift_corres_args = (match premises in H[thin]:"corres_underlying _ _ _ _ (P x) (P' x) (f x) (f' x)" (cut 5) for P P' f f' x \<R... | lemma | lib | [
"Corres_Cases",
"SpecValid_R"
] | lib/CorresK_Method.thy | lift_args_corres | |
corres_adjust_preconds begin text \<open>Worker predicates. Broadly speaking, a goal of the form "preconds ?A ?B ?C ?D ==> P" expects to establish P by instantiating ?A, or failing that ?B, etc. A goal of the form finalise_preconds A exists to make sure that schematic conjuncts of A are resolved to True.\<close> | locale | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | corres_adjust_preconds | |
preconds :: "bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool" where "preconds A B C D = (A \<and> B \<and> C \<and> D)" | definition | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | preconds | |
finalise_preconds :: "bool \<Rightarrow> bool" where "finalise_preconds A = True" text \<open>Use a precond directly to establish goal.\<close> | definition | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | finalise_preconds | |
consume_preconds : "preconds A True True True \<Longrightarrow> A" "preconds True B True True \<Longrightarrow> B" "preconds True True C True \<Longrightarrow> C" "preconds True True True D \<Longrightarrow> D" by (simp_all add: preconds_def) lemmas consume_preconds_True = consume_preconds(1)[where A=True] text \<open>... | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | consume_preconds | |
split_preconds_left : "preconds (A \<and> A') (B \<and> B') (C \<and> C') (D \<and> D') \<Longrightarrow> preconds A B C D" "preconds (A \<and> A') (B \<and> B') (C \<and> C') True \<Longrightarrow> preconds A B C True" "preconds (A \<and> A') (B \<and> B') True True \<Longrightarrow> preconds A B True True" "preconds ... | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | split_preconds_left | |
split_preconds_right : "preconds (A \<and> A') (B \<and> B') (C \<and> C') (D \<and> D') \<Longrightarrow> preconds A' B' C' D'" "preconds (A \<and> A') (B \<and> B') (C \<and> C') True \<Longrightarrow> preconds A' B' C' True" "preconds (A \<and> A') (B \<and> B') True True \<Longrightarrow> preconds A' B' True True" ... | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | split_preconds_right | |
preconds_goal_initiate : "preconds A B C D \<Longrightarrow> (preconds A B C D \<Longrightarrow> Q) \<Longrightarrow> finalise_preconds (A \<and> B \<and> C \<and> D) \<Longrightarrow> Q" by simp text \<open>Finalise preconds, trying to replace conjuncts with True if they are not yet instantiated.\<close> | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | preconds_goal_initiate | |
finalise_preconds : "finalise_preconds True" "finalise_preconds A \<Longrightarrow> finalise_preconds B \<Longrightarrow> finalise_preconds (A \<and> B)" "finalise_preconds X" by (simp_all add: finalise_preconds_def) text \<open>Shape of the whole process for application to regular corres goals.\<close> | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | finalise_preconds | |
corres_adjust_pre : "corres_underlying R nf nf' rs P Q f f' \<Longrightarrow> (\<And>s s'. (s, s') \<in> R \<Longrightarrow> preconds (P1 s) (Q1 s') True True \<Longrightarrow> P s) \<Longrightarrow> (\<And>s s'. (s, s') \<in> R \<Longrightarrow> preconds (Q2 s') (P2 s) True True \<Longrightarrow> Q s') \<Longrightarro... | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | corres_adjust_pre | |
intro_split ctxt intros i = ((resolve_tac ctxt intros THEN_ALL_NEW (TRY o assume_tac ctxt)) THEN_ALL_NEW (fn j => (EVERY (replicate (j - i) (dresolve_tac ctxt @{thms split_preconds_left} j))) THEN dresolve_tac ctxt @{thms split_preconds_right} j)) i | fun | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | intro_split | |
handle_preconds ctxt intros = TRY o (eresolve_tac ctxt [@{thm preconds_goal_initiate}] THEN' REPEAT_ALL_NEW (eresolve_tac ctxt @{thms consume_preconds_True} ORELSE' intro_split ctxt (intros @ def_intros) ORELSE' eresolve_tac ctxt @{thms consume_preconds}) THEN' REPEAT_ALL_NEW (resolve_tac ctxt @{thms finalise_preconds}... | fun | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | handle_preconds | |
mk_adj_preconds ctxt intros rule = let val xs = [rule] RL (Named_Theorems.get ctxt @{named_theorems corres_adjust_precond_structures}) val x = case xs of [] => raise THM ("no unifier with corres_adjust_precond_structures", 1, [rule]) | xs => hd xs in x |> ALLGOALS (handle_preconds ctxt intros) |> Seq.hd |> Simplifier.s... | fun | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | mk_adj_preconds | |
test_sr :: "(nat \<times> nat) set" where "test_sr = {(x, y). y = 2 * x}" | definition | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | test_sr | |
test_corres : "corres_underlying test_sr nf nf' dc (\<lambda>x. x < 40) (\<lambda>y. y < 30 \<and> y = 6) (modify (\<lambda>x. x + 2)) (modify (\<lambda>y. 10))" by (simp add: corres_underlying_def simpler_modify_def test_sr_def) | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | test_corres | |
test_adj_precond : "(x, y) \<in> test_sr \<Longrightarrow> x = 3 \<Longrightarrow> y = 6" by (simp add: test_sr_def) ML \<open> Corres_Adjust_Preconds.mk_adj_preconds @{context} [@{thm test_adj_precond}] @{thm test_corres} \<close> | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | test_adj_precond | |
foo_adj_corres : "corres_underlying test_sr nf nf' dc (\<lambda>s. s < 40 \<and> s = 3) (\<lambda>s'. s' < 30) (modify (\<lambda>x. x + 2)) (modify (\<lambda>y. 10))" by (rule test_corres[adj_corres test_adj_precond]) text \<open>A more general demo of what it does.\<close> | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | foo_adj_corres | |
assumes my_corres: "corres_underlying my_sr nf nf' rvrel P Q a c" assumes my_adj: "\<And>s s'. (s,s') \<in> my_sr \<Longrightarrow> P s \<Longrightarrow> Q s'" shows "corres_underlying my_sr nf nf' rvrel (\<lambda>s. P s \<and> P s) (\<lambda>s'. True) a c" apply (rule my_corres[adj_corres my_adj]) done | lemma | lib | [
"\"Corres_UL\""
] | lib/Corres_Adjust_Preconds.thy | assumes | |
get_split_rule ctxt target = let val (hdTarget, args) = strip_comb (Envir.eta_contract target) val (constNm, _) = dest_Const hdTarget val constNm_fds = String.fields (fn c => c = #".") constNm val _ = if String.isPrefix "case_" (List.last constNm_fds) then () else raise TERM ("Not a case statement", [target]) val typeN... | fun | lib | [
"Corres_UL"
] | lib/Corres_Cases.thy | get_split_rule | |
no_fail_triv : "no_fail P f \<Longrightarrow> no_fail P f" . lemmas hoare_trivs = hoare_triv hoare_trivE hoare_trivE_R hoare_trivR_R no_fail_triv (* Succeed if the conclusion is a wp/no_fail goal and also not purely schematic*) method is_wp = succeeds \<open>rule hoare_trivs\<close>, fails \<open>rule TrueI\<close> lem... | lemma | lib | [
"Corres_Cases",
"ExtraCorres"
] | lib/Corres_Method.thy | no_fail_triv | |
corres_get_trivial [corres_term]: "corres_underlying sr nf nf' (\<lambda>s s'. (s,s') \<in> sr) \<top> \<top> get get" by simp lemmas corres_underlying_stateAssert_stateAssert_trivial[corres_term] = corres_underlying_stateAssert_stateAssert[where P=\<top> and P'=\<top>, simplified] | lemma | lib | [
"Corres_Cases",
"ExtraCorres"
] | lib/Corres_Method.thy | corres_get_trivial | |
corres_modify_tivial [corres_term]: "(\<And>s s'. (s, s') \<in> sr \<Longrightarrow> (f s, g s') \<in> sr) \<Longrightarrow> corres_underlying sr nf nf' dc \<top> \<top> (modify f) (modify g)" by (simp add: corres_modify) (* Regular corres rules are rules where we expect side conditions to be solvable once the rule mat... | lemma | lib | [
"Corres_Cases",
"ExtraCorres"
] | lib/Corres_Method.thy | corres_modify_tivial | |
corres_underlying :: "(('s \<times> 't) set) \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('s \<Rightarrow> bool) \<Rightarrow> ('t \<Rightarrow> bool) \<Rightarrow> ('s, 'a) nondet_monad \<Rightarrow> ('t, 'b) nondet_monad \<Rightarrow> bool" where "corres_... | definition | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlying | |
corres_underlyingI : assumes rv: "\<And>s t rv' t'. \<lbrakk>(s, t) \<in> R; P s; P' t; (rv', t') \<in> fst (c t)\<rbrakk> \<Longrightarrow> \<exists>(rv, s') \<in> fst (a s). (s', t') \<in> R \<and> r rv rv'" and nf: "\<And>s t. \<lbrakk>(s, t) \<in> R; P s; P' t; nf'\<rbrakk> \<Longrightarrow> \<not> snd (c t)" shows... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlyingI | |
corres_underlyingE : assumes cul: "corres_underlying R nf nf' r P P' a c" and xin: "(s, t) \<in> R" "P s" "P' t" "(rv', t') \<in> fst (c t)" and rl: "\<And>s' rv. \<lbrakk>nf' \<longrightarrow> \<not> snd (c t); (rv, s') \<in> fst (a s); (s', t') \<in> R; r rv rv'\<rbrakk> \<Longrightarrow> Q" and nf: "nf \<longrightar... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlyingE | |
corres_underlyingD : "\<lbrakk> corres_underlying R nf nf' rs P P' f f'; (s,s') \<in> R; P s; P' s'; nf \<longrightarrow> \<not> snd (f s) \<rbrakk> \<Longrightarrow> (\<forall>(r',t')\<in>fst (f' s'). \<exists>(r,t)\<in>fst (f s). (t, t') \<in> R \<and> rs r r') \<and> (nf' \<longrightarrow> \<not> snd (f' s'))" by (f... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlyingD | |
corres_underlyingD2 : "\<lbrakk> corres_underlying R nf nf' rs P P' f f'; (s,s') \<in> R; P s; P' s'; (r',t')\<in>fst (f' s'); nf \<longrightarrow> \<not> snd (f s) \<rbrakk> \<Longrightarrow> \<exists>(r,t)\<in>fst (f s). (t, t') \<in> R \<and> rs r r'" by (fastforce dest: corres_underlyingD) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlyingD2 | |
propagate_no_fail : "\<lbrakk> corres_underlying S nf True R P P' f f'; no_fail P f; \<forall>s'. P' s' \<longrightarrow> (\<exists>s. P s \<and> (s,s') \<in> S) \<rbrakk> \<Longrightarrow> no_fail P' f'" apply (clarsimp simp: corres_underlying_def no_fail_def) apply (erule allE, erule (1) impE) apply clarsimp apply (d... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | propagate_no_fail | |
corres_underlying_serial : "\<lbrakk> corres_underlying S False True rrel G G' m m'; empty_fail m' \<rbrakk> \<Longrightarrow> \<forall>s. (\<exists>s'. (s,s') \<in> S \<and> G s \<and> G' s') \<longrightarrow> fst (m s) \<noteq> {}" apply (clarsimp simp: corres_underlying_def empty_fail_def) apply (drule_tac x="(s, s'... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlying_serial | |
corres_singleton : "corres_underlying sr nf nf' r P P' (\<lambda>s. ({(R s, S s)},x)) (\<lambda>s. ({(R' s, S' s)},False)) = (\<forall>s s'. P s \<and> P' s' \<and> (s, s') \<in> sr \<and> (nf \<longrightarrow> \<not> x) \<longrightarrow> ((S s, S' s') \<in> sr \<and> r (R s) (R' s')))" by (auto simp: corres_underlying... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_singleton | |
corres_return [simp, corres_no_simp]: "corres_underlying sr nf nf' r P P' (return a) (return b) = ((\<exists>s s'. P s \<and> P' s' \<and> (s, s') \<in> sr) \<longrightarrow> r a b)" by (simp add: return_def corres_singleton) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_return | |
corres_get [simp, corres_no_simp]: "corres_underlying sr nf nf' r P P' get get = (\<forall> s s'. (s, s') \<in> sr \<and> P s \<and> P' s' \<longrightarrow> r s s')" by (fastforce simp: get_def corres_singleton) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_get | |
corres_gets [simp, corres_no_simp]: "corres_underlying sr nf nf' r P P' (gets a) (gets b) = (\<forall> s s'. P s \<and> P' s' \<and> (s, s') \<in> sr \<longrightarrow> r (a s) (b s'))" by (simp add: simpler_gets_def corres_singleton) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_gets | |
corres_gets_return : "corres_underlying sr nf nf' r P P' (gets f) (return v) = (\<forall>s s'. ((s, s') \<in> sr \<and> P s \<and> P' s') \<longrightarrow> r (f s) v)" by (fastforce simp: corres_underlying_def gets_def get_def return_def bind_def) text \<open>A safer non-rewrite version of @{thm corres_gets_return} \<c... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_gets_return | |
corres_gets_return_trivial : "(\<And>s s'. \<lbrakk>(s, s') \<in> sr; P s; P' s'\<rbrakk> \<Longrightarrow> r (f s) v) \<Longrightarrow> corres_underlying sr nf nf' r P P' (gets f) (return v)" by (fastforce simp: corres_gets_return) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_gets_return_trivial | |
corres_throwError [simp, corres_no_simp]: "corres_underlying sr nf nf' r P P' (throwError a) (throwError b) = ((\<exists>s s'. P s \<and> P' s' \<and> (s, s') \<in> sr) \<longrightarrow> r (Inl a) (Inl b))" by (simp add: throwError_def) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_throwError | |
corres_no_failI_base : assumes f: "nf \<Longrightarrow> no_fail P f" assumes f': "nf' \<Longrightarrow> no_fail P' f'" assumes corres: "\<forall>(s, s') \<in> S. P s \<and> P' s' \<longrightarrow> (\<forall>(r', t') \<in> fst (f' s'). \<exists>(r, t) \<in> fst (f s). (t, t') \<in> S \<and> R r r')" shows "corres_underl... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_no_failI_base | |
corres_no_failI : assumes f': "nf' \<Longrightarrow> no_fail P' f'" assumes corres: "\<forall>(s, s') \<in> S. P s \<and> P' s' \<longrightarrow> (\<forall>(r', t') \<in> fst (f' s'). \<exists>(r, t) \<in> fst (f s). (t, t') \<in> S \<and> R r r')" shows "corres_underlying S False nf' R P P' f f'" using assms by (simp ... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_no_failI | |
corres_cong : assumes "\<And>s. P s = P' s" assumes "\<And>s s'. \<lbrakk> (s,s') \<in> sr; P' s \<rbrakk> \<Longrightarrow> Q s' = Q' s'" assumes "\<And>s s'. \<lbrakk> (s,s') \<in> sr; P' s; Q' s' \<rbrakk> \<Longrightarrow> f s = f' s" assumes "\<And>s s'. \<lbrakk> (s,s') \<in> sr; P' s; Q' s' \<rbrakk> \<Longright... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_cong | |
corres_weaker_cong : assumes "f = f'" assumes "g = g'" shows "corres_underlying sr nf nf' r P Q f g = corres_underlying sr nf nf' r P Q f' g'" by (simp add: assms cong: corres_cong) (* Rewrite only the return relation, with context. Occasionally useful: *) lemmas corres_rel_cong = corres_cong[OF refl refl refl refl] (*... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_weaker_cong | |
assumes cross_rule: "\<And>s s'. \<lbrakk> (s,s') \<in> sr; Q s \<rbrakk> \<Longrightarrow> Q' s'" shows "corres_underlying sr nf nf' r (K P and Q) (Q' and K P) (assert P) (do get; assert P od)" including corres_no_cong (* current default *) apply simp (* simplifies K, but nothing else *) including corres_cong apply si... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | assumes | |
stronger_corres_guard_imp [corres_pre]: assumes x: "corres_underlying sr nf nf' r Q Q' f g" assumes y: "\<And>s s'. \<lbrakk> P s; P' s'; (s, s') \<in> sr \<rbrakk> \<Longrightarrow> Q s" assumes z: "\<And>s s'. \<lbrakk> P s; P' s'; (s, s') \<in> sr \<rbrakk> \<Longrightarrow> Q' s'" shows "corres_underlying sr nf nf'... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | stronger_corres_guard_imp | |
corres_guard_imp : assumes x: "corres_underlying sr nf nf' r Q Q' f g" assumes y: "\<And>s. P s \<Longrightarrow> Q s" "\<And>s. P' s \<Longrightarrow> Q' s" shows "corres_underlying sr nf nf' r P P' f g" apply corres_pre apply (rule x) apply (simp add: y)+ done | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_guard_imp | |
corres_guard_imp2 : "\<lbrakk>corres_underlying sr nf nf' r Q P' f g; \<And>s. P s \<Longrightarrow> Q s\<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r P P' f g" by corres_pre (* FIXME: names\<dots> (cf. corres_guard2_imp below) *) lemmas corres_guard1_imp = corres_guard_imp2 | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_guard_imp2 | |
corres_guard2_imp : "\<lbrakk>corres_underlying sr nf nf' r P Q' f g; \<And>s. P' s \<Longrightarrow> Q' s\<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r P P' f g" by corres_pre named_theorems corres_rrel_pre (* Introduce schematic return relation, fail if already schematic *) method corres_rrel_pre = WP_Pre.... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_guard2_imp | |
corres_rel_imp [corres_rrel_pre]: assumes x: "corres_underlying sr nf nf' r' P P' f g" assumes y: "\<And>x y. r' x y \<Longrightarrow> r x y" shows "corres_underlying sr nf nf' r P P' f g" apply (insert x) apply (simp add: corres_underlying_def) apply clarsimp apply (drule (1) bspec, clarsimp) apply (drule (1) bspec, c... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_rel_imp | |
corres_underlying_split : assumes ac: "corres_underlying sr nf nf' r' P P' a c" assumes bd: "\<And>rv rv'. r' rv rv' \<Longrightarrow> corres_underlying sr nf nf' r (Q rv) (Q' rv') (b rv) (d rv')" assumes valid: "\<lbrace>P\<rbrace> a \<lbrace>Q\<rbrace>" "\<lbrace>P'\<rbrace> c \<lbrace>Q'\<rbrace>" shows "corres_unde... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlying_split | |
corres_split : assumes x: "corres_underlying sr nf nf' r' P P' a c" assumes y: "\<And>rv rv'. r' rv rv' \<Longrightarrow> corres_underlying sr nf nf' r (R rv) (R' rv') (b rv) (d rv')" assumes "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbrace>R'\<rbrace>" shows "corres_underlying sr nf nf' r (... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split | |
corres_split_forwards : assumes ac: "corres_underlying sr nf nf' r' P P' a c" assumes valid: "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbrace>R'\<rbrace>" assumes bd: "\<And>rv rv'. r' rv rv' \<Longrightarrow> corres_underlying sr nf nf' r (R rv) (R' rv') (b rv) (d rv')" shows "corres_underl... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_forwards | |
rel_sum_comb :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('c \<Rightarrow> 'd \<Rightarrow> bool) \<Rightarrow> ('a + 'c \<Rightarrow> 'b + 'd \<Rightarrow> bool)" (infixl "\<oplus>" 95) where "(f \<oplus> g) (Inr x) y = (\<exists>y'. y = Inr y' \<and> (g x y'))" | "(f \<oplus> g) (Inl x) y = (\<exists>y... | primrec | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | rel_sum_comb | |
rel_sum_comb_r2 [simp]: "(f \<oplus> g) x (Inr y) = (\<exists>x'. x = Inr x' \<and> g x' y)" apply (case_tac x, simp_all) done | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | rel_sum_comb_r2 | |
rel_sum_comb_l2 [simp]: "(f \<oplus> g) x (Inl y) = (\<exists>x'. x = Inl x' \<and> f x' y)" apply (case_tac x, simp_all) done | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | rel_sum_comb_l2 | |
corres_splitEE : assumes "corres_underlying sr nf nf' (f \<oplus> r') P P' a c" assumes y: "\<And>rv rv'. r' rv rv' \<Longrightarrow> corres_underlying sr nf nf' (f \<oplus> r) (R rv) (R' rv') (b rv) (d rv')" assumes x: "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>,\<lbrace>\<top>\<top>\<rbrace>" "\<lbrace>Q'\<rbrace> c \... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_splitEE | |
corres_splitEE_prod : assumes x: "corres_underlying sr nf nf' (f \<oplus> r') P P' a c" assumes y: "\<And>x y x' y'. r' (x, y) (x', y') \<Longrightarrow> corres_underlying sr nf nf' (f \<oplus> r) (R x y) (R' x' y') (b x y) (d x' y')" assumes z: "\<lbrace>Q\<rbrace> a \<lbrace>\<lambda>(x, y). R x y \<rbrace>,\<lbrace>... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_splitEE_prod | |
corres_split_handle : assumes "corres_underlying sr nf nf' (f' \<oplus> r) P P' a c" assumes y: "\<And>ft ft'. f' ft ft' \<Longrightarrow> corres_underlying sr nf nf' (f \<oplus> r) (E ft) (E' ft') (b ft) (d ft')" assumes x: "\<lbrace>Q\<rbrace> a \<lbrace>\<top>\<top>\<rbrace>,\<lbrace>E\<rbrace>" "\<lbrace>Q'\<rbrace... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_handle | |
corres_split_catch : assumes x: "corres_underlying sr nf nf' (f \<oplus> r) P P' a c" assumes y: "\<And>ft ft'. f ft ft' \<Longrightarrow> corres_underlying sr nf nf' r (E ft) (E' ft') (b ft) (d ft')" assumes z: "\<lbrace>Q\<rbrace> a \<lbrace>\<top>\<top>\<rbrace>,\<lbrace>E\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbrace>... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_catch | |
corres_split_eqr : assumes x: "corres_underlying sr nf nf' (=) P P' a c" assumes y: "\<And>rv. corres_underlying sr nf nf' r (R rv) (R' rv) (b rv) (d rv)" assumes z: "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbrace>R'\<rbrace>" shows "corres_underlying sr nf nf' r (P and Q) (P' and Q') (a >>... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_eqr | |
dc_simp [simp]: "dc a b" by (simp add: dc_def) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | dc_simp | |
dc_o_simp1 [simp]: "dc \<circ> f = dc" by (simp add: dc_def o_def) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | dc_o_simp1 | |
dc_o_simp2 [simp]: "dc x \<circ> f = dc x" by (simp add: dc_def o_def) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | dc_o_simp2 | |
unit_dc_is_eq : "(dc::unit\<Rightarrow>_\<Rightarrow>_) = (=)" by (fastforce simp: dc_def) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | unit_dc_is_eq | |
corres_split_nor : "\<lbrakk> corres_underlying sr nf nf' dc P P' a c; corres_underlying sr nf nf' r R R' b d; \<lbrace>Q\<rbrace> a \<lbrace>\<lambda>x. R\<rbrace>; \<lbrace>Q'\<rbrace> c \<lbrace>\<lambda>x. R'\<rbrace> \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r (P and Q) (P' and Q') (a >>= (\<lambda>r... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_nor | |
corres_split_norE : "\<lbrakk> corres_underlying sr nf nf' (f \<oplus> dc) P P' a c; corres_underlying sr nf nf' (f \<oplus> r) R R' b d; \<lbrace>Q\<rbrace> a \<lbrace>\<lambda>x. R\<rbrace>, \<lbrace>\<top>\<top>\<rbrace>; \<lbrace>Q'\<rbrace> c \<lbrace>\<lambda>x. R'\<rbrace>,\<lbrace>\<top>\<top>\<rbrace> \<rbrakk... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_norE | |
corres_split_eqrE : assumes z: "corres_underlying sr nf nf' (f \<oplus> (=)) P P' a c" assumes y: "\<And>rv. corres_underlying sr nf nf' (f \<oplus> r) (R rv) (R' rv) (b rv) (d rv)" assumes x: "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>,\<lbrace>\<top>\<top>\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbrace>R'\<rbrace>,\<lbrac... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_eqrE | |
corres_split_mapr : assumes y: "corres_underlying sr nf nf' ((=) \<circ> f) P P' a c" assumes x: "\<And>rv. corres_underlying sr nf nf' r (R rv) (R' (f rv)) (b rv) (d (f rv))" assumes z: "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbrace>R'\<rbrace>" shows "corres_underlying sr nf nf' r (P and... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_mapr | |
corres_split_maprE : assumes z: "corres_underlying sr nf nf' (r' \<oplus> ((=) \<circ> f)) P P' a c" assumes y: "\<And>rv. corres_underlying sr nf nf' (r' \<oplus> r) (R rv) (R' (f rv)) (b rv) (d (f rv))" assumes x: "\<lbrace>Q\<rbrace> a \<lbrace>R\<rbrace>,\<lbrace>\<top>\<top>\<rbrace>" "\<lbrace>Q'\<rbrace> c \<lbr... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_split_maprE | |
corres_if : "\<lbrakk> G = G'; corres_underlying sr nf nf' r P P' a c; corres_underlying sr nf nf' r Q Q' b d \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r (if G then P else Q) (if G' then P' else Q') (if G then a else b) (if G' then c else d)" by simp | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_if | |
corres_whenE : "\<lbrakk> G = G'; corres_underlying sr nf nf' (fr \<oplus> r) P P' f g; r () () \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' (fr \<oplus> r) (\<lambda>s. G \<longrightarrow> P s) (\<lambda>s. G' \<longrightarrow> P' s) (whenE G f) (whenE G' g)" by (simp add: whenE_def returnOk_def) lemmas cor... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_whenE | |
corres_if_r : "\<lbrakk> corres_underlying sr nf nf' r P P' a c; corres_underlying sr nf nf' r P Q' a d \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r (P) (if G' then P' else Q') (a) (if G' then c else d)" by (simp) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_if_r | |
corres_if3 : "\<lbrakk> G = G'; G \<Longrightarrow> corres_underlying sr nf nf' r P P' a c; \<not> G' \<Longrightarrow> corres_underlying sr nf nf' r Q Q' b d \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r (if G then P else Q) (if G' then P' else Q') (if G then a else b) (if G' then c else d)" by simp | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_if3 | |
corres_if_strong : "\<lbrakk>\<And>s s'. \<lbrakk>(s, s') \<in> sr; R s; R' s'\<rbrakk> \<Longrightarrow> G = G'; \<lbrakk>G; G'\<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r P P' a c; \<lbrakk>\<not> G; \<not> G'\<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r Q Q' b d \<rbrakk> \<Longrightarrow> c... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_if_strong | |
corres_liftM_simp [simp]: "corres_underlying sr nf nf' r P P' (liftM t f) g = corres_underlying sr nf nf' (r \<circ> t) P P' f g" by (fastforce simp add: corres_underlying_def in_liftM) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_liftM_simp | |
corres_liftM2_simp [simp]: "corres_underlying sr nf nf' r P P' f (liftM t g) = corres_underlying sr nf nf' (\<lambda>x. r x \<circ> t) P P' f g" by (fastforce simp add: corres_underlying_def in_liftM) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_liftM2_simp | |
corres_liftE_rel_sum [simp]: "corres_underlying sr nf nf' (f \<oplus> r) P P' (liftE m) (liftE m') = corres_underlying sr nf nf' r P P' m m'" by (simp add: liftE_liftM o_def) lemmas corres_liftE_lift = corres_liftE_rel_sum[THEN iffD2] text \<open>Support for proving correspondence to noop with hoare triples\<close> | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_liftE_rel_sum | |
corres_noop : assumes P: "\<And>s. P s \<Longrightarrow> \<lbrace>\<lambda>s'. (s, s') \<in> sr \<and> P' s'\<rbrace> f \<lbrace>\<lambda>rv s'. (s, s') \<in> sr \<and> r x rv\<rbrace>" assumes nf': "\<And>s. \<lbrakk> P s; nf' \<rbrakk> \<Longrightarrow> no_fail (\<lambda>s'. (s, s') \<in> sr \<and> P' s') f" shows "c... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_noop | |
corres_noopE : assumes P: "\<And>s. P s \<Longrightarrow> \<lbrace>\<lambda>s'. (s, s') \<in> sr \<and> P' s'\<rbrace> f \<lbrace>\<lambda>rv s'. (s, s') \<in> sr \<and> r x rv\<rbrace>,\<lbrace>\<lambda>r s. False\<rbrace>" assumes nf': "\<And>s. \<lbrakk> P s; nf' \<rbrakk> \<Longrightarrow> no_fail (\<lambda>s'. (s,... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_noopE | |
corres_noop2 : assumes x: "\<And>s. P s \<Longrightarrow> \<lbrace>(=) s\<rbrace> f \<exists>\<lbrace>\<lambda>r. (=) s\<rbrace>" assumes y: "\<And>s. P' s \<Longrightarrow> \<lbrace>(=) s\<rbrace> g \<lbrace>\<lambda>r. (=) s\<rbrace>" assumes z: "nf' \<Longrightarrow> no_fail P f" "nf' \<Longrightarrow> no_fail P' g"... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_noop2 | |
corres_disj_division : "\<lbrakk> P \<or> Q; P \<Longrightarrow> corres_underlying sr nf nf' r R S x y; Q \<Longrightarrow> corres_underlying sr nf nf' r T U x y \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r (\<lambda>s. (P \<longrightarrow> R s) \<and> (Q \<longrightarrow> T s)) (\<lambda>s. (P \<longright... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_disj_division | |
corres_weaker_disj_division : "\<lbrakk> P \<or> Q; P \<Longrightarrow> corres_underlying sr nf nf' r R S x y; Q \<Longrightarrow> corres_underlying sr nf nf' r T U x y \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r (R and T) (S and U) x y" by (corres_pre, rule corres_disj_division, simp+) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_weaker_disj_division | |
corres_symmetric_bool_cases : "\<lbrakk> P = P'; \<lbrakk> P; P' \<rbrakk> \<Longrightarrow> corres_underlying srel nf nf' r Q Q' f g; \<lbrakk> \<not> P; \<not> P' \<rbrakk> \<Longrightarrow> corres_underlying srel nf nf' r R R' f g \<rbrakk> \<Longrightarrow> corres_underlying srel nf nf' r (\<lambda>s. (P \<longrigh... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_symmetric_bool_cases | |
corres_symb_exec_l : assumes z: "\<And>rv. corres_underlying sr nf nf' r (Q rv) P' (x rv) y" assumes x: "\<And>s. P s \<Longrightarrow> \<lbrace>(=) s\<rbrace> m \<exists>\<lbrace>\<lambda>r. (=) s\<rbrace>" assumes y: "\<lbrace>P\<rbrace> m \<lbrace>Q\<rbrace>" assumes nf: "nf' \<Longrightarrow> no_fail P m" shows "co... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_symb_exec_l | |
corres_symb_exec_r : assumes z: "\<And>rv. corres_underlying sr nf nf' r P (Q' rv) x (y rv)" assumes y: "\<lbrace>P'\<rbrace> m \<lbrace>Q'\<rbrace>" assumes x: "\<And>s. P' s \<Longrightarrow> \<lbrace>(=) s\<rbrace> m \<lbrace>\<lambda>r. (=) s\<rbrace>" assumes nf: "nf' \<Longrightarrow> no_fail P' m" shows "corres_... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_symb_exec_r | |
corres_symb_exec_r_conj : assumes z: "\<And>rv. corres_underlying sr nf nf' r Q (R' rv) x (y rv)" assumes y: "\<lbrace>Q'\<rbrace> m \<lbrace>R'\<rbrace>" assumes x: "\<And>s. \<lbrace>\<lambda>s'. (s, s') \<in> sr \<and> P' s'\<rbrace> m \<lbrace>\<lambda>rv s'. (s, s') \<in> sr\<rbrace>" assumes nf: "\<And>s. nf' \<L... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_symb_exec_r_conj | |
corres_bind_return_r : "corres_underlying S nf nf' (\<lambda>x y. r x (h y)) P Q f g \<Longrightarrow> corres_underlying S nf nf' r P Q f (do x \<leftarrow> g; return (h x) od)" by (fastforce simp: corres_underlying_def bind_def return_def) | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_bind_return_r | |
corres_underlying_symb_exec_l : "\<lbrakk> corres_underlying sr nf nf' dc P P' f (return ()); \<And>rv. corres_underlying sr nf nf' r (Q rv) P' (g rv) h; \<lbrace>P\<rbrace> f \<lbrace>Q\<rbrace> \<rbrakk> \<Longrightarrow> corres_underlying sr nf nf' r P P' (f >>= g) h" apply (drule corres_underlying_split) apply assu... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_underlying_symb_exec_l | |
corres_req : assumes x: "\<And>s s'. \<lbrakk> (s, s') \<in> sr; P s; P' s' \<rbrakk> \<Longrightarrow> F" assumes y: "F \<Longrightarrow> corres_underlying sr nf nf' r P P' f g" shows "corres_underlying sr nf nf' r P P' f g" apply (cases "F") apply (rule y) apply assumption apply (simp add: corres_underlying_def) appl... | lemma | lib | [
"Crunch_Instances_NonDet",
"Monads.WPEx",
"Monads.WPFix",
"HaskellLemmaBucket"
] | lib/Corres_UL.thy | corres_req |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.