pub struct CausalSetSpacetime { /* private fields */ }Expand description
An element of a causal set, with the elements that precede it.
A causal set is a set C with a relation ≺ that is transitive, irreflexive and locally
finite: for any x, z only finitely many y satisfy x ≺ y ≺ z. Transitivity and
irreflexivity together exclude cycles (Sorkin 2003, p. 5). There are no coordinates, distances
or durations, only the order.
predecessors holds every element x with x ≺ self: the past of this
element, not only its links, the relations not implied by transitivity (Sorkin 2003, p. 5).
Irreflexivity is local: add_predecessor is the only way to extend the
past, and it refuses the element’s own id. No method changes the id. Transitivity, acyclicity
across elements and local finiteness are properties of the whole set, which one element cannot
see; whoever builds the set keeps them.
It implements none of the coordinate or time traits, so it cannot fill a Context’s spacetime
slot. A context carries it in its data slot instead, as Data<CausalSetSpacetime>. The
Default element has id 0, no label and an empty past, which keeps irreflexivity.
§Example
use deep_causality_context::*;
let mut e = CausalSetSpacetime::new(3, Some("C".into()));
assert!(e.add_predecessor(1));
assert!(e.add_predecessor(2));
assert!(!e.add_predecessor(3)); // an element does not precede itself
assert!(e.is_after(1));
assert_eq!(e.predecessor_count(), 2);The past is not writable from outside the type:
use deep_causality_context::*;
let mut e = CausalSetSpacetime::new(3, None);
e.predecessors.insert(3); // private fieldNor can it change the id to one it records as a predecessor:
use deep_causality_context::*;
let mut e = CausalSetSpacetime::new(3, None);
e.add_predecessor(5);
e.id = 5; // private field§References
- Sorkin, R. D. (2003). Causal Sets: Discrete Gravity (Notes for the Valdivia Summer School).
arXiv:gr-qc/0309009, p. 5. Copy:
papers/sorkin_2003_causal_sets_discrete_gravity_arXiv_gr-qc_0309009.pdf.
Implementations§
Source§impl CausalSetSpacetime
impl CausalSetSpacetime
pub fn new(id: ContextoidId, label: Option<String>) -> Self
Source§impl CausalSetSpacetime
impl CausalSetSpacetime
Sourcepub fn predecessors(&self) -> &BTreeSet<ContextoidId>
pub fn predecessors(&self) -> &BTreeSet<ContextoidId>
Every element that precedes this one, in ascending id order.
Sourcepub fn add_predecessor(&mut self, parent_id: ContextoidId) -> bool
pub fn add_predecessor(&mut self, parent_id: ContextoidId) -> bool
Records parent_id ≺ self. Returns whether it was added: false when parent_id is this
element’s own id, which irreflexivity forbids, or when it is already recorded.
Sourcepub fn is_after(&self, other_id: ContextoidId) -> bool
pub fn is_after(&self, other_id: ContextoidId) -> bool
Whether other_id ≺ self.
Sourcepub fn predecessor_count(&self) -> usize
pub fn predecessor_count(&self) -> usize
How many elements precede this one: the cardinality of its past.