pm4py.objects.process_tree.utils.generic module#

pm4py.objects.process_tree.utils.generic.fold(tree)[source]#

This method reduces a process tree by merging nodes of the form N(N(a,b),c) into N(a,b,c), i.e., where N = || or X. For example X(X(a,b),c) == X(a,b,c). Furthermore, meaningless parts, e.g., internal nodes without children, or, operators with one child are removed as well.

Parameters:

tree

Returns:

pm4py.objects.process_tree.utils.generic.reduce_tau_leafs(tree)[source]#

This method reduces tau leaves that are not meaningful. For example tree ->(a, au,b) is reduced to ->(a,b). In some cases this results in constructs such as ->(a), i.e., a sequence with a single child. Such constructs are not further reduced.

Parameters:

tree

Returns:

pm4py.objects.process_tree.utils.generic.is_tau_leaf(tree)[source]#
pm4py.objects.process_tree.utils.generic.is_leaf(tree)[source]#
pm4py.objects.process_tree.utils.generic.project_execution_sequence_to_leafs(execution_sequence)[source]#

Project an execution sequence to the set of leafs of the tree.

Parameters:

execution_sequence – Execution sequence on the process tree

Returns:

Leafs nodes of the process tree

Return type:

list_leafs

pm4py.objects.process_tree.utils.generic.project_execution_sequence_to_labels(execution_sequence)[source]#

Project an execution sequence to a set of labels

Parameters:

execution_sequence – Execution sequence on the process tree

Returns:

List of labels contained in the process tree

Return type:

list_labels

pm4py.objects.process_tree.utils.generic.parse(string_rep)[source]#

Parse a string provided by the user to a process tree (initialization method)

Parameters:

string_rep – String representation of the process tree

Returns:

Process tree object

Return type:

node

pm4py.objects.process_tree.utils.generic.parse_recursive(string_rep, depth_cache, depth)[source]#

Parse a string provided by the user to a process tree (recursive method)

Parameters:
  • string_rep – String representation of the process tree

  • depth_cache – Depth cache of the algorithm

  • depth – Current step depth

Returns:

Process tree object

Return type:

node

pm4py.objects.process_tree.utils.generic.tree_sort(tree)[source]#

Sort a tree in such way that the order of the nodes in AND/XOR children is always the same. This is a recursive function

Parameters:

tree – Process tree

pm4py.objects.process_tree.utils.generic.structurally_language_equal(tree1, tree2)[source]#

this function checks if two given process trees are structurally equal, modulo, shuffling of children (if allowed), i.e., in the parallel, or and xor operators, the order does not matter.

Parameters:
  • tree1

  • tree2

Returns:

pm4py.objects.process_tree.utils.generic.get_process_tree_height(pt: ProcessTree) int[source]#

calculates from the given node the max height downwards :param pt: process tree node :return: height

pm4py.objects.process_tree.utils.generic.process_tree_to_binary_process_tree(tree: ProcessTree) ProcessTree[source]#
pm4py.objects.process_tree.utils.generic.common_ancestor(t1: ProcessTree, t2: ProcessTree) ProcessTree | None[source]#
pm4py.objects.process_tree.utils.generic.get_ancestors_until(t: ProcessTree, until: ProcessTree, include_until: bool = True) List[ProcessTree] | None[source]#
pm4py.objects.process_tree.utils.generic.get_leaves(t: ProcessTree, leaves=None)[source]#
pm4py.objects.process_tree.utils.generic.get_leaves_as_tuples(t: ProcessTree, leaves=None)[source]#
pm4py.objects.process_tree.utils.generic.is_operator(tree: ProcessTree, operator: Operator) bool[source]#
pm4py.objects.process_tree.utils.generic.is_any_operator_of(tree: ProcessTree, operators: List[Operator]) bool[source]#
pm4py.objects.process_tree.utils.generic.is_in_state(tree: ProcessTree, target_state: OperatorState, tree_state: Dict[Tuple[int, ProcessTree], OperatorState]) bool[source]#
pm4py.objects.process_tree.utils.generic.is_root(tree: ProcessTree) bool[source]#