Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
3aef594c
Commit
3aef594c
authored
Nov 30, 2011
by
ntmtuyen
Browse files
add TestNegAsXOR_MainResult_2.v
parent
017817c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/bitvector1.why
View file @
3aef594c
...
...
@@ -624,6 +624,8 @@ theory TestNegAsXOR
lemma MainResultZero : forall x:bv. 0 = exp(x) /\ mantissa(x) = 0 ->
double_of_bv64 (bw_xor x j) = -. double_of_bv64 x
lemma sign_neg:
forall x:bv. sign_value(notb(sign(x))) = -.sign_value(sign(x))
lemma MainResult : forall x:bv. 0 < exp(x) < 2047 ->
double_of_bv64 (bw_xor x j) = -. double_of_bv64 x
...
...
tests/bitvector1/bitvector1_TestNegAsXOR_MainResult_
1
.v
→
tests/bitvector1/bitvector1_TestNegAsXOR_MainResult_
2
.v
View file @
3aef594c
...
...
@@ -464,6 +464,9 @@ Axiom MainResultZero : forall (x:bv), ((0%Z = (to_nat_sub x 62%Z 52%Z)) /\
((
to_nat_sub
x
51
%
Z
0
%
Z
)
=
0
%
Z
))
->
((
double_of_bv64
(
bw_xor
x
(
from_int
9223372036854775808
%
Z
)))
=
(
-
(
double_of_bv64
x
))
%
R
).
Axiom
sign_neg
:
forall
(
x
:
bv
),
((
sign_value
(
negb
(
nth
x
63
%
Z
)))
=
(
-
(
sign_value
(
nth
x
63
%
Z
)))
%
R
).
(
*
YOU
MAY
EDIT
THE
CONTEXT
BELOW
*
)
Open
Scope
Z_scope
.
(
*
DO
NOT
EDIT
BELOW
*
)
...
...
@@ -474,10 +477,15 @@ Theorem MainResult : forall (x:bv), ((0%Z < (to_nat_sub x 62%Z 52%Z))%Z /\
(
*
YOU
MAY
EDIT
THE
PROOF
BELOW
*
)
intros
x
H
.
rewrite
double_of_bv64_value
.
rewrite
rewrite
MainResultSign
.
rewrite
Sign_of_xor_j
.
rewrite
Exp_of_xor_j
.
rewrite
Mantissa_of_xor_j
.
rewrite
sign_neg
.
rewrite
double_of_bv64_value
.
repeat
rewrite
Rmult_assoc
.
auto
with
*
.
exact
H
.
rewrite
Exp_of_xor_j
;
exact
H
.
Qed
.
(
*
DO
NOT
EDIT
BELOW
*
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment