Live data from Hacker News

Learn Prolog Now (2006)

lpn.swi-prolog.org

241–250 of 251 posts

Re: Learn Prolog Now (2006)

#241
post #228

Earlier quoted context omitted.

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.

> how is calculating it in your own head brute-force

Doing this calculation in your head is not brute force, which was their entire point. Their math question was an example of why the brain isn't brute-forcing solutions, replying to this:

> 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)

#242

Earlier quoted context omitted.

> "?- 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 language…

> but you agree that it is correct.

No, i did not; do not twist nor misrepresent my words. Your example had nothing whatsoever to do with "Reasoning" and hence i called it dumb.

> you sure have a lot of not-understanding going on.

Your and my comments are there for all to see. Your comments are evidence that you are absolutely clueless on Reasoning, Logic Programming Approaches and Prolog.

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

Which is True. But it is up to you to present the world-view to Prolog in the appropriate Formal manner.

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

Which is stupid. This single statement establishes the fact that you know nothing about Logic Programming nor the aspect of Predicate Logic it is based on.

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

Which is True and not a "gotcha". You have no definite understanding of what the word "Reasoning" means in the context of Prolog. We have explained concepts and pointed you to papers none of which you are interested in studying nor understanding.

> 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.

What does this even mean? This is just nonsense verbiage.

> Presumably you are arguing for some superior purpose?

Yes. I am testing my understanding of Predicate Logic/Logic Programming/Prolog against others. Also whether others have come up with better ways of application in this era of LLMs i.e. what are the different ways to use Prolog with LLMs today?.

I initially thought you were probably wanting a philosophical discussion of what "Reasoning" means and hence pointed to some relevant articles/papers but i am now convinced you have no clue about this entire subject and are really making up stuff as you go.

You are wasting everybody's time, testing their patience and coming across as totally ignorant on this domain.

Re: Learn Prolog Now (2006)

#243

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…

This sparked a really fascinating discussion, I don't know if anyone will see this but thanks everyone for sharing your thoughts :)

I understand your point - to an LLM there's no meaningful difference between once turing complete language and another. I'll concede that I don't have a counter argument, and perhaps it doesn't need to be prolog - though my hunch is that LLM's tend to give better results when using purpose built tools for a given type of problem.

The only loose end I want to address is the idea of "doing reasoning."

This isn't an AGI proposal (I was careful to say "good at writing prolog") just an augmentation that (as a user) I haven't yet seen applied in practice. But neither have I seen it convincingly dismissed.

The idea is the LLM would act like an NLP parser that gradually populates a prolog ontology, like building a logic jail one brick at a time.

The result would be a living breathing knowledge base which constrains and informs the LLM's outputs.

The punchline is that I don't even know any prolog myself, I just think it's a neat idea.

Re: Learn Prolog Now (2006)

#244

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…

This is my own recent attempt at this:

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

The core idea of DeepClause is to use a custom Prolog-based DSL together with a metainterpreter implemented in Prolog that can keep track of execution state and implicitly manage conversational memory for an LLM. The DSL itself comes with special predicates that are interpreted by an LLM. "Vague" parts of the reasoning chain can thus be handed off to a (reasonably) advanced LLM.

Would love to collect some feedback and interesting ideas for possible applications.

Re: Learn Prolog Now (2006)

#245

Earlier quoted context omitted.

> "?- 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 language…

You edited your comment without any indication tags which is dishonest. However, my previous response at https://news.ycombinator.com/item?id=45939440 is still valid. This is an addendum to that;

> 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

I have no interest in trying to change your mind since you simply do not have the first idea about what Prolog is doing vis-a-vis any other non-logic programming language. You have to have some basic knowledge before we can have a meaningful discussion.

However, in my previous comment here https://news.ycombinator.com/item?id=45712934 i link to some usecases from others. In particular; the casestudy from user "bytebach" is noteworthy and explains exactly what you are asking for.

> 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.

This is your dishonest edit without notification. I refuse to suffer wilful stupidity and hence retorted in a pointed manner; that was the only way left to get the message across. We had given you enough data/pointers in our detailed comments none of which you seem to have even grasped nor looked into. In a forum like this, if we are to learn from each other, both parties must put forth effort to understand the other side and articulate one's own position clearly. You have failed on both counts in this thread.

Re: Learn Prolog Now (2006)

#246

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…

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, bas…

> "how should I feel if you just "agree" with me as a way to get me to stop arguing?"

Triumphant? Victorious? magnificent, successful, proud, powerful, insert any adjective which applies to a situation where someone wanted something, and then got it.

> "And it is very hard to see how carrying out a proof automatically is "not reasoning. 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"

And that does not stop Python or Javascript from being used to find solutions to e.g. an Einstein Puzzle, something a human might call "a reasoning problem". This means Prolog 'doing reasoning' must not be the thing which solves the 'reasoning problem', something else must be doing that because non-reasoning systems can do it too.

If Prolog 'doing reasoning' meant it could solve 'reasoning problems' that no other programming language could, that would be a strong reason to use Prolog, but that is not something you or the other 'reasoning' commenters have claimed or offered examples of. Clearly the word 'reasoning' has different definitions in the different sentences and that is important here because I am responding to one and youall on the other.

If 'doing reasoning' is not the thing which makes it useful for 'solving reasoning problems' - if that neither compels one to use Prolog when working to 'solve a reasoning problem', nor convinces one to avoid other languages - if the definition does not influence one's decision in any way - it's very hard to see how it is the relevant version of 'reasoning' to focus on, and what point is trying to be made by this insistence on focusing on it, except academic one-upping.

Re: Learn Prolog Now (2006)

#247

Earlier quoted context omitted.

Its a Horn clause interpreter. Maybe lookup what that is before commenting on it. Clearly you don't have a good grasp of Computer Science concepts or math based upon your comments here. You also don't seem to understand the AI/ML definition of reasoning (which is based in formal logic, much like Prolog itself). Python and Prolog are based upon completely different kinds of math. The only thing they share is that they…

None of that is relevant.

Of course it is. Your confusing reasoning with intelligence. They are not the same thing.

Re: Learn Prolog Now (2006)

#248

Earlier quoted context omitted.

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.

[deleted]

Re: Learn Prolog Now (2006)

#249

Earlier quoted context omitted.

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, bas…

> " how should I feel if you just "agree" with me as a way to get me to stop arguing? " Triumphant? Victorious? magnificent, successful, proud, powerful, insert any adjective which applies to a situation where someone wanted something, and then got it. > " And it is very hard to see how carrying out a proof automatically is "not reasoning. The same clearly does not apply to Python, because its interpreter is not an a…

[deleted]

Re: Learn Prolog Now (2006)

#250

Earlier quoted context omitted.

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, bas…

> " how should I feel if you just "agree" with me as a way to get me to stop arguing? " Triumphant? Victorious? magnificent, successful, proud, powerful, insert any adjective which applies to a situation where someone wanted something, and then got it. > " And it is very hard to see how carrying out a proof automatically is "not reasoning. The same clearly does not apply to Python, because its interpreter is not an a…

>> And that does not stop Python or Javascript from being used to find solutions to e.g. an Einstein Puzzle, something a human might call "a reasoning problem". This means Prolog 'doing reasoning' must not be the thing which solves the 'reasoning problem', something else must be doing that because non-reasoning systems can do it too.

To solve an Einstein puzzle in Python et al. you have to code 1) a definition of the problem and 2) a solution that you come up with. In Prolog you only have to code a definition of the problem and then executing the definition gets to the solution.

Other languages indeed can solve problems that Prolog can, but a human programmer must code the solution, while Prolog comes built-in with a universal problem solver, SLD-Resolution, that can solve any problem a human programmer can pose to it.

I looked around for an example of this with real code and found this SO thread on programmatically solving a Zebra puzzle (same as the Einstein puzzle):

https://stackoverflow.com/questions/318888/solving-who-owns-...

There are a few proposed solutions in Python, and in Prolog. The Python solutions pull-in constraint solving libraries, encode the problem constraints and then use for-loops to iterate over the set of solutions that respect the constraints.

The Prolog solutions do not pull in any libraries and do not iterate. They declare the constraints of the problem and then execute the constraints, letting the Prolog interpreter find a solution that satisfies them.

So the difference is that Prolog can solve the problem on its own, while Python can solve it only if you hand-code the solution, which includes importing a constraint solver. Constraint solving is of course a form of reasoning, and that's how you can get Python to do reasoning: by implementing a reasoning algorithm. In Prolog you don't need to do that, because SLD-Resolution is a universal problem solver that can be applied to constraint problems, like any other problem. This is not an academic matter, as you insist that it is; it is a practical matter, of knowing how to code a universal problem solver and getting it to run on real-world hardware.

I say that solving constraints is a form of reasoning. You won't find anyone to disagree with this in the CS and symbolic AI community. While you also won't find an agreed-upon, formal definition of "reasoning", we don't need one because we've been studying reasoning since the time of Aristotle and his "Syllogisms" (literally, "Reasonings" in Greek). In the same way you won't really find an agreed-upon definition of "mathematics", but we don't need one because we've been studying maths since the time of the ancient Babylonians (at least; my memory is hazy).

You argue that what Prolog does isn't reasoning, but that's a very niche view. Not that this means you're wrong, but one reason I insist with this discussion is that your view is so unorthodox. If you're right, I'd like to know, so I can understand where I was wrong. But so far I still only see a misunderstanding of Prolog and a continued unwillingness to engage with the argument that Prolog does reasoning because it has an automated theorem prover as an interpreter.

Note that the Prolog solutions in the SO thread are a bit over-engineered for my tastes. The one in the link below is much more straightforward although it's for a simplified version of the problem. Still, it shows what I mean that you only need to define the problem and then the interpreter figures out how to solve it.

https://www.101computing.net/solving-a-zebra-puzzle-using-pr...

Post reply on HN