Published August 4, 2026 | Version v1

A Minimal Mathematical Definition of a Stateless Event-Condition-Action Rule Engine

Description

This note defines a stateless ECA rule engine as a pure mathematical action-selection function. An event occurrence consists of an event type and an optional payload. Payloads and condition sets are finite typed partial maps that distinguish a concrete value, an explicit null, and an absent key. A condition-side null is an explicit wildcard, whereas a payload-side null is a present null value. The query retains the matching rules of greatest specificity, resolves any tie with a fixed deterministic selector, and returns one action or the no-action value ⊥.

Specificity assigns weight two to a concrete condition, one to an explicit-null wildcard, and zero to an omitted key. The score is defined for every condition set and compared only among rules that fully match the current payload. The engine is stateless because, for a fixed rule base and tie selector, its result depends only on the current event occurrence. Event types, parameter domains, conditions, and actions remain otherwise uninterpreted, making the model independent of any application domain or implementation technology.

Status: Independent technical note; not peer-reviewed.

Companion implementation: 10.5281/zenodo.21802923
Interactive demonstration: https://rohingosling.github.io/eca-rule-engine-2/

Files

stateless-eca-rule-engine.pdf

Files (316.9 kB)

Name Size Download all
md5:6ec7983ddddeb7166778a4d2d43630fe
316.9 kB Preview Download

Additional details

Related works

Documents
Software: 10.5281/zenodo.21802923 (DOI)

References

  • McCarthy and Dayal, "The Architecture of an Active Database Management System," DOI 10.1145/66926.66946
  • Chakravarthy and Mishra, "Snoop: An Expressive Event Specification Language for Active Databases," DOI 10.1016/0169-023X(94)90006-X
  • Chakravarthy et al., "Composite Events for Active Databases: Semantics, Contexts and Detection."
  • Paton and Díaz, "Active Database Systems," DOI 10.1145/311531.311623
  • Paschke, "Reaction RuleML 1.0 for Rules, Events and Actions in Semantic Complex Event Processing," DOI 10.1007/978-3-319-09870-8_1
  • Berstel-Da Silva, "Formalizing Both Refraction-Based and Sequential Executions of Production Rule Programs," DOI 10.1007/978-3-642-32689-9_5
  • Yen, "A Principled Approach to Reasoning About the Specificity of Rules."
  • de Sainte Marie, Hallmark and Paschke, eds., "RIF Production Rule Dialect (Second Edition)."