Implementing Logic Programming
23 points by veqq
23 points by veqq
There was quite a lot of research about logic programming back in the 80s and early 90s, around the first AI boom. A while back I picked up used copies of, Implementations of Prolog and Parallel Logic Programming, as well as a book on Strand, an Expert Systems book, and an old, second edition version of “Programming with Prolog”. A lot of people think of concurrency and parallelism as modern topics, but they were running Prolog on 16 core machines in the late 80s.
Unfortunately I haven’t found much use for logic programming yet. One of the books even says, “If you know an algorithm, use that, otherwise Prolog may be a suitable alternative”, although it wasn’t as blunt about it. The dirty secret seems to be that logic programming is basically a glorified search through the solution space. It’s handy to have available, but probably not the most efficient technique. The books still cover a lot of useful techniques that can be used outside of logic programming, but logic programming itself seems limited, IMO.
Are there any attempts to use LLMs and modern AI combined with logic programming? One downside of logic programming is the neccesity of entering all of the rules… if those came from LLM training data somehow, I could see if being a lot more useful. Is that basically what ChatGPT and OpenAI are doing? Or what if ChatGPT generated the rules for an expert system? A kind of hybrid approach where the AI generates the rules and human experts double check them.
One interesting ability of Expert Systems, (and to an extent Prolog), is the ability to explain its reasoning by showing the rules and inferences made. That’d be a great feature for modern AI to adopt.
Prolog is sometimes used for rules systems today. Gerrit used to let you configure the rules about what could be merged in Prolog. (E.g. needs two +1, no -1, plus validation from CI.)
I also recently went back to Prolog to experiment with parsing. It went fairly well.
I think I read some paper about making LLM solve some kinds of puzzles by translating them into Prolog programs. I can imagine it could work reasonably well.
My baby is a custom logic programming setup for equity valuation. The use case is basically weighing different predictions. Given an amount of data, you can encode different analyses. If the majority vote yes (and nothing decisively says no) it will act. The number of votes change according to past success and many “analyses” are fuzzed patterns. There is no specific algorithm/model here.
glorified search through the solution space
I once read that Norvig turned everything into a search problem. I quite like that style!
attempts to use LLMs and modern AI combined with logic programming
I don’t use/know LLMs but there are other forms of generative AI, genetic algorithms etc. which are thriving too. Look up neuro-symbolic AI. I am a big fan of annotated logic for the logic side and have been integrating PyReason’s approach with my own. You can do wonders with time series and cross-sectional data, using gofai as a filter to shrink the problem space for inference.
http://www.korns.com/ does similar work, also building it out of Common Lisp.