logoalt Hacker News

lynx2311/07/20243 repliesview on HN

Do you have a suggestion on where to / how to start learning Prolog beyond towers-of-hanoi? Prolog is basically the last language on my list of things I want to look at, but whenever I tried, I failed to find anything practical to do/try.


Replies

dbcurtis11/07/2024

Try a rules-based synthesis problem. Prolog style (put simplisticly) is to write down what is true about a solution, and turn the search engine loose. Prolog is still procedural, unfortunately, so practical Prolog requires understanding the search algorithm. A suggestion: produce the XY locations of the nails for a building-code-compliant nailing pattern for a panel of plywood roof sheathing. Allow different stud spacing and wind speed zones. This is a small toy problem but will channel your thought process toward something Prologgy.

show 1 reply
amock11/07/2024

I’ve enjoyed https://www.metalevel.at/prolog but I’m not a Prolog Programmer.

show 1 reply
lordwarnut11/08/2024

I have been going through https://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/pro...

It starts out pretty easy but gets harder and requires more thought. It has different sections on things like list processing or graph problems.