Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
colibrics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
colibrics
Commits
f2c345ce
Commit
f2c345ce
authored
3 years ago
by
Arthur Correnson
Browse files
Options
Downloads
Patches
Plain Diff
clean inter_correct proof
parent
7ac41d60
No related branches found
Branches containing commit
No related tags found
1 merge request
!16
Fp/ieee
Pipeline
#36665
waiting for manual action
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src_common/ieee/coq/Interval.v
+21
-50
21 additions, 50 deletions
src_common/ieee/coq/Interval.v
with
21 additions
and
50 deletions
src_common/ieee/coq/Interval.v
+
21
−
50
View file @
f2c345ce
...
@@ -257,6 +257,17 @@ Qed.
...
@@ -257,6 +257,17 @@ Qed.
Ltac
classify
f
:=
Ltac
classify
f
:=
destruct
(
classification
f
)
as
[
|
[
|
[
|
]]];
try
(
subst
;
easy
).
destruct
(
classification
f
)
as
[
|
[
|
[
|
]]];
try
(
subst
;
easy
).
Ltac
classify_nan
x
:=
match
goal
with
|
[
H
:
is_nan
x
=
true
|-
_
]
=>
rewrite
(
is_nan_inv
x
H
)
in
*
|
[
H
:
Bleb
_
x
=
true
|-
_
]
=>
assert
(
is_nan
x
=
false
)
by
apply
(
le_not_nan_r
_
_
H
)
|
[
H
:
Bleb
x
_
=
true
|-
_
]
=>
assert
(
is_nan
x
=
false
)
by
apply
(
le_not_nan_l
_
_
H
)
|
_
=>
fail
"can't determine if"
x
"is NaN"
end
.
Lemma
is_finite_not_nan
:
Lemma
is_finite_not_nan
:
forall
(
x
:
float
),
is_finite
x
=
true
->
is_nan
x
=
false
.
forall
(
x
:
float
),
is_finite
x
=
true
->
is_nan
x
=
false
.
Proof
.
fdestruct
x
.
Qed
.
Proof
.
fdestruct
x
.
Qed
.
...
@@ -266,14 +277,10 @@ Program Lemma inter_correct :
...
@@ -266,14 +277,10 @@ Program Lemma inter_correct :
forall
(
I1
I2
:
Interval
)
x
,
forall
(
I1
I2
:
Interval
)
x
,
contains
I1
x
->
contains
I2
x
->
contains
(
inter
I1
I2
)
x
.
contains
I1
x
->
contains
I2
x
->
contains
(
inter
I1
I2
)
x
.
Proof
.
Proof
.
intros
[
[
|
|
?
?
[
]]
H1
]
[
[
|
|
?
?
[
]]
H2
]
x
Hx1
Hx2
;
simpl
in
*
;
try
easy
.
intros
[
[
|
|
?
?
[
]]
H1
]
[
[
|
|
?
?
[
]]
H2
]
x
Hx1
Hx2
;
simpl
in
*
;
-
fdestruct
x
;
intuition
.
try
easy
;
try
(
fdestruct
x
;
intuition
;
fail
).
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
].
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
];
try
(
fdestruct
x
;
fail
).
+
pose
proof
(
le_not_nan_r
_
_
Hc1
).
+
classify_nan
l
;
classify_nan
h
;
classify_nan
l0
;
classify_nan
h0
.
pose
proof
(
le_not_nan_l
_
_
H1
).
pose
proof
(
le_not_nan_r
_
_
H1
).
pose
proof
(
le_not_nan_l
_
_
H2
).
pose
proof
(
le_not_nan_r
_
_
H2
).
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
...
@@ -282,16 +289,10 @@ Proof.
...
@@ -282,16 +289,10 @@ Proof.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
+
fdestruct
x
.
+
fdestruct
x
.
+
fdestruct
x
.
+
fdestruct
x
.
destruct
(
Bltb
h
_
),
(
Bltb
h0
);
simpl
;
auto
.
destruct
(
Bltb
h
_
),
(
Bltb
h0
);
simpl
;
auto
.
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
].
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
];
try
(
fdestruct
x
;
fail
).
+
pose
proof
(
le_not_nan_r
_
_
Hc1
).
classify_nan
l
;
classify_nan
h
;
classify_nan
l0
;
classify_nan
h0
.
pose
proof
(
le_not_nan_l
_
_
H1
).
pose
proof
(
le_not_nan_r
_
_
H1
).
pose
proof
(
le_not_nan_l
_
_
H2
).
pose
proof
(
le_not_nan_r
_
_
H2
).
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
...
@@ -300,16 +301,8 @@ Proof.
...
@@ -300,16 +301,8 @@ Proof.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
+
fdestruct
x
.
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
];
try
(
fdestruct
x
;
fail
).
+
fdestruct
x
.
classify_nan
l
;
classify_nan
h
;
classify_nan
l0
;
classify_nan
h0
.
+
fdestruct
x
.
-
fdestruct
x
;
intuition
.
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
].
+
pose
proof
(
le_not_nan_r
_
_
Hc1
).
pose
proof
(
le_not_nan_l
_
_
H1
).
pose
proof
(
le_not_nan_r
_
_
H1
).
pose
proof
(
le_not_nan_l
_
_
H2
).
pose
proof
(
le_not_nan_r
_
_
H2
).
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
...
@@ -318,15 +311,8 @@ Proof.
...
@@ -318,15 +311,8 @@ Proof.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
+
fdestruct
x
.
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
];
try
(
fdestruct
x
;
fail
).
+
fdestruct
x
.
classify_nan
l
;
classify_nan
h
;
classify_nan
l0
;
classify_nan
h0
.
+
fdestruct
x
.
-
destruct
Hx1
as
[[
Hc1
Hc1
'
]
|
],
Hx2
as
[[
Hc2
Hc2
'
]
|
].
+
pose
proof
(
le_not_nan_r
_
_
Hc1
).
pose
proof
(
le_not_nan_l
_
_
H1
).
pose
proof
(
le_not_nan_r
_
_
H1
).
pose
proof
(
le_not_nan_l
_
_
H2
).
pose
proof
(
le_not_nan_r
_
_
H2
).
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
destruct
(
Bltb
h
l0
)
eqn
:
E1
,
(
Bltb
h0
l
)
eqn
:
E2
;
simpl
in
*
;
try
easy
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
*
apply
Bltb_true_Bleb
in
E1
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc2
Hc1
'
)
in
E1
.
...
@@ -335,21 +321,6 @@ Proof.
...
@@ -335,21 +321,6 @@ Proof.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
*
apply
Bltb_true_Bleb
in
E2
;
auto
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
now
rewrite
(
Bleb_trans
_
_
_
_
_
Hc1
Hc2
'
)
in
E2
.
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
*
left
;
split
;
[
now
apply
Bmax_le
|
now
apply
Bmin_le
].
+
fdestruct
x
.
+
fdestruct
x
.
+
fdestruct
x
.
Qed
.
Qed
.
Ltac
classify_nan
x
:=
match
goal
with
|
[
H
:
is_nan
x
=
true
|-
_
]
=>
rewrite
(
is_nan_inv
x
H
)
in
*
|
[
H
:
Bleb
_
x
=
true
|-
_
]
=>
assert
(
is_nan
x
=
false
)
by
apply
(
le_not_nan_r
_
_
H
)
|
[
H
:
Bleb
x
_
=
true
|-
_
]
=>
assert
(
is_nan
x
=
false
)
by
apply
(
le_not_nan_l
_
_
H
)
|
_
=>
fail
"can't determine if"
x
"is NaN"
end
.
End
Finterval
.
End
Finterval
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment