←back to thread

Use Prolog to improve LLM's reasoning

(shchegrikovich.substack.com)
232 points shchegrikovich | 3 comments | | HN request time: 0s | source
Show context
z5h ◴[] No.41873798[source]
i've come to appreciate, over the past 2 years of heavy Prolog use, that all coding should be (eventually) be done in Prolog.

It's one of few languages that is simultaneously a standalone logical formalism, and a standalone representation of computation. (With caveats and exceptions, I know). So a Prolog program can stand in as a document of all facts, rules and relations that a person/organization understands/declares to be true. Even if AI writes code for us, we should expect to have it presented and manipulated as a logical formalism.

Now if someone cares to argue that some other language/compiler is better at generating more performant code on certain architectures, then that person can declare their arguments in a logical formalism (Prolog) and we can use Prolog to translate between language representations, compile, optimize, etc.

replies(7): >>41874164 #>>41874229 #>>41874594 #>>41874985 #>>41875196 #>>41875236 #>>41876524 #
dmead ◴[] No.41874164[source]
It's taken ages for anything from functional programming to penetrate general use. Do you think uptake of logic stuff will be any faster?
replies(1): >>41874609 #
1. johnnyjeans ◴[] No.41874609[source]
Prolog (and logic programming in general) is much older than you think. In fact, if we take modern functional programming to have been born with John Backus' Turing Award presentation[1], then it even predates it.

Many advancements to functional programming were implemented on top of Prolog! Erlang's early versions were built on top of a Prolog-derived language who's name escapes me. It's the source of Erlang's unfamiliar syntax for more unlearned programmers. It's very much like writing Prolog if you had return values and no cuts or complex terms.

As for penetrating general use, probably not without a major shift in the industry. But it's a very popular language just on the periphery, even to this day.

[1] - https://dl.acm.org/doi/10.1145/359576.359579

replies(1): >>41875216 #
2. dmead ◴[] No.41875216[source]
Did you just answer me with chatgpt?
replies(1): >>41875549 #
3. hydrolox ◴[] No.41875549[source]
definitely not how chat gpt writes