Skip to main content

rustkernel_procint/
lib.rs

1//! # RustKernel Process Intelligence
2//!
3//! GPU-accelerated process mining and conformance checking.
4//!
5//! ## Kernels
6//! - `DFGConstruction` - Directly-follows graph construction
7//! - `PartialOrderAnalysis` - Concurrency detection
8//! - `ConformanceChecking` - Multi-model conformance (DFG/Petri/BPMN)
9//! - `OCPMPatternMatching` - Object-centric process mining
10//! - `NextActivityPrediction` - Markov/N-gram next activity prediction
11//! - `EventLogImputation` - Event log quality detection and repair
12//! - `DigitalTwin` - Process simulation for what-if analysis
13//!
14//! ## Features
15//! - Directly-follows graph construction from event logs
16//! - Partial order analysis for concurrency detection
17//! - Conformance checking against DFG and Petri net models
18//! - Object-centric process mining for multi-object workflows
19//! - Next activity prediction using Markov chains and N-grams
20//! - Event log imputation for missing events and timestamp repair
21
22#![warn(missing_docs)]
23
24pub mod conformance;
25pub mod dfg;
26pub mod imputation;
27pub mod ocpm;
28pub mod partial_order;
29pub mod prediction;
30pub mod simulation;
31pub mod types;
32
33/// Prelude for convenient imports.
34pub mod prelude {
35    pub use crate::conformance::*;
36    pub use crate::dfg::*;
37    pub use crate::imputation::*;
38    pub use crate::ocpm::*;
39    pub use crate::partial_order::*;
40    pub use crate::prediction::*;
41    pub use crate::simulation::*;
42    pub use crate::types::*;
43}
44
45// Re-export main kernels
46pub use conformance::ConformanceChecking;
47pub use dfg::DFGConstruction;
48pub use imputation::EventLogImputation;
49pub use ocpm::OCPMPatternMatching;
50pub use partial_order::PartialOrderAnalysis;
51pub use prediction::NextActivityPrediction;
52pub use simulation::DigitalTwin;
53
54// Re-export key types
55pub use types::{
56    AlignmentStep, Arc, ConformanceResult, ConformanceStats, DFGEdge, DFGResult, Deviation,
57    DeviationType, DirectlyFollowsGraph, EventLog, OCPMEvent, OCPMEventLog, OCPMObject,
58    OCPMPatternResult, PartialOrderResult, PetriNet, Place, ProcessEvent, Trace, Transition,
59};
60
61/// Register all process intelligence kernels with a registry.
62pub fn register_all(
63    registry: &rustkernel_core::registry::KernelRegistry,
64) -> rustkernel_core::error::Result<()> {
65    tracing::info!("Registering process intelligence kernels");
66
67    // DFG kernel (1) - Batch
68    registry.register_batch_metadata_from(dfg::DFGConstruction::new)?;
69
70    // Partial order kernel (1) - Batch
71    registry.register_batch_metadata_from(partial_order::PartialOrderAnalysis::new)?;
72
73    // Conformance kernel (1) - Ring
74    registry.register_ring_metadata_from(conformance::ConformanceChecking::new)?;
75
76    // OCPM kernel (1) - Batch
77    registry.register_batch_metadata_from(ocpm::OCPMPatternMatching::new)?;
78
79    // Prediction kernel (1) - Batch
80    registry.register_batch_metadata_from(prediction::NextActivityPrediction::new)?;
81
82    // Imputation kernel (1) - Batch
83    registry.register_batch_metadata_from(imputation::EventLogImputation::new)?;
84
85    // Simulation kernel (1) - Batch
86    registry.register_batch_metadata_from(simulation::DigitalTwin::new)?;
87
88    tracing::info!("Registered 7 process intelligence kernels");
89    Ok(())
90}
91
92#[cfg(test)]
93mod tests {
94    use super::*;
95    use rustkernel_core::registry::KernelRegistry;
96
97    #[test]
98    fn test_register_all() {
99        let registry = KernelRegistry::new();
100        register_all(&registry).expect("Failed to register procint kernels");
101        assert_eq!(registry.total_count(), 7);
102    }
103}