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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
//! # Process Cube
//!
//! Typed shapes for the Process Cube framework (van der Aalst, 2013).
//!
//! ## What this is
//!
//! The dimensional structure for multi-perspective process comparison:
//! cube dimensions, slice projections, and perspective witnesses. The process
//! cube is a multi-dimensional framework for comparing process behavior across
//! different slices of an event log — e.g., slicing by resource, time window,
//! or case attribute and comparing the resulting sub-logs.
//!
//! ## What this is not
//!
//! The cube computation engine. Slicing, dicing, and cross-cell comparison
//! graduate to `wasm4pm`. This module carries the shapes those operations
//! produce and consume. No sub-log extraction, no model discovery per cell,
//! no cross-cell conformance comparison belongs here.
//!
//! ## Paper authority
//!
//! van der Aalst, W.M.P. (2013). *Process Cubes: Slicing, Dicing, Rolling Up
//! and Drilling Down Event Data for Process Mining.* In: Proceedings of the
//! 1st Asia Pacific Conference on Business Process Management, LNBIP 159.
//!
//! ## Graduate to `wasm4pm`
//!
//! When you need to *run* the cube — extract sub-logs per cell, apply discovery
//! per slice, or compute cross-cell conformance distances — graduate to `wasm4pm`.
//! The shapes here travel with the evidence into the engine.
use PhantomData;
/// A named dimension in the process cube (e.g., resource, time, activity).
///
/// ## What this is
///
/// A zero-cost compile-time name for one axis of a process cube. `NAME` is a
/// `&'static str` const parameter, so `CubeDimension<"resource">` and
/// `CubeDimension<"time">` are **different types** — the compiler rejects
/// a function expecting one where the other is passed.
///
/// ## What this is not
///
/// Not a runtime dimension value or an enumerated attribute bag. The runtime
/// attribute value lives in [`crate::process_cube::CubeSlice::value`]. This is the axis label only.
///
/// ## Graduate to `wasm4pm`
///
/// Actual log partitioning by this dimension requires the `wasm4pm` engine.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::CubeDimension;
/// let _resource_dim: CubeDimension<"resource"> = CubeDimension;
/// let _time_dim: CubeDimension<"time"> = CubeDimension;
/// ```
;
/// A slice through the process cube along a specific dimension and value.
///
/// ## What this is
///
/// The typed shape of a single dimension-value binding. `D` names the
/// dimension; `V` carries the concrete value for that dimension (e.g.,
/// a resource name or a time-bucket tag). Together they identify one
/// "column" through the cube along the named axis.
///
/// ## What this is not
///
/// Not the slice operation — partitioning an event log by this slice requires
/// the `wasm4pm` engine.
///
/// ## Graduate to `wasm4pm`
///
/// Log partitioning and sub-log extraction graduate to `wasm4pm`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::{CubeDimension, CubeSlice};
/// use core::marker::PhantomData;
///
/// let slice: CubeSlice<CubeDimension<"resource">, &str> = CubeSlice {
/// dimension: PhantomData,
/// value: "Alice",
/// };
/// let _ = slice.value;
/// ```
/// A cell in the process cube — the intersection of multiple dimension slices.
///
/// ## What this is
///
/// The structural shape of a single process-cube cell. `DIMS` is the number of
/// dimensions this cell is indexed by. Each cell corresponds to a sub-log
/// resulting from applying a conjunction of dimension-slice filters; the
/// sub-log extraction is an engine concern.
///
/// ## What this is not
///
/// Not the sub-log itself, not the process model discovered from the cell's
/// sub-log. Those graduate to `wasm4pm`.
///
/// ## Graduate to `wasm4pm`
///
/// Sub-log extraction, model discovery per cell, and cell-level conformance
/// all graduate to `wasm4pm`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::CubeCell;
/// let cell: CubeCell<3> = CubeCell::new();
/// ```
/// Witness that a projection was performed along a named set of cube dimensions.
///
/// ## What this is
///
/// A zero-cost shape recording that a projection reduced FROM_DIMS original
/// cube dimensions down to TO_DIMS projected dimensions. This is the receipt
/// shape for a projection step — it names that a projection happened and what
/// the arity reduction was.
///
/// ## What this is not
///
/// Not the projection computation. The engine produces this shape; this crate
/// only defines the shape and validates its structural invariants.
///
/// ## Graduate to `wasm4pm`
///
/// The actual projection computation (sub-log extraction and merging along the
/// dropped dimensions) graduates to `wasm4pm`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::CubeProjectionWitness;
/// let _w: CubeProjectionWitness<3, 2> = CubeProjectionWitness::new();
/// ```
/// The process cube metamodel — typed shape without execution.
///
/// ## What this is
///
/// The top-level structure for the process cube: a `Log` type parameter
/// represents the kind of event log the cube is built over, and `DIMENSIONS`
/// is the count of named dimensions the cube is indexed by at this usage site.
///
/// This is structure only: holding a `ProcessCube<Log, N>` means you have
/// declared that you intend to analyze `Log` across N dimensions. The actual
/// cube computation (sub-log extraction, cell discovery, cross-cell comparison)
/// graduates to `wasm4pm`.
///
/// ## What this is not
///
/// Not a runtime cube. No sub-log extraction, no model per cell, no comparison
/// engine is present here.
///
/// ## Graduate to `wasm4pm`
///
/// All computation on this shape graduates to `wasm4pm`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::ProcessCube;
/// use core::marker::PhantomData;
///
/// struct MyLog;
/// let _cube: ProcessCube<MyLog, 3> = ProcessCube { log: PhantomData };
/// ```
/// Dimension kinds from the process cube framework.
///
/// ## What this is
///
/// An enumeration of the *semantic kinds* of dimensions that appear in the
/// process cube framework. These are the standard analytical axes used to
/// partition and compare process behavior.
///
/// ## What this is not
///
/// Not a runtime filter or partitioning key. The partitioning logic graduates
/// to `wasm4pm`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::CubeDimensionKind;
/// let kind = CubeDimensionKind::Resource;
/// assert_eq!(format!("{}", kind), "resource");
/// ```
/// A comparison between two cube cells — structure for the result shape.
///
/// ## What this is
///
/// The structural shape of a cross-cell comparison result. Two cells at the
/// same number of dimensions `DIM_COUNT` are named and held together. This
/// shape is the receipt that a comparison was declared between these cells.
///
/// ## What this is not
///
/// Not the comparison computation. Conformance checking, model discovery, or
/// cross-cell difference analysis all graduate to `wasm4pm`.
///
/// ## Graduate to `wasm4pm`
///
/// The actual comparison engine (fitness difference, model distance, variant
/// overlap) graduates to `wasm4pm`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::process_cube::{CubeCell, CellComparison};
/// let cmp = CellComparison {
/// cell_a: CubeCell::<2>::new(),
/// cell_b: CubeCell::<2>::new(),
/// };
/// assert_eq!(cmp.cell_a.dim_count(), 2);
/// ```