Class ProcessGraphPredicates
- java.lang.Object
-
- de.aristaflow.adept2.model.processmodel.tools.ProcessGraphPredicates
-
public class ProcessGraphPredicates extends Object
Predicates for ADEPT2 graphs.These are implementations of the methods described in Reic00. They make no use of "advanced" properties like branch IDs, split node IDs or corresponding block node IDs. Therefore they may be used to discover inconsistencies in the graph.
Since they anyways only use getPred/SuccByEdgeType, do not expect efficiency.
For an overview of the most predicates implemented here, cf. Reic00 page 333.
- Author:
- Kevin Goeser
-
-
Constructor Summary
Constructors Constructor Description ProcessGraphPredicates()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
branchNodes(Template template, int nodeID1, int nodeID2)
Returns the branch nodes of the given nodes as array of length 2.static Set<Integer>
c_pred(Template template, int nodeID)
The direct predecessors of the given node following control edges only, as described in Reic00 page 333.static Set<Integer>
c_pred_trans(Template template, int nodeID)
Returns all direct and transitive predecessors, following control edges, cf.static Set<Integer>
c_succ(Template template, int nodeID)
The direct successors of the given node following control edges only, as described in Reic00 page 333.static Set<Integer>
c_succ_trans(Template template, int nodeID)
Returns all direct and transitive predecessors, following control edges, cf.static int
endloop(Template template, int startLoopID)
Returns the end loop node ID for a given start loop node ID.static int
findSplitNode(Template template, int nodeID)
Finds the split node of the given node, cf.static boolean
isBlockEnd(Template template, int nodeID)
A block end node, as it is defined in Reic00.static boolean
isBlockStart(Template template, int nodeID)
A block start node, as it is defined in Reic00.static int
join(Template template, int nodeID)
Finds the join node of a given split node.static Set<Integer>
joinNodes(Template template)
Returns all nodes which are join nodes, as defined in Reic00 having an enter behaviour of ALL_OF_ALL or ONE_OF_ALL.static Set<Integer>
loopBody(Template template, int startLoopID)
Returns all nodes in the body of a loop block.static Set<Integer>
pred(Template template, int nodeID)
The direct predecessors of the given node, as described in Reic00 page 333.static Set<Integer>
pred_trans(Template template, int nodeID)
Returns all direct and transitive predecessors, following control and sync edges, cf.static int
split(Template template, int nodeID)
Finds the split node of a given join node.static Set<Integer>
splitNodes(Template template)
Returns all nodes which are split nodes, as defined in Reic00 having an exit behaviour of ALL_OF_ALL or ONE_OF_ALL.static Set<Integer>
succ(Template template, int nodeID)
The direct successors of the given node, as described in Reic00 page 333.static Set<Integer>
succ_trans(Template template, int nodeID)
Returns all direct and transitive successors, following control and sync edges, cf.
-
-
-
Field Detail
-
logger
protected static final Logger logger
My logger.
-
-
Method Detail
-
c_succ_trans
public static Set<Integer> c_succ_trans(Template template, int nodeID)
Returns all direct and transitive predecessors, following control edges, cf. Reic00 page 333.This is c_succ*(n)
- Parameters:
template
-nodeID
-- Returns:
- All transitive successors following ET_CONTROL edges.
-
c_pred_trans
public static Set<Integer> c_pred_trans(Template template, int nodeID)
Returns all direct and transitive predecessors, following control edges, cf. Reic00 page 333.This is c_pred*(n)
- Parameters:
template
-nodeID
-- Returns:
- All transitive predecessors following ET_CONTROL edges.
-
succ_trans
public static Set<Integer> succ_trans(Template template, int nodeID)
Returns all direct and transitive successors, following control and sync edges, cf. Reic00 page 333.This is succ*(n)
- Parameters:
template
-nodeID
-- Returns:
- The set of all successors following control and sync edges.
-
pred_trans
public static Set<Integer> pred_trans(Template template, int nodeID)
Returns all direct and transitive predecessors, following control and sync edges, cf. Reic00 page 333.This is pred*(n)
- Parameters:
template
-nodeID
-- Returns:
- The set of all predecessors following control and sync edges.
-
c_succ
public static Set<Integer> c_succ(Template template, int nodeID)
The direct successors of the given node following control edges only, as described in Reic00 page 333.- Parameters:
template
-nodeID
-- Returns:
- c_succ(n)
-
c_pred
public static Set<Integer> c_pred(Template template, int nodeID)
The direct predecessors of the given node following control edges only, as described in Reic00 page 333.- Parameters:
template
-nodeID
-- Returns:
- c_pred(n)
-
succ
public static Set<Integer> succ(Template template, int nodeID)
The direct successors of the given node, as described in Reic00 page 333.- Parameters:
template
-nodeID
-- Returns:
- succ(n)
-
pred
public static Set<Integer> pred(Template template, int nodeID)
The direct predecessors of the given node, as described in Reic00 page 333.- Parameters:
template
-nodeID
-- Returns:
- pred(n)
-
split
public static int split(Template template, int nodeID)
Finds the split node of a given join node.- Parameters:
template
-nodeID
-- Returns:
- split(j)
-
join
public static int join(Template template, int nodeID)
Finds the join node of a given split node.- Parameters:
template
-nodeID
-- Returns:
- join(s)
-
findSplitNode
public static int findSplitNode(Template template, int nodeID)
Finds the split node of the given node, cf.Template.getNodeSplitNodeID(int)
.- Parameters:
template
-nodeID
-- Returns:
- Finds the ID of the split node, cf.
Template.getNodeSplitNodeID(int)
.
-
isBlockEnd
public static boolean isBlockEnd(Template template, int nodeID)
A block end node, as it is defined in Reic00.- Parameters:
template
-nodeID
-- Returns:
- True, if the node is the end node of a block (the "right" one).
-
isBlockStart
public static boolean isBlockStart(Template template, int nodeID)
A block start node, as it is defined in Reic00.- Parameters:
template
-nodeID
-- Returns:
- True, if the node is the start node of a block (the "left" one).
-
splitNodes
public static Set<Integer> splitNodes(Template template)
Returns all nodes which are split nodes, as defined in Reic00 having an exit behaviour of ALL_OF_ALL or ONE_OF_ALL.Cf. Reic00 page 75.
- Parameters:
template
-- Returns:
- SplitNodes CFS: exit behaviour ALL_OF_ALL or ONE_OF_ALL
-
joinNodes
public static Set<Integer> joinNodes(Template template)
Returns all nodes which are join nodes, as defined in Reic00 having an enter behaviour of ALL_OF_ALL or ONE_OF_ALL.Cf. Reic00 page 75.
- Parameters:
template
-- Returns:
- JoinNodes CFS: enter behaviour ALL_OF_ALL or ONE_OF_ALL.
-
branchNodes
public static int[] branchNodes(Template template, int nodeID1, int nodeID2)
Returns the branch nodes of the given nodes as array of length 2.Cf. Reic00 page 340.
- Parameters:
template
-nodeID1
-nodeID2
-- Returns:
- The branch nodes of the given nodes, cf. Reic00 page 340.
-
loopBody
public static Set<Integer> loopBody(Template template, int startLoopID)
Returns all nodes in the body of a loop block.- Parameters:
template
-startLoopID
-- Returns:
- The body of a loop, given by the start loop ID
-
endloop
public static int endloop(Template template, int startLoopID)
Returns the end loop node ID for a given start loop node ID.- Parameters:
template
-startLoopID
-- Returns:
- The ID of the end loop node, for the given start loop node.
-
-