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
1305bbfb
Commit
1305bbfb
authored
1 year ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Garbled mix origin: removes use of Abstract_interp.Make_Lattice_Base.
Defines datatype and lattice of LocationLattice in origin.ml.
parent
7129e55b
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/kernel_services/abstract_interp/origin.ml
+61
-3
61 additions, 3 deletions
src/kernel_services/abstract_interp/origin.ml
src/kernel_services/abstract_interp/origin.mli
+1
-4
1 addition, 4 deletions
src/kernel_services/abstract_interp/origin.mli
with
62 additions
and
7 deletions
src/kernel_services/abstract_interp/origin.ml
+
61
−
3
View file @
1305bbfb
...
...
@@ -26,10 +26,68 @@ type kind =
|
K_Merge
|
K_Arith
module
Location
=
Cil_datatype
.
Location
module
LocationLattice
=
struct
include
Abstract_interp
.
Make_Lattice_Base
(
Cil_datatype
.
Location
)
let
current_loc
()
=
inject
(
Cil
.
CurrentLoc
.
get
()
)
type
t
=
Top
|
Bottom
|
Value
of
Location
.
t
module
Datatype_Input
=
struct
include
Datatype
.
Serializable_undefined
type
nonrec
t
=
t
let
name
=
"Origin.LocationLattice"
let
reprs
=
[
Top
]
let
structural_descr
=
Structural_descr
.
t_sum
[
|
[
|
Location
.
packed_descr
|
]
|
]
let
compare
l1
l2
=
match
l1
,
l2
with
|
Top
,
Top
|
Bottom
,
Bottom
->
0
|
Value
loc1
,
Value
loc2
->
Location
.
compare
loc1
loc2
|
Top
,
_
->
1
|
_
,
Top
->
-
1
|
Bottom
,
_
->
-
1
|
_
,
Bottom
->
1
let
equal
l1
l2
=
match
l1
,
l2
with
|
Top
,
Top
|
Bottom
,
Bottom
->
true
|
Value
loc1
,
Value
loc2
->
Location
.
equal
loc1
loc2
|
_
->
false
let
hash
=
function
|
Top
->
3
|
Bottom
->
5
|
Value
loc
->
Location
.
hash
loc
*
7
let
pretty
fmt
=
function
|
Top
->
Format
.
fprintf
fmt
"Top"
|
Bottom
->
Format
.
fprintf
fmt
"Bottom"
|
Value
loc
->
Format
.
fprintf
fmt
"{%a}"
Location
.
pretty
loc
end
include
(
Datatype
.
Make
(
Datatype_Input
)
:
Datatype
.
S
with
type
t
:=
t
)
let
current_loc
()
=
Value
(
Cil
.
CurrentLoc
.
get
()
)
let
join
l1
l2
=
if
l1
==
l2
then
l1
else
match
l1
,
l2
with
|
Top
,
_
|
_
,
Top
->
Top
|
Bottom
,
l
|
l
,
Bottom
->
l
|
Value
loc1
,
Value
loc2
->
if
Location
.
equal
loc1
loc2
then
l1
else
Top
let
narrow
l1
l2
=
if
l1
==
l2
then
l1
else
match
l1
,
l2
with
|
Bottom
,
_
|
_
,
Bottom
->
Bottom
|
Top
,
l
|
l
,
Top
->
l
|
Value
loc1
,
Value
loc2
->
if
Location
.
equal
loc1
loc2
then
l1
else
Bottom
let
meet
=
narrow
end
type
origin
=
...
...
@@ -139,7 +197,7 @@ include Datatype.Make
let
mem_project
=
Datatype
.
never_any_project
end
)
let
bottom
=
Arith
(
LocationLattice
.
b
ottom
)
let
bottom
=
Arith
LocationLattice
.
B
ottom
let
join
o1
o2
=
let
result
=
...
...
This diff is collapsed.
Click to expand it.
src/kernel_services/abstract_interp/origin.mli
+
1
−
4
View file @
1305bbfb
...
...
@@ -30,10 +30,7 @@
(** Lattice of source locations. *)
module
LocationLattice
:
sig
include
Lattice_type
.
Lattice_Base
with
type
l
=
Cil_types
.
location
val
current_loc
:
unit
->
t
end
module
LocationLattice
:
Datatype
.
S
(** List of possible origins. Most of them also include the set of
source locations where the operation took place. *)
...
...
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