lib/monads: move empty_fail_guard into NonDetMonadVCG
So that it is available together with the other empty_fail lemmas. Eventually, these should go into their own theory. Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
parent
238acb46bb
commit
0aa2914b84
|
@ -513,9 +513,6 @@ lemma bind_fail_propagates:
|
|||
"empty_fail A \<Longrightarrow> A >>= (\<lambda>_. fail) = fail"
|
||||
by (monad_eq simp: empty_fail_def) fastforce
|
||||
|
||||
lemma empty_fail_guard [simp]: "empty_fail (state_assert G)"
|
||||
by (clarsimp simp: state_assert_def assert_def empty_fail_def get_def return_def bind_def)
|
||||
|
||||
lemma simple_bind_fail [simp]:
|
||||
"(state_assert X >>= (\<lambda>_. fail)) = fail"
|
||||
"(modify M >>= (\<lambda>_. fail)) = fail"
|
||||
|
|
|
@ -872,6 +872,10 @@ lemma empty_fail_select[simp]:
|
|||
"empty_fail (select V) = (V \<noteq> {})"
|
||||
by (clarsimp simp: select_def empty_fail_def)
|
||||
|
||||
lemma empty_fail_guard[simp]:
|
||||
"empty_fail (state_assert G)"
|
||||
by (clarsimp simp: state_assert_def empty_fail_get empty_fail_assert)
|
||||
|
||||
lemma empty_fail_not_snd:
|
||||
"\<lbrakk> \<not> snd (m s); empty_fail m \<rbrakk> \<Longrightarrow> \<exists>v. v \<in> fst (m s)"
|
||||
by (fastforce simp: empty_fail_def)
|
||||
|
|
Loading…
Reference in New Issue