4 ms·
Does anyone else have any war stories about using Prolog in their day jobs? It's a tool I'm always on the look out to use to simplify some of my more complex ta
by tlack 16y ago
Does anyone else have any war stories about using Prolog in their day jobs? It's a tool I'm always on the look out to use to simplify some of my more complex tasks, but so far I haven't had any luck in that regard.
- ciex 16y agoI am currently learning Prolog as part of my artificial intelligence class and as far as I know it's used in many contexts in ai research in my uni.
- porlw 16y agoI once had a huge pile of Oracle PL/SQL to take care of, which was written for performance rather than ease of maintenance and used a lot of session level global data. PL/SQL doesn't give you nice stack traces when you have an error, I just knew the entry point and the place where the error occurred. Even knowing the data coming in to the entry point, use of the globals meant that you often couldn't know for sure what route the code would take. I wrote a primitive PL/SQL parser (in Perl) to turn the call tree into Prolog rules, and then used Prolog to give me the possible routes between the entry point and the error location, making debugging much easier.
- tlack 16y agoWow, that sounds like a serious undertaking. How much PL/SQL are we talking about here? How long did writing the Perl -> Prolog solution take?
- porlw 16y agoI think it was about 60Mb of source, around 1000 packages and stand-alone procs. Basically the perl pulled a list of scoped function names from the DDL, did a text index on the executable code, and searched the index for references to those functions, creating a list of [from.function, to.function] pairs that I fed into prolog.
- MichaelSalib 16y agoAt a previous job, one of my coworkers implemented a fairly complex role-based access control system by linking a prolog interpreter to our application. Our problem domain was...very unusual, so this was probably the best solution.