Package org.jtool.pdg
Class PDG
An object storing information on a program dependence graph (PDG).
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Tests if a given PDG is equal to this PDG.Returns all control dependence edges of this PDG.getCFG()
Returns the CFG corresponding to this dependency graph.Returns all data dependence edges of this PDG.getEdges()
Returns all edges of this PDG.Returns the entry node for this PDG.long
getId()
Returns the identification number of this PDG.getIncomingCDEdges
(PDGNode node) Obtains control dependence edges incoming to a given node.getIncomingDDEdges
(PDGNode node) Obtains data dependence edges incoming to a given node.getIncomingEdges
(PDGNode node) Obtains dependence edges incoming to a given node.getNode
(long id) Finds the node having a given identification number.getNodes()
Returns all nodes of this PDG.getOutgoingCDEdges
(PDGNode node) Obtains control dependence edges outgoing from a given node.getOutgoingDDEdges
(PDGNode node) Obtains data dependence edges outgoing from a given node.getOutgoingEdges
(PDGNode node) Obtains dependence edges outgoing from a given node.Returns the fully-qualified name of this PDG.int
hashCode()
boolean
isDominated
(PDGNode node) Tests if a given node is dominated by any control flow.boolean
isFalseDominated
(PDGNode node) Tests if a given node is dominated by a false control flow.boolean
isTrueDominated
(PDGNode node) Tests if a given node is dominated by a true control flow.void
print()
Displays information on this graph.void
setEntryNode
(PDGEntry node) Sets the entry node for this PDG.void
setTimeoutOccurred
(boolean bool) Sets whether the timeout occurred.boolean
Tests if the timeout occurred.Obtains information on this dependency graph.protected String
Obtains information on control dependence edges enclosed in this dependency graph.protected String
Obtains information on data dependence edges enclosed in this dependency graph.protected String
Obtains information on all edges enclosed in this dependency graph.protected String
Obtains information on all nodes enclosed in this dependency graph.
-
Constructor Details
-
PDG
Creates a new, empty object for storing a PDG information. This method is not intended to be invoked by clients.- Parameters:
cfg
- the corresponding CFG
-
-
Method Details
-
getCFG
Returns the CFG corresponding to this dependency graph.- Returns:
- the CFG, or
null
if the corresponding CFG does not exist
-
setEntryNode
Sets the entry node for this PDG. This method is not intended to be invoked by clients.- Parameters:
node
- the entry node to be set
-
getEntryNode
Returns the entry node for this PDG.- Returns:
- the entry node
-
setTimeoutOccurred
public void setTimeoutOccurred(boolean bool) Sets whether the timeout occurred.- Parameters:
bool
-true
if the timeout occurred, otherwisefalse
-
timeoutOccurred
public boolean timeoutOccurred()Tests if the timeout occurred.- Returns:
true
if the timeout occurred, otherwisefalse
-
getId
public long getId()Returns the identification number of this PDG.- Returns:
- the identification number
-
getQualifiedName
Returns the fully-qualified name of this PDG.- Returns:
- the fully-qualified name
-
getNodes
Returns all nodes of this PDG.- Overrides:
getNodes
in classGraph<PDGNode,
Dependence> - Returns:
- the collection of the nodes
-
getEdges
Returns all edges of this PDG.- Overrides:
getEdges
in classGraph<PDGNode,
Dependence> - Returns:
- the collection of the edges
-
getCDEdges
Returns all control dependence edges of this PDG.- Returns:
- the collection of the edges
-
getDDEdges
Returns all data dependence edges of this PDG.- Returns:
- the collection of the edges
-
getNode
Finds the node having a given identification number.- Parameters:
id
- the identification number to the node to be retrieved- Returns:
- the found node, or
null
if the corresponding node is not found
-
getIncomingEdges
Obtains dependence edges incoming to a given node.- Parameters:
node
- the node- Returns:
- the collection of the incoming edges
-
getIncomingCDEdges
Obtains control dependence edges incoming to a given node.- Parameters:
node
- node the node- Returns:
- the collection of the incoming control dependence edges
-
getIncomingDDEdges
Obtains data dependence edges incoming to a given node.- Parameters:
node
- the node- Returns:
- the collection of the incoming data dependence edges
-
getOutgoingEdges
Obtains dependence edges outgoing from a given node.- Parameters:
node
- the node- Returns:
- the collection of the outgoing dependence edges
-
getOutgoingCDEdges
Obtains control dependence edges outgoing from a given node.- Parameters:
node
- the node- Returns:
- the collection of the outgoing control dependence edges
-
getOutgoingDDEdges
Obtains data dependence edges outgoing from a given node.- Parameters:
node
- the node- Returns:
- the collection of the outgoing data dependence edges
-
isDominated
Tests if a given node is dominated by any control flow.- Parameters:
node
- the node- Returns:
true
if this is a dominated node, otherwisefalse
-
isTrueDominated
Tests if a given node is dominated by a true control flow.- Parameters:
node
- the node- Returns:
true
if this is a true-dominated node, otherwisefalse
-
isFalseDominated
Tests if a given node is dominated by a false control flow.- Parameters:
node
- the node- Returns:
true
if this is a false-dominated node, otherwisefalse
-
equals
-
equals
Tests if a given PDG is equal to this PDG.- Parameters:
pdg
- the PDG to be checked- Returns:
- the
true
if the given PDG is equal to this PDG
-
hashCode
public int hashCode() -
print
public void print()Displays information on this graph. -
toString
Obtains information on this dependency graph.- Parameters:
kindName
- the kind name of this dependency graph- Returns:
- the string representing the information on this dependency graph
-
toStringForNodes
Obtains information on all nodes enclosed in this dependency graph.- Overrides:
toStringForNodes
in classGraph<PDGNode,
Dependence> - Returns:
- the string representing the information
-
toStringForEdges
Obtains information on all edges enclosed in this dependency graph.- Overrides:
toStringForEdges
in classGraph<PDGNode,
Dependence> - Returns:
- the string representing the information
-
toStringForCDEdges
Obtains information on control dependence edges enclosed in this dependency graph.- Returns:
- the string representing the information
-
toStringForDDEdges
Obtains information on data dependence edges enclosed in this dependency graph.- Returns:
- the string representing the information
-