Never got around to learning Prolog, even though I was always interested. what would be a good excuse to do so now?
items = fetch_list_from_db()
for item in items:
if item.match(param):
..
elif item.whatever > param2 || item.override:
..
else:
some_default_behavior()
return custom_sort_thing(results)
In each instance, the logic is critical to business function and frequently evolving, but often underspecified, hard to audit, and each case has its own little missing features.Prolog allows me to very easily state these rules in a way others can understand at a glance and keep them separate from the operational code. Best of it all, it solves for all possible answers (or all inputs for a given answer) without implicitly stating very much looping or recursion - even less so than functional languages in some cases.
EDIT: IMHO one should learn it just to get introduced into the mindset of declarative programming. You can implement a sufficiently fast and complete prolog easily in any language if that allows for a clearer solution to a specific problem than explicit specification of control flow.