Skip to main content
. 2025 Aug 27;25(17):5331. doi: 10.3390/s25175331
Algorithm 1. Stateful Complex Event Matching in GICEDCAM.
Input: stream of spatial events e = ⟨type, bindings, t, conf, corrected
   window W, watermark ω
State: partial matches M[q] keyed by (q, bindings)

upon spatial event e at time t:  // events are pre-filtered & projected
// 1) advance existing partials
for each (q, b) in M where δ(q, e.type, b, t) is enabled
   q′ ← δ(q, e.type, b, t)  // checks Allen relation & gap constraints
   b′ ← unify(b, e.bindings)  // variable binding; reject on conflict
   upsert M[q′] with {bindings = b′, start_time(b), last_time = t}
// 2) possibly start a new partial
if δ(q0, e.type, e.bindings, t) enabled
   upsert M[q1] with {bindings = e.bindings, start_time = t, last_time = t}
// 3) emit completes when safe
for each partial in M with state q  F
   if (last_time start_time) ≤ Wandlast_timeω
     emit ComplexEvent(partial.bindings, [start_time, last_time])
     delete partial
// 4) prune stale partials (semantic bound)
 delete any partial with (current_time start_time) > W