pub struct CausalSetSpacetime {
pub id: u64,
pub label: Option<String>,
pub predecessors: BTreeSet<u64>,
}Expand description
A symbolic, discrete model of spacetime based on causal set theory (CST).
CausalSetSpacetime represents events not by coordinates, but by their
causal relationships — i.e., who can influence whom. This allows reasoning
about causality and temporal order without requiring geometry, coordinates, or metrics.
This type is part of a broader class of non-metric causal models, ideal for:
- Symbolic AI
- Quantum gravity models
- Abstract causal graphs
§Fields
id: Unique identifier for the eventlabel: Optional semantic tag (e.g., “observation”, “input”)predecessors: Set of event IDs that causally precede this one
§Notes
- This model assumes transitive reduction (i.e., minimal representation of causality)
- No distance or duration is defined — just causal topology
- Cycles are disallowed by construction
§Example
use deep_causality::*;
let mut e1 = CausalSetSpacetime::new(1, Some("A".into()));
let mut e2 = CausalSetSpacetime::new(2, Some("B".into()));
e2.add_predecessor(1);
assert!(e2.predecessors.contains(&1));
assert_eq!(e2.label.as_deref(), Some("B"));Fields§
§id: u64Unique event identifier
label: Option<String>Optional label or annotation for semantic reasoning
predecessors: BTreeSet<u64>List of causally preceding event IDs (must be acyclic)
Implementations§
Source§impl CausalSetSpacetime
impl CausalSetSpacetime
Sourcepub fn add_predecessor(&mut self, parent_id: u64)
pub fn add_predecessor(&mut self, parent_id: u64)
Adds a causal link (edge) from another event that precedes this one.
Sourcepub fn is_after(&self, other_id: u64) -> bool
pub fn is_after(&self, other_id: u64) -> bool
Checks whether the current event is causally downstream of another.
Sourcepub fn causal_depth(&self) -> usize
pub fn causal_depth(&self) -> usize
Returns the causal depth (number of direct predecessors)
Trait Implementations§
Source§impl Clone for CausalSetSpacetime
impl Clone for CausalSetSpacetime
Source§fn clone(&self) -> CausalSetSpacetime
fn clone(&self) -> CausalSetSpacetime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CausalSetSpacetime
impl Debug for CausalSetSpacetime
Source§impl Display for CausalSetSpacetime
impl Display for CausalSetSpacetime
Source§impl PartialEq for CausalSetSpacetime
impl PartialEq for CausalSetSpacetime
impl StructuralPartialEq for CausalSetSpacetime
Auto Trait Implementations§
impl Freeze for CausalSetSpacetime
impl RefUnwindSafe for CausalSetSpacetime
impl Send for CausalSetSpacetime
impl Sync for CausalSetSpacetime
impl Unpin for CausalSetSpacetime
impl UnwindSafe for CausalSetSpacetime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more