Skip to main content

Event-Based Microcontroller Programming in Datalog

  • Conference paper
  • First Online:
Rules and Reasoning (RuleML+RR 2021)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12851))

Included in the following conference series:

  • 433 Accesses

Abstract

We propose a declarative language for event-based microcontroller programming. The language uses rules and can be seen as a more convenient notation for a pure Datalog program (with a small external controller). In this way, it has a clear semantics and the large body of previous work on declarative programming in Datalog can be used.

We defined and implemented a Datalog-based language for microcontroller programming before [12, 13]. It was based on ideas from Dedalus [1] and Statelog [6]. However, programming in that language needed polling, e.g., repeatedly querying system time until a certain time interval was over. For more complex programs, event-based programming is generally recommended. The language proposed in this paper is event-based and also contains a module concept in order to manage more complex tasks.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Alvaro, P., Marczak, W.R., Conway, N., Hellerstein, J.M., Maier, D., Sears, R.: Dedalus: Datalog in time and space. In: de Moor, O., Gottlob, G., Furche, T., Sellers, A. (eds.) Datalog 2.0 2010. LNCS, vol. 6702, pp. 262–281. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-24206-9_16. http://www.neilconway.org/docs/dedalus_dl2.pdf

  2. Brass, S., Wenzel, M.: Integrity constraints for microcontroller programming in Datalog. In: Bellatreche, L., Dumas, M., Karras, P., Matulevičius, R. (eds.) ADBIS 2021. LNCS, vol. 12843, pp. 152–166. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-82472-3_12

    Chapter  Google Scholar 

  3. Chabin, J., Halfeld-Ferrari, M., Markhoff, B., Nguyen, T.B.: Validating data from semantic web providers. In: Tjoa, A.M., Bellatreche, L., Biffl, S., van Leeuwen, J., Wiedermann, J. (eds.) SOFSEM 2018. LNCS, vol. 10706, pp. 682–695. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-73117-9_48

    Chapter  Google Scholar 

  4. Harel, D.: Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8, 231–274 (1987)

    Article  MathSciNet  Google Scholar 

  5. Kowalski, R., Sadri, F.: Reactive computing as model generation. New Gener. Comput. 33, 33–67 (2015). https://doi.org/10.1007/s00354-015-0103-z

    Article  MATH  Google Scholar 

  6. Lausen, G., Ludäscher, B., May, W.: On active deductive databases: the statelog approach. In: Freitag, B., Decker, H., Kifer, M., Voronkov, A. (eds.) DYNAMICS 1997. LNCS, vol. 1472, pp. 69–106. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0055496

    Chapter  MATH  Google Scholar 

  7. Przymusinski, T.C.: Every logic program has a natural stratification and an iterated least fixed point model. In: Proceedings of the Eighth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, (PODS 1989), pp. 11–21. ACM (1989)

    Google Scholar 

  8. Samek, M.: Practical UML Statecharts in C/C++: Event-Driven Programming for Embedded Systems, 2nd edn. CRC Press, Boca Raton (2009)

    Google Scholar 

  9. Scholz, B., Jordan, H., Subotić, P., Westmann, T.: On fast large-scale program analysis in Datalog. In: Proceedings of the 25th International Conference on Compiler Construction (CC 2016), pp. 196–206. ACM (2016)

    Google Scholar 

  10. Shkapsky, A., Yang, M., Interlandi, M., Chiu, H., Condie, T., Zaniolo, C.: Big data analytics with Datalog queries on Spark. In: Proceedings of the 2016 International Conference on Management of Data (SIGMOD 2016), pp. 1135–1149. ACM (2016). http://yellowstone.cs.ucla.edu/~yang/paper/sigmod2016-p958.pdf

  11. Van Gelder, A., Ross, K., Schlipf, J.S.: Unfounded sets and well-founded semantics for general logic programs. In: Proceedings of the Seventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS 1988), pp. 221–230 (1988)

    Google Scholar 

  12. Wenzel, M., Brass, S.: Declarative programming for microcontrollers - Datalog on Arduino. In: Hofstedt, P., Abreu, S., John, U., Kuchen, H., Seipel, D. (eds.) INAP/WLP/WFLP 2019. LNCS (LNAI), vol. 12057, pp. 119–138. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-46714-2_9. https://arxiv.org/abs/1909.00043

  13. Wenzel, M., Brass, S.: Translation of interactive Datalog programs for microcontrollers to finite state machines. In: Fernández, M. (ed.) LOPSTR 2020. LNCS, vol. 12561, pp. 210–227. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-68446-4_11

    Chapter  Google Scholar 

Download references

Acknowledgement

I would like to thank Mario Wenzel for the inspiration, helpful questions and important suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Stefan Brass .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Brass, S. (2021). Event-Based Microcontroller Programming in Datalog. In: Moschoyiannis, S., Peñaloza, R., Vanthienen, J., Soylu, A., Roman, D. (eds) Rules and Reasoning. RuleML+RR 2021. Lecture Notes in Computer Science(), vol 12851. Springer, Cham. https://doi.org/10.1007/978-3-030-91167-6_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-91167-6_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-91166-9

  • Online ISBN: 978-3-030-91167-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics