CPN-Py: A Python-Based Tool for Modeling and Analyzing Colored Petri Nets

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Berti, Alessandro, van der Aalst, Wil M. P.
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916793908461568
author Berti, Alessandro
van der Aalst, Wil M. P.
author_facet Berti, Alessandro
van der Aalst, Wil M. P.
contents Colored Petri Nets (CPNs) are an established formalism for modeling processes where tokens carry data. Although tools like CPN Tools and CPN IDE excel at CPN-based simulation, they are often separate from modern data science ecosystems. Meanwhile, Python has become the de facto language for process mining, machine learning, and data analytics. In this paper, we introduce CPN-Py, a Python library that faithfully preserves the core concepts of Colored Petri Nets -- including color sets, timed tokens, guard logic, and hierarchical structures -- while providing seamless integration with the Python environment. We discuss its design, highlight its synergy with PM4Py (including stochastic replay, process discovery, and decision mining functionalities), and illustrate how the tool supports state space analysis and hierarchical CPNs. We also outline how CPN-Py accommodates large language models, which can generate or refine CPN models through a dedicated JSON-based format.
format Preprint
id arxiv_https___arxiv_org_abs_2506_12238
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle CPN-Py: A Python-Based Tool for Modeling and Analyzing Colored Petri Nets
Berti, Alessandro
van der Aalst, Wil M. P.
Databases
Colored Petri Nets (CPNs) are an established formalism for modeling processes where tokens carry data. Although tools like CPN Tools and CPN IDE excel at CPN-based simulation, they are often separate from modern data science ecosystems. Meanwhile, Python has become the de facto language for process mining, machine learning, and data analytics. In this paper, we introduce CPN-Py, a Python library that faithfully preserves the core concepts of Colored Petri Nets -- including color sets, timed tokens, guard logic, and hierarchical structures -- while providing seamless integration with the Python environment. We discuss its design, highlight its synergy with PM4Py (including stochastic replay, process discovery, and decision mining functionalities), and illustrate how the tool supports state space analysis and hierarchical CPNs. We also outline how CPN-Py accommodates large language models, which can generate or refine CPN models through a dedicated JSON-based format.
title CPN-Py: A Python-Based Tool for Modeling and Analyzing Colored Petri Nets
topic Databases
url https://arxiv.org/abs/2506.12238