in what we will call abstract dependency, where a
variable is relevant to an expression if it affects a
given property of its evaluation. More precisely, This
notion of dependency is parametric on the properties
of interest. Basically, an expression e depends on a
variable x w.r.t. a property ρ if changing x, and keep-
ing all other variables unchanged with respect to ρ,
may lead to a change in e with respect to ρ.
Definition 5. (Abstract dependency) Let x, y ∈ Var,
then the abstract dependency between the expression
e and variable x with respect to an abstract domain ρ
(property) is defined formally as,
∃ϕ
1
,ϕ
2
∈ Σ
ρ
.∀y 6= x.ϕ
1
(y) = ϕ
2
(y) ∧
H [[e]]ϕ
1
6= H [[e]]ϕ
2
.
Dataflow based property driven program slicing is
a fixed point computation where each iterate has two
phases, first, the control flow analysis is combined
with a static analysis in a abstract interpretation based
framework. Hence, each program point of the pro-
gram is enhanced with information about the abstract
state of variables with respect to the property of in-
terest. Then, a backward program slicing technique is
applied to the augmented program exploiting the ab-
stract dependencies.
4.1 Phase 1: Static Analysis
Our representation of programs are def/use graphs.
The objective of a static analysis based on Abstract
Interpretation is to assign sets of possible abstract val-
ues to edges of a def/use graph. The def/use graph
consists of five different node types which represent
program points:
1. A designated start and end node representing the
beginning and end point of a def/use graph.
2. Expression nodes representing different expres-
sion types found in a concrete semantic model.
3. Condition nodes representing forks in a control
flow, i.e. this type of nodes has one incoming and
two outgoing edges.
4. Join nodes merging two paths of the def/use
graph, i.e. these nodes have two incoming and
one outgoing edge.
Like the classical approach, our analysis also be-
gins at the start node of the def/use graph and traverses
the graph during its static program analysis phase.
Depending on the encountered node type, a particular
set of rules which is based on Abstract Interpretation
is applied.
Based on the def/use graph, the classical approach
begins with the construction of a complete transition
system for the five node types. It defines how an ab-
stract state is transferred into one state to another state
at program point p:
T
p
:℘(Σ
A
) → ℘(Σ
A
)
The transition system T is used to construct a sys-
tem of equations which define the assignment of ab-
stract states to program points. A solution is found
by a fixed-point iteration. It begins with the least pos-
sible assignment T (⊥) where ⊥ is the least element
representing
/
0. The fixed-point iteration continues as
long as a further application of T does not compute
a new state: T
n−1
= T
n
.
Now we will define T for the different types of
edges in a def/use graph. For any edge e ∈ E we shall
denote its predecessor edges as e
pre
. For merge nodes,
which have two incoming edges, the second is de-
noted e
pre
′
. In the following, T is given for every
type of program point with respect to a given abstract
domain ρ. ∀ϕ
ρ
∈ Σ
ρ
denotes the abstract states asso-
ciated to program variables at each program point.
Start Edge. At the start edge e, nothing is known
about the values of variables. Having said this, the
natural definition of an abstract state associated
with the initial state should be as follows:
T
e
(ϕ
ρ
) = ⊥
Assignment Edge. An assignment edge is an
edge which emerges from an assignment node.
Let, an assignment node has an assignment x :=
a associated with it, where x ∈ Var and a ∈ AExp,
then T
e
(ϕ
ρ
) should be equal to the previous ab-
stract state with the variable x updated to the ab-
stract value of e (Table 1), as follows:.
T
e
(ϕ
ρ
) = T
e
pre
(ϕ
ρ
[x ← H [[a]]ϕ
ρ
])
Merge Edge. The problem of Abstract Interpre-
tation is that a termination of the fixed-point it-
eration can not be guaranteed. Due to the nature
of Abstract Interpretation which iteratively sim-
ulates each state transition, the fixed-point itera-
tion can consume a significant amount of time for
loops with large iteration counts. To overcome
both problems, the widening operator ∇ (Cortesi
and Zanioli, 2010) can be applied. Its applica-
tion typically enlarges the abstract states during
the fixed-point iteration leading to a correct but
also over-approximated solution which might be-
come infeasible as result for many applications.
Thus, a narrowing operator △ was introduced
(Cortesi and Zanioli, 2010) to restrict the over-
approximation afterwards.
A merge edge is an edge emerging from a merge
node. A merge node combines the analysis re-
sults of the two incoming edges. The least ab-
stract value which is correct with respect to both
ICSOFT 2011 - 6th International Conference on Software and Data Technologies
152