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
86589b84
Commit
86589b84
authored
3 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Minor simplifications when using Integer.to_int[_opt].
parent
5bdf95a6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/value/partitioning/partition.ml
+2
-6
2 additions, 6 deletions
src/plugins/value/partitioning/partition.ml
src/plugins/value/partitioning/partitioning_parameters.ml
+5
-13
5 additions, 13 deletions
src/plugins/value/partitioning/partitioning_parameters.ml
with
7 additions
and
19 deletions
src/plugins/value/partitioning/partition.ml
+
2
−
6
View file @
86589b84
...
...
@@ -336,15 +336,11 @@ struct
let
eval_exp_to_int
state
exp
=
let
_valuation
,
ival
=
evaluate_exp_to_ival
state
exp
in
try
match
Integer
.
to_int_opt
(
Ival
.
project_int
ival
)
with
|
Some
i
->
i
|
None
->
fail
~
exp
"this partitioning parameter overflows an integer"
try
Integer
.
to_int
(
Ival
.
project_int
ival
)
with
|
Ival
.
Not_Singleton_Int
->
fail
~
exp
"this partitioning parameter must evaluate to a singleton"
|
Failure
_
->
fail
~
exp
"this partitioning parameter is too big"
|
Z
.
Overflow
->
fail
~
exp
"this partitioning parameter overflows an integer"
let
split_by_predicate
state
predicate
=
let
env
=
...
...
This diff is collapsed.
Click to expand it.
src/plugins/value/partitioning/partitioning_parameters.ml
+
5
−
13
View file @
86589b84
...
...
@@ -93,19 +93,11 @@ struct
let
t
=
Cil
.
visitCilTerm
(
new
Logic_utils
.
simplify_const_lval
global_init
)
t
in
match
Logic_utils
.
constFoldTermToInt
t
with
|
Some
n
->
begin
match
Integer
.
to_int_opt
n
with
|
Some
n'
->
Partition
.
IntLimit
n'
|
None
->
warn
"invalid loop unrolling parameter (%a); ignoring"
(
Integer
.
pretty
~
hexa
:
false
)
n
;
default
end
|
None
->
try
Partition
.
ExpLimit
(
term_to_exp
t
)
let
i
=
Logic_utils
.
constFoldTermToInt
t
in
match
Option
.
bind
i
Integer
.
to_int_opt
with
|
Some
n
->
Partition
.
IntLimit
n
|
None
->
try
Partition
.
ExpLimit
(
term_to_exp
t
)
with
Db
.
Properties
.
Interp
.
No_conversion
->
warn
"loop unrolling parameters must be valid expressions; \
ignoring"
;
...
...
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