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
e7e4ae71
Commit
e7e4ae71
authored
6 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[wp] fix havoc tactical
parent
1d58bf41
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/Auto.mli
+1
-1
1 addition, 1 deletion
src/plugins/wp/Auto.mli
src/plugins/wp/TacHavoc.ml
+28
-53
28 additions, 53 deletions
src/plugins/wp/TacHavoc.ml
src/plugins/wp/TacHavoc.mli
+1
-2
1 addition, 2 deletions
src/plugins/wp/TacHavoc.mli
with
30 additions
and
56 deletions
src/plugins/wp/Auto.mli
+
1
−
1
View file @
e7e4ae71
...
@@ -35,7 +35,7 @@ val contrapose : ?priority:float -> selection -> strategy
...
@@ -35,7 +35,7 @@ val contrapose : ?priority:float -> selection -> strategy
val
compound
:
?
priority
:
float
->
selection
->
strategy
val
compound
:
?
priority
:
float
->
selection
->
strategy
val
cut
:
?
priority
:
float
->
?
modus
:
bool
->
selection
->
strategy
val
cut
:
?
priority
:
float
->
?
modus
:
bool
->
selection
->
strategy
val
filter
:
?
priority
:
float
->
?
anti
:
bool
->
unit
->
strategy
val
filter
:
?
priority
:
float
->
?
anti
:
bool
->
unit
->
strategy
val
havoc
:
?
priority
:
float
->
havoc
:
selection
->
addr
:
selection
->
strategy
val
havoc
:
?
priority
:
float
->
havoc
:
selection
->
strategy
val
separated
:
?
priority
:
float
->
selection
->
strategy
val
separated
:
?
priority
:
float
->
selection
->
strategy
val
instance
:
?
priority
:
float
->
selection
->
selection
list
->
strategy
val
instance
:
?
priority
:
float
->
selection
->
selection
list
->
strategy
val
lemma
:
?
priority
:
float
->
?
at
:
selection
->
string
->
selection
list
->
strategy
val
lemma
:
?
priority
:
float
->
?
at
:
selection
->
string
->
selection
list
->
strategy
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/TacHavoc.ml
+
28
−
53
View file @
e7e4ae71
...
@@ -30,62 +30,38 @@ module L = Qed.Logic
...
@@ -30,62 +30,38 @@ module L = Qed.Logic
(* --- Havoc --- *)
(* --- Havoc --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
let
field
,
parameter
=
let
lookup_havoc
e
=
Tactical
.
composer
match
F
.
repr
e
with
~
id
:
"address"
|
L
.
Aget
(
m
,
p
)
->
~
title
:
"Address"
begin
~
descr
:
"Access Outside the Assigned Range"
match
F
.
repr
m
with
()
|
L
.
Fun
(
f
,
[
mr
;
m0
;
a
;
n
]
)
when
f
==
MemTyped
.
f_havoc
->
Some
(
mr
,
m0
,
a
,
n
,
p
)
let
has_type
t
e
=
|
_
->
None
try
F
.
Tau
.
equal
t
(
F
.
typeof
e
)
end
with
Not_found
->
false
|
_
->
None
let
match_havoc
=
let
havoc
m1
=
function
|
L
.
Fun
(
f
,
[
m_undef
;
m0
;
a
;
n
]
)
when
f
==
MemTyped
.
f_havoc
->
m1
,
(
m_undef
,
m0
,
a
,
n
)
|
_
->
raise
Not_found
in
function
|
L
.
Eq
(
m
,
m'
)
->
(
try
havoc
m'
(
F
.
repr
m
)
with
|
Not_found
->
havoc
m
(
F
.
repr
m'
))
|
_
->
raise
Not_found
class
havoc
=
class
havoc
=
object
(
self
)
object
inherit
Tactical
.
make
~
id
:
"Wp.havoc"
inherit
Tactical
.
make
~
id
:
"Wp.havoc"
~
title
:
"Havoc"
~
title
:
"Havoc"
~
descr
:
"Go Through Assigns"
~
descr
:
"Go Through Assigns"
~
params
:
[
parameter
]
~
params
:
[]
method
select
feedback
sel
=
method
select
_feedback
sel
=
match
sel
with
let
at
=
Tactical
.
at
sel
in
|
Clause
(
Step
s
)
->
let
e
=
Tactical
.
selected
sel
in
begin
match
lookup_havoc
e
with
match
s
.
condition
with
|
None
->
Not_applicable
|
Have
p
|
When
p
->
|
Some
(
mr
,
m0
,
a
,
n
,
p
)
->
let
m1
,
(
m_undef
,
m0
,
a
,
n
)
=
match_havoc
(
F
.
e_expr
p
)
in
let
separated
=
let
tp
=
F
.
typeof
a
in
F
.
p_call
MemTyped
.
p_separated
feedback
#
update_field
~
filter
:
(
has_type
tp
)
field
;
[
p
;
F
.
e_int
1
;
a
;
n
]
in
let
sel
=
self
#
get_field
field
in
let
process
=
Tactical
.
rewrite
?
at
[
if
not
(
Tactical
.
is_empty
sel
)
then
"Unassigned"
,
separated
,
e
,
F
.
e_get
m0
p
;
let
ptr
=
Tactical
.
selected
sel
in
"Assigned"
,
F
.
p_not
separated
,
e
,
F
.
e_get
mr
p
;
if
has_type
tp
ptr
then
]
in
let
separated
=
Applicable
process
F
.
p_call
MemTyped
.
p_separated
[
ptr
;
F
.
e_int
1
;
a
;
n
]
in
let
equal_unassigned
=
F
.
p_equal
(
F
.
e_get
m1
ptr
)
(
F
.
e_get
m0
ptr
)
in
let
equal_assigned
=
F
.
p_equal
(
F
.
e_get
m1
ptr
)
(
F
.
e_get
m_undef
ptr
)
in
let
process
=
Tactical
.
insert
~
at
:
s
.
id
[
"Havoc"
,
F
.
p_if
separated
equal_unassigned
equal_assigned
]
in
Applicable
process
else
(
feedback
#
set_error
"Not a pointer type"
;
Not_configured
)
else
Not_configured
|
_
->
Not_applicable
end
|
_
->
Not_applicable
end
end
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
...
@@ -219,14 +195,13 @@ class validity =
...
@@ -219,14 +195,13 @@ class validity =
module
Havoc
=
module
Havoc
=
struct
struct
let
field
=
field
let
tactical
=
Tactical
.
export
(
new
havoc
)
let
tactical
=
Tactical
.
export
(
new
havoc
)
let
strategy
?
(
priority
=
1
.
0
)
~
havoc
~
addr
=
let
strategy
?
(
priority
=
1
.
0
)
~
havoc
=
Strategy
.{
Strategy
.{
priority
;
priority
;
tactical
;
tactical
;
selection
=
havoc
;
selection
=
havoc
;
arguments
=
[
arg
field
addr
]
;
arguments
=
[]
;
}
}
end
end
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/TacHavoc.mli
+
1
−
2
View file @
e7e4ae71
...
@@ -27,10 +27,9 @@ open Strategy
...
@@ -27,10 +27,9 @@ open Strategy
module
Havoc
:
module
Havoc
:
sig
sig
val
field
:
selection
field
val
tactical
:
tactical
val
tactical
:
tactical
val
strategy
:
val
strategy
:
?
priority
:
float
->
havoc
:
selection
->
addr
:
selection
->
strategy
?
priority
:
float
->
havoc
:
selection
->
strategy
end
end
module
Separated
:
module
Separated
:
...
...
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