pub struct SymbolicTime { /* private fields */ }Expand description
A symbolic time representation for use in logic-based, non-numeric, or event-driven causal systems.
SymbolicTime models time points that are defined in terms of symbolic relationships
rather than purely numeric values. It wraps a SymbolicTimeUnit enum that encodes
relations like "Before Event X", "After Event Y", or "Simultaneous with A and B",
while also assigning a numeric i64 scalar value to make it compatible with
systems that require Temporal<i64>.
The id field is a globally unique numeric identifier for disambiguation and integration
with Identifiable graphs or context systems.
§Fields
id: Unique identifier for the symbolic time pointtime: ASymbolicTimeUnitenum variant representing the qualitative relation
§Symbolic Semantics
Symbolic time allows reasoning over:
- Event ordering (before/after)
- Named time anchors (e.g., “init”, “decision”, “outcome”)
- Simultaneity of events
This makes it useful in:
- Symbolic causal graphs
- Event calculus and temporal logic
- Explainable AI and decision traces
- Formal methods and simulations
§Examples
use deep_causality::{SymbolicTime, SymbolicTimeUnit};
let t1 = SymbolicTime::new(
1,
SymbolicTimeUnit::Named("DecisionPoint".into(), 42),
);
let t2 = SymbolicTime::new(
2,
SymbolicTimeUnit::Before("SensorReading".into(), -10),
);
println!("{}", t1); // Output: #1, Named(DecisionPoint) @ 42
println!("{}", t2); // Output: #2, Before(SensorReading) @ -10§Trait Compatibility
- Implements
Identifiableusingid - Implements
Temporal<i64>using the scalar inside theSymbolicTimeUnit - Can be used in graphs, timelines, or symbolic propagation engines
§Note
While the scalar time value (i64) enables numeric compatibility,
its semantic interpretation must be context-dependent.
Do not rely solely on numeric ordering when symbolic intent (e.g., Simultaneous)
should override raw comparisons.
Implementations§
Source§impl SymbolicTime
impl SymbolicTime
pub fn new(id: u64, time: SymbolicTimeUnit) -> Self
pub fn time(&self) -> &SymbolicTimeUnit
Trait Implementations§
Source§impl Clone for SymbolicTime
impl Clone for SymbolicTime
Source§fn clone(&self) -> SymbolicTime
fn clone(&self) -> SymbolicTime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more