Thanks for the responses everyone
I made a small detour to Unison but I’d like to do some more Prolog before the end of the month.
I’ll check out the resources you mentioned. I did look at “Learn Prolog Now!” but maybe I dismissed it too quickly.
One thing I did learn in the meanwhile and seems to be really useful is the trace
command in SWIPL. When you activate it you get a step-by-step walk through of a query. For example for this reverse list “function” (don’t know the correct Prolog name for it):
[trace] ?- reverse_list([1,2,3], [], K).
Call: (10) reverse_list([1, 2, 3], [], _278150) ? creep
Call: (11) reverse_list([2, 3], [1], _278150) ? creep
Call: (12) reverse_list([3], [2, 1], _278150) ? creep
Call: (13) reverse_list([], [3, 2, 1], _278150) ? creep
Exit: (13) reverse_list([], [3, 2, 1], [3, 2, 1]) ? creep
Exit: (12) reverse_list([3], [2, 1], [3, 2, 1]) ? creep
Exit: (11) reverse_list([2, 3], [1], [3, 2, 1]) ? creep
Exit: (10) reverse_list([1, 2, 3], [], [3, 2, 1]) ? creep
K = [3, 2, 1].
Have you identified any specific obstacles?
With the logic puzzle exercises (“Garden Party”, “Cheryl’s Birthday” and “Floored”) I simply don’t know how to start approaching the problem, even if I know the answer to the riddle like in Cheryl’s Birthday (because it’s explained on Wikipedia).
The few community solutions these exercises have all look very different, and to me quite complicated. No idea how you would start approaching such exercises, how to solve them using lists and such.
(I’m still hoping Erik will make a Prolog video to learn about his thought process.)
I have to admit I haven’t tried to solve more “traditional” Exercism exercises with Prolog yet because I thought these logic ones would be really suitable for learning a logic based language.