Interface ISupergraph<T,P>
- All Superinterfaces:
EdgeManager<T>, Graph<T>, Iterable<T>, NodeManager<T>, NumberedEdgeManager<T>, NumberedGraph<T>, NumberedNodeManager<T>
- All Known Implementing Classes:
BackwardsSupergraph, ICFGSupergraph
A supergraph as defined by Reps, Horwitz, and Sagiv POPL95
In our implementation we don't require explicit entry and exit nodes. So, the first basic block in a method is implicitly the entry node, but might also be a call node too. Similarly for exit nodes. The solver is coded to deal with this appropriately.
Additionally, due to exceptional control flow, each method might have multiple exits or multiple entries.
T type of node in the supergraph P type of a procedure (like a box in an RSM)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionbyteclassifyEdge(T src, T dest) getCalledNodes(T call) getCallSites(T ret, P callee) T[]getEntriesForProcedure(P procedure) T[]getExitsForProcedure(P procedure) getLocalBlock(P procedure, int i) intgetNormalSuccessors(T call) intgetNumberOfBlocks(P procedure) getReturnSites(T call, P callee) booleanbooleanbooleanbooleanMethods inherited from interface EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdgesModifier and TypeMethodDescriptionvoidintReturn the number ofimmediate predecessornodes of ngetPredNodes(T n) Return anIteratorover the immediate predecessor nodes of nintReturn the number ofimmediate successornodes of this Node in the GraphgetSuccNodes(T n) Return an Iterator over the immediate successor nodes of nbooleanvoidremoveAllIncidentEdges(T node) voidremoveEdge(T src, T dst) voidremoveIncomingEdges(T node) voidremoveOutgoingEdges(T node) Methods inherited from interface Graph
removeNodeAndEdgesModifier and TypeMethodDescriptionvoidremove a node and all its incident edgesMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface NodeManager
addNode, containsNode, getNumberOfNodes, iterator, removeNode, streamModifier and TypeMethodDescriptionvoidadd a node to this graphbooleancontainsNode(T n) intiterator()voidremoveNode(T n) remove a node from this graphstream()Methods inherited from interface NumberedEdgeManager
getPredNodeNumbers, getSuccNodeNumbersMethods inherited from interface NumberedNodeManager
getMaxNumber, getNode, getNumber, iterateNodes
-
Field Details
-
CALL_EDGE
static final byte CALL_EDGE- See Also:
-
RETURN_EDGE
static final byte RETURN_EDGE- See Also:
-
CALL_TO_RETURN_EDGE
static final byte CALL_TO_RETURN_EDGE- See Also:
-
OTHER
static final byte OTHER- See Also:
-
-
Method Details
-
getProcedureGraph
-
isCall
- Parameters:
n- a node in this supergraph- Returns:
- true iff this node includes a call.
-
getCalledNodes
-
getNormalSuccessors
-
getReturnSites
- Parameters:
call- a "call" node in the supergraphcallee- a "called" "procedure" in the supergraph. if callee is null, answer return sites for which no callee was found.- Returns:
- the corresponding return nodes. There may be many, because of exceptional control flow.
-
getCallSites
-
isExit
- Parameters:
n- a node in the supergraph- Returns:
- true iff this node is an exit node
-
getProcOf
-
getEntriesForProcedure
-
getExitsForProcedure
-
getNumberOfBlocks
- Parameters:
procedure- an object that represents a procedure- Returns:
- the number of blocks from this procedure in this supergraph
-
getLocalBlockNumber
- Parameters:
n- a node in the supergraph- Returns:
- the "logical" basic block number of n in its procedure
-
getLocalBlock
-
isReturn
- Parameters:
n- a node in this supergraph- Returns:
- true iff this node is a return site.
-
isEntry
- Returns:
- true iff this node is an entry node s_p for a procedure
-
classifyEdge
-