Real World Programming in SWI-Prolog
I love Prolog -- the problem I find is that it makes hard stuff easy, but things that should be easy, hard - most of which comes from abuse of backtracking. When you realize that default Prolog SLD resolution is just a depth-first search and that every predicate you define really has a implicit &quot;foreach&quot; in front of it, it&#x27;s easier to wrap your brain around. To get efficiency however, you need to embrace logical vars and use them as &quot;holes&quot; in data-structures (such as diff-lists) that will be filled in later, which does require some restructuring of your thinking sometimes.