I have the definition my_def1
:
Require Import compcert.common.Memory.
Require Import compcert.common.Values.
Require Import compcert.lib.Integers.
Definition my_def1 (vl: list memval) : val :=
match proj_bytes vl with
| Some bl => Vint(Int.sign_ext 16 (Int.repr (decode_int bl)))
| None => Vundef
end.
I would like to write another definition my_def2
similar to my_def1
like below and add an axiom that proj_bytes vl
always return Some bl
, So:
Definition my_def2 (vl: list memval) : val :=
Vint(Int.sign_ext 16 (Int.repr (decode_int ((*?*)) )))
end.
My question is how can I complete my_def2
and write the related axiom
about proj_bytes vl
?
Or the question is how can I cast from the type list memval
to list byte
[decode_int
accepts list byte
]?
And here is the definition for memval
:
Inductive memval : Type :=
Undef : memval
| Byte : byte -> memval
| Fragment : val -> quantity -> nat -> memval