Source-linked AI summary
Simply Logical -- The First Three Decades
Peter Flach, Kacper Sokol, Jan Wielemaker
TL;DR
Interactive Prolog teaching requires browser-based execution that supports more than batch interaction, while server-side execution also brings portability and infrastructure concerns. The paper traces how browser technologies and modular authoring workflows are used to develop interactive Prolog learning materials. It concludes that in-browser Prolog is probably the future of Prolog on the web, especially for education.
Problem
Realising the book’s teaching philosophy requires interactive in-browser Prolog, while server-side execution can be difficult to sustain and SWISH is practically not portable to other Prolog implementations.
Source: §2 · p. 2, §4 · pp. 8–9Method
Results
Running Prolog in the browser as a static file allows storage and chat services to be offloaded to cloud services and supports a distributed infrastructure across Prolog implementations.
Source: §4 · p. 9Takeaways & Limitations
The authors conclude that in-browser Prolog is probably the future of Prolog on the web, especially for education, alongside tools such as SWISH and an envisaged authoring suite.
Source: §4 · p. 9Server-side execution requires a complex, non-standard service, significant compute resources, continuous maintenance, and sustained funding.
Source: §4 · p. 8
Abstract
from arXiv · showhide
This paper charts the evolution of the Prolog textbook Simply Logical -- Intelligent Reasoning by Example from print with runnable programmes on a 3.5-inch diskette published in 1994, via various intermediate online versions, to the fully interactive online edition available today. Our aim is to investigate -- from both the writer's and the reader's perspectives -- the potential impact of technology on educational materials. The three authors of this paper present three distinct and complementary points of view, which come together to shape an interactive online book that offers an immersive learning experience. Peter describes the philosophy behind the original book and experiences teaching from it. Jan demonstrates how contemporary web programming has enabled a fully interactive realisation of the book's philosophy. Kacper reports how different technologies can be adopted to build a versatile authoring toolkit that underpins the interactive online edition of the book. Collating these distinct yet coherent perspectives allows us to reflect on future opportunities for interactive Prolog teaching materials arising from the continuous development of web technologies. The insights we offer should be of interest to teachers of Prolog as well as those wanting to find out about the latest educational technologies.
1 The Paperback
Simply Logical grew from Prolog teaching materials into a book focused on intelligent reasoning, using programmes to teach by example. Its original philosophy joins showing techniques through runnable code with learning by doing.
1 The Paperback
- Lecture notes built from practical Prolog exercises and coursework eventually became Simply Logical – Intelligent Reasoning by Example.Source: §1 · p. 1
- Each AI technique was paired with a Prolog programme, whose execution and declarative reading supported learning by doing and understanding the technique.More elaborate programmes were developed step by step, with key issues explained along the way.Source: §1 · p. 2
- The book focused on forms of reasoning rather than attempting to cover all of AI, including deductive, inductive, natural-language, and incomplete-information reasoning.Source: §1 · p. 2
- Peter continued using the book to introduce logic programming and AI, while modernising demonstrators and assignments rather than the text.Examples include a resolution prover for breadth-first search and a Chapter 7 question-answering programme developed into an Amazon Alexa skill.Source: §1 · p. 2
2 Interactive Prolog in the Browser
Interactive browser execution is central to realizing Simply Logical’s philosophy. The section compares ways to run Prolog online and describes how SWISH supports both classroom use and interactive learning materials.
2 Interactive Prolog in the Browser
- Server sandboxes typically offer batch-style interaction, while dedicated Prolog web services and in-browser execution are more suitable for interactive educational resources.Examples include SWISH, JavaScript Prolog systems such as Tau-Prolog, and Prolog compiled to JavaScript or Web Assembly.Source: §2 · pp. 2–3
- SWISH executes queries in a sandboxed server thread and temporary module, supporting client interaction such as reading input, requesting alternatives, and tracing.Its interface also provides semantic highlighting, predicate feedback, and template insertion.Source: §2 · p. 3
- Since its 2014 launch, SWISH has become a widely used Prolog learning and sharing resource, hosting over 150,000 programmes and nearly 15,000 notebooks by December 2022.It sustains hundreds of concurrent users on average, peaking above one thousand, and teachers use notebooks for course materials and exercises.Source: §2 · pp. 3–4
- A rewriting proxy made Learn Prolog Now! interactive by connecting programme and query fragments to embedded SWISH instances, but acceptable programmatic identification proved infeasible, prompting manual identification for Simply Logical.The proxy parsed source pages, rewrote code fragments into HTML elements, and injected JavaScript to make code boxes interactive.Source: §2 · p. 4
3 The Online Edition(s)
The online edition developed from a static release into an interactive book and then a modular authoring system. Its current toolkit supports reusable educational content and interactive Prolog materials across several languages.
3 The Online Edition(s)
- The first interactive release paired editable code with pre-populated queries and an answer pane, bringing the book’s teaching philosophy into practice through SWISH code boxes.A code listing can be opened as an interactive box by pressing its play button.Source: §3 · pp. 4–5, Figure 1 · p. 5
- HTML was limiting for authoring, while an annotated bespoke prototype made the workflow overly complicated; Jupyter Book later supported modular content but needed a custom SWISH code-box plugin.The book’s varied text, figures, and code listings motivated the effort to separate content into reusable building blocks.Source: §3 · p. 6
- The third online edition uses Jupyter Book and bespoke extensions to organize the book into reusable text, exercise, solution, code, and figure files.The materials are published under a Creative Commons BY-NC-SA licence for reuse and adaptation in courses and other educational resources.Source: §3 · p. 6
- The released extensions embed interactive SWI-Prolog and cplint code boxes and provide analogous ProbLog functionality through its online execution environment.The extensions were built for Jupyter Book and also work with Sphinx.Source: §3 · p. 6
- Markdown-based SWISH code boxes can load programmes and queries, import code from other boxes or files, and hide embedded example queries before launch.The format uses specially formatted Markdown blocks with optional parameters for supplying or importing queries and code.Source: §3 · p. 7
- Templates for Prolog, cplint, and ProbLog let authors fork repositories to adapt static resources or create new teaching materials in minutes.The earlier online releases followed the 2007 PDF release and a 2015 pilot conversion of the original source to HTML.Source: §3 · pp. 4, 7
4 Discussion and Outlook
The discussion argues for browser-based Prolog and versatile authoring tools as directions for interactive teaching materials. It also identifies constraints in server-side execution, browser control flow, and cross-query state.
4 Discussion and Outlook
- A prototype unified-source workflow generates online documents, slides, and computational notebooks; Quarto is described as a more powerful realization.Quarto supports authoring in Markdown or Jupyter Notebooks and publishing in multiple formats, including HTML, PDF, MS Word, and EPUB.Source: §4 · p. 8
- The ideal authoring environment lets authors focus on content without initially considering delivery format, but limited interactivity and compute access constrain online code examples.The authors identify the need for compute resources as one reason educational resources on the Internet have limited interactivity.Source: §4 · p. 8
- Server-side execution remains a complex, non-standard service requiring significant compute resources, continuous maintenance, and sustained funding.SWISH had moved from one server to two at different locations, but load balancing was still missing.Source: §4 · p. 8
- SWISH’s stateless queries cannot use clauses asserted in a previous query, but fresh query environments make executions fully reproducible.The clauses must be both asserted and used in the same query.Source: §4 · pp. 8–9
- Browser control flow cannot wait synchronously for input; WebWorkers or yielding and resuming Prolog when events arrive are proposed alternatives.The authors note that WebWorker interaction resembles remote-server Prolog, whereas pure JavaScript or yielding Prolog offers another interface design.Source: §4 · p. 9
- Browser execution can offload SWISH storage and chat services to cloud services, supporting distributed infrastructure across several Prolog implementations.Diversification matters because SWISH’s use of SWI-Prolog-specific features makes it practically non-portable to other Prolog implementations.Source: §4 · p. 9
- The authors conclude that in-browser Prolog, combined with an envisaged authoring suite, could offer immersive Prolog teaching and learning materials.They describe SWISH as suited to collaborative interactive coding and programmatic access to shared data sets, while noting that its limitations affect dependent tools and resources.Source: §4 · p. 9