Implementing a semi-causal domain-specific language for context detection over binary sensors
- 7 April 2020
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 53 (9), 66-78
- https://doi.org/10.1145/3393934.3278134
Abstract
In spite of the fact that many sensors in use today are binary (i.e. produce only values of 0 and 1), and that useful context-aware applications are built exclusively on top of them, there is currently no development approach specifically targeted to binary sensors. Dealing with notions of state and state combinators, central to binary sensors, is tedious and error-prone in current approaches. For instance, developing such applications in a general programming language requires writing code to process events, maintain state and perform state transitions on events, manage timers and/or event histories. In another paper, we introduced a domain specific language (DSL) called Allen, specifically targeted to binary sensors. Allen natively expresses states and state combinations, and detects contexts on line, on incoming streams of binary events. Expressing state combinations in Allen is natural and intuitive due to a key ingredient: semi-causal operators. That paper focused on the concept of the language and its main operators, but did not address its implementation challenges. Indeed, online evaluation of expressions containing semi-causal operators is difficult, because semi-causal sub-expressions may block waiting for future events, thus generating unknown values, besides 0 and 1. These unknown values may or may not propagate to the containing expressions, depending on the current value of the other arguments. This paper presents a compiler and runtime for the Allen language, and shows how they implement its state combining operators, based on reducing complex expressions to a core subset of operators, which are implemented natively. We define several assisted living applications both in Allen and in a general scripting language. We show that the former are much more concise in Allen, achieve more effective code reuse, and ease the checking of some domain properties.Keywords
This publication has 15 references indexed in Scilit:
- Engineering context-aware systems and applications: A surveyJournal of Systems and Software, 2016
- A First-Person Experience with End-User Development for Smart HomesIEEE Pervasive Computing, 2016
- Supporting mental model accuracy in trigger-action programmingPublished by Association for Computing Machinery (ACM) ,2015
- A survey on reactive programmingACM Computing Surveys, 2013
- Activity recognition on streaming sensor dataPervasive and Mobile Computing, 2012
- Processing flows of informationACM Computing Surveys, 2012
- Technologies for aging gracefullyInteractions, 2012
- Analysis of Deterministic Tracking of Multiple Objects Using a Binary Sensor NetworkACM Transactions on Sensor Networks, 2011
- Declarative event-oriented programmingPublished by Association for Computing Machinery (ACM) ,2000
- Maintaining knowledge about temporal intervalsCommunications of the ACM, 1983