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
bec9ca8e
Commit
bec9ca8e
authored
4 years ago
by
François Bobot
Browse files
Options
Downloads
Patches
Plain Diff
[MemValue] Add MemValue in the commandline and gui
parent
76ae754c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/wp/Factory.ml
+1
-0
1 addition, 0 deletions
src/plugins/wp/Factory.ml
src/plugins/wp/GuiPanel.ml
+5
-2
5 additions, 2 deletions
src/plugins/wp/GuiPanel.ml
src/plugins/wp/MemValue.ml
+7
-3
7 additions, 3 deletions
src/plugins/wp/MemValue.ml
with
13 additions
and
5 deletions
src/plugins/wp/Factory.ml
+
1
−
0
View file @
bec9ca8e
...
...
@@ -355,6 +355,7 @@ let update_config ~warning m s = function
|
"TYPED"
->
{
s
with
mheap
=
Typed
MemTyped
.
Fits
}
|
"CAST"
->
{
s
with
mheap
=
Typed
MemTyped
.
Unsafe
}
|
"NOCAST"
->
{
s
with
mheap
=
Typed
MemTyped
.
NoCast
}
|
"VALUE"
->
{
s
with
mheap
=
Value
}
|
"CAVEAT"
->
{
s
with
mvar
=
Caveat
}
|
"RAW"
->
{
s
with
mvar
=
Raw
}
|
"REF"
->
{
s
with
mvar
=
Ref
}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/GuiPanel.ml
+
5
−
2
View file @
bec9ca8e
...
...
@@ -93,7 +93,7 @@ let run_and_prove
(* --- Model Panel --- *)
(* ------------------------------------------------------------------------ *)
type
memory
=
TREE
|
HOARE
|
TYPED
|
REGION
type
memory
=
TREE
|
HOARE
|
TYPED
|
REGION
|
VALUE
class
model_selector
(
main
:
Design
.
main_window_extension_points
)
=
let
dialog
=
new
Wpane
.
dialog
...
...
@@ -101,6 +101,7 @@ class model_selector (main : Design.main_window_extension_points) =
let
memory
=
new
Widget
.
group
HOARE
in
let
r_hoare
=
memory
#
add_radio
~
label
:
"Hoare Memory Model"
~
value
:
HOARE
()
in
let
r_typed
=
memory
#
add_radio
~
label
:
"Typed Memory Model"
~
value
:
TYPED
()
in
let
r_value
=
memory
#
add_radio
~
label
:
"Value Memory Model"
~
value
:
VALUE
()
in
let
c_casts
=
new
Widget
.
checkbox
~
label
:
"Unsafe casts"
()
in
let
c_byref
=
new
Widget
.
checkbox
~
label
:
"Reference Arguments"
()
in
let
c_ctxt
=
new
Widget
.
checkbox
~
label
:
"Context Arguments (Caveat)"
()
in
...
...
@@ -113,6 +114,7 @@ class model_selector (main : Design.main_window_extension_points) =
begin
dialog
#
add_row
r_hoare
#
coerce
;
dialog
#
add_row
r_typed
#
coerce
;
dialog
#
add_row
r_value
#
coerce
;
dialog
#
add_row
c_casts
#
coerce
;
dialog
#
add_row
c_byref
#
coerce
;
dialog
#
add_row
c_ctxt
#
coerce
;
...
...
@@ -140,7 +142,7 @@ class model_selector (main : Design.main_window_extension_points) =
|
Region
->
memory
#
set
REGION
|
Hoare
->
memory
#
set
HOARE
|
Typed
m
->
memory
#
set
TYPED
;
c_casts
#
set
(
m
=
MemTyped
.
Unsafe
)
|
Value
->
()
)
;
|
Value
->
memory
#
set
VALUE
)
;
c_byref
#
set
(
s
.
mvar
=
Ref
)
;
c_ctxt
#
set
(
s
.
mvar
=
Caveat
)
;
c_cint
#
set
(
s
.
cint
=
Cint
.
Machine
)
;
...
...
@@ -154,6 +156,7 @@ class model_selector (main : Design.main_window_extension_points) =
|
HOARE
->
Hoare
|
TYPED
->
Typed
(
if
c_casts
#
get
then
MemTyped
.
Unsafe
else
MemTyped
.
Fits
)
|
VALUE
->
Value
in
{
mheap
=
m
;
mvar
=
if
c_ctxt
#
get
then
Caveat
else
if
c_byref
#
get
then
Ref
else
Var
;
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/MemValue.ml
+
7
−
3
View file @
bec9ca8e
...
...
@@ -111,7 +111,7 @@ module VState =
struct
module
M
=
Cvalue
.
Model
let
current
:
M
.
t
ref
=
ref
M
.
bottom
let
_
update
()
=
let
update
()
=
try
match
WpContext
.
get_scope
()
with
|
Global
->
assert
false
...
...
@@ -260,7 +260,7 @@ struct
|
M_float
->
L
.
Array
(
t_addr
,
L
.
Real
)
|
M_base
_
->
L
.
Array
(
L
.
Int
,
t_addr
)
let
basename_of_chunk
c
=
match
c
with
|
M_int
->
"Mint"
|
M_int
->
"Mint
00
"
|
M_char
->
"Mchar"
|
M_float
->
"Mfloat"
|
M_base
b
->
match
b
with
...
...
@@ -361,7 +361,10 @@ let imval c = Sigs.Mchunk (Pretty_utils.to_string Chunk.pretty c, KValue)
let
lookup_lv
_c
_e
=
assert
false
(* TODO *)
let
lookup
s
e
=
imval
(
Tmap
.
find
e
s
)
let
lookup
s
e
=
match
Tmap
.
find
e
s
with
|
exception
Not_found
->
Mterm
|
v
->
imval
v
let
apply
f
s
=
let
m
=
ref
Tmap
.
empty
in
...
...
@@ -670,6 +673,7 @@ let scope : sigma sequence -> scope -> varinfo list -> pred list = fun seq scope
|
Enter
->
alloc_pred
seq
xs
ALLOC
|
Leave
->
VState
.
update
()
;
alloc_pred
seq
xs
FREE
let
global
:
sigma
->
term
(*addr*)
->
pred
=
fun
_sigma
p
->
...
...
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