Require Export VST.veric.base.
(* This file contains lemmas regarding "superprecise", and in principle, almost proving that "mapsto" is superprecise.  However, mapsto is not superprecise, because it's not quite true that decode_val is injective.  The only reason is the treatment of single-precision floating-point NaNs, where the conversion from single-prec to double-prec loses one bit of information: both quiet 32-bit NaNs and signalling 32-bit NaNs are quietly turned into quite 64-bit NaNs.  If CompCert ever changes so that this does not happen, then the lemmas in this file might become useful.  *)

(* Specifications: *)
Lemma int_of_bytes_uniq:
forall i j, length i = length j -> int_of_bytes i = int_of_bytes j -> i = j.
Lemma decode_int_uniq:
forall i j, length i = length j -> decode_int i = decode_int j -> i=j.
Lemma decode_int_range:
forall l N, N = two_p (8 * Z.of_nat (length l)) -> 0 <= decode_int l < N.
Lemma sign_ext_injective:
forall n i j,
0 < n < Int.zwordsize ->
0 <= i < two_p n ->
0 <= j < two_p n ->
Int.sign_ext n (Int.repr i) = Int.sign_ext n (Int.repr j) ->
i=j.
Lemma zero_ext_injective:
forall n i j,
0 <= n < Int.zwordsize ->
0 <= i < two_p n ->
0 <= j < two_p n ->
Int.zero_ext n (Int.repr i) = Int.zero_ext n (Int.repr j) ->
i=j.
Lemma repr_decode_int_inj:
forall l1 l2, length l1 = 4%nat -> length l2 = 4%nat ->
Int.repr (decode_int l1) = Int.repr (decode_int l2) ->
l1=l2.
Lemma repr_decode_int64_inj:
forall l1 l2, length l1 = 8%nat -> length l2 = 8%nat ->
Int64.repr (decode_int l1) = Int64.repr (decode_int l2) ->
l1=l2.