How can I prove that these two statements are equal:
Val.shru (Val.and a (Vint b)) (Vint c) = Vint ?3434 /\ ?3434 <> d
Val.shru (Val.and a (Vint b)) (Vint c) <> d
The concept is pretty simple but stuck in finding the right tactic to solve it. This is actually the Lemma I'm going to prove:
Require Import compcert.common.Values.
Require Import compcert.lib.Coqlib.
Require Import compcert.lib.Integers.
Lemma val_remains_int:
forall (a : val) (b c d: int),
(Val.shru (Val.and a (Vint b)) (Vint c)) <> (Vint d) ->
(exists (e : int), (Val.shru (Val.and a (Vint b)) (Vint c)) = (Vint e) /\ e <> d).
Proof.
intros.
eexists.
...
Admitted.
Thanks,
If you can construct a value of type
int
(i0
in the example below), then this lemma does not hold:There are at least two reasons:
Val.and
andVal.shru
returnVundef
for all arguments that are notVint
(it's an instance of the GIGO principle);Val.shru
).As for the modified lemma you mentioned in your comment, simple
reflexivity
would do: