CPN-Py: A Python-Based Tool for Modeling and Analyzing Colored Petri Nets
Alessandro Berti, Wil M.P. van der Aalst

TL;DR
CPN-Py is a Python library that enables modeling, analysis, and integration of Colored Petri Nets within data science workflows, supporting advanced features like hierarchical structures, state space analysis, and large language model integration.
Contribution
It introduces a Python-based tool that faithfully implements core CPN concepts and integrates seamlessly with data science and process mining tools, filling a gap in existing CPN software.
Findings
Supports core CPN concepts including color sets and hierarchy
Enables integration with process mining tools like PM4Py
Facilitates large language model-based CPN model generation and refinement
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBusiness Process Modeling and Analysis
