Live data from Hacker News

Learn Prolog Now (2006)

lpn.swi-prolog.org

61–70 of 251 posts

Re: Learn Prolog Now (2006)

#62

I am once again shilling the idea that someone should find a way to glue Prolog and LLMs together for better reasoning agents. https://news.ycombinator.com/context?id=43948657 Thesis: 1. LLMs are bad at counting the number of r's in strawberry. 2. LLMs are good at writing code that counts letters in a string. 3. LLMs are bad at solving reasoning problems. 4. Prolog is good at solving reasoning problems. 5. ??? 6. LLM…

> "4. Prolog is good at solving reasoning problems." Plain Prolog's way of solving reasoning problems is effectively: for person in [martha, brian, sarah, tyrone]: if timmy.parent == person: print "solved!" You hard code some options, write a logical condition with placeholders, and Prolog brute-forces every option in every placeholder. It doesn't do reasoning . Arguably it lets a human express reasoning problems bet…

What makes you think your brain isn't also brute forcing potential solutions subconciously and only surfacing the useful results?

Re: Learn Prolog Now (2006)

#63

Earlier quoted context omitted.

That is where Lisp or Scheme weirdly shines. It is incredibly easy to add prolog to a Lisp or a Scheme. It’s almost as if it comes out naturally if you just go down the rabbit hole. “The little prover” is a fantastic book for that. The whole series is.

I worked through the little scheme but not the little prover, I think Ill take a look at that. Thanks.

One can of course add the same stuff to other languages in form of libraries and stuff, but lisp/scheme make it incredibly easy to make it look like part of the language itself and make seem a mere extension of the language. So you can have both worlds if you want to. Lisp/scheme is not dead.

In fact, in recent years people have started contributing again and are rediscovering the merits.

Re: Learn Prolog Now (2006)

#64

I am once again shilling the idea that someone should find a way to glue Prolog and LLMs together for better reasoning agents. https://news.ycombinator.com/context?id=43948657 Thesis: 1. LLMs are bad at counting the number of r's in strawberry. 2. LLMs are good at writing code that counts letters in a string. 3. LLMs are bad at solving reasoning problems. 4. Prolog is good at solving reasoning problems. 5. ??? 6. LLM…

@goblinqueen, you around?

Re: Learn Prolog Now (2006)

#65
post #62

Earlier quoted context omitted.

> "4. Prolog is good at solving reasoning problems." Plain Prolog's way of solving reasoning problems is effectively: for person in [martha, brian, sarah, tyrone]: if timmy.parent == person: print "solved!" You hard code some options, write a logical condition with placeholders, and Prolog brute-forces every option in every placeholder. It doesn't do reasoning . Arguably it lets a human express reasoning problems bet…

What makes you think your brain isn't also brute forcing potential solutions subconciously and only surfacing the useful results?

Can you try calculating 101 * 70 in your head?

Re: Learn Prolog Now (2006)

#66

I am once again shilling the idea that someone should find a way to glue Prolog and LLMs together for better reasoning agents. https://news.ycombinator.com/context?id=43948657 Thesis: 1. LLMs are bad at counting the number of r's in strawberry. 2. LLMs are good at writing code that counts letters in a string. 3. LLMs are bad at solving reasoning problems. 4. Prolog is good at solving reasoning problems. 5. ??? 6. LLM…

We've done this, and it works. Our setup is to have some agents that synthesize Prolog and other types of symbolic and/or probabilistic models. We then use these models to increase our confidence in LLM reasoning and iterate if there is some mismatch. Making synthesis work reliably on a massive set of queries is tricky, though.

Imagine a medical doctor or a lawyer. At the end of the day, their entire reasoning process can be abstracted into some probabilistic logic program which they synthesize on-the-fly using prior knowledge, access to their domain-specific literature, and observed case evidence.

There is a growing body of publications exploring various aspects of synthesis, e.g. references included in [1] are a good starting point.

[1] https://proceedings.neurips.cc/paper_files/paper/2024/file/8...

Re: Learn Prolog Now (2006)

#67
post #48

There seems to an interesting difference between Prolog and conventional (predicate) logic. In Prolog, anything that can't be inferred from the knowledge base is false. If nothing about "playsAirGuitar(mia)" is implied by the knowledge base, it's false. All the facts are assumed to be given; therefore, if something isn't given, it must be false. Predicate logic is the opposite: If I can't infer anything about "playsA…

This is called the Closed World Assumption (CWA) - https://en.wikipedia.org/wiki/Closed-world_assumption

Prolog’s Closed-World Assumption: A Journey Through Time - https://medium.com/@kenichisasagawa/prologs-closed-world-ass...

Is Prolog really based on the closed-world assumption? - https://stackoverflow.com/questions/65014705/is-prolog-reall...

Re: Learn Prolog Now (2006)

#68

I am once again shilling the idea that someone should find a way to glue Prolog and LLMs together for better reasoning agents. https://news.ycombinator.com/context?id=43948657 Thesis: 1. LLMs are bad at counting the number of r's in strawberry. 2. LLMs are good at writing code that counts letters in a string. 3. LLMs are bad at solving reasoning problems. 4. Prolog is good at solving reasoning problems. 5. ??? 6. LLM…

yes

Re: Learn Prolog Now (2006)

#69
post #62

Earlier quoted context omitted.

What makes you think your brain isn't also brute forcing potential solutions subconciously and only surfacing the useful results?

Can you try calculating 101 * 70 in your head?

I think therefore I am calculator?
Post reply on HN