module type S =sig
..end
module Graph:SHGraph.S
type ('a, 'b)
manager = {
|
mutable bottom : |
(* | Create a bottom value | *) |
|
mutable canonical : |
(* | Make an abstract value canonical | *) |
|
mutable is_bottom : |
(* | Emptiness test | *) |
|
mutable is_leq : |
(* | Inclusion test | *) |
|
mutable join : |
|||
|
mutable join_list : |
(* | Binary and n-ary join operation | *) |
|
mutable widening : |
(* | Apply widening at the given point, with the two arguments | *) |
|
mutable apply : |
(* | Apply the function indexed by hedge to the array of arguments.
It returns the new abstract value, but also a user-defined information that will be associated to the hyperedge in the result. | *) |
|
mutable arc_init : |
(* | Initial value for arcs | *) |
|
mutable get_init : |
(* | Return the initial value associated to the given vertex | *) |
|
mutable print_abstract : |
|||
|
mutable print_arc : |
|||
|
mutable print_vertex : |
|||
|
mutable print_hedge : |
|||
|
mutable widening_first : |
(* | When to apply widening from first non bottom value. | *) |
|
mutable widening_start : |
(* | First widening step | *) |
|
mutable widening_freq : |
(* | widening every n steps | *) |
|
mutable widening_descend : |
(* | Maximum nb. of descending steps | *) |
|
mutable print_analysis : |
|||
|
mutable print_step : |
|||
|
mutable print_state : |
|||
|
mutable print_postpre : |
type
strategy_vertex = {
|
mutable vertex : |
|||
|
mutable hedges : |
(* | Order in which the incoming hyperedges will be applied | *) |
|
mutable widen : |
(* | Should this vertex be a widening point ? | *) |
vertex
.hedges
is a list of incoming hyperedges. The effect of hyperedges are
applied "in parallel" and the destination vertex is updated. Be cautious:
if an incoming hyperedge is forgotten in this list, it won't be taken
into account in the analysis.widen
specifies whether the vertex is a widening point or not.typestrategy =
strategy_vertex Ilist.t
[1; [2;3]; 4;
[5]; 6]
means: - update 1
; - update 2
then 3
, and loop until
stabilization; - update 4
; - update 5
and loop until stabilization; -
update 6
and ends the analysis.
Some observations on this example:
6
to 2
, the loop will not be iterated.[1; [2;
[3;4]; [5]]; 6]
, where the loop [3;4]
needs to be (temporarily stable)
before going on with 5
.type
stat = {
|
time : |
|
iterations : |
|
descendings : |
type('a, 'b)
output =('a, 'b, stat) Graph.t
type ('a, 'b)
graph
val print_strategy_vertex : ('a, 'b) manager ->
Format.formatter -> strategy_vertex -> unit
print_strategy_vertex man fmt sv
prints an object of type
strategy_vertex
, using the manager man
for printing vertices and
hyperedges. The output has the form (vertex,[list of
hedges],boolean)
.val print_strategy : ('a, 'b) manager ->
Format.formatter -> strategy -> unit
print_strategy_vertex man fmt sv
prints an object of type
strategy
, using the manager man
for printing vertices and
hyperedges.val print_graph : ('a, 'b) manager ->
Format.formatter -> ('a, 'b) graph -> unit
print_graph man print_arc fmt graph
prints an object of (abstract)
type ('abstract,'arc) graph
, using print_arc
for printing the
information associated to hyperedges.
val print_stat : Format.formatter -> stat -> unit
val print_output : ('a, 'b) manager ->
Format.formatter -> ('a, 'b) output -> unit
print_graph man print_arc fmt graph
prints an object of type 'arc
output
, using print_arc
for printing the information associated to
hyperedges.
val init : ('a, 'b) manager ->
('c, 'd, 'e) Graph.t -> Graph.SetV.t -> ('a, 'b) graph
init manager inputgraph sinit
creates an internal graph and
initializes it.inputgraph
is used.sinit
is the set of vertices with non-bottom initial values. Initial
values are obtained by calling the function manager.get_init
on these
vertices.val fixpoint : ('a, 'b) manager ->
('a, 'b) graph -> strategy -> unit
fixpoint manager graph strategy
computes a fixpoint (or a
postfixpoint in case of widening) of the system of equation represented
by graph
. The iteration order (and set of widening points) is specified
by the argument strategy
.val descend : ('a, 'b) manager ->
('a, 'b) graph -> strategy -> bool
descend manager graph sinit strategy
performs several descending
steps, depending on the option manager.widening_descend
. strategy
is
used only for the ordering of connex components and the iteration
ordering inside them.val analysis : ('a, 'b) manager ->
('c, 'd, 'e) Graph.t ->
Graph.SetV.t -> strategy -> ('a, 'b) graph
val analysis_guided : ?depth:int ->
?priority:(Graph.hedge -> int) ->
?modify_strategy:(strategy -> strategy) ->
('a, 'b) manager ->
('c, 'd, 'e) Graph.t -> Graph.SetV.t -> ('a, 'b) graph
analysis
, but with the technique of Gopan and Reps published
in Static Anlaysis Symposium, SAS'2007.val output_of_graph : ('a, 'b) graph -> ('a, 'b) output
val strategy_default : ?depth:int ->
?priority:(Graph.hedge -> int) ->
('a, 'b, 'c) Graph.t -> Graph.SetV.t -> strategy
(1 2 (3 4 5)
6 (7 8) 9)
where 1, 2, 6, 9
are SCC by themselves. A higher value
defines a more recursive behavior, like (1 2 (3 (4 5)) 6 (7 (8)) 9)
.priority h >= 0
and the widening points, and also indicates
which hyperedge should be explored first at a point of choice.