SWI-Prolog / roadmap

Discuss future development
20 stars 3 forks source link

Integrating parts of GUPU in SWISH #19

Closed triska closed 4 years ago

triska commented 8 years ago

GUPU is an extensive and excellent teleteaching environment for Prolog, written by Ulrich Neumerkel.

For more information, see:

http://www.complang.tuwien.ac.at/ulrich/gupu/

For a pictorial overview, see:

http://www.complang.tuwien.ac.at/ulrich/gupu/d-2-europastadt-dax

GUPU contains dozens of specialized reasoners and meta-interpreters to prove (non-)termination of student programs. It can generate failure slices and explanations that contrast program results with expected results by reference implementations.

I will work on incorporating ideas from GUPU in SWI-Prolog and SWISH to make Prolog easier to teach. With some luck, even some of the code can be ported to SWI-Prolog. A good first impulse in this direction is library(diadem), generously contributed by Ulrich Neumerkel.

I wrote SWI's library(clpfd) and library(clpb) to make all of this possible. Please contact me if you want to work on this item. All contributions are highly welcome!

wouterbeek commented 8 years ago

Hi Markus, do I understand this issue correctly in that "GUPU on SWISH" could provide a sandbox for studying Prolog? If this is the case then it may be worthwhile to see whether some of the tutorial can be implemented inside "GUPU on SWISH".

triska commented 8 years ago

Definitely! GUPU is a tutorial on steroids: GUPU goes far beyond what is currently possible with SWISH notebooks, which by themselves are already a nice thing to have.

GUPU is able to produce explanations, and in this sense mimics a skilled Prolog instructor: It automatically points students to code snippets that necessarily must be changed to fix mistakes in the code, contrasting student-supplied code with reference implementations and assertions that you know must hold with a correct implementation. It can also automatically give counter-examples to assertions that are false, and guides students to think in declarative terms, contrasting generality of different queries, assertions and Prolog programs.

Using failure slices, GUPU also shows you minimal parts of your program that already by themselves cause nontermination. For this, it also makes extensive use of CLP(B) constraints and cTI in the background.

Beyond that, GUPU includes dozens of built-in visualizations that truly show students the immense potential and versatility of logic programming. Among the examples I find most impressive are fractals, construction planning, DNA sequencing and CPU scheduling.

So yes, SWISH tutorials would definitely benefit from GUPU running in the background. In their current state, SWISH notebooks let you run predefined code snippets, which is nice. GUPU also allows that, but goes much further: It truly guides students to build their own solutions to given (predefined) tasks, and explains to them what is wrong when they make mistakes.

JanWielemaker commented 8 years ago

I'm all in favour! GUPU on the web might be a real killer app for educational usage. It makes GUPU available to anyone everywhere without installation and with a modern-looking interface. It demonstrates that you can write real stuff in Prolog (SWISH+GUPU) and that declarative programming can help education.

wouterbeek commented 8 years ago

This issue interacts with #10 (tutorials).

triska commented 8 years ago

Yes, this is definitely connected with #10: Everyone who intends to dedicate a serious amount of work towards tutorials is well advised to first check out the state of the art of intelligent tutoring systems like GUPU for teaching Prolog. For tutorials, having the GUPU machinery in place can save a lot of work for authors, and be of greater help to students.

Thus, to encourage a more vivid terminology, I consider GUPU a vitalizing app for Prolog education.

Moreover, GUPU-style functionality also helps with regular Prolog development, since it can be used as a declarative debugger. For example, GUPU can show you code snippets that by themselves already cause unintended satisfaction of a negative assertion.

To really spread declarative Prolog programming and constraints, this is the roadmap item that I consider most relevant strategically, and the prospect to get parts of GUPU running in SWI and (now) SWISH was the driving force behind most of my contributions to SWI. I think subsets of this issue would be really nice student projects, up to Master's theses. Also connected is #18.

Anniepoo commented 8 years ago

Maybe I'm being blind, but I'm not finding a download link for GUPU.

roschler commented 8 years ago

Any updates on this project?

triska commented 8 years ago

This is a longer-term project (10+ years), and will be the culmination of all (more) recent developments in SWI-Prolog. #18 must be solved before we can start working on GUPU-like functionality. #14 and #27 should also be solved first.

To get a glimpse of the GUPU functionality, see for example this generalization, answering a typical student question: The program unexpectedly fails, and we need to find out why. GUPU, among many other features, generates such generalizations automatically, showing you the parts of the program that contain the mistake.

Currently, I am still busy with CLP(B) and its implementation description in order to port cTI to SWI-Prolog. At the same time, I want to improve GUPU itself, and therefore work on CLP(Z).

I you want to help with this and have some experience with web-based applications, I suggest you check out #21, because such animations help students a lot and they are also an integral part of GUPU.

haskie-lambda commented 2 years ago

@triska is there any reason this is closed? also how far did the project actually go?

triska commented 2 years ago

Ulrich no longer contributes to SWI-Prolog due to its radical departure from the Prolog ISO standard, therefore GUPU cannot be ported to SWI-Prolog. Please see this document for more information:

https://www.complang.tuwien.ac.at/ulrich/iso-prolog/SWI7_and_ISO

As to how far this project went: From 2006 to 2012, Ulrich filed more than 600 issues in order to improve SWI-Prolog with the goal of getting it ready to run GUPU. These issues are available from:

https://www.complang.tuwien.ac.at/ulrich/swi-prolog/