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):
- 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.
Present tutorials
- CLP(FD) http://www.pathwayslms.com/swipltuts/clpfd/clpfd.html and http://mndrix.github.io/julian/index.html
- DCG http://www.pathwayslms.com/swipltuts/dcg/ and http://www.metalevel.at/dcg.html
- Modules http://michael.richter.name/tutorials/swiplmod
- Web Service http://www.swi-prolog.org/howto/http/
- Web Applications http://www.pathwayslms.com/swipltuts/html/index.html
Incomplete/outdated tutorials
Great tutorial that only need a bit of polishing to be ok to go.
- C++ <---> Prolog http://www.swi-prolog.org/howto/cpp-compiling.html
- ClioPatria http://cliopatria.swi-prolog.org/swish/pldoc/doc/home/swipl/src/ClioPatria/ClioPatria/web/tutorial/Piracy.txt
- Getting started http://www.swi-prolog.org/pldoc/man?section=quickstart
- Debugger http://www.swi-prolog.org/pldoc/man?section=debugoverview
- Dynamic DB http://www.swi-prolog.org/howto/database.html
- IDE (XPCE)
- Graphical tracer http://www.swi-prolog.org/gtrace.html
- Profiler http://www.swi-prolog.org/profile.html
- Cross referencer http://www.swi-prolog.org/gxref.html
- Navigator http://www.swi-prolog.org/navigator.html
- Editor http://www.swi-prolog.org/PceEmacs.html
- Java <---> Prolog http://www.swi-prolog.org/pldoc/jpl/java_api/index.html
- Packs http://www.swi-prolog.org/howto/Pack.html
- plDoc 1.0 http://chiselapp.com/user/ttmrichter/repository/swipldoctut/doc/tip/doc/tutorial.html
- RDF applications http://cliopatria.swi-prolog.org/tutorial/Parsia/
- RDF prefixes http://www.swi-prolog.org/howto/UseRdfMeta.html
- Web scraping http://www.swi-prolog.org/howto/scrape/
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.
http://www.ida.liu.se/~TDDD08/misc/clpfd.pdf
is password protected