Allen - A language for online state processing

There is a large variety of binary sensors in use today, and useful context-aware services can be defined using such binary sensors. However, the currently available approaches for programming context-aware services do not conveniently support binary sensors. Indeed, no existing approach simultaneously supports a notion of state, central to binary sensors, offers a complete set of operators to compose states, allows to define reusable abstractions by means of such compositions, and implements efficient online processing of these operators.

We propose a new language called Allen for event processing, specifically targeted to binary sensors. The central contributions of this language are a native notion of state and semi-causal operators for temporal state composition, including: Allen’s interval relations generalized for handling multiple intervals, and temporal filters for handling delays.

Compared to other approaches such as CEP (complex event processing), Allen provides less discontinued information, allows less restricted compositions, and supports reusable abstractions.

We implemented a compiler and a virtual machine for this language, and we applied them to successfully rewrite a full set of real Ambient Assisted Living services. The performance of our prototype competes well with a commercial CEP engine when expressing the same services.

The implementation is available as open source under the GPL license.