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
64264c61
Commit
64264c61
authored
3 years ago
by
Valentin Perrelle
Committed by
David Bühler
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Reduc] Use the new Eva API
parent
d0fdd0ee
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/reduc/hyp.ml
+1
-2
1 addition, 2 deletions
src/plugins/reduc/hyp.ml
src/plugins/reduc/value2acsl.ml
+6
-8
6 additions, 8 deletions
src/plugins/reduc/value2acsl.ml
src/plugins/reduc/value2acsl.mli
+2
-2
2 additions, 2 deletions
src/plugins/reduc/value2acsl.mli
with
9 additions
and
12 deletions
src/plugins/reduc/hyp.ml
+
1
−
2
View file @
64264c61
...
...
@@ -36,12 +36,11 @@ class hypotheses_visitor (env: Collect.env) = object(self)
method
!
vstmt_aux
stmt
=
let
kf
=
Option
.
get
(
self
#
current_kf
)
in
let
state
=
Db
.
Value
.
get_stmt_state
stmt
in
if
Collect
.
should_annotate_stmt
env
stmt
then
begin
let
vars
=
Collect
.
get_relevant_vars_stmt
env
kf
stmt
in
List
.
iter
(
fun
e
->
let
p_opt
=
pred_opt_from_expr_state
st
ate
e
in
let
p_opt
=
pred_opt_from_expr_state
st
mt
e
in
Option
.
iter
(
Misc
.
assert_and_validate
~
kf
stmt
)
p_opt
)
vars
end
;
...
...
This diff is collapsed.
Click to expand it.
src/plugins/reduc/value2acsl.ml
+
6
−
8
View file @
64264c61
...
...
@@ -165,15 +165,13 @@ let value_to_predicate_opt ?(loc=Location.unknown) t v =
with
|
Not_based_on_null
->
(* base_offsets_to_predicate ~loc t m *)
None
let
exp_to_predicate
?
(
loc
=
Location
.
unknown
)
st
ate
e
=
let
value
=
!
Db
.
Value
.
eval_expr
~
with_alarms
:
CilE
.
warn_none_mode
state
e
in
let
exp_to_predicate
?
(
loc
=
Location
.
unknown
)
st
mt
e
=
let
value
=
Eva
.
Results
.(
before
stmt
|>
eval_exp
e
|>
as_ival
)
in
let
te
=
Logic_utils
.
expr_to_term
~
coerce
:
false
e
in
val
ue
_to_predicate_opt
~
loc
te
value
Option
.
bind
(
Result
.
to_option
value
)
(
i
val_to_predicate_opt
~
loc
te
)
let
lval_to_predicate
?
(
loc
=
Location
.
unknown
)
state
lv
=
let
value
=
snd
(
!
Db
.
Value
.
eval_lval
~
with_alarms
:
CilE
.
warn_none_mode
None
state
lv
)
in
let
lval_to_predicate
?
(
loc
=
Location
.
unknown
)
stmt
lv
=
let
value
=
Eva
.
Results
.(
before
stmt
|>
eval_lval
lv
|>
as_ival
)
in
let
e
=
Cil
.
new_exp
~
loc
(
Lval
lv
)
in
let
te
=
Logic_utils
.
expr_to_term
~
coerce
:
false
e
in
val
ue
_to_predicate_opt
~
loc
te
value
Option
.
bind
(
Result
.
to_option
value
)
(
i
val_to_predicate_opt
~
loc
te
)
This diff is collapsed.
Click to expand it.
src/plugins/reduc/value2acsl.mli
+
2
−
2
View file @
64264c61
...
...
@@ -27,5 +27,5 @@ open Cil_types
@return None if no such predicate can be created. *)
val
value_to_predicate_opt
:
?
loc
:
location
->
term
->
Cvalue
.
V
.
t
->
predicate
option
val
lval_to_predicate
:
?
loc
:
location
->
C
value
.
Model
.
t
->
lval
->
predicate
option
val
exp_to_predicate
:
?
loc
:
location
->
C
value
.
Model
.
t
->
exp
->
predicate
option
val
lval_to_predicate
:
?
loc
:
location
->
C
il_types
.
stm
t
->
lval
->
predicate
option
val
exp_to_predicate
:
?
loc
:
location
->
C
il_types
.
stm
t
->
exp
->
predicate
option
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