I would be gladly writing a lot of stuff in a Prolog-like language if there was a dialect that separated rule construction from traversal manipulation. This is such an obvious thing. I should be able to construct a set of rules and then say "but this time, ignore this branch" (without changing the tree with cuts). Or something like "do depth-first for up to 1000 levels and give me the incomplete set of answers".
In SQL you don't change the database simply because you want to run a different query. You manipulate the query, the indices and the query hints.