1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//! POWL8 operator discriminant — compact wire-format companion to [`crate::powl::PowlNodeKind`].
//!
//! [`Powl8Op`] is a `#[repr(u8)]` enum naming each POWL operator kind, including
//! the [`Powl8Op::ChoiceGraph`] variant from Kourani, Park, van der Aalst
//! "Unlocking Non-Block-Structured Decisions: Inductive Mining with Choice Graphs"
//! (arXiv:2505.07052). It is the structural/op-level wire format; it is **not**
//! wrapped in `Evidence` because it names operators, not process objects.
//!
//! ## Choice Graphs
//!
//! Choice Graphs represent a generalization of block-structured choice operators
//! (such as the standard `Choice` variant). Standard process trees and POWL models
//! typically enforce block-structured decisions (single-entry, single-exit choices).
//! Choice Graphs relax this constraint by allowing a directed acyclic graph (DAG)
//! of sub-models, unlocking the representation and mining of non-block-structured
//! decisions.
//!
//! According to Kourani, Park, and van der Aalst (2025), "Unlocking Non-Block-Structured
//! Decisions: Inductive Mining with Choice Graphs" (arXiv:2505.07052), this operator
//! enables inductive mining techniques to discover more precise models from event logs
//! containing non-trivial decision patterns, while remaining sound and structurally clear.
/// Error returned when a raw `u8` does not map to any [`Powl8Op`] discriminant.
///
/// ### Representation
/// Error returned when a raw `u8` discriminant does not correspond to any known variant of `Powl8Op`.
///
/// ### Structure-only
/// This is a zero-cost structure-only error type to represent parse failure. It contains no error diagnostic recovery engines or tracing spans.
///
/// ### Graduation
/// Graduate to `wasm4pm` for rich runtime exception tracing or high-level compiler diagnostics.
///
/// # Examples
///
/// ```
/// use wasm4pm_compat::powl8_op::Powl8OpError;
///
/// let error = Powl8OpError::InvalidDiscriminant;
/// assert_eq!(format!("{}", error), "Invalid Powl8Op discriminant");
/// ```
/// Compact `u8`-discriminant enum representing POWL operator kinds.
///
/// ### Representation
/// A compact, 1-byte (`u8`) discriminant mapping to the operator vocabulary used in the POWL
/// Evidence substrate and acts as the wire-format companion to [`crate::powl::PowlNodeKind`].
///
/// ### Structure-only
/// This enum acts as a lightweight wire-format identifier. It contains no execution semantics,
/// process trees, or parser/compiler logic directly.
///
/// ### Graduation
/// Graduate to `wasm4pm` when you need to construct process model execution paths, run
/// simulation/replay engines, or perform inductive mining algorithms.
///
/// # Examples
///
/// ```
/// use wasm4pm_compat::powl8_op::Powl8Op;
/// use core::convert::TryFrom;
///
/// let op = Powl8Op::try_from(8u8).unwrap();
/// assert_eq!(op, Powl8Op::ChoiceGraph);
///
/// let err = Powl8Op::try_from(99u8);
/// assert!(err.is_err());
/// ```