skip to main content
article

Implementing a semi-causal domain-specific language for context detection over binary sensors

Published:07 April 2020Publication History
Skip Abstract Section

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.

References

  1. Unai Alegre, Juan Carlos Augusto, and Tony Clark. 2016. Engineering context-aware systems and applications: A survey. Journal of Systems and Software 117 (2016), 55-83. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. James F. Allen. 1983. Maintaining Knowledge About Temporal Intervals. Commun. ACM 26, 11 (Nov. 1983), 832-843. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Ronald M. Baecker, Karyn Moffatt, and Michael Massimi. 2012. Technologies for Aging Gracefully. interactions 19, 3 (May 2012), 32-36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Engineer Bainomugisha, Andoni Lombide Carreton, Tom van Cutsem, Stijn Mostinckx, and Wolfgang de Meuter. 2013. A Survey on Reactive Programming. ACM Comput. Surv. 45, 4, Article 52 (Aug. 2013), 34 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. Bourke and A. Sowmya. 2010. Delays in Esterel. In SYNCHRON 2009 (Dagstuhl Seminar Proceedings), Albert Benveniste, Stephen A. Edwards, Edward Lee, Klaus Schneider, and Reinhard von Hanxleden (Eds.). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Germany, Dagstuhl, Germany. http://drops.dagstuhl.de/opus/volltexte/2010/2434.Google ScholarGoogle Scholar
  6. Yann Busnel, Leonardo Querzoni, Roberto Baldoni, Marin Bertier, and Anne-Marie Kermarrec. 2011. Analysis of Deterministic Tracking of Multiple Objects using a Binary Sensor Network. ACM Transactions on Sensor Networks 8 (2011). https://hal.inria.fr/inria-00590873. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Charles Consel, Lucile Dupuy, and Hélène Sauzéon. 2017. HomeAssist: An Assisted Living Platform for Aging in Place Based on an Interdisciplinary Approach. In Proceedings of the 8th International Conference on Applied Human Factors and Ergonomics (AHFE 2017). Springer.Google ScholarGoogle Scholar
  8. Joëlle Coutaz and James L Crowley. 2016. A First-Person Experience with End-User Development for Smart Homes. IEEE Pervasive Computing 15 (May 2016), 26-39. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Gianpaolo Cugola and Alessandro Margara. 2012. Processing Flows of Information: From Data Stream to Complex Event Processing. ACM Comput. Surv. 44, 3, Article 15 (June 2012), 62 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Conal Elliott. 2000. Declarative Event-oriented Programming. In Proceedings of the 2Nd ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP '00). ACM, New York, NY, USA, 56-67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Abdoulaye Gamatié. 2010. Designing Embedded Systems with the SIGNAL Programming Language: Synchronous, Reactive Specification. Springer New York, New York, NY, Chapter Synchronous Programming: Overview, 21-39.Google ScholarGoogle Scholar
  12. Malik Ghallab and Amine Mounir Alaoui. 1989. Managing Efficiently Temporal Relations Through Indexed Spanning Trees. In Proceedings of the 11th International Joint Conference on Artificial Intelligence-Volume 2 (IJCAI'89). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1297-1303. http://dl.acm.org/citation.cfm?id=1623891.1623963. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Justin Huang and Maya Cakmak. 2015. Supporting Mental Model Accuracy in Trigger-action Programming. In Proceedings of the 2015 ACM International Joint Conference on Pervasive and Ubiquitous Computing (UbiComp '15). ACM, New York, NY, USA, 215-225. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. David Janin and Bernard Paul Serpette. 2016. Timed Denotational Semantics for Causal Functions over Timed Streams. Research Report. LaBRI-Laboratoire Bordelais de Recherche en Informatique. https://hal.archives-ouvertes.fr/hal-01402209.Google ScholarGoogle Scholar
  15. Narayanan C. Krishnan and Diane J. Cook. 2014. Activity recognition on streaming sensor data. Pervasive and Mobile Computing 10 (2014), 138-154. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Fco. Javier Ordóñez, Paula de Toledo, and Araceli Sanchis. 2013. Activity Recognition Using Hybrid Generative/Discriminative Models on Home Environments Using Binary Sensors. Sensors 13, 5 (2013), 5460-5477.Google ScholarGoogle ScholarCross RefCross Ref
  17. C. Perera, A. Zaslavsky, P. Christen, and D. Georgakopoulos. 2014. Context Aware Computing for The Internet of Things: A Survey. IEEE Communications Surveys Tutorials 16, 1 (First 2014), 414-454.Google ScholarGoogle ScholarCross RefCross Ref
  18. J. Saives, C. Pianon, and G. Faraut. 2015. Activity Discovery and Detection of Behavioral Deviations of an Inhabitant From Binary Sensors. IEEE Transactions on Automation Science and Engineering 12, 4 (Oct 2015), 1211-1224.Google ScholarGoogle ScholarCross RefCross Ref
  19. Lénaïc Terrier, Alexandre Demeure, and Sybille Caffiau. 2017. CCBL: A Language for Better Supporting Context Centered Programming in the Smart Home. In The 9th ACM SIGCHI Symposium on Engineering Interactive Computing Systems (PACM on Human-Computer Interaction), Vol. 1. Lisbonne, Portugal. https://hal.archives-ouvertes.fr/hal-01534805. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Lenaïc Terrier, Alexandre Demeure, and Sybille Caffiau. 2017. CCBL: A new language for End User Development in the Smart Homes. In Proceedings of IS-EUD 2017. 82-87. https://pure.tue.nl/ws/files/69763287/IS_EUD2017_extended_abstracts.pdf#page=83.Google ScholarGoogle Scholar
  21. Blase Ur, Elyse McManus, Melwyn Pak Yong Ho, and Michael L. Littman. 2014. Practical Trigger-action Programming in the Smart Home. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (CHI '14). ACM, New York, NY, USA, 803-812. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Nic Volanschi, Bernard Serpette, Adrien Carteron, and Charles Consel. 2018. A Language for Online State Processing of Binary Sensors, Applied to Ambient Assisted Living. Technical Report submitted for publication. Inria Bordeaux. Available upon request.Google ScholarGoogle Scholar
  23. Le Yi Wang, Ji-Feng Zhang, and G. G. Yin. 2003. System identification using binary sensors. IEEE Trans. Automat. Control 48, 11 (Nov 2003), 1892-1907.Google ScholarGoogle Scholar

Index Terms

  1. Implementing a semi-causal domain-specific language for context detection over binary sensors

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            • Published in

              cover image ACM SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 53, Issue 9
              GPCE '18
              September 2018
              214 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/3393934
              Issue’s Table of Contents
              • cover image ACM Conferences
                GPCE 2018: Proceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
                November 2018
                214 pages
                ISBN:9781450360456
                DOI:10.1145/3278122

              Copyright © 2018 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 7 April 2020

              Check for updates

              Qualifiers

              • article

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!