This app converts the trace of SWI-Prolog into a readable interactive table. The following screenshots show a console output and the two versions of the corresponding table in the app. (This is the second example shown on the page.)
![]() | ![]() |
![]() |
The app is not quite ready for use in RL, because it does not recognize
infix operators.
E.g. alice\=clara
has been converted to \=(alice, clara)
to make the example above work.
The backend uses Django REST framework and the frontend is written in Vue.js.
The app can be found at prolog-trace.watchduck.net.
(The backend API is backend.prolog-trace.watchduck.net/trace.)
An important part of the backend is text_to_dicts.py, which is explained in text_to_dicts.md.
The formulas in the table cells can be represented in two ways:
Linear formulas with parentheses,
and little tables representing the tree structure.
The following screenshot shows the tree structure for a result in a common Prolog example about travel routes,
namely the question how to get from Valmont to Bangkok. (This is the fourth example shown on the page.)
![]() |
|
A proof of concept for these little tables is the separate tree_table app,
which uses the same backend.
It can be found at tree-table.watchduck.net.