pm4py.algo.analysis.woflan package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Subpackages#

Submodules#

pm4py.algo.analysis.woflan.algorithm module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.analysis.woflan.algorithm.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

RETURN_ASAP_WHEN_NOT_SOUND = 'return_asap_when_not_sound'#
PRINT_DIAGNOSTICS = 'print_diagnostics'#
RETURN_DIAGNOSTICS = 'return_diagnostics'#
class pm4py.algo.analysis.woflan.algorithm.Outputs(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

S_C_NET = 's_c_net'#
PLACE_INVARIANTS = 'place_invariants'#
UNIFORM_PLACE_INVARIANTS = 'uniform_place_invariants'#
S_COMPONENTS = 's_components'#
UNCOVERED_PLACES_S_COMPONENT = 'uncovered_places_s_component'#
NOT_WELL_HANDLED_PAIRS = 'not_well_handled_pairs'#
LEFT = 'left'#
UNCOVERED_PLACES_UNIFORM = 'uncovered_places_uniform'#
WEIGHTED_PLACE_INVARIANTS = 'weighted_place_invariants'#
UNCOVERED_PLACES_WEIGHTED = 'uncovered_places_weighted'#
MCG = 'mcg'#
DEAD_TASKS = 'dead_tasks'#
R_G_S_C = 'r_g_s_c'#
R_G = 'r_g'#
LOCKING_SCENARIOS = 'locking_scenarios'#
RESTRICTED_COVERABILITY_TREE = 'restricted_coverability_tree'#
DIAGNOSTIC_MESSAGES = 'diagnostic_messages'#
class pm4py.algo.analysis.woflan.algorithm.woflan(net, initial_marking, final_marking, print_diagnostics=False)[source]#

Bases: object

set_s_c_net(s_c_net)[source]#
set_place_invariants(invariants)[source]#
set_uniform_place_invariants(invariants)[source]#
set_s_components(s_components)[source]#
set_uncovered_places_s_component(uncovered_places)[source]#
set_not_well_handled_pairs(not_well_handled_pairs)[source]#
set_left(left)[source]#
set_uncovered_places_uniform(places)[source]#
set_weighted_place_invariants(invariants)[source]#
set_uncovered_places_weighted(places)[source]#
set_mcg(mcg)[source]#
set_dead_tasks(dead_tasks)[source]#
set_r_g_s_c(r_g)[source]#
set_r_g(r_g)[source]#
set_locking_scenarios(scenarios)[source]#
set_restricted_coverability_tree(graph)[source]#
get_net()[source]#
get_initial_marking()[source]#
get_final_marking()[source]#
get_s_c_net()[source]#
get_place_invariants()[source]#
get_uniform_place_invariants()[source]#
get_s_components()[source]#
get_uncovered_places_s_component()[source]#
get_not_well_handled_pairs()[source]#
get_left()[source]#
get_uncovered_places_uniform()[source]#
get_weighted_place_invariants()[source]#
get_uncovered_places_weighted()[source]#
get_mcg()[source]#
get_dead_tasks()[source]#
get_r_g_s_c()[source]#
get_r_g()[source]#
get_locking_scenarios()[source]#
get_restricted_coverability_tree()[source]#
get_output()[source]#

Returns a dictionary representation of the entities that are calculated during WOFLAN

pm4py.algo.analysis.woflan.algorithm.short_circuit_petri_net(net, print_diagnostics=False)[source]#

Fist, sink and source place are identified. Then, a transition from source to sink is added to short-circuited the given petri net. If there is no unique source and sink place, an error gets returned :type print_diagnostics: bool :param net: Petri net that is going to be short circuited :return:

pm4py.algo.analysis.woflan.algorithm.step_1(woflan_object, return_asap_when_unsound=False)[source]#

In the first step, we check if the input is given correct. We check if net is an PM4Py Petri Net representation and if the exist a correct entry for the initial and final marking. :type return_asap_when_unsound: bool :param woflan_object: Object that contains all necessary information :return: Proceed with step 2 if ok; else False

pm4py.algo.analysis.woflan.algorithm.step_2(woflan_object, return_asap_when_unsound=False)[source]#

This method checks if a given Petri net is a workflow net. First, the Petri Net gets short-circuited (connect start and end place with a tau-transition. Second, the Petri Net gets converted into a networkx graph. Finally, it is tested if the resulting graph is a strongly connected component. :type return_asap_when_unsound: bool :param woflan_object: Woflan objet containing all information :return: Bool=True if net is a WF-Net

pm4py.algo.analysis.woflan.algorithm.step_3(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_4(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_5(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_6(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_7(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_8(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_9(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_10(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_11(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_12(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.step_13(woflan_object, return_asap_when_unsound=False)[source]#
pm4py.algo.analysis.woflan.algorithm.apply(net: PetriNet, i_m: Marking, f_m: Marking, parameters: Dict[str | Parameters, Any] | None = None) bool | Any[source]#

Apply the Woflan Soundness check. Trough this process, different steps are executed. :type f_m: Marking :type i_m: Marking :type net: PetriNet :param net: Petri Net representation of PM4Py :param i_m: initial marking of given Net. Marking object of PM4Py :param f_m: final marking of given Net. Marking object of PM4Py :return: True, if net is sound; False otherwise.

pm4py.algo.analysis.woflan.algorithm.compute_non_live_sequences(woflan_object)[source]#

We want to compute the sequences of transitions which lead to deadlocks. To do this, we first compute a reachbility graph (possible, since we know that the Petri Net is bounded) and then we convert it to a spanning tree. Afterwards, we compute the paths which lead to nodes from which the final marking cannot be reached. Note: We are searching for the shortest sequence. After the first red node, all successors are also red. Therefore, we do not have to consider them. :param woflan_object: Object that contains the necessary information :return: List of sequence of transitions, each sequence is a list

pm4py.algo.analysis.woflan.algorithm.compute_unbounded_sequences(woflan_object)[source]#

We compute the sequences which lead to an infinite amount of tokens. To do this, we compute a restricted coverability tree. The tree works similar to the graph, despite we consider tree characteristics during the construction. :param woflan_object: Woflan object that contains all needed information. :return: List of unbounded sequences, each sequence is a list of transitions