#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum WitnessFamily {
Standard,
Paper,
ApiGrammar,
RustLaw,
InternalBridge,
}
pub trait Witness {
const KEY: &'static str;
const FAMILY: WitnessFamily;
const TITLE: &'static str;
const YEAR: Option<u16>;
}
macro_rules! witness_marker {
($(#[$meta:meta])* $name:ident, $key:literal, $family:expr, $title:literal, $year:expr) => {
$(#[$meta])*
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum $name {}
impl Witness for $name {
const KEY: &'static str = $key;
const FAMILY: WitnessFamily = $family;
const TITLE: &'static str = $title;
const YEAR: Option<u16> = $year;
}
};
}
witness_marker!(
Ocel20, "ocel-2.0", WitnessFamily::Standard, "OCEL 2.0", Some(2023)
);
witness_marker!(
Xes1849, "xes-1849-2016", WitnessFamily::Standard, "XES (IEEE 1849-2016)", Some(2016)
);
witness_marker!(
Pm4pyApiGrammar, "pm4py-api-grammar", WitnessFamily::ApiGrammar, "pm4py API grammar", None
);
witness_marker!(
PmaxConsumerGrammar, "pmax-consumer-grammar", WitnessFamily::ApiGrammar, "pmax consumer grammar", None
);
witness_marker!(
PowlPaper, "powl-paper", WitnessFamily::Paper, "POWL: Partially Ordered Workflow Language", Some(2023)
);
witness_marker!(
ObjectCentricPetriNetPaper,
"oc-petri-net-paper",
WitnessFamily::Paper,
"Discovering Object-Centric Petri Nets",
Some(2020)
);
witness_marker!(
WfNetSoundnessPaper,
"wfnet-soundness-paper",
WitnessFamily::Paper,
"The Application of Petri Nets to Workflow Management (soundness)",
Some(1998)
);
witness_marker!(
OcpqPaper, "ocpq-paper", WitnessFamily::Paper, "Object-Centric Process Querying", Some(2024)
);
witness_marker!(
DeclareFamily, "declare-family", WitnessFamily::Paper, "Declare constraint family", Some(2007)
);
witness_marker!(
PredictiveMonitoringFamily,
"predictive-monitoring-family",
WitnessFamily::Paper,
"Predictive Process Monitoring family",
Some(2018)
);
witness_marker!(
ReceiptFamily, "receipt-family", WitnessFamily::Paper, "Receipt-shaped evidence family", None
);
witness_marker!(
RustTypestateLaw, "rust-typestate-law", WitnessFamily::RustLaw, "Rust typestate law", None
);
witness_marker!(
Wasm4pmBridge, "wasm4pm-bridge", WitnessFamily::InternalBridge, "wasm4pm graduation bridge", None
);
witness_marker!(
YawlPaper,
"yawl-paper",
WitnessFamily::Paper,
"YAWL: Yet Another Workflow Language",
Some(2004)
);
witness_marker!(
SeparableWfNetPaper,
"separable-wfnet-paper",
WitnessFamily::Paper,
"Hierarchical Decomposition of Separable Workflow-Nets",
Some(2026)
);
witness_marker!(
WorkflowPatternsPaper,
"workflow-patterns-paper",
WitnessFamily::Paper,
"Workflow Patterns: The Definitive Guide",
Some(2016)
);
witness_marker!(
InductiveMiner,
"inductive-miner",
WitnessFamily::Paper,
"Inductive Miner (Leemans, Fahland & van der Aalst)",
Some(2013)
);
witness_marker!(
DeclareConstraints,
"declare-constraints",
WitnessFamily::Paper,
"Declare constraint-template language",
Some(2006)
);
witness_marker!(
AlignmentPaper,
"alignment-paper",
WitnessFamily::Paper,
"Alignment-Based Conformance Checking",
Some(2008)
);
witness_marker!(
OcPetriNets,
"oc-petri-nets",
WitnessFamily::Paper,
"Object-Centric Petri Nets (notation)",
Some(2020)
);
witness_marker!(
LogSkeleton,
"log-skeleton",
WitnessFamily::Paper,
"Log Skeleton (Verbeek & Leemans)",
Some(2018)
);
witness_marker!(
AlphaMiner,
"alpha-miner",
WitnessFamily::Paper,
"Alpha Algorithm (van der Aalst, Weijters & Maruster)",
Some(2004)
);
witness_marker!(
XesLifecycleExt,
"xes-lifecycle-extension",
WitnessFamily::Standard,
"XES lifecycle extension (IEEE 1849-2016)",
Some(2016)
);
witness_marker!(
XesConceptExt,
"xes-concept-extension",
WitnessFamily::Standard,
"XES concept extension (IEEE 1849-2016)",
Some(2016)
);
witness_marker!(
OcelObjectType,
"ocel-object-type",
WitnessFamily::Standard,
"OCEL 2.0 object-type namespace",
Some(2023)
);
witness_marker!(
OcelEventType,
"ocel-event-type",
WitnessFamily::Standard,
"OCEL 2.0 event-type (activity) namespace",
Some(2023)
);
witness_marker!(
OcelAttributeType,
"ocel-attribute-type",
WitnessFamily::Standard,
"OCEL 2.0 attribute-type namespace",
Some(2023)
);
witness_marker!(
WfNet2Powl,
"wfnet-to-powl",
WitnessFamily::Paper,
"WF-net to POWL 2.0 conversion (Kourani, Park & van der Aalst)",
Some(2026)
);
witness_marker!(
DivergenceWitness,
"oc-pm-divergence",
WitnessFamily::Paper,
"OC-PM divergence detection (paper #49)",
None
);
witness_marker!(
ConvergenceWitness,
"oc-pm-convergence",
WitnessFamily::Paper,
"OC-PM convergence detection (paper #49)",
None
);
witness_marker!(
ProcessCubePaper,
"process-cube-paper",
WitnessFamily::Paper,
"Process Cubes (van der Aalst, 2013)",
Some(2013)
);
witness_marker!(
OperationalView,
"process-cube-operational-view",
WitnessFamily::Paper,
"Process Cube operational view",
Some(2013)
);
witness_marker!(
AnalyticalView,
"process-cube-analytical-view",
WitnessFamily::Paper,
"Process Cube analytical view",
Some(2013)
);
witness_marker!(
StreamingEvidenceWitness,
"streaming-evidence",
WitnessFamily::Paper,
"Streaming evidence (online collection context)",
None
);
witness_marker!(
CausalConsistencyWitness,
"causal-consistency",
WitnessFamily::Paper,
"Causal consistency (cross-object causal ordering verified)",
None
);
witness_marker!(
CrossLogCorrelationWitness,
"cross-log-correlation",
WitnessFamily::Paper,
"Cross-log correlation (multi-log provenance)",
None
);
witness_marker!(
AggregationView,
"process-cube-aggregation-view",
WitnessFamily::Paper,
"Process Cube aggregation view",
Some(2013)
);
witness_marker!(
TimeAwareWitness,
"time-aware-witness",
WitnessFamily::Paper,
"Time-aware evidence (temporal ordering established)",
Some(2020)
);
witness_marker!(
TemporalProfileWitness,
"temporal-profile-witness",
WitnessFamily::Paper,
"Temporal profile (AVG/STD per activity-pair — Stertz et al. 2020)",
Some(2020)
);
witness_marker!(
ControlFlowPerspectiveWitness,
"cf-perspective",
WitnessFamily::Paper,
"Control-Flow Perspective (Mannhardt et al. 2016)",
Some(2016)
);
witness_marker!(
DataPerspectiveWitness,
"data-perspective",
WitnessFamily::Paper,
"Data Perspective (Mannhardt et al. 2016)",
Some(2016)
);
witness_marker!(
ResourcePerspectiveWitness,
"resource-perspective",
WitnessFamily::Paper,
"Resource Perspective (Mannhardt et al. 2016)",
Some(2016)
);
witness_marker!(
TimePerspectiveWitness,
"time-perspective",
WitnessFamily::Paper,
"Time Perspective (Mannhardt et al. 2016)",
Some(2016)
);
pub trait Join {
fn join(self, other: Self) -> Self;
}
pub trait WithTop {
fn is_top(&self) -> bool;
}
#[derive(Debug, PartialEq, Eq, Hash)]
pub enum WitnessState<W: Witness> {
Unknown(core::marker::PhantomData<W>),
Satisfied(core::marker::PhantomData<W>),
Violated(core::marker::PhantomData<W>),
Contradiction(core::marker::PhantomData<W>),
}
impl<W: Witness> Clone for WitnessState<W> {
fn clone(&self) -> Self {
*self
}
}
impl<W: Witness> Copy for WitnessState<W> {}
impl<W: Witness> Join for WitnessState<W> {
fn join(self, other: Self) -> Self {
match (self, other) {
(WitnessState::Unknown(_), s) => s,
(s, WitnessState::Unknown(_)) => s,
(WitnessState::Satisfied(_), WitnessState::Satisfied(_)) => self,
(WitnessState::Violated(_), WitnessState::Violated(_)) => self,
_ => WitnessState::Contradiction(core::marker::PhantomData),
}
}
}
impl<W: Witness> WithTop for WitnessState<W> {
fn is_top(&self) -> bool {
matches!(self, WitnessState::Contradiction(_))
}
}