Introduction
Composite Event Recognition (CER) is critical for processing symbolic event streams into high-level actionable insights, such as identifying maritime maneuvers or human activities from raw sensor data. The Event Calculus (EC) provides a robust logic-based framework for these tasks, utilizing "fluents" to represent time-varying properties.
In the Run-Time Event Calculus (RTEC), developers typically define fluents in two ways:
- Simple Fluents: Defined by initiation and termination events (the "law of inertia"). These are intuitive for humans but computationally expensive.
- Statically Determined Fluents: Defined as direct Boolean combinations of other fluents. These are exponentially faster for machines but difficult for humans to write correctly for complex activities.
This research addresses the performance bottleneck caused by the "inertia tax" by introducing an automated compiler that transforms simple fluents into statically determined ones.
Methodology: Automatic Fluent Translation
The core of this work is an open-source compiler that identifies specific structural symmetries—Inertial Condition, Guard Condition, and Boolean Representation symmetries—within simple fluent definitions. When these conditions are met, the compiler automatically rewrites the rules using RTEC’s efficient interval manipulation constructs (e.g., intersect_all, union_all). This process is formally proven to preserve the original temporal logic while shifting the computational burden from tracking every start/end point to performing direct interval math.
Experimental Evaluation
The compiler was evaluated across several real-world domains, including human activity recognition (CAVIAR dataset), maritime situational awareness (18 million AIS signals), and city transport management (Helsinki public transport data).
Rule Compression
A primary benefit of the optimization is the drastic reduction in the complexity of the temporal specifications. By converting exponential rule sets into linear Boolean combinations, the compiler significantly reduces the number of rule conditions the system must evaluate.
As seen in the figure above, the maritime domain ($\mathcal{E}_m$) saw a reduction from 1,212 to 215 rules, while human activity recognition ($\mathcal{E}_h$) dropped from 569 to 71.
Performance Gains
The reduction in rule complexity translates directly into reasoning speedups. Experimental results demonstrate that the optimized specifications consistently outperform the original input by one to two orders of magnitude.
As shown in the performance plots, the gap between the original ($\mathcal{E}^i$) and optimized ($\mathcal{E}^o$) code widens as the data window size increases, highlighting the scalability of the approach. The compilation process itself is nearly instantaneous, typically completing in less than 500ms for all tested applications.
Conclusion
By automating the translation of simple fluents into statically determined ones, this work allows knowledge engineers to maintain intuitive, easy-to-write specifications without sacrificing run-time performance. This optimization is a vital step toward scalable, real-time logic-based event recognition in complex, data-intensive environments.
Summary updated