pm4py.objects.petri_net.semantics module#

PM4Py – A Process Mining Library for Python Copyright (C) 2026 Process Intelligence Solutions GmbH

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.objects.petri_net.semantics.PetriNetSemantics[source]#

Bases: Generic[N]

classmethod is_enabled(pn: N, transition: T, marking: Counter[P]) → bool[source]#

Checks whether a given transition is enabled in a given Petri net and marking

Parameters:
  • param pn: Petri net

  • param transition: transition to check

  • param marking: marking to check

Return type:

return: true if enabled, false otherwise

classmethod fire(pn: N, transition: T, marking: Counter[P]) → Counter[P][source]#

Execute a transition For performance reasons, the algorithm method not check if the transition is enabled, i.e., this should be performed by the invoking algorithm (if needed). Hence, markings can become negative.

Parameters:
  • param pn: Petri net

  • param transition: transition to execute

  • param marking: marking to use

Return type:

return: newly reached marking

class pm4py.objects.petri_net.semantics.ClassicSemantics[source]#

Bases: Semantics

is_enabled(t, pn, m, **kwargs)[source]#

Verifies whether a given transition is enabled in a given Petri net and marking

Parameters:
  • param t: transition to check

  • param pn: Petri net

  • param m: marking to check

Return type:

return: true if enabled, false otherwise

execute(t, pn, m, **kwargs)[source]#

Executes a given transition in a given Petri net and Marking

Parameters:
  • param t: transition to execute

  • param pn: Petri net

  • param m: marking to use

Return type:

return: newly reached marking if :param t: is enabled, None otherwise

weak_execute(t, pn, m, **kwargs)[source]#

Execute a transition even if it is not fully enabled

Parameters:
  • param t: transition to execute

  • param pn: Petri net

  • param m: marking to use

Return type:

return: newly reached marking if :param t: is enabled, None otherwise

enabled_transitions(pn, m, **kwargs)[source]#

Returns a set of enabled transitions in a Petri net and given marking

Parameters:
  • param pn: Petri net

  • param m: marking of the pn

Return type:

return: set of enabled transitions

pm4py.objects.petri_net.semantics.is_enabled(t, pn, m)[source]#
pm4py.objects.petri_net.semantics.execute(t, pn, m)[source]#
pm4py.objects.petri_net.semantics.weak_execute(t, m)[source]#
pm4py.objects.petri_net.semantics.enabled_transitions(pn, m)[source]#