Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
AVA
FloVer
Commits
8414e5ff
Commit
8414e5ff
authored
May 04, 2018
by
Heiko Becker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract general RoundoffErrorValidator
parent
c8684a1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
coq/CertificateChecker.v
coq/CertificateChecker.v
+3
-3
coq/RoundoffErrorValidator.v
coq/RoundoffErrorValidator.v
+33
-0
No files found.
coq/CertificateChecker.v
View file @
8414e5ff
...
...
@@ -6,7 +6,7 @@
**
)
Require
Import
Coq
.
Reals
.
Reals
Coq
.
QArith
.
Qreals
.
Require
Import
Flover
.
Infra
.
RealSimps
Flover
.
Infra
.
RationalSimps
Flover
.
Infra
.
RealRationalProps
Flover
.
Infra
.
Ltacs
.
Require
Import
Flover
.
RealRangeValidator
Flover
.
ErrorValidat
ion
Flover
.
Environments
Flover
.
Typing
Flover
.
FPRangeValidator
.
Require
Import
Flover
.
RealRangeValidator
Flover
.
Roundoff
ErrorValidat
or
Flover
.
Environments
Flover
.
Typing
Flover
.
FPRangeValidator
.
Require
Export
Coq
.
QArith
.
QArith
.
Require
Export
Flover
.
Infra
.
ExpressionAbbrevs
Flover
.
Commands
.
...
...
@@ -17,7 +17,7 @@ Definition CertificateChecker (e:expr Q) (absenv:analysisResult) (P:precond) (de
if
(
typeCheck
e
defVars
tMap
)
then
if
RangeValidator
e
absenv
P
&&
FPRangeValidator
e
absenv
tMap
NatSet
.
empty
then
(
validErrorbound
e
tMap
absenv
NatSet
.
empty
)
then
RoundoffErrorValidator
e
tMap
absenv
NatSet
.
empty
else
false
else
false
.
...
...
@@ -67,7 +67,7 @@ Proof.
edestruct
(
RangeValidator_sound
e
absenv
(
P
:=
P
)
(
Gamma
:=
defVars
)
(
E
:=
E1
))
as
[
iv_e
[
err_e
[
vR
[
map_e
[
eval_real
real_bounds_e
]]]]];
eauto
.
destruct
iv_e
as
[
elo
ehi
].
edestruct
(
validErrorbound
_sound
e
(
typeMap
defVars
e
(
FloverMap
.
empty
mType
))
L
approxE1E2
H0
eval_real
R0
L1
H
P_valid
H1
map_e
)
as
[[
vF
[
mF
eval_float
]]
err_bounded
];
auto
.
edestruct
(
RoundoffErrorValidator
_sound
e
(
typeMap
defVars
e
(
FloverMap
.
empty
mType
))
L
approxE1E2
H0
eval_real
R0
L1
H
P_valid
H1
map_e
)
as
[[
vF
[
mF
eval_float
]]
err_bounded
];
auto
.
exists
(
elo
,
ehi
),
err_e
,
vR
,
vF
,
mF
;
split
;
auto
.
Qed
.
...
...
coq/RoundoffErrorValidator.v
0 → 100644
View file @
8414e5ff
From
Coq
Require
Import
Reals
.
Reals
QArith
.
Qreals
.
From
Flover
Require
Export
Infra
.
ExpressionAbbrevs
ErrorValidation
.
Definition
RoundoffErrorValidator
(
e
:
expr
Q
)
(
tMap
:
FloverMap
.
t
mType
)
(
A
:
analysisResult
)
(
dVars
:
NatSet
.
t
)
:=
(
*
if
*
)
validErrorbound
e
tMap
A
dVars
.
(
*
then
true
*
)
(
*
else
validAffineErrorBounds
e
A
tMap
dVars
*
)
Theorem
RoundoffErrorValidator_sound
:
forall
(
e
:
expr
Q
)
(
E1
E2
:
env
)
(
fVars
dVars
:
NatSet
.
t
)
(
A
:
analysisResult
)
(
nR
:
R
)
(
err
:
error
)
(
P
:
precond
)
(
elo
ehi
:
Q
)
(
Gamma
:
FloverMap
.
t
mType
)
(
defVars
:
nat
->
option
mType
),
Typing
.
typeCheck
e
defVars
Gamma
=
true
->
Environments
.
approxEnv
E1
defVars
A
fVars
dVars
E2
->
NatSet
.
Subset
(
usedVars
e
--
dVars
)
fVars
->
eval_expr
E1
(
toRMap
defVars
)
(
toREval
(
toRExp
e
))
nR
REAL
->
RoundoffErrorValidator
e
Gamma
A
dVars
=
true
->
IntervalValidation
.
validIntervalbounds
e
A
P
dVars
=
true
->
IntervalValidation
.
dVars_range_valid
dVars
E1
A
->
IntervalValidation
.
fVars_P_sound
fVars
E1
P
->
IntervalValidation
.
vars_typed
(
fVars
∪
dVars
)
defVars
->
FloverMap
.
find
(
elt
:=
intv
*
error
)
e
A
=
Some
(
elo
,
ehi
,
err
)
->
(
exists
(
nF
:
R
)
(
m
:
mType
),
eval_expr
E2
defVars
(
toRExp
e
)
nF
m
)
/
\
(
forall
(
nF
:
R
)
(
m
:
mType
),
eval_expr
E2
defVars
(
toRExp
e
)
nF
m
->
(
Rabs
(
nR
-
nF
)
<=
Q2R
err
)
%
R
).
Proof
.
intros
.
cbn
in
*
.
eapply
validErrorbound_sound
;
eauto
.
Qed
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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