Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
frama-c
Commits
78886523
Commit
78886523
authored
3 months ago
by
Loïc Correnson
Committed by
David Bühler
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[eva] use fold-result
parent
63d4d352
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/eva/utils/export.ml
+7
-12
7 additions, 12 deletions
src/plugins/eva/utils/export.ml
with
7 additions
and
12 deletions
src/plugins/eva/utils/export.ml
+
7
−
12
View file @
78886523
...
...
@@ -134,15 +134,14 @@ let frange ~kind (exp : Exp.exp) = function
|
None
->
True
|
Some
(
a
,
b
)
->
pand
(
fmin
~
kind
exp
a
)
(
fmax
~
kind
exp
b
)
let
fval
~
kind
(
exp
:
Exp
.
exp
)
(
fval
:
Fval
.
t
)
:
pred
=
let
fval
typ
(
exp
:
Exp
.
exp
)
(
fval
:
Fval
.
t
)
:
pred
=
let
kind
=
match
typ
with
|
TFloat
(
kind
,_
)
->
kind
|
_
->
assert
false
in
let
range
,
isNaN
=
Fval
.
min_and_max
fval
in
por
(
fNaN
exp
isNaN
)
(
frange
~
kind
exp
range
)
let
fkind
(
typ
:
typ
)
=
match
typ
with
|
TFloat
(
kind
,_
)
->
kind
|
_
->
assert
false
(* -------------------------------------------------------------------------- *)
(* --- Values --- *)
(* -------------------------------------------------------------------------- *)
...
...
@@ -151,14 +150,10 @@ type value = Results.value Results.evaluation
let
domain
(
exp
:
Exp
.
exp
)
typ
(
value
:
value
)
:
pred
=
if
Cil
.
isIntegralType
typ
then
match
Results
.
as_ival
value
with
|
Ok
v
->
ival
exp
v
|
Error
err
->
error
err
Results
.
as_ival
value
|>
Result
.
fold
~
error
~
ok
:
(
ival
exp
)
else
if
Cil
.
isFloatingType
typ
then
match
Results
.
as_fval
value
with
|
Ok
v
->
fval
~
kind
:
(
fkind
typ
)
exp
v
|
Error
err
->
error
err
Results
.
as_fval
value
|>
Result
.
fold
~
error
~
ok
:
(
fval
typ
exp
)
else
True
(* -------------------------------------------------------------------------- *)
...
...
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