pm4py.convert.convert_to_reachability_graph#

pm4py.convert.convert_to_reachability_graph(*args: Tuple[PetriNet, Marking, Marking] | BPMN | ProcessTree) TransitionSystem[source]#

Converts an input model to a reachability graph (transition system).

The input models can be Petri nets (with markings), BPMN models, or process trees. The output is the state-space of the model, encoded as a TransitionSystem object.

Return type:

TransitionSystem

Parameters:

args

  • If converting from a Petri net: a tuple of (PetriNet, Marking, Marking).

  • If converting from a BPMN or ProcessTree: a single object of the respective type.

Returns:

A TransitionSystem object.

import pm4py

# Reads a Petri net from a file
net, im, fm = pm4py.read_pnml("tests/input_data/running-example.pnml")
# Converts it to a reachability graph
reach_graph = pm4py.convert_to_reachability_graph(net, im, fm)