I used SWI-Prolog during an internship for the local city government over 20 years ago, we were developing an application where you could load a city map with streets and bus stops as a graph and it would determine the best routes within two points by car, bus or foot. Pretty much a primitive version of what modern map/GPS apps do. I don't remember which algorithms we used but it involved lots of backtracking, so Prolog was deemed the ideal choice for the routing engine.
It wasn't a pleasant experience, while I understood the fundamentals of the language quite well, once the dreaded "cuts" entered the picture it became impossible for me to follow the different paths within the code. In the end it kind of "worked" for bus and walking routes but the driving ones would almost certainly fail due to the one way streets. In the end it seems they got more talented/experienced developers to work on it since about a year after I left they released a somewhat decent version to the public in their website.
I haven't gone back to Prolog or declarative programming in general since then, it may be the "elegant" way to solve certain problems but good old imperative languages are much easier to maintain and debug.