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
80b25403
Commit
80b25403
authored
13 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[e-acsl] little refactoring
parent
144f42bb
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/e-acsl/TODO
+15
-15
15 additions, 15 deletions
src/plugins/e-acsl/TODO
src/plugins/e-acsl/visit.ml
+9
-5
9 additions, 5 deletions
src/plugins/e-acsl/visit.ml
with
24 additions
and
20 deletions
src/plugins/e-acsl/TODO
+
15
−
15
View file @
80b25403
- utiliser Options.use_asserts
########
# CODE #
########
- utiliser Options.use_asserts
- gestion des initialiseurs des globals: requiert un main
- ajouter des gardes dans les specs devant les termes indéfinis
/*@ assert \forall integer x; -1<= x<= 1 ==> 1/x == 0 || 1/x != 0; */
the plug-in would generate something like
/*@ assert \forall integer x; -1<= x<= 1 ==> (x != 0&& 1/x == 0) || (x != 0
&& 1/x != 0); */
- mkcall ne devrait pas générer de nouvelles variables pour une même fonction
- garde pour les casts quand overflows potentiels
(même pas de warnings aujourd'hui)
- tester les opérations binaires sur les pointeurs (requiert complex left value)
- minimiser le nombre de variables générées
- constante entière longue: utiliser la représentation sous forme de string et
rechercher la base appropriée.
#########
# TESTS #
#########
- tester les opérations binaires sur les pointeurs (requiert complex left value)
- améliorer test "integer_constant.i" quand bug fixed #745
- améliorer test "arith.i" quand bug fixed #751
####################
# AVANT LA DISTRIB #
####################
en lien avec bts #743:
- make distrib
- headers (copyright 2011)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/visit.ml
+
9
−
5
View file @
80b25403
...
...
@@ -46,7 +46,7 @@ let not_yet s =
let
e_acsl_header
()
=
GText
(
Read_header
.
text
()
)
(* Build a C conditional doing a runtime assertion check. *)
let
mk_
if
e
p
=
let
mk_
e_acsl_guard
e
p
=
let
loc
=
p
.
loc
in
let
unicode
=
Parameters
.
Unicode
.
get
()
in
Parameters
.
Unicode
.
off
()
;
...
...
@@ -65,10 +65,10 @@ module Mpz : sig
val
is_t
:
typ
->
bool
(* is the type equal to "mpz_t"? *)
val
e_got_t
:
exp
->
bool
(* is the type of e is equal to "mpz_t"? *)
val
init
:
exp
->
stmt
(* build stmt "mpz_init(v)" *)
val
clear
:
exp
->
stmt
(* build stmt "mpz_clear(v)" *)
val
init_set
:
exp
->
exp
->
stmt
(* build stmt "mpz_init_set_*(v, e)" with the good function 'set' according to
the type of e *)
val
clear
:
exp
->
stmt
(* build stmt "mpz_clear(v)" *)
end
=
struct
let
t_torig
=
...
...
@@ -237,7 +237,9 @@ let constant_to_exp ?(loc=Location.unknown) = function
kinteger64_repr
?
loc
k
n
s
|
CInt64
(
n
,
(
ILongLong
|
IULongLong
)
,
_s
)
->
(* cannot use the string [s] if any since we do not know the base in which
it is written. Such a base is required by GMP. *)
it is written. Such a base is required by GMP.
[TODO] Actually possible to find the base for the string, but not done
yet *)
mkString
?
loc
(
Int64
.
to_string
n
)
|
CStr
_
|
CWStr
_
|
CChr
_
|
CReal
_
|
CEnum
_
as
c
->
new_exp
?
loc
(
Const
c
)
...
...
@@ -321,7 +323,7 @@ let rec term_to_exp env t =
let
call
=
mk_call
~
loc
name
[
e
;
e1
;
e2
]
in
match
bop
with
|
Div
|
Mod
->
let
cond
=
mk_
if
guard
(
Logic_const
.
prel
(
Req
,
t2
,
zero
))
in
let
cond
=
mk_
e_acsl_guard
guard
(
Logic_const
.
prel
(
Req
,
t2
,
zero
))
in
Env
.
add_assert
cond
(
Logic_const
.
prel
(
Rneq
,
t2
,
zero
));
[
cond
;
call
]
|
_
->
...
...
@@ -465,7 +467,9 @@ let rec named_predicate_to_exp env p =
let
convert_named_predicate
env
p
=
let
e
,
env
=
named_predicate_to_exp
env
p
in
assert
(
Typ
.
equal
(
typeOf
e
)
intType
);
Env
.
add_stmt
env
(
mk_if
(
new_exp
~
loc
:
e
.
eloc
(
UnOp
(
LNot
,
e
,
intType
)))
p
)
Env
.
add_stmt
env
(
mk_e_acsl_guard
(
new_exp
~
loc
:
e
.
eloc
(
UnOp
(
LNot
,
e
,
intType
)))
p
)
let
convert_annotation
env
annot
=
try
...
...
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