Track causality in distributed systems with vector timestamps, message passing, and concurrency detection
Internal event: Process increments its own entry in the vector clock. For process B with clock [1, 2, 0], an internal event yields [1, 3, 0].
Send: Increment own entry, then attach the updated vector clock to the outgoing message.
Receive: Take element-wise max of the local clock and the received clock, then increment own entry. This captures causal knowledge from the sender.
Concurrent (||): Events where neither happens-before the other. Example: A:[2,0,0] and B:[0,1,0] are concurrent because neither dominates.
Happens-before (→): VC(a) < VC(b) means a causally precedes b. Every entry in a's clock is ≤ the corresponding entry in b's clock, with at least one strictly less.
Comparison rules: If VC(a) < VC(b), a happened before b. If VC(b) < VC(a), b happened before a. Otherwise, a and b are concurrent.