Live data from Hacker News

Learn Prolog Now (2006)

lpn.swi-prolog.org

231–240 of 251 posts

Re: Learn Prolog Now (2006)

#231

Earlier quoted context omitted.

With Prolog, the proof is carried out by the computer, not a human. A human writes up a theory and a theorem and the computer proves the theorem with respect to the theory. So I ask again, how is carrying out a proof not reasoning? >> I'm not claiming that reason is incorrect, I'm handwaving it away as irrelevant and academic. That's not a great way to have a discussion.

The word "reason" came into this thread with the original comment: 3. LLMs are bad at solving reasoning problems. 4. Prolog is good at solving reasoning problems. I agree with you. In Prolog "?- 1=1." is reasoning by definition. Then 4. becomes "LLMs should emit Prolog because Prolog is good at executing Prolog code". I think that's not a useful place to be, so I was trying to head off going there. But now I'll go wi…

This is not my claim:

>> "executing Prolog code is reasoning" makes Prolog more useful for LLMs to emit than Python?

I said what I think about LLMs generating Prolog here:

https://news.ycombinator.com/item?id=45914587

But I was mainly asking why you say that Prolog's execution is "not reasoning". I don't understand what you mean that '"?- 1=1." is reasoning by definition' and how that ties-in with our discussion about Prolog reasoning or not.

Re: Learn Prolog Now (2006)

#232

Earlier quoted context omitted.

The word "reason" came into this thread with the original comment: 3. LLMs are bad at solving reasoning problems. 4. Prolog is good at solving reasoning problems. I agree with you. In Prolog "?- 1=1." is reasoning by definition. Then 4. becomes "LLMs should emit Prolog because Prolog is good at executing Prolog code". I think that's not a useful place to be, so I was trying to head off going there. But now I'll go wi…

This is not my claim: >> "executing Prolog code is reasoning" makes Prolog more useful for LLMs to emit than Python? I said what I think about LLMs generating Prolog here: https://news.ycombinator.com/item?id=45914587 But I was mainly asking why you say that Prolog's execution is "not reasoning". I don't understand what you mean that '"?- 1=1." is reasoning by definition' and how that ties-in with our discussion abou…

"?- 1=1." is Prolog code. Executing Prolog code is reasoning. Therefore that is reasoning. Q.E.D. This is the point you refused to move on from until I agreed. So I agreed. So we could get back to the interesting topic.

A topic you had no interest in, only interest dragging onto a trangent and grinding it down to make ... what point, exactly? If "executing Prolog code" is reasoning, then what? I say it isn't useful to call it reasoning (in the context of this thread) because it's too broad to be a helpful definition, basically everything is reasoning, and almost nothing is not. When I tried to say in advance that this wouldn't be a useful direction and I didn't want to go here, you said it was " not a great way to have a discussion". And now having dragged me off onto this academic tangent, you dismiss it as "I wasn't interested in that other topic anyway". Annoying.

Re: Learn Prolog Now (2006)

#233

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…

Its a Horn clause resolver...that's exactly the kind of reasoning that LLMs are bad at. I have no idea how to graft Prolog to an LLM but if you can graft any programming language to it, you can graft Prolog more easily. Also, that you push Python and JavaScript makes me think you don't know many languages. Those are terrible languages to try to graft to anything. Just because you only know those 2 languages doesn't m…

> I have no idea how to graft Prolog to an LLM

Wrapping either the SWI prolog MQI, or even simpler an existing Python interface like like janus_swi, in a simple MCP is probably an easy weekend project. Tuning the prompting to get an LLM to reliably and effectively choose to use it when it would benefit from symbolic reasoning may be harder, though.

Re: Learn Prolog Now (2006)

#234

Earlier quoted context omitted.

I'm not. Python and JS are scripting languages. And in this case, we want something that models formal logic. We are hammering in a nail, you picked up a screwdriver and I am telling you to use a claw hammer.

What does this comment even mean? A claw hammer? By formal definitions, all 3 languages are Turing complete and can express programs of the same computational complexity.

> By formal definitions, all 3 languages are Turing complete and can express programs of the same computational complexity.

So is Brainfuck.

Turing equivalence does not imply that languages are equally useful choices for any particular application.

