Skip to main content

Declarative Programming for Microcontrollers - Datalog on Arduino

  • Conference paper
  • First Online:
Declarative Programming and Knowledge Management (INAP 2019, WLP 2019, WFLP 2019)

Abstract

In this paper we describe a novel approach to programming microcontrollers based on the Arduino platform using Datalog as a clear and concise description language for system behaviors.

The application areas of cheap and easily programmable microcontroller platforms, like robotics, home automation, and IoT devices hold mainstream appeal and are often used as motivation in natural science and technology teaching. The choice of programming languages for microcontrollers is severely limited, especially with regard to rule-based declarative languages.

We use an approach that is based on the Dedalus language augmented with operations that allow for side-effects and we also take the limited resources of a microcontroller into account.

Our compiler and runtime environment allow to run Datalog programs on Arduino-based systems.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://github.com/frp-arduino/frp-arduino

  2. 2.

    https://github.com/ryansuchocki/microscheme

  3. 3.

    https://esphome.io/

  4. 4.

    https://www.arduino.cc

  5. 5.

    https://platformio.org/

  6. 6.

    As of November 2019.

  7. 7.

    github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/Arduino.h

  8. 8.

    https://www.arduino.cc/en/Main/Software

References

  1. Agatolio, F., Moro, M.: A workshop to promote Arduino-based robots as wide spectrum learning support tools. In: Merdan, M., Lepuschitz, W., Koppensteiner, G., Balogh, R. (eds.) Robotics in Education - Research and Practices for Robotics in STEM Education. AISC, vol. 457, pp. 113–125. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-42975-5_11

    Chapter  Google Scholar 

  2. 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

    Chapter  Google Scholar 

  3. Brass, S.: SLDMagic — the real magic (with applications to web queries). In: Lloyd, J., et al. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 1063–1077. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-44957-4_71

    Chapter  Google Scholar 

  4. Brass, S., Stephan, H.: Pipelined bottom-up evaluation of datalog programs: the push method. In: Petrenko, A.K., Voronkov, A. (eds.) PSI 2017. LNCS, vol. 10742, pp. 43–58. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-74313-4_4

    Chapter  Google Scholar 

  5. Eiter, T., Ianni, G., Schindlauer, R., Tompits, H.: A uniform integration of higher-order reasoning and external evaluations in answer-set programming. In: Kaelbling, L.P., Saffiotti, A. (eds.) IJCAI-05, Proceedings of the Nineteenth International Joint Conference on Artificial Intelligence, Edinburgh, Scotland, UK, 30 July–5 August 2005, pp. 90–96. Professional Book Center (2005). http://ijcai.org/Proceedings/05/Papers/1353.pdf

  6. Eiter, T., Subrahmanian, V.S., Pick, G.: Heterogeneous active agents, I: semantics. Artif. Intell. 108(1–2), 179–255 (1999). https://doi.org/10.1016/S0004-3702(99)00005-3

    Article  MathSciNet  MATH  Google Scholar 

  7. 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

    Chapter  MATH  Google Scholar 

  8. Grebe, M., Gill, A.: Haskino: a remote monad for programming the arduino. In: Gavanelli, M., Reppy, J. (eds.) PADL 2016. LNCS, vol. 9585, pp. 153–168. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-28228-2_10

    Chapter  Google Scholar 

  9. Halbwachs, N., Caspi, P., Raymond, P., Pilaud, D.: The synchronous dataflow programming language LUSTRE. In: Proceedings of the IEEE, pp. 1305–1320 (1991)

    Google Scholar 

  10. Helbling, C., Guyer, S.Z.: Juniper: a functional reactive programming language for the Arduino. In: Janin, D., Sperber, M. (eds.) Proceedings of the 4th International Workshop on Functional Art, Music, Modelling, and Design, FARM@ICFP 2016, Nara, Japan, 24 September 2016, pp. 8–16. ACM (2016). https://doi.org/10.1145/2975980.2975982

  11. Jordan, H., Scholz, B., Subotić, P.: Soufflé: on synthesis of program analyzers. In: Chaudhuri, S., Farzan, A. (eds.) CAV 2016. LNCS, vol. 9780, pp. 422–430. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41540-6_23

    Chapter  Google Scholar 

  12. 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 

  13. Martín-Ramos, P., da Silva, M.M.L., Lopes, M.J., Silva, M.R.: Student2student: Arduino project-based learning. In: García-Peñalvo, F.J. (ed.) Proceedings of the Fourth International Conference on Technological Ecosystems for Enhancing Multiculturality, Salamanca, Spain, 02–04 November 2016, pp. 79–84. ACM (2016). http://dl.acm.org/citation.cfm?id=3012500

  14. Russell, I., Jin, K.H., Sabin, M.: Make and learn: A CS principles course based on the arduino platform. In: Clear, A., Cuadros-Vargas, E., Carter, J., Túpac, Y. (eds.) Proceedings of the 2016 ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE 2016, Arequipa, Peru, 9–13 July 2016, p. 366. ACM (2016). https://doi.org/10.1145/2899415.2925490

  15. Schwarz, S., Wenzel, M.: Controlling Lego EV3 robots with Prolog. In: Seipel, D., Hanus, M., Abreu, S. (eds.) Declare 2017 - Conference on Declarative Programming, 31st Workshop on Logic Programming (WLP 2017) (2017). https://www.uni-wuerzburg.de/fileadmin/10030100/Publications/TR_Declare17.pdf

  16. Specht, E., et al.: Analysis of the use of declarative languages for enhanced embedded system software development. In: Petraglia, A., Pedroni, V.A., Cauwenberghs, G. (eds.) Proceedings of the 20th Annual Symposium on Integrated Circuits and Systems Design, SBCCI 2007, Copacabana, Rio de Janeiro, Brazil, 3–6 September 2007, pp. 324–329. ACM (2007). https://doi.org/10.1145/1284480.1284565

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mario Wenzel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wenzel, M., Brass, S. (2020). Declarative Programming for Microcontrollers - Datalog on Arduino. In: Hofstedt, P., Abreu, S., John, U., Kuchen, H., Seipel, D. (eds) Declarative Programming and Knowledge Management. INAP WLP WFLP 2019 2019 2019. Lecture Notes in Computer Science(), vol 12057. Springer, Cham. https://doi.org/10.1007/978-3-030-46714-2_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-46714-2_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-46713-5

  • Online ISBN: 978-3-030-46714-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics