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
d1e7d05a
Commit
d1e7d05a
authored
3 years ago
by
Basile Desloges
Committed by
Julien Signoles
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixup! [eacsl] Use the label analysis to translate `\at` values
parent
a9b91bf2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/e-acsl/src/code_generator/translate_ats.ml
+13
-13
13 additions, 13 deletions
src/plugins/e-acsl/src/code_generator/translate_ats.ml
src/plugins/e-acsl/src/code_generator/translate_predicates.ml
+3
-3
3 additions, 3 deletions
...plugins/e-acsl/src/code_generator/translate_predicates.ml
with
16 additions
and
16 deletions
src/plugins/e-acsl/src/code_generator/translate_ats.ml
+
13
−
13
View file @
d1e7d05a
...
...
@@ -251,15 +251,15 @@ let indexed_exp ~loc kf env e_at =
(* ************************************************************************** *)
(* Table storing the [varinfo] with the translation of a given [at_data]. *)
let
translations
:
varinfo
Error
.
result
At
D
ata
.
Hashtbl
.
t
=
At
D
ata
.
Hashtbl
.
create
17
let
translations
:
varinfo
Error
.
result
At
_d
ata
.
Hashtbl
.
t
=
At
_d
ata
.
Hashtbl
.
create
17
(* [pretranslate_to_exp ~loc kf env pot] immediately translates the given
[pred_or_term] in the current environment and return the translated
expression. *)
let
pretranslate_to_exp
~
loc
kf
env
pot
=
Options
.
debug
~
level
:
4
"pre-translating %a in local environment '%a'"
Pred
OrT
erm
.
pretty
pot
Pred
_or_t
erm
.
pretty
pot
Typing
.
Function_params_ty
.
pretty
(
Env
.
Local_vars
.
get
env
);
let
e
,
env
,
t_opt
=
let
adata
=
Assert
.
no_data
in
...
...
@@ -298,7 +298,7 @@ let pretranslate_to_exp ~loc kf env pot =
let
pretranslate_to_exp_with_lscope
~
loc
~
lscope
kf
env
pot
=
Options
.
debug
~
level
:
4
"pre-translating %a in local environment '%a' with lscope '%a'"
Pred
OrT
erm
.
pretty
pot
Pred
_or_t
erm
.
pretty
pot
Typing
.
Function_params_ty
.
pretty
(
Env
.
Local_vars
.
get
env
)
Lscope
.
D
.
pretty
lscope
;
let
term_to_exp
=
!
term_to_exp_ref
in
...
...
@@ -477,11 +477,11 @@ let for_stmt env kf stmt =
in
(* Translate the [\at()]. *)
let
stmt_translations
=
Pred
OrT
erm
.
Hashtbl
.
create
7
in
At
D
ata
.
Set
.
fold
let
stmt_translations
=
Pred
_or_t
erm
.
Hashtbl
.
create
7
in
At
_d
ata
.
Set
.
fold
(
fun
({
lscope
;
pot
;
error
}
as
at_data
)
env
->
let
vi_or_err
,
env
=
let
vi_or_err
=
Pred
OrT
erm
.
Hashtbl
.
find_opt
stmt_translations
pot
in
let
vi_or_err
=
Pred
_or_t
erm
.
Hashtbl
.
find_opt
stmt_translations
pot
in
match
error
,
vi_or_err
with
|
Some
exn
,
(
Some
_
|
None
)
->
(* If there was an error during the pre-analysis, then store it
...
...
@@ -505,8 +505,8 @@ let for_stmt env kf stmt =
with
Error
.(
Typing_error
_
|
Not_yet
_
)
as
exn
->
Result
.
Error
exn
,
env
in
Pred
OrT
erm
.
Hashtbl
.
replace
stmt_translations
pot
vi_or_err
;
At
D
ata
.
Hashtbl
.
replace
translations
at_data
vi_or_err
;
Pred
_or_t
erm
.
Hashtbl
.
replace
stmt_translations
pot
vi_or_err
;
At
_d
ata
.
Hashtbl
.
replace
translations
at_data
vi_or_err
;
env
)
at_for_stmt
env
...
...
@@ -514,10 +514,10 @@ let for_stmt env kf stmt =
let
to_exp
~
loc
~
adata
kf
env
pot
label
=
let
kinstr
=
Env
.
get_kinstr
env
in
let
lscope
=
Env
.
Logic_scope
.
get
env
in
let
at
=
At
D
ata
.
create
kf
kinstr
lscope
pot
label
in
let
at
=
At
_d
ata
.
create
kf
kinstr
lscope
pot
label
in
if
is_label_defined
label
then
try
let
vi_or_err
=
At
D
ata
.
Hashtbl
.
find
translations
at
in
let
vi_or_err
=
At
_d
ata
.
Hashtbl
.
find
translations
at
in
match
vi_or_err
with
|
Result
.
Ok
vi
->
let
e
,
env
=
...
...
@@ -547,9 +547,9 @@ let to_exp ~loc ~adata kf env pot label =
This usually happens when using a label defined after the place@ \
where the %s should be translated"
potstr
Pred
OrT
erm
.
pretty
pot
Pred
_or_t
erm
.
pretty
pot
potstr
let
reset
()
=
At
D
ata
.
Hashtbl
.
clear
translations
;
At
_d
ata
.
Hashtbl
.
clear
translations
;
clabels_ref
:=
Logic_label
.
Set
.
empty
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/src/code_generator/translate_predicates.ml
+
3
−
3
View file @
d1e7d05a
...
...
@@ -305,11 +305,11 @@ let rec predicate_content_to_exp ~adata ?(inplace=false) ?name kf env p =
immediately translated or if [Translate_ats] should be used to retrieve
the translation.
- [name]: name to use for generated variables.
- [kf]:
T
he enclosing function.
- [kf]:
t
he enclosing function.
- [rte]: if true, generate and translate RTE before translating the
predicate.
- [env]:
T
he current environment.
- [p]:
T
he predicate to translate. *)
- [env]:
t
he current environment.
- [p]:
t
he predicate to translate. *)
and
to_exp
~
adata
?
inplace
?
name
kf
?
rte
env
p
=
let
p
=
Logic_normalizer
.
get_pred
p
in
let
rte
=
match
rte
with
None
->
Env
.
generate_rte
env
|
Some
b
->
b
in
...
...
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