←back to thread

Use Prolog to improve LLM's reasoning

(shchegrikovich.substack.com)
379 points shchegrikovich | 1 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(11): >>41874164 #>>41874229 #>>41874594 #>>41874985 #>>41875196 #>>41875236 #>>41876524 #>>41876589 #>>41876880 #>>41878634 #>>41882848 #
cmrdporcupine ◴[] No.41874229[source]
So why Prolog in particular and not another logic language like Mercury or Oz/Mozart etc?
replies(3): >>41874625 #>>41874708 #>>41875287 #
jfengel ◴[] No.41874708[source]
"Prolog" is like Lisp, a wide array of superficially similar languages that actually are quite diverse.

Mind you, in that sense, Java and C# are more or less the same language, which has Prolog programmers nodding their heads and Java and C# developers screaming.

replies(1): >>41877454 #
tannhaeuser ◴[] No.41877454[source]
Nope. Prolog is an ISO-standardized language since 1995 and the spec was updated in 2012. Where older "legacy" Prolog implementations such as SWI, YAP, and SICStus are deviating from the standard is generally pretty well-known to Prolog practitioners, and the convener of ISO 13211 actually can verify claims of ISO conformance; for example, [1] is a link to the ISO certification of Quantum Prolog (the web app at [2]).

It's true however that people are quick to conflate Prolog with constraint-logic programming libs, "expert systems" (RETE-style forward-chainging systems and other "rule engines"), or random "functional-logic" programming languages. The misunderstanding of Prolog and logic by Lisp programmers has been ongoing since the 1980s, probably because at one point Prolog and Lisp were seen as competing "languages for AI" for some reason even though they have very little in common.

[1]: http://www.complang.tuwien.ac.at/ulrich/quantum-prolog/

[2]: https://quantumprolog.sgml.net

replies(4): >>41877591 #>>41878414 #>>41879294 #>>41879595 #
1. samatman ◴[] No.41879595{3}[source]
You are referring to 'Prolog', replying to a post referring to '"Prolog"'.

Your constraint system is missing a clause ;-)