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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
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
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
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
Harel, D.: Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8, 231–274 (1987)
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
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
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)
Samek, M.: Practical UML Statecharts in C/C++: Event-Driven Programming for Embedded Systems, 2nd edn. CRC Press, Boca Raton (2009)
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)
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
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)
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
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
Acknowledgement
I would like to thank Mario Wenzel for the inspiration, helpful questions and important suggestions.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
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)