triska / the-power-of-prolog

Introduction to modern Prolog
https://www.metalevel.at/prolog
1.21k stars 75 forks source link

A useful chapter - getting started tutorial #46

Open dougransom opened 8 months ago

dougransom commented 8 months ago

I think a useful chapter would be a getting started tutorial.

Start with a working program that does something, using have a dozen predicates with two clauses each. p1 :- .... p2 :- ... p3 :- ... ... p6 :-...

Exercises, get used to the syntax errors in your toplevel:

Next exercise: repeat with a DCG example.

Show how to use some debugging features of scryer.

Show how to put a testcase in the file, so when you consult, you can easily run the example.

Next exercise:

A few examples of predicates, like integer, -> , dif, etc, that the reader might want to use later.