SymbolicTime

Struct SymbolicTime 

Source
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 point
  • time: A SymbolicTimeUnit enum 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 Identifiable using id
  • Implements Temporal<i64> using the scalar inside the SymbolicTimeUnit
  • 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

Source

pub fn new(id: u64, time: SymbolicTimeUnit) -> Self

Source

pub fn time(&self) -> &SymbolicTimeUnit

Trait Implementations§

Source§

impl Clone for SymbolicTime

Source§

fn clone(&self) -> SymbolicTime

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SymbolicTime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SymbolicTime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for SymbolicTime

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Identifiable for SymbolicTime

Source§

fn id(&self) -> u64

Source§

impl PartialEq for SymbolicTime

Source§

fn eq(&self, other: &SymbolicTime) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Temporal<i64> for SymbolicTime

Source§

fn time_scale(&self) -> TimeScale

Returns the unit scale of time (e.g. TimeScale::Milliseconds).
Source§

fn time_unit(&self) -> i64

Returns a reference to the numeric time unit (e.g. 0, 100, 32768).
Source§

impl Eq for SymbolicTime

Source§

impl StructuralPartialEq for SymbolicTime

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.