Re: Learn Prolog Now (2006)

#235
post #228

Earlier quoted context omitted.

You are not replying to what I said. I am not going to repeat myself, see the parent comment you replied to.

Your original comment completely missed the point of what it was replying to, you phrased it like you were correcting them but you were actually in agreement and didn't seem to realize it. They tried to clarify when you asked and when you responded you assumed they had the opposite viewpoint from what they actually have.

I replied to "Can you try calculating 101 * 70 in your head?".

Yes, many people can successfully calculate it through learned tricks or no learned tricks.

That is all I am saying. And my question is: how is calculating it in your own head brute-force, especially if done without such tricks?

No need to complicate it, answers to my question would suffice.

Re: Learn Prolog Now (2006)

#236

Earlier quoted context omitted.

This is not my claim: >> "executing Prolog code is reasoning" makes Prolog more useful for LLMs to emit than Python? I said what I think about LLMs generating Prolog here: https://news.ycombinator.com/item?id=45914587 But I was mainly asking why you say that Prolog's execution is "not reasoning". I don't understand what you mean that '"?- 1=1." is reasoning by definition' and how that ties-in with our discussion abou…

"?- 1=1." is Prolog code. Executing Prolog code is reasoning. Therefore that is reasoning. Q.E.D. This is the point you refused to move on from until I agreed. So I agreed. So we could get back to the interesting topic. A topic you had no interest in, only interest dragging onto a trangent and grinding it down to make ... what point, exactly? If "executing Prolog code" is reasoning, then what? I say it isn't useful t…

I'm sorry you find my contribution to the discussion annoying, but how should I feel if you just "agree" with me as a way to get me to stop arguing?

But I think your annoyance may be caused by misunderstanding my argument. For example:

>> If "executing Prolog code" is reasoning, then what? I say it isn't useful to call it reasoning (in the context of this thread) because it's too broad to be a helpful definition, basically everything is reasoning, and almost nothing is not.

Everything is not reasoning, nor is executing any code reasoning, but "executing Prolog code" is, because executing Prolog code is a special case of executing code. The reason for that is that Prolog's interpreter is an automated theorem prover, therefore executing Prolog code is carrying out a proof; in an entirely literal and practical sense, and not in any theoretical or abstract sense. And it is very hard to see how carrying out a proof automatically is "not reasoning".

I made this point in my first comment under yours, here:

https://news.ycombinator.com/item?id=45909159

The same clearly does not apply to Python, because its interpreter is not an automated theorem prover; it doesn't apply to javascript because its interpreter is not an automated theorem prover; it doesn't apply to C because its compiler is not an automated theorem prover; and so on, and so forth. Executing code in any of those languages is not reasoning, except in the most abstract and, well, academic, sense, e.g. in the context of the Curry-Howard correspondence. But not in the practical, down-to-brass-tacks way it is in Prolog. Calling what Prolog does reasoning is not a definition of reasoning that's too broad to be useful, as you say. On the contrary, it's a very precise definition of reasoning that applies to Prolog but not to most other programming languages.

I think you misunderstand this argument and as a consequence fail to engage with it and then dismiss it as irrelevant because you misunderstand it. I think you should really try to understand it, because it's obvious you have some strong views on Prolog which are not correct, and you might have the chance to correct them.

I absolutely have an interest in any claim that generating Prolog code with LLMs will fix LLMs' inability to reason. Prolog is a major part of my programming work and research.

Re: Learn Prolog Now (2006)

#237

I really enjoyed learning Prolog in university, but it is a weird language. I think that 98% of tasks I would not want to use Prolog for, but for that remaining 2% of tasks it's extremely well suited for. I have always wished that I could easily call Prolog easily from other languages when it suited the use case, however good luck getting most companies to allow writing some code in Prolog.

[dead]

Re: Learn Prolog Now (2006)

#238
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?

Because I can solve problems that would take the age of the universe to brute force, without waiting the age of the universe. So can you: start counting at 1, increment the counter up to 10^8000, then print the counter value. Prolog: 1, 2, 3, 4, 5 ... You and me instantly: 10^8000

The brain can still use other means of working in addition to brute forcing solutions. For example, how would you go about solving the chess puzzle of eight queens that doesn't involve going through the potential positions and then filtering out the options that don't match the criteria for the solution?

Prolog can also evaluate mathematical expressions directly as well.

Re: Learn Prolog Now (2006)

#239

Earlier quoted context omitted.

This is not my claim: >> "executing Prolog code is reasoning" makes Prolog more useful for LLMs to emit than Python? I said what I think about LLMs generating Prolog here: https://news.ycombinator.com/item?id=45914587 But I was mainly asking why you say that Prolog's execution is "not reasoning". I don't understand what you mean that '"?- 1=1." is reasoning by definition' and how that ties-in with our discussion abou…

"?- 1=1." is Prolog code. Executing Prolog code is reasoning. Therefore that is reasoning. Q.E.D. This is the point you refused to move on from until I agreed. So I agreed. So we could get back to the interesting topic. A topic you had no interest in, only interest dragging onto a trangent and grinding it down to make ... what point, exactly? If "executing Prolog code" is reasoning, then what? I say it isn't useful t…

> "?- 1=1." is Prolog code. Executing Prolog code is reasoning. Therefore that is reasoning. Q.E.D.

This is the dumbest thing i have read yet on HN. You are absolutely clueless about this topic and are merely arguing for argument's sake.

> If "executing Prolog code" is reasoning, then what? I say it isn't useful to call it reasoning (in the context of this thread) because it's too broad to be a helpful definition, basically everything is reasoning, and almost nothing is not.

What does this even mean? It has already been pointed out that Prolog does a specific type of formalized reasoning which is well understood. The fact that there are other formalized models to tackle subdomains of "Commonsense Reasoning" does not detract from the above. That is why folks are trying to marry Prolog (predicate logic) to LLMs (mainly statistical approaches) to get the best of both worlds.

User "YeGoblynQueenne" was being polite in his comments but for some reason you willfully don't want to understand and have come up with ridiculous examples and comments which only reflect badly on you.

Re: Learn Prolog Now (2006)

#240

Earlier quoted context omitted.

"?- 1=1." is Prolog code. Executing Prolog code is reasoning. Therefore that is reasoning. Q.E.D. This is the point you refused to move on from until I agreed. So I agreed. So we could get back to the interesting topic. A topic you had no interest in, only interest dragging onto a trangent and grinding it down to make ... what point, exactly? If "executing Prolog code" is reasoning, then what? I say it isn't useful t…

> "?- 1=1." is Prolog code. Executing Prolog code is reasoning. Therefore that is reasoning. Q.E.D. This is the dumbest thing i have read yet on HN. You are absolutely clueless about this topic and are merely arguing for argument's sake. > If "executing Prolog code" is reasoning, then what? I say it isn't useful to call it reasoning (in the context of this thread) because it's too broad to be a helpful definition, ba…

You call it the dumbest thing you have ever read, and say that I know nothing - but you agree that it is a correct statement ("Prolog does a specific type of formalized reasoning").

> "What does this even mean?"

For someone who is so eager to call comments dumb, you sure have a lot of not-understanding going on.

1. Someone said "Prolog is good at reasoning problems"

2. I said it isn't any better than other languages.

3. Prolog people jumped on me because Ackchually Technickally everything Prolog does is 'reasoning' hah gotcha!

4. I say that is entirely unrelated to the 'reasoning' in "Prolog is good at reasoning problems". I demonstrate this by reductio ad absurdum - if executing "?- 1=1." is "reasoning" then it's absurd for the person to be saying that definition is a compelling reason to use Prolog, therefore they were not saying that, therefore this whole tangent about whether some formalism is or isn't reasoning by some academic definition is irrelevant to the claim and counter claim.

> "are merely arguing for argument's sake."

Presumably you are arguing for some superior purpose?

The easiest way for you to change my mind is to demonstrate literally anything that is better for an LLM to emit in Prolog than Python - given the condition that LLMs don't have to care about conciseness or expressivity or readability in the same way humans do. For one example I say it would no better for an LLM to solve an Einstein Puzzle one way or the other. The fact that you can't or won't do this, and prefer insults, is not changing my mind nor is it educating me in anything.

Post reply on HN