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
Package registry
Container Registry
Model registry
Operate
Terraform modules
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
Vincent Laviron
frama-c
Commits
be3154c8
Commit
be3154c8
authored
3 years ago
by
Basile Desloges
Browse files
Options
Downloads
Patches
Plain Diff
[eacsl] Add a "not yet" error in case of GMP loop variant
parent
1376b821
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/e-acsl/src/code_generator/loops.ml
+31
-26
31 additions, 26 deletions
src/plugins/e-acsl/src/code_generator/loops.ml
with
31 additions
and
26 deletions
src/plugins/e-acsl/src/code_generator/loops.ml
+
31
−
26
View file @
be3154c8
...
@@ -48,32 +48,37 @@ let handle_annotations env kf stmt =
...
@@ -48,32 +48,37 @@ let handle_annotations env kf stmt =
|
Loop
(
_
,
({
bstmts
=
stmts
}
as
blk
)
,
loc
,
cont
,
break
)
->
|
Loop
(
_
,
({
bstmts
=
stmts
}
as
blk
)
,
loc
,
cont
,
break
)
->
(* Loop variant, save the current value of the variant *)
(* Loop variant, save the current value of the variant *)
let
stmts
,
env
,
variant
=
let
stmts
,
env
,
variant
=
match
Env
.
top_loop_variant
env
with
Error
.
handle
|
Some
(
t
,
measure_opt
)
->
(
fun
(
stmts
,
env
,
_
)
->
let
env
=
Env
.
set_annotation_kind
env
Smart_stmt
.
Variant
in
match
Env
.
top_loop_variant
env
with
let
env
=
Env
.
push
env
in
|
Some
(
t
,
measure_opt
)
->
Typing
.
type_term
~
use_gmp_opt
:
true
t
;
let
env
=
Env
.
set_annotation_kind
env
Smart_stmt
.
Variant
in
let
ty
=
Typing
.
get_typ
t
in
let
env
=
Env
.
push
env
in
let
e
,
env
=
!
term_to_exp_ref
kf
env
t
in
Typing
.
type_term
~
use_gmp_opt
:
true
t
;
let
vi_old
,
e_old
,
env
=
let
ty
=
Typing
.
get_typ
t
in
Env
.
new_var
if
Gmp_types
.
is_t
ty
then
Error
.
not_yet
"loop variant using GMP"
;
~
loc
let
e
,
env
=
!
term_to_exp_ref
kf
env
t
in
~
scope
:
Varname
.
Function
let
vi_old
,
e_old
,
env
=
~
name
:
"old_variant"
Env
.
new_var
env
~
loc
kf
~
scope
:
Varname
.
Function
(
Some
t
)
~
name
:
"old_variant"
ty
env
(
fun
_
_
->
[]
)
kf
in
(
Some
t
)
let
stmt
=
ty
Smart_stmt
.
assigns
~
loc
~
result
:
(
Cil
.
var
vi_old
)
e
(
fun
_
_
->
[]
)
in
in
let
blk
,
env
=
let
stmt
=
Env
.
pop_and_get
env
stmt
~
global_clear
:
false
Env
.
Middle
Smart_stmt
.
assigns
~
loc
~
result
:
(
Cil
.
var
vi_old
)
e
in
in
Smart_stmt
.
block_stmt
blk
::
stmts
,
env
,
Some
(
t
,
e_old
,
measure_opt
)
let
blk
,
env
=
|
None
->
stmts
,
env
,
None
Env
.
pop_and_get
env
stmt
~
global_clear
:
false
Env
.
Middle
in
let
stmts
=
Smart_stmt
.
block_stmt
blk
::
stmts
in
stmts
,
env
,
Some
(
t
,
e_old
,
measure_opt
)
|
None
->
stmts
,
env
,
None
)
(
stmts
,
env
,
None
)
in
in
(* Auxiliary function to generate variant and invariant checks *)
(* Auxiliary function to generate variant and invariant checks *)
let
rec
aux
(
stmts
,
env
)
=
function
let
rec
aux
(
stmts
,
env
)
=
function
...
...
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