libpetri — Coloured Time Petri Net Engine
A high-performance Petri net engine with formal verification support.
Quick Start
use *;
let p1 = new;
let p2 = new;
let t = builder
.input
.output
.action
.build;
let net = builder.transition.build;
let mut marking = new;
marking.add;
let mut executor = new;
executor.run_sync;
assert_eq!;
Example: Basic Chain
Example: Order Processing Pipeline
A showcase net demonstrating all arc types (input, output, read, inhibitor, reset), both place types (regular + environment), all timing modes (immediate, deadline, delayed, window, exact), and patterns (AND-fork, AND-join, XOR, priority).
Crate Structure
- [
core] — Places, tokens, transitions, timing, actions - [
event] — Event store for recording execution events - [
runtime] — Bitmap-based executor (sync + async) - [
export] — DOT/Graphviz export pipeline - [
verification] — Formal verification (P-invariants, state class graphs, SMT)