mirror of https://github.com/seL4/l4v.git
word_lib: add toEnum_unat_le
Relates toEnum (unat x) with ucast. Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
parent
aebe8c6b20
commit
e8a219ffc9
|
@ -1047,4 +1047,14 @@ lemma ucast_and_mask_source:
|
|||
UCAST('a \<rightarrow> 'b::len) w && mask n = ucast w && mask LENGTH('a)" for w::"'a::len word"
|
||||
by word_eqI (fastforce dest: test_bit_lenD)
|
||||
|
||||
lemma toEnum_unat_le:
|
||||
"x \<le> ucast y \<Longrightarrow> toEnum (unat x) \<le> y" for x::"'a::len word" and y::"'b::len word"
|
||||
apply (subgoal_tac "unat y < 2^LENGTH('b)")
|
||||
apply (subgoal_tac "unat x < 2^LENGTH('b)")
|
||||
apply (simp add: le_ucast_ucast_le)
|
||||
apply (fastforce simp: word_le_nat_alt unat_ucast
|
||||
elim!: order_trans order_le_less_trans[rotated])
|
||||
apply simp
|
||||
done
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue