SWI-Prolog/roadmap

Tutorials

Opened this issue · 4 comments

The SWI Web site needs three ways of describing each library/topic (a topic may involve multiple libraries, e.g., the topic "Building industry-strength Web Services" will inevitable involve multiple libraries):

  1. A short, high-level description. What it is / what it does. This should interest the Future Prolog User.
  2. A tutorial that explains the basics in easy yet cool examples.
  3. A detailed documentation of all the public predicates, options, theoretical and practical considerations.

Present tutorials

Incomplete/outdated tutorials
Great tutorial that only need a bit of polishing to be ok to go.

Missing tutorials

  • All-solutions (setof, bagof, findall and friends)
  • Arithmetic, with CLP(FD)
  • Assert/retract
  • Command-line options
  • Foreign language interface
  • Initialization & at-halt
  • Messages (print_message, debug, logging, message handling)
  • Meta-predicates (maplist and friends, meta_predicate declarations)
  • Options
  • Persistent DB
  • Pure Prolog
  • Semantic Web
  • Setting up an industry-strength Prolog project (settings, logging, monitoring, DB persistence, DB backup)
    ** Logging
    ** Settings
  • SWISH
  • SWISH IDE
  • Threads

Other useful tutorials:

  • print_message, debug, logging, message handling
  • all-solutions (setof, bagof, findall and friends)
  • foreign language interfaces
  • suggestions for teaching Prolog
    • Cliopatria (eg update of Pirates tutorial)
    • pldoc - There is one, but Michael Richter's version relevant to the old pldoc 1.0 was much better, maybe we can update it.

Additional incomplete tutorials:

  • Setting up a prolog project, settings, logging, 'making it industrial strength'

[Thanks for the input! This is now integrated into the issue. -- Wouter]

I agree wholeheartedly with:
The SWI Web site needs three ways of describing each library/component:

A short, high-level description. What it is / what it does. This should interest the Future Prolog User.
A tutorial that explains the basics in easy yet cool examples.
A detailed documentation of all the public predicates, options, theoretical and practical considerations.

My only comment would be that there's not a bijection between library/component and tutorial topic in some cases.

[Thanks for the input! This is now integrated into the issue. -- Wouter]

Great list Wouter!

Regarding CLP(FD), here are some excellent resources:

A CLP(FD) tutorial by Ulf Nilsson

http://ima.udg.es/Docencia/3105IG0017/clpfd.pdf

All code examples work with SWI-Prolog after at most minimal adaptations (like replacing domain/3 by ins/2). This is the tutorial that motivated me to implement cumulative/2 and circuit/1 in SWI's library(clpfd), so that users can reproduce all results shown in this tutorial.

High performance declarative programming (lecture notes)

https://github.com/szarnyasg/ndp

For CLP(FD), see in particular: https://github.com/szarnyasg/ndp/blob/master/clp5.tex

These notes cover many more language elements that are SICStus-specific, but some examples are still useful also in the context of SWI-Prolog.

In my view, the only shortcoming of these two documents is that they do not yet push CLP(FD) to its ultimate consequence, namely as a general substitute for all integer arithmetic. However, they are great for the combinatorial part.

The CLP(FD) documentation itself separates the declarative integer and combinatorial aspects to stress the former point:

http://eu.swi-prolog.org/man/clpfd.html

Great usage examples of CLP(FD) constraints

The following examples nicely demonstrate how CLP(FD) constraints are meant to be used for integer arithmetic in modern Prolog code, increasing generality and allowing a completely declarative reading in many situations that also makes Prolog easier to teach and understand:

patch.pl by Michael Hendricks

movement.pl by Erik Peldan

The calendar example by Michael Hendricks, which you already linked to, is also a great.