fact stringlengths 1 2.11k | type stringclasses 27
values | library stringclasses 888
values | imports listlengths 0 81 | filename stringlengths 9 106 | symbolic_name stringlengths 1 113 | docstring stringlengths 0 1.34k ⌀ |
|---|---|---|---|---|---|---|
ebind2letRETURN_refine[refine2]:
assumes "ERETURN x \<le> \<Down>\<^sub>E E R' M'"
assumes "\<And>x'. (x,x')\<in>R' \<Longrightarrow> ERETURN (f x) \<le> \<Down>\<^sub>E E R (f' x')"
shows "ERETURN (Let x f) \<le> \<Down>\<^sub>E E R (ebind M' (\<lambda>x'. f' x'))"
using assms
apply (simp add: pw_ele_iff ref... | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | ebind2letRETURN_refine | null |
ERETURN_as_SPEC_refine[refine2]:
assumes "RELATES R"
assumes "M \<le> ESPEC (\<lambda>_. False) (\<lambda>c. (c,a)\<in>R)"
shows "M \<le> \<Down>\<^sub>E E R (ERETURN a)"
using assms
by (simp add: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | ERETURN_as_SPEC_refine | null |
if_ERETURN_refine[refine2]:
assumes "b \<longleftrightarrow> b'"
assumes "\<lbrakk>b;b'\<rbrakk> \<Longrightarrow> ERETURN S1 \<le> \<Down>\<^sub>E E R S1'"
assumes "\<lbrakk>\<not>b;\<not>b'\<rbrakk> \<Longrightarrow> ERETURN S2 \<le> \<Down>\<^sub>E E R S2'"
shows "ERETURN (if b then S1 else S2) \<le> \<Down>... | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | if_ERETURN_refine | null |
enres_lift:: "'a nres \<Rightarrow> (_,'a) enres" where
"enres_lift m \<equiv> do { x \<leftarrow> m; RETURN (Inr x) }" | definition | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | enres_lift | Breaking down enres-monad |
enres_lift_rule[refine_vcg]: "m\<le>SPEC \<Phi> \<Longrightarrow> enres_lift m \<le> ESPEC E \<Phi>"
by (auto simp: pw_ele_iff pw_le_iff refine_pw_simps enres_lift_def)
named_theorems_rev enres_breakdown | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | enres_lift_rule | Breaking down enres-monad |
enres_lift_fail[simp]: "enres_lift FAIL = FAIL"
unfolding enres_lift_def by auto | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | enres_lift_fail | null |
option_case_enbd[enres_breakdown]:
"case_option (enres_lift fn) (\<lambda>v. enres_lift (fs v)) = (\<lambda>x. enres_lift (case_option fn fs x))"
by (auto split: option.split)
named_theorems enres_inline
method opt_enres_unfold = ((unfold enres_inline)?; (unfold enres_monad_laws)?; (unfold enres_breakdown)?; (rule ... | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | option_case_enbd | null |
CHECK_monadic_rule_iff:
"(CHECK_monadic c e \<le> ESPEC E P) \<longleftrightarrow> (c \<le> ESPEC E (\<lambda>r. (r \<longrightarrow> P ()) \<and> (\<not>r \<longrightarrow> E e)))"
by (auto simp: pw_ele_iff CHECK_monadic_def refine_pw_simps)
lemma CHECK_monadic_pw[refine_pw_simps]:
"nofail (CHECK_monadic... | lemma | VerifyThis2018 | [
"Refine_Monadic.Refine_Monadic",
"DRAT_Misc"
] | VerifyThis2018/lib/Exc_Nres_Monad.thy | CHECK_monadic_rule_iff | More Combinators CHECK-Monadic |
prep_termt = let
val nidx = maxidx_of_term t + 1
val t = map_aterms (fn
@{mpat (typs) "\<hole>::?'v_T"} => Var (("HOLE",nidx),T)
| v as Var ((name,_),T) => if String.isPrefix "_" name then v else Var (("_"^name,nidx),T)
| t => t
) t
|> Term_Subst.zero_var_indexe... | fun | VerifyThis2018 | [
"Automatic_Refinement.Refine_Lib",
"HOL-Library.Rewrite",
"Refine_Imperative_HOL.Sepref_Misc",
"keywords",
"synth_definition",
"::",
"thy_goal"
] | VerifyThis2018/lib/Synth_Definition.thy | prep_term | null |
nfoldli_upt_rule:
assumes INTV: "lb\<le>ub"
assumes I0: "I lb \<sigma>0"
assumes IS: "\<And>i \<sigma>. \<lbrakk> lb\<le>i; i<ub; I i \<sigma>; c \<sigma> \<rbrakk> \<Longrightarrow> f i \<sigma> \<le> SPEC (I (i+1))"
assumes FNC: "\<And>i \<sigma>. \<lbrakk> lb\<le>i; i\<le>ub; I i \<sigma>; \<not>c \<sigma> \... | lemma | VerifyThis2018 | [
"Array_Map_Default",
"Dynamic_Array",
"Synth_Definition",
"Exc_Nres_Monad"
] | VerifyThis2018/lib/VTcomp.thy | nfoldli_upt_rule | Extra Stuff We added this stuff as preparation for the competition. Specialized Rules for Foreach Loops |
efor_rule:
assumes INTV: "lb\<le>ub"
assumes I0: "I lb \<sigma>0"
assumes IS: "\<And>i \<sigma>. \<lbrakk> lb\<le>i; i<ub; I i \<sigma> \<rbrakk> \<Longrightarrow> f i \<sigma> \<le> ESPEC E (I (i+1))"
assumes FC: "\<And>\<sigma>. \<lbrakk> I ub \<sigma> \<rbrakk> \<Longrightarrow> P \<sigma>"
shows "efor lb ... | lemma | VerifyThis2018 | [
"Array_Map_Default",
"Dynamic_Array",
"Synth_Definition",
"Exc_Nres_Monad"
] | VerifyThis2018/lib/VTcomp.thy | efor_rule | null |
blit_len[simp]: "si + len \<le> length src \<and> di + len \<le> length dst
\<Longrightarrow> length (op_list_blit src si dst di len) = length dst"
by (auto simp: op_list_blit_def)
context
notes [fcomp_norm_unfold] = array_assn_def[symmetric]
begin
lemma array_blit_hnr_aux:
"(uncurry4 (\<l... | lemma | VerifyThis2018 | [
"Array_Map_Default",
"Dynamic_Array",
"Synth_Definition",
"Exc_Nres_Monad"
] | VerifyThis2018/lib/VTcomp.thy | blit_len | null |
ebind:: "('e,'a) enres \<Rightarrow> ('a \<Rightarrow> ('e,'b) enres) \<Rightarrow> ('e,'b) enres"
where [enres_unfolds]:
"ebind m f \<equiv> do {
x \<leftarrow> m;
case x of Inl e \<Rightarrow> RETURN (Inl e) | Inr x \<Rightarrow> f x
}" | definition | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind | Unfolding theorems from enres to nres |
EASSUME_simps[simp]:
"EASSUME True = ERETURN ()"
"EASSUME False = SUCCEED"
unfolding EASSUME_def by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSUME_simps | null |
EASSERT_simps[simp]:
"EASSERT True = ERETURN ()"
"EASSERT False = FAIL"
unfolding EASSERT_def by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSERT_simps | null |
CHECK_simps[simp]:
"CHECK True e = ERETURN ()"
"CHECK False e = THROW e"
unfolding CHECK_def by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CHECK_simps | null |
pw_ESPEC[simp, refine_pw_simps]:
"nofail (ESPEC \<Phi> \<Psi>)"
"inres (ESPEC \<Phi> \<Psi>) (Inl e) \<longleftrightarrow> \<Phi> e"
"inres (ESPEC \<Phi> \<Psi>) (Inr x) \<longleftrightarrow> \<Psi> x"
unfolding enres_unfolds
by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_ESPEC | null |
pw_ERETURN[simp, refine_pw_simps]:
"nofail (ERETURN x)"
"\<not>inres (ERETURN x) (Inl e)"
"inres (ERETURN x) (Inr y) \<longleftrightarrow> x=y"
unfolding enres_unfolds
by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_ERETURN | null |
pw_ebind[refine_pw_simps]:
"nofail (ebind m f) \<longleftrightarrow> nofail m \<and> (\<forall>x. inres m (Inr x) \<longrightarrow> nofail (f x))"
"inres (ebind m f) (Inl e) \<longleftrightarrow> inres m (Inl e) \<or> (\<exists>x. inres m (Inr x) \<and> inres (f x) (Inl e))"
"inres (ebind m f) (Inr x) \<longleftr... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_ebind | null |
pw_THROW[simp,refine_pw_simps]:
"nofail (THROW e)"
"inres (THROW e) (Inl f) \<longleftrightarrow> f=e"
"\<not>inres (THROW e) (Inr x)"
unfolding enres_unfolds
by (auto simp: refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_THROW | null |
pw_CHECK[simp, refine_pw_simps]:
"nofail (CHECK \<Phi> e)"
"inres (CHECK \<Phi> e) (Inl f) \<longleftrightarrow> \<not>\<Phi> \<and> f=e"
"inres (CHECK \<Phi> e) (Inr u) \<longleftrightarrow> \<Phi>"
unfolding enres_unfolds
by (auto simp: refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_CHECK | null |
pw_EASSUME[simp, refine_pw_simps]:
"nofail (EASSUME \<Phi>)"
"\<not>inres (EASSUME \<Phi>) (Inl e)"
"inres (EASSUME \<Phi>) (Inr u) \<longleftrightarrow> \<Phi>"
unfolding EASSUME_def
by (auto simp: refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_EASSUME | null |
pw_EASSERT[simp, refine_pw_simps]:
"nofail (EASSERT \<Phi>) \<longleftrightarrow> \<Phi>"
"inres (EASSERT \<Phi>) (Inr u)"
"inres (EASSERT \<Phi>) (Inl e) \<longleftrightarrow> \<not>\<Phi>"
unfolding EASSERT_def
by (auto simp: refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_EASSERT | null |
pw_CATCH[refine_pw_simps]:
"nofail (CATCH m h) \<longleftrightarrow> (nofail m \<and> (\<forall>x. inres m (Inl x) \<longrightarrow> nofail (h x)))"
"inres (CATCH m h) (Inl e) \<longleftrightarrow> (nofail m \<longrightarrow> (\<exists>e'. inres m (Inl e') \<and> inres (h e') (Inl e)))"
"inres (CATCH m h) (Inr x)... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_CATCH | null |
pw_ele_iff: "m \<le> n \<longleftrightarrow> (nofail n \<longrightarrow>
nofail m
\<and> (\<forall>e. inres m (Inl e) \<longrightarrow> inres n (Inl e))
\<and> (\<forall>x. inres m (Inr x) \<longrightarrow> inres n (Inr x))
)"
apply (auto simp: pw_le_iff)
by (metis sum.exhaust_sel) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_ele_iff | null |
pw_eeq_iff: "m = n \<longleftrightarrow>
(nofail m \<longleftrightarrow> nofail n)
\<and> (\<forall>e. inres m (Inl e) \<longleftrightarrow> inres n (Inl e))
\<and> (\<forall>x. inres m (Inr x) \<longleftrightarrow> inres n (Inr x))"
apply (auto simp: pw_eq_iff)
by (metis sum.exhaust_sel)+ | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_eeq_iff | null |
enres_monad_laws[simp]:
"ebind (ERETURN x) f = f x"
"ebind m (ERETURN) = m"
"ebind (ebind m f) g = ebind m (\<lambda>x. ebind (f x) g)"
by (auto simp: pw_eeq_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enres_monad_laws | null |
enres_additional_laws[simp]:
"ebind (THROW e) f = THROW e"
"CATCH (THROW e) h = h e"
"CATCH (ERETURN x) h = ERETURN x"
"CATCH m THROW = m"
apply (auto simp: pw_eeq_iff refine_pw_simps)
done
lemmas ESPEC_trans = order_trans[where z="ESPEC Error_Postcond Normal_Postcond" for Error_Postcond Normal_Postcond, ze... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enres_additional_laws | null |
ESPEC_cons:
assumes "m \<le> ESPEC E Q"
assumes "\<And>e. E e \<Longrightarrow> E' e"
assumes "\<And>x. Q x \<Longrightarrow> Q' x"
shows "m \<le> ESPEC E' Q'"
using assms by (auto simp: pw_ele_iff) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ESPEC_cons | null |
ebind_rule_iff: "doE { x\<leftarrow>m; f x } \<le> ESPEC \<Phi> \<Psi> \<longleftrightarrow> m \<le> ESPEC \<Phi> (\<lambda>x. f x \<le> ESPEC \<Phi> \<Psi>)"
by (auto simp: pw_ele_iff refine_pw_simps)
lemmas ebind_rule[refine_vcg] = ebind_rule_iff[THEN iffD2] | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind_rule_iff | null |
ERETURN_rule_iff[simp]: "ERETURN x \<le> ESPEC \<Phi> \<Psi> \<longleftrightarrow> \<Psi> x"
by (auto simp: pw_ele_iff refine_pw_simps)
lemmas ERETURN_rule[refine_vcg] = ERETURN_rule_iff[THEN iffD2] | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ERETURN_rule_iff | null |
ESPEC_rule_iff: "ESPEC \<Phi> \<Psi> \<le> ESPEC \<Phi>' \<Psi>' \<longleftrightarrow> (\<forall>e. \<Phi> e \<longrightarrow> \<Phi>' e) \<and> (\<forall>x. \<Psi> x \<longrightarrow> \<Psi>' x)"
by (auto simp: pw_ele_iff refine_pw_simps)
lemmas ESPEC_rule[refine_vcg] = ESPEC_rule_iff[THEN iffD2] | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ESPEC_rule_iff | null |
THROW_rule_iff: "THROW e \<le> ESPEC \<Phi> \<Psi> \<longleftrightarrow> \<Phi> e"
by (auto simp: pw_ele_iff refine_pw_simps)
lemmas THROW_rule[refine_vcg] = THROW_rule_iff[THEN iffD2] | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | THROW_rule_iff | null |
CATCH_rule_iff: "CATCH m h \<le> ESPEC \<Phi> \<Psi> \<longleftrightarrow> m \<le> ESPEC (\<lambda>e. h e \<le> ESPEC \<Phi> \<Psi>) \<Psi>"
by (auto simp: pw_ele_iff refine_pw_simps)
lemmas CATCH_rule[refine_vcg] = CATCH_rule_iff[THEN iffD2] | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CATCH_rule_iff | null |
CHECK_rule_iff: "CHECK c e \<le> ESPEC \<Phi> \<Psi> \<longleftrightarrow> (c \<longrightarrow> \<Psi> ()) \<and> (\<not>c \<longrightarrow> \<Phi> e)"
by (auto simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CHECK_rule_iff | null |
CHECK_rule[refine_vcg]:
assumes "c \<Longrightarrow> \<Psi> ()"
assumes "\<not>c \<Longrightarrow> \<Phi> e"
shows "CHECK c e \<le> ESPEC \<Phi> \<Psi>"
using assms by (simp add: CHECK_rule_iff) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CHECK_rule | null |
EASSUME_rule[refine_vcg]: "\<lbrakk>\<Phi> \<Longrightarrow> \<Psi> ()\<rbrakk> \<Longrightarrow> EASSUME \<Phi> \<le> ESPEC E \<Psi>"
by (cases \<Phi>) auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSUME_rule | null |
EASSERT_rule[refine_vcg]: "\<lbrakk>\<Phi>; \<Phi> \<Longrightarrow> \<Psi> ()\<rbrakk> \<Longrightarrow> EASSERT \<Phi> \<le> ESPEC E \<Psi>" by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSERT_rule | null |
eprod_rule[refine_vcg]:
"\<lbrakk>\<And>a b. p=(a,b) \<Longrightarrow> S a b \<le> ESPEC \<Phi> \<Psi>\<rbrakk> \<Longrightarrow> (case p of (a,b) \<Rightarrow> S a b) \<le> ESPEC \<Phi> \<Psi>"
by (auto split: prod.split) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eprod_rule | null |
eprod2_rule[refine_vcg]:
assumes "\<And>a b c d. \<lbrakk>ab=(a,b); cd=(c,d)\<rbrakk> \<Longrightarrow> f a b c d \<le> ESPEC \<Phi> \<Psi>"
shows "(\<lambda>(a,b) (c,d). f a b c d) ab cd \<le> ESPEC \<Phi> \<Psi>"
using assms
by (auto split: prod.split) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eprod2_rule | TODO: Add a simplifier setup that normalizes nested case-expressions to the vcg! |
eif_rule[refine_vcg]:
"\<lbrakk> b \<Longrightarrow> S1 \<le> ESPEC \<Phi> \<Psi>; \<not>b \<Longrightarrow> S2 \<le> ESPEC \<Phi> \<Psi>\<rbrakk>
\<Longrightarrow> (if b then S1 else S2) \<le> ESPEC \<Phi> \<Psi>"
by (auto) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eif_rule | null |
eoption_rule[refine_vcg]:
"\<lbrakk> v=None \<Longrightarrow> S1 \<le> ESPEC \<Phi> \<Psi>; \<And>x. v=Some x \<Longrightarrow> f2 x \<le> ESPEC \<Phi> \<Psi>\<rbrakk>
\<Longrightarrow> case_option S1 f2 v \<le> ESPEC \<Phi> \<Psi>"
by (auto split: option.split) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eoption_rule | null |
eLet_rule[refine_vcg]: "f v \<le> ESPEC \<Phi> \<Psi> \<Longrightarrow> (let x=v in f x) \<le> ESPEC \<Phi> \<Psi>" by simp | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eLet_rule | null |
eLet_rule':
assumes "\<And>x. x=v \<Longrightarrow> f x \<le> ESPEC \<Phi> \<Psi>"
shows "Let v (\<lambda>x. f x) \<le> ESPEC \<Phi> \<Psi>"
using assms by simp | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eLet_rule' | null |
EWHILEIT_rule[refine_vcg]:
assumes WF: "wf R"
and I0: "I s\<^sub>0"
and IS: "\<And>s. \<lbrakk>I s; b s; (s,s\<^sub>0)\<in>R\<^sup>*\<rbrakk> \<Longrightarrow> f s \<le> ESPEC E (\<lambda>s'. I s' \<and> (s', s) \<in> R)"
and IMP: "\<And>s. \<lbrakk>I s; \<not> b s; (s,s\<^sub>0)\<in>R\<^sup>*\<rbrakk> \<... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EWHILEIT_rule | null |
EWHILET_rule:
assumes WF: "wf R"
and I0: "I s\<^sub>0"
and IS: "\<And>s. \<lbrakk>I s; b s; (s,s\<^sub>0)\<in>R\<^sup>*\<rbrakk> \<Longrightarrow> f s \<le> ESPEC E (\<lambda>s'. I s' \<and> (s', s) \<in> R)"
and IMP: "\<And>s. \<lbrakk>I s; \<not> b s; (s,s\<^sub>0)\<in>R\<^sup>*\<rbrakk> \<Longrightarro... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EWHILET_rule | null |
EWHILEIT_weaken:
assumes "\<And>x. I x \<Longrightarrow> I' x"
shows "EWHILEIT I' b f x \<le> EWHILEIT I b f x"
unfolding enres_unfolds
apply (rule WHILEIT_weaken)
using assms by (auto split: sum.split) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EWHILEIT_weaken | null |
EWHILEIT_expinv_rule:
assumes WF: "wf R"
and I0: "I s\<^sub>0"
and IS: "\<And>s. \<lbrakk>I s; b s; (s,s\<^sub>0)\<in>R\<^sup>*\<rbrakk> \<Longrightarrow> f s \<le> ESPEC E (\<lambda>s'. I s' \<and> (s', s) \<in> R)"
and IMP: "\<And>s. \<lbrakk>I s; \<not> b s; (s,s\<^sub>0)\<in>R\<^sup>*\<rbrakk> \<Longr... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EWHILEIT_expinv_rule | Explicitly specify a different invariant. |
enfoldli_simps[simp]:
"enfoldli [] c f s = ERETURN s"
"enfoldli (x#ls) c f s =
(if c s then doE { s\<leftarrow>f x s; enfoldli ls c f s} else ERETURN s)"
unfolding enres_unfolds
by (auto split: sum.split intro!: arg_cong[where f = "Refine_Basic.bind _"] ext) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enfoldli_simps | null |
enfoldli_rule:
assumes I0: "I [] l0 \<sigma>0"
assumes IS: "\<And>x l1 l2 \<sigma>. \<lbrakk> l0=l1@x#l2; I l1 (x#l2) \<sigma>; c \<sigma> \<rbrakk> \<Longrightarrow> f x \<sigma> \<le> ESPEC E (I (l1@[x]) l2)"
assumes FNC: "\<And>l1 l2 \<sigma>. \<lbrakk> l0=l1@l2; I l1 l2 \<sigma>; \<not>c \<sigma> \<rbrakk> \<... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enfoldli_rule | null |
sum_rel_conv:
"(Inl l, s') \<in> \<langle>L,R\<rangle>sum_rel \<longleftrightarrow> (\<exists>l'. s'=Inl l' \<and> (l,l')\<in>L)"
"(Inr r, s') \<in> \<langle>L,R\<rangle>sum_rel \<longleftrightarrow> (\<exists>r'. s'=Inr r' \<and> (r,r')\<in>R)"
"(s, Inl l') \<in> \<langle>L,R\<rangle>sum_rel \<longleftrightarrow... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | sum_rel_conv | Data Refinement |
econc_fun("\<Down>\<^sub>E") where [enres_unfolds]: "econc_fun E R \<equiv> \<Down>(\<langle>E,R\<rangle>sum_rel)" | definition | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_fun | null |
RELATES_pat_erefine[refine_dref_pattern]: "\<lbrakk>RELATES R; mi \<le>\<Down>\<^sub>E E R m \<rbrakk> \<Longrightarrow> mi \<le>\<Down>\<^sub>E E R m" . | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | RELATES_pat_erefine | null |
pw_econc_iff[refine_pw_simps]:
"inres (\<Down>\<^sub>E E R m) (Inl ei) \<longleftrightarrow> (nofail m \<longrightarrow> (\<exists>e. inres m (Inl e) \<and> (ei,e)\<in>E))"
"inres (\<Down>\<^sub>E E R m) (Inr xi) \<longleftrightarrow> (nofail m \<longrightarrow> (\<exists>x. inres m (Inr x) \<and> (xi,x)\<in>R))"
... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | pw_econc_iff | null |
econc_fun_id[simp]: "\<Down>\<^sub>E Id Id = (\<lambda>x. x)"
by (auto simp: pw_eeq_iff refine_pw_simps intro!: ext) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_fun_id | null |
econc_fun_ESPEC: "\<Down>\<^sub>E E R (ESPEC \<Phi> \<Psi>) = ESPEC (\<lambda>ei. \<exists>e. (ei,e)\<in>E \<and> \<Phi> e) (\<lambda>ri. \<exists>r. (ri,r)\<in>R \<and> \<Psi> r)"
by (auto simp: pw_eeq_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_fun_ESPEC | null |
econc_fun_ERETURN: "\<Down>\<^sub>E E R (ERETURN x) = ESPEC (\<lambda>_. False) (\<lambda>xi. (xi,x)\<in>R)"
by (auto simp: pw_eeq_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_fun_ERETURN | null |
econc_fun_univ_id[simp]: "\<Down>\<^sub>E UNIV Id (ESPEC \<Phi> \<Psi>) = ESPEC (\<lambda>_. Ex \<Phi>) \<Psi>"
by (auto simp: pw_eeq_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_fun_univ_id | null |
erefine_same_sup_Id[simp]: "\<lbrakk> Id\<subseteq>E; Id\<subseteq>R \<rbrakk> \<Longrightarrow> m \<le>\<Down>\<^sub>E E R m" by (auto simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | erefine_same_sup_Id | null |
econc_mono3: "m\<le>m' \<Longrightarrow> \<Down>\<^sub>E E R m \<le> \<Down>\<^sub>E E R m'"
by (auto simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_mono3 | null |
econc_x_trans[trans]:
"x \<le> \<Down>\<^sub>E E R y \<Longrightarrow> y \<le> z \<Longrightarrow> x \<le> \<Down>\<^sub>E E R z"
by (force simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_x_trans | Order of these two is important! |
econc_econc_trans[trans]:
"x \<le>\<Down>\<^sub>E E1 R1 y \<Longrightarrow> y \<le> \<Down>\<^sub>E E2 R2 z \<Longrightarrow> x \<le> \<Down>\<^sub>E (E1 O E2) (R1 O R2) z"
by (force simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | econc_econc_trans | Order of these two is important! |
ERETURN_refine[refine]:
assumes "(xi,x)\<in>R"
shows "ERETURN xi \<le> \<Down>\<^sub>EE R (ERETURN x)"
using assms
by (auto simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ERETURN_refine | null |
EASSERT_bind_refine_right:
assumes "\<Phi> \<Longrightarrow> mi \<le>\<Down>\<^sub>E E R m"
shows "mi \<le>\<Down>\<^sub>E E R (doE {EASSERT \<Phi>; m})"
using assms
by (simp add: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSERT_bind_refine_right | null |
EASSERT_bind_refine_left:
assumes "\<Phi>"
assumes "mi \<le>\<Down>\<^sub>E E R m"
shows "(doE {EASSERT \<Phi>; mi}) \<le>\<Down>\<^sub>E E R m"
using assms
by simp | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSERT_bind_refine_left | null |
EASSUME_bind_refine_right:
assumes "\<Phi>"
assumes "mi \<le>\<Down>\<^sub>E E R m"
shows "mi \<le>\<Down>\<^sub>E E R (doE {EASSUME \<Phi>; m})"
using assms
by (simp) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSUME_bind_refine_right | null |
EASSUME_bind_refine_left:
assumes "\<Phi> \<Longrightarrow> mi \<le>\<Down>\<^sub>E E R m"
shows "(doE {EASSUME \<Phi>; mi}) \<le>\<Down>\<^sub>E E R m"
using assms
by (simp add: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EASSUME_bind_refine_left | null |
ebind_refine:
assumes "mi \<le>\<Down>\<^sub>E E R' m"
assumes "\<And>xi x. (xi,x)\<in>R' \<Longrightarrow> fi xi \<le>\<Down>\<^sub>E E R (f x)"
shows "doE { xi \<leftarrow> mi; fi xi } \<le> \<Down>\<^sub>E E R (doE { x \<leftarrow> m; f x })"
using assms
by (simp add: pw_ele_iff refine_pw_simps) blast | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind_refine | null |
ebind_refine':
assumes "mi \<le>\<Down>\<^sub>E E R' m"
assumes "\<And>xi x. \<lbrakk>(xi,x)\<in>R'; inres mi (Inr xi); inres m (Inr x); nofail mi; nofail m\<rbrakk> \<Longrightarrow> fi xi \<le>\<Down>\<^sub>E E R (f x)"
shows "doE { xi \<leftarrow> mi; fi xi } \<le> \<Down>\<^sub>E E R (doE { x \<leftarrow> m; ... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind_refine' | null |
THROW_refine[refine]: "(ei,e)\<in>E \<Longrightarrow> THROW ei \<le>\<Down>\<^sub>E E R (THROW e)"
by (auto simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | THROW_refine | null |
CATCH_refine':
assumes "mi \<le> \<Down>\<^sub>E E' R m"
assumes "\<And>ei e. \<lbrakk> (ei,e)\<in>E'; inres mi (Inl ei); inres m (Inl e); nofail mi; nofail m \<rbrakk> \<Longrightarrow> hi ei \<le>\<Down>\<^sub>E E R (h e)"
shows "CATCH mi hi \<le> \<Down>\<^sub>E E R (CATCH m h)"
using assms
by (simp add: p... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CATCH_refine' | null |
CATCH_refine[refine]:
assumes "mi \<le> \<Down>\<^sub>E E' R m"
assumes "\<And>ei e. \<lbrakk> (ei,e)\<in>E' \<rbrakk> \<Longrightarrow> hi ei \<le>\<Down>\<^sub>E E R (h e)"
shows "CATCH mi hi \<le> \<Down>\<^sub>E E R (CATCH m h)"
using assms CATCH_refine' by metis | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CATCH_refine | null |
CHECK_refine[refine]:
assumes "\<Phi>i \<longleftrightarrow> \<Phi>"
assumes "\<not>\<Phi> \<Longrightarrow> (msgi,msg)\<in>E"
shows "CHECK \<Phi>i msgi \<le>\<Down>\<^sub>E E Id (CHECK \<Phi> msg)"
using assms by (auto simp: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CHECK_refine | null |
CHECK_bind_refine[refine]:
assumes "\<Phi>i \<longleftrightarrow> \<Phi>"
assumes "\<not>\<Phi> \<Longrightarrow> (msgi,msg)\<in>E"
assumes "\<Phi> \<Longrightarrow> mi \<le>\<Down>\<^sub>E E R m"
shows "doE {CHECK \<Phi>i msgi;mi} \<le>\<Down>\<^sub>E E R (doE {CHECK \<Phi> msg; m})"
using assms by (auto sim... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CHECK_bind_refine | This must be declared after @{thm CHECK_refine}! |
Let_unfold_refine[refine]:
assumes "f x \<le> \<Down>\<^sub>E E R (f' x')"
shows "Let x f \<le> \<Down>\<^sub>E E R (Let x' f')"
using assms by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | Let_unfold_refine | null |
Let_refine:
assumes "(m,m')\<in>R'"
assumes "\<And>x x'. (x,x')\<in>R' \<Longrightarrow> f x \<le> \<Down>\<^sub>E E R (f' x')"
shows "Let m (\<lambda>x. f x) \<le>\<Down>\<^sub>E E R (Let m' (\<lambda>x'. f' x'))"
using assms by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | Let_refine | null |
eif_refine[refine]:
assumes "(b,b')\<in>bool_rel"
assumes "\<lbrakk>b;b'\<rbrakk> \<Longrightarrow> S1 \<le> \<Down>\<^sub>E E R S1'"
assumes "\<lbrakk>\<not>b;\<not>b'\<rbrakk> \<Longrightarrow> S2 \<le> \<Down>\<^sub>E E R S2'"
shows "(if b then S1 else S2) \<le> \<Down>\<^sub>E E R (if b' then S1' else S2')"... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | eif_refine | null |
enfoldli_refine[refine]:
assumes "(li, l) \<in> \<langle>S\<rangle>list_rel"
and "(si, s) \<in> R"
and CR: "(ci, c) \<in> R \<rightarrow> bool_rel"
and FR: "\<And>xi x si s. \<lbrakk> (xi,x)\<in>S; (si,s)\<in>R; c s \<rbrakk> \<Longrightarrow> fi xi si \<le> \<Down>\<^sub>E E R (f x s)"
shows "enfoldli ... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enfoldli_refine | TODO: Also add enfoldli_invar_refine |
EWHILET_refine[refine]:
assumes R0: "(x,x')\<in>R"
assumes COND_REF: "\<And>x x'. \<lbrakk> (x,x')\<in>R \<rbrakk> \<Longrightarrow> b x = b' x'"
assumes STEP_REF:
"\<And>x x'. \<lbrakk> (x,x')\<in>R; b x; b' x' \<rbrakk> \<Longrightarrow> f x \<le> \<Down>\<^sub>E E R (f' x')"
shows "EWHILET b f x \<le>\<D... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EWHILET_refine | null |
EWHILEIT_refine[refine]:
assumes R0: "I' x' \<Longrightarrow> (x,x')\<in>R"
assumes I_REF: "\<And>x x'. \<lbrakk> (x,x')\<in>R; I' x' \<rbrakk> \<Longrightarrow> I x"
assumes COND_REF: "\<And>x x'. \<lbrakk> (x,x')\<in>R; I x; I' x' \<rbrakk> \<Longrightarrow> b x = b' x'"
assumes STEP_REF:
"\<And>x x'. \<l... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | EWHILEIT_refine | null |
remove_eLet_refine:
assumes "M \<le> \<Down>\<^sub>E E R (f x)"
shows "M \<le> \<Down>\<^sub>E E R (Let x f)" using assms by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | remove_eLet_refine | Refine2- heuristics |
intro_eLet_refine:
assumes "f x \<le> \<Down>\<^sub>E E R M'"
shows "Let x f \<le> \<Down>\<^sub>E E R M'" using assms by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | intro_eLet_refine | null |
ebind2let_refine[refine2]:
assumes "ERETURN x \<le> \<Down>\<^sub>E E R' M'"
assumes "\<And>x'. (x,x')\<in>R' \<Longrightarrow> f x \<le> \<Down>\<^sub>E E R (f' x')"
shows "Let x f \<le> \<Down>\<^sub>E E R (ebind M' (\<lambda>x'. f' x'))"
using assms
apply (simp add: pw_ele_iff refine_pw_simps)
apply fast... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind2let_refine | null |
ebind_Let_refine2[refine2]: "\<lbrakk>
m' \<le>\<Down>\<^sub>E E R' (ERETURN x);
\<And>x'. \<lbrakk>inres m' (Inr x'); (x',x)\<in>R'\<rbrakk> \<Longrightarrow> f' x' \<le> \<Down>\<^sub>E E R (f x)
\<rbrakk> \<Longrightarrow> ebind m' (\<lambda>x'. f' x') \<le> \<Down>\<^sub>E E R (Let x (\<lambda>x. f x))"
... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind_Let_refine2 | null |
ebind2letRETURN_refine[refine2]:
assumes "ERETURN x \<le> \<Down>\<^sub>E E R' M'"
assumes "\<And>x'. (x,x')\<in>R' \<Longrightarrow> ERETURN (f x) \<le> \<Down>\<^sub>E E R (f' x')"
shows "ERETURN (Let x f) \<le> \<Down>\<^sub>E E R (ebind M' (\<lambda>x'. f' x'))"
using assms
apply (simp add: pw_ele_iff ref... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ebind2letRETURN_refine | null |
ERETURN_as_SPEC_refine[refine2]:
assumes "RELATES R"
assumes "M \<le> ESPEC (\<lambda>_. False) (\<lambda>c. (c,a)\<in>R)"
shows "M \<le> \<Down>\<^sub>E E R (ERETURN a)"
using assms
by (simp add: pw_ele_iff refine_pw_simps) | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | ERETURN_as_SPEC_refine | null |
if_ERETURN_refine[refine2]:
assumes "b \<longleftrightarrow> b'"
assumes "\<lbrakk>b;b'\<rbrakk> \<Longrightarrow> ERETURN S1 \<le> \<Down>\<^sub>E E R S1'"
assumes "\<lbrakk>\<not>b;\<not>b'\<rbrakk> \<Longrightarrow> ERETURN S2 \<le> \<Down>\<^sub>E E R S2'"
shows "ERETURN (if b then S1 else S2) \<le> \<Down>... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | if_ERETURN_refine | null |
enres_lift:: "'a nres \<Rightarrow> (_,'a) enres" where
"enres_lift m \<equiv> do { x \<leftarrow> m; RETURN (Inr x) }" | definition | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enres_lift | Breaking down enres-monad |
enres_lift_rule[refine_vcg]: "m\<le>SPEC \<Phi> \<Longrightarrow> enres_lift m \<le> ESPEC E \<Phi>"
by (auto simp: pw_ele_iff pw_le_iff refine_pw_simps enres_lift_def)
named_theorems_rev enres_breakdown | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enres_lift_rule | Breaking down enres-monad |
enres_lift_fail[simp]: "enres_lift FAIL = FAIL"
unfolding enres_lift_def by auto | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | enres_lift_fail | null |
option_case_enbd[enres_breakdown]:
"case_option (enres_lift fn) (\<lambda>v. enres_lift (fs v)) = (\<lambda>x. enres_lift (case_option fn fs x))"
by (auto split: option.split)
named_theorems enres_inline
method opt_enres_unfold = ((unfold enres_inline)?; (unfold enres_monad_laws)?; (unfold enres_breakdown)?; (rule ... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | option_case_enbd | null |
CHECK_monadic_rule_iff:
"(CHECK_monadic c e \<le> ESPEC E P) \<longleftrightarrow> (c \<le> ESPEC E (\<lambda>r. (r \<longrightarrow> P ()) \<and> (\<not>r \<longrightarrow> E e)))"
by (auto simp: pw_ele_iff CHECK_monadic_def refine_pw_simps)
lemma CHECK_monadic_pw[refine_pw_simps]:
"nofail (CHECK_monadic... | lemma | VerifyThis2019 | [
"Refine_Imperative_HOL.IICF"
] | VerifyThis2019/lib/Exc_Nres_Monad.thy | CHECK_monadic_rule_iff | More Combinators CHECK-Monadic |
monadic_WHILEIT_unfold:
"monadic_WHILEIT I b f s = do {
ASSERT (I s); bb\<leftarrow>b s; if bb then do { s \<leftarrow> f s; monadic_WHILEIT I b f s } else RETURN s
}"
unfolding monadic_WHILEIT_def
apply (subst RECT_unfold)
apply refine_mono
by simp
no_notation Ref.lookup ("!_" 61)
no_notation Ref.updat... | lemma | VerifyThis2019 | [
"Exc_Nres_Monad"
] | VerifyThis2019/lib/VTcomp.thy | monadic_WHILEIT_unfold | Library |
nfoldli_upt_rule:
assumes INTV: "lb\<le>ub"
assumes I0: "I lb \<sigma>0"
assumes IS: "\<And>i \<sigma>. \<lbrakk> lb\<le>i; i<ub; I i \<sigma>; c \<sigma> \<rbrakk> \<Longrightarrow> f i \<sigma> \<le> SPEC (I (i+1))"
assumes FNC: "\<And>i \<sigma>. \<lbrakk> lb\<le>i; i\<le>ub; I i \<sigma>; \<not>c \<sigma> \... | lemma | VerifyThis2019 | [
"Exc_Nres_Monad"
] | VerifyThis2019/lib/VTcomp.thy | nfoldli_upt_rule | Specialized Rules for Foreach-Loops |
efor_rule:
assumes INTV: "lb\<le>ub"
assumes I0: "I lb \<sigma>0"
assumes IS: "\<And>i \<sigma>. \<lbrakk> lb\<le>i; i<ub; I i \<sigma> \<rbrakk> \<Longrightarrow> f i \<sigma> \<le> ESPEC E (I (i+1))"
assumes FC: "\<And>\<sigma>. \<lbrakk> I ub \<sigma> \<rbrakk> \<Longrightarrow> P \<sigma>"
shows "efor lb ... | lemma | VerifyThis2019 | [
"Exc_Nres_Monad"
] | VerifyThis2019/lib/VTcomp.thy | efor_rule | null |
blit_len[simp]: "si + len \<le> length src \<and> di + len \<le> length dst
\<Longrightarrow> length (op_list_blit src si dst di len) = length dst"
by (auto simp: op_list_blit_def)
context
notes [fcomp_norm_unfold] = array_assn_def[symmetric]
begin
lemma array_blit_hnr_aux:
"(uncurry4 (\<l... | lemma | VerifyThis2019 | [
"Exc_Nres_Monad"
] | VerifyThis2019/lib/VTcomp.thy | blit_len | null |
wheremem_grow_impl_is[code]: "mem_grow_impl m n = Some (mem_grow m n)" | axiomatization | WebAssembly | [
"../Wasm_Interpreter_Properties",
"Wasm_Type_Abs_Printing",
"HOL-Library.Code_Target_Nat",
"Native_Word.Code_Target_Int_Bit"
] | WebAssembly/Wasm_Printing/Wasm_Interpreter_Printing_Pure.thy | where | null |
bytes_takefill_rep_eq[code abstract]:
"Rep_bytes (bytes_takefill b n bs) = takefill b n (Rep_bytes bs)"
using bytes_takefill.rep_eq Rep_uint8_inverse
by simp | lemma | WebAssembly | [
"../Wasm_Interpreter_Properties",
"Wasm_Type_Abs_Printing",
"HOL-Library.Code_Target_Nat",
"Native_Word.Code_Target_Int_Bit"
] | WebAssembly/Wasm_Printing/Wasm_Interpreter_Printing_Pure.thy | bytes_takefill_rep_eq | null |
bytes_replicate_rep_eq[code abstract]:
"Rep_bytes (bytes_replicate n b) = replicate n b"
using bytes_replicate.rep_eq Rep_uint8_inverse
by simp
export_code open run in OCaml | lemma | WebAssembly | [
"../Wasm_Interpreter_Properties",
"Wasm_Type_Abs_Printing",
"HOL-Library.Code_Target_Nat",
"Native_Word.Code_Target_Int_Bit"
] | WebAssembly/Wasm_Printing/Wasm_Interpreter_Printing_Pure.thy | bytes_replicate_rep_eq | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.