Skip to main content Accessibility help

Using SWISH to Realize Interactive Web-based Tutorials for Logic-based Languages



Programming environments have evolved from purely text based to using graphical user interfaces, and now we see a move toward web-based interfaces, such as Jupyter. Web-based interfaces allow for the creation of interactive documents that consist of text and programs, as well as their output. The output can be rendered using web technology as, for example, text, tables, charts, or graphs. This approach is particularly suitable for capturing data analysis workflows and creating interactive educational material. This article describes SWISH, a web front-end for Prolog that consists of a web server implemented in SWI-Prolog and a client web application written in JavaScript. SWISH provides a web server where multiple users can manipulate and run the same material, and it can be adapted to support Prolog extensions. In this article we describe the architecture of SWISH, and describe two case studies of extensions of Prolog, namely Probabilistic Logic Programming and Logic Production System, which have used SWISH to provide tutorial sites.



Hide All

This research was partially supported by the VRE4EIC project, a project that has received funding from the European Union’s Horizon 2020 research and innovation program under grant agreement no. 676247. The SWISH implementation of LPS was developed under an EPSRC grant administered by Imperial College London. We thank the referees for their helpful comments.



Hide All
Alberti, M., Bellodi, E., Cota, G., Riguzzi, F. and Zese, R. 2017. cplint on SWISH: Probabilistic logical inference with a web browser. Intelligenza Artificiale 11, 1, 4764.
Bellodi, E. and Riguzzi, F. 2013. Expectation maximization over binary decision diagrams for probabilistic logic programs. Intelligent Data Analysis 17, 2, 343363.
Bellodi, E. and Riguzzi, F. 2015. Structure learning of probabilistic logic programs by searching the clause space. Theory and Practice of Logic Programming 15, 2, 169212.
Blackburn, P., Bos, J. and Striegnitz, K. 2006. Learn Prolog Now!, vol. 7. College Publications, London, UK.
Byrd, L. 1980. Understanding the control flow of Prolog programs. In Logic Programming Workshop. Department of Artificial Intelligence, University of Edinburgh, Debrecen, Hungary.
De Raedt, L. and Kimmig, A. 2015. Probabilistic (logic) programming concepts. Machine Learning 100, 1, 547.
De Raedt, L., Kimmig, A. and Toivonen, H. 2007. ProbLog: A probabilistic Prolog and its application in link discovery. In 20th International Joint Conference on Artificial Intelligence, Hyderabad, India (IJCAI-07), Veloso, M. M., Ed., vol. 7. AAAI Press, Palo Alto, California USA, 24622467.
Denecker, M. 2000. Extending classical logic with inductive definitions. In Computational logicCL 2000. Springer, Cham, 703717.
Di Mauro, N., Bellodi, E. and Riguzzi, F. 2015. Bandit-based Monte-Carlo structure learning of probabilistic logic programs. Machine Learning 100, 1, 127156.
Dries, A., Kimmig, A., Meert, W., Renkens, J., Van den Broeck, G., Vlasselaer, J. and De Raedt, L. 2015. Problog2: Probabilistic logic programming. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2015, Porto, Portugal, 7–11 Sept. 2015, Proceedings, Part III, Bifet, A., May, M., Zadrozny, B., Gavalda, R., Pedreschi, D., Bonchi, F., Cardoso, J. and Spiliopoulou, M., Eds. Springer International Publishing, Cham, 312315.
Fierens, D., den Broeck, G. V., Renkens, J., Shterionov, D. S., Gutmann, B., Thon, I., Janssens, G. and De Raedt, L. 2015. Inference and learning in probabilistic logic programs using weighted Boolean formulas. Theory and Practice of Logic Programming 15, 3, 358401.
Flach, P. 1994. Simply Logical: Intelligent Reasoning by Example. Wiley, Chichester, UK.
Gandrud, C. 2013. Reproducible Research with R and R Studio. CRC Press, Boca Raton, FL.
Knuth, D. E. 1984. Literate programming. The Computer Journal 27, 2, 97111.
Kowalski, R. and Sadri, F. 2015. Reactive computing as model generation. New Generation Computing 33, 1, 3367.
Kowalski, R. and Sadri, F. 2016. Programming in logic without logic programming. Theory and Practice of Logic Programming 16, 3, 269295.
Kowalski, R. and Sergot, M. 1986. A logic-based calculus of events. New Generation Computing 4, 1, 6795.
Lager, T. and Wielemaker, J. 2014. Pengines: Web logic programming made easy. TPLP 14, 4–5, 539552.
Nguembang Fadja, A. and Riguzzi, F. 2017. Probabilistic logic programming in action. In Towards Integrative Machine Learning and Knowledge Extraction, Holzinger, A., Goebel, R., Ferri, M. and Palade, V., Eds., vol. 10344. Springer, Heidelberg, Germany.
Riguzzi, F. 2013. MCINTYRE: A Monte Carlo system for probabilistic logic programming. Fundamenta Informaticae 124, 4, 521541.
Riguzzi, F., Bellodi, E., Lamma, E., Zese, R. and Cota, G. 2016. Probabilistic logic programming on the web. Software: Practice and Experience 46, 10, 13811396.
Riguzzi, F. and Swift, T. 2013. Well-definedness and efficient inference for probabilistic logic programming under the distribution semantics. Theory Pract. Log. Program. 13, Special Issue 02 - 25th Annual GULP Conference (March), Cambridge University Press, 279302.
Rossant, C. 2013. Learning IPython for Interactive Computing and Data Visualization. Packt Publishing Ltd., Birmingham, UK.
Sato, T. 1995. A statistical learning method for logic programs with distribution semantics. In 12th International Conference on Logic Programming, Sterling, L., Ed. MIT Press, Cambridge, MA, 715729.
Sergot, M. J., Sadri, F., Kowalski, R. A., Kriwaczek, F., Hammond, P. and Cory, H. T. 1986. The British Nationality Act as a logic program. Communications of the ACM 29, 5, 370386.
Srinivasan, A., Muggleton, S., Sternberg, M. J. E. and King, R. D. 1996. Theories for mutagenicity: A study in first-order and feature-based induction. Artificial Intelligence 85, 1–2, 277299.
Vennekens, J., Verbaeten, S. and Bruynooghe, M. 2004. Logic programs with annotated disjunctions. In Logic Programming: 20th International Conference, ICLP 2004, Saint-Malo, France, 6–10 Sept. 2004. Proceedings, Demoen, B. and Lifschitz, V., Eds. LNCS, vol. 3132. Springer, Berlin, Heidelberg, Germany, 431445.
Wielemaker, J. and Anjewierden, A. 2007. PlDoc: Wiki style literate programming for Prolog. In Proceedings of the 17th Workshop on Logic-Based Methods in Programming Environments, Hill, P. and Vanhoof, W., Eds. Cornell University Library, Ithaca, NY, 1630.
Wielemaker, J., Huang, Z. and van der Meij, L. 2008. SWI-prolog and the web. TPLP 8, 3, 363392.
Worlfram, S. 2016. How to teach computational thinking.



Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed