lib: make some elimination rules safer
Elimination against the pattern "P v", where both "P" and "v" are free, can loop, if the rule is marked as a safe elimination rule. In the rules modified in this commit, variable "v" provides no real benefit, so we replace the pattern with "P".
This commit is contained in:
parent
70de40bcdd
commit
0570943ee8
|
@ -159,7 +159,7 @@ lemma in_oreturn [simp]:
|
|||
by (auto simp: oreturn_def K_def)
|
||||
|
||||
lemma oreturnE:
|
||||
"\<lbrakk>oreturn x s = Some v; v = x \<Longrightarrow> P x\<rbrakk> \<Longrightarrow> P v"
|
||||
"\<lbrakk>oreturn x s = Some v; v = x \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
|
||||
by simp
|
||||
|
||||
lemma in_ofail [simp]:
|
||||
|
@ -192,7 +192,7 @@ lemma in_othrow_eq [simp]:
|
|||
by (auto simp: othrow_def K_def)
|
||||
|
||||
lemma othrowE:
|
||||
"\<lbrakk>othrow e s = Some v; v = Inl e \<Longrightarrow> P (Inl e)\<rbrakk> \<Longrightarrow> P v"
|
||||
"\<lbrakk>othrow e s = Some v; v = Inl e \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
|
||||
by simp
|
||||
|
||||
lemma in_oreturnOk_eq [simp]:
|
||||
|
@ -200,7 +200,7 @@ lemma in_oreturnOk_eq [simp]:
|
|||
by (auto simp: oreturnOk_def K_def)
|
||||
|
||||
lemma oreturnOkE:
|
||||
"\<lbrakk>oreturnOk x s = Some v; v = Inr x \<Longrightarrow> P (Inr x)\<rbrakk> \<Longrightarrow> P v"
|
||||
"\<lbrakk>oreturnOk x s = Some v; v = Inr x \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
|
||||
by simp
|
||||
|
||||
lemmas omonadE [elim!] =
|
||||
|
|
Loading…
Reference in New Issue