Abstract
We consider microcontroller-programming with a declarative language based on the logic-programming language Datalog. Our prototype implementation translates a Datalog dialect to C-code for the Arduino IDE. In order to prove the correctness, one must ensure that the very limited memory of the microcontroller is sufficient for the derived facts. In this paper, we propose a class of constraints called “generalized exclusion constraints” that can be used for this task. Moreover, they are needed to exclude conflicting commands to the hardware, e.g. different output values on a pin in the same state. This class of constraints also generalizes keys and functional dependencies, therefore our results also help to prove such constraints for derived predicates.
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.J. (eds.) Datalog Reloaded – First International Workshop, Datalog 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
Bry, F., Manthey, R., Martens, B.: Integrity verification in knowledge bases. In: Voronkov, A. (ed.) RCLP -1990. LNCS, vol. 592, pp. 114–139. Springer, Heidelberg (1992). https://doi.org/10.1007/3-540-55460-2_9
Calì, A., Gottlob, G., Lukasiewicz, T.: A general Datalog-based framework for tractable query answering over ontologies. In: Proceedings of the 28th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS 2009), pp. 77–86. ACM (2009)
Casanova, M.A., Vidal, V.M.P.: Towards a sound view integration methodology. In: Proceedings of the 2nd ACM SIGACT-SIGMOD Symposium on Principles of Database Systems (PODS 1983), pp. 36–47 (1983)
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
Engels, C., Behrend, A., Brass, S.: A rule-based approach to analyzing database schema objects with Datalog. In: Fioravanti, F., Gallagher, J.P. (eds.) LOPSTR 2017. LNCS, vol. 10855, pp. 20–36. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-94460-9_2
Imbert, J.-L., Cohen, J., Weeger, M.D.: An algorithm for linear constraint solving: its incorporation in a Prolog meta-interpreter for CLP. J. Log. Program. 16, 235–253 (1993). https://core.ac.uk/download/pdf/82420821.pdf
Schewe, K.D., Thalheim, B.: Towards a theory of consistency enforcement. Acta Informatica 36, 97–141 (1999). https://doi.org/10.1007/s002360050155
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
Thalheim, B.: Dependencies in Relational Databases. Teubner, Germany (1991)
Van Hentenryck, P., Graf, T.: Standard forms for rational linear arithmetic in constraint logic programming. Ann. Math. Artif. Intell. 5(2), 303–319 (1992). https://doi.org/10.1007/BF01543480
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. LOPSTR 2020. LNCS, vol. 12561, pp. 210–227. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-68446-4_11
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., Wenzel, M. (2021). Integrity Constraints for Microcontroller Programming in Datalog. In: Bellatreche, L., Dumas, M., Karras, P., Matulevičius, R. (eds) Advances in Databases and Information Systems. ADBIS 2021. Lecture Notes in Computer Science(), vol 12843. Springer, Cham. https://doi.org/10.1007/978-3-030-82472-3_12
Download citation
DOI: https://doi.org/10.1007/978-3-030-82472-3_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-82471-6
Online ISBN: 978-3-030-82472-3
eBook Packages: Computer ScienceComputer Science (R0)