News for hackers. Stuff that matters.
Re:Prolog at Work by YeGoblynQueenne on Tuesday January 03, 2023 @10:16AM (#34232391)
Thanks for trying to correct me, if I'm wrong (but thanks anyway). What I write is the impression I've formed after reading various sources on the history of Prolog, over the years. Some of them are even by Kowalski himself and my impression that he was the "neat" and Colmerauer the "scruffy" comes from his comments on their relation. I certainly could have misunderstood his comments, or be misremembering them. Unfortunately it will take me some time to dig out the specific sources and check my assumptions [1].

One such recent source is this documentary (in French) about Alain Colmerauer by a lady who shares his surname (a relative, I'm guessing):

https://youtu.be/74Ig_QKndvE?t=311

I've pointed the link to just before the start of an interview with Kowalski where he says (in English) what I transfer above, that Colmerauer was more practically minded and coming from a computer science side point of view while he (Kowalski) was more theoretically minded and coming from a mathematical logic point of view, and also that this tension created an "alchemy" that would not have transpired otherwise. I watched this documentary very recently and I guess it coloured my comment above.

More generally, it's easy to find discussion of the "pure" subset of Prolog and about its purported advantages compared to the rest. I'd have to go back to those textbooks to be sure, but I think I first encountered this idea in The Art of Prolog (O'Keefe) or "The Craft of Prolog" (Sterling & Shapiro), or probably both. And I have heard Ivan Bratko's coding style in his Prolog Programming for AI described as being too imperative and not the recommended style today [2].

I guess what people mean when they talk about "purity" is the lack of side-effects, and other concessions to the everyday needs of the working programmer. I understand the occurs-check flag to be one such concession, for example [3].

So I don't think that all this is just my imagination. In my experience, there really is a divide between Prolog users that think of Prolog as a kind of mathematical notation for computers and smart at the thought of its "dirty" side-effects, and those who just want to use it as a powerful, and beautiful, tool. Like myself.

But I should try to be less sentimental in my analysis in the future. Again, thanks for reminding me to check my assumptions and try to remember where my knowledge comes from.

_____________

[1] I spent four years during my PhD at Imperial College literally down the corridor from Kowalski's office, but I never had the guts to go and talk to him and ask him about Prolog's history, that I am always very curious about. I regert that now that my PhD is ended and I'm no longer in the same building, or the same city :/

[2] Which is nonsense. Also Bratko said I'm good with Prolog, so there.

[3] What does the DEC10 Prolog manual say about the occurs check?

Re:Prolog at Work by falsissime on Wednesday January 04, 2023 @04:47AM (#34243808)
> [3] What does the DEC10 Prolog manual say about the occurs check?

See I.2.1. Occur Check of https://userweb.fct.unl.pt/~lmp/publications/online-papers/D...

A recent related discussion: https://stackoverflow.com/questions/65600226/what-occurs-che...

In general, we do agree on the observation that Prolog profits from both the theoretical and the practical side. But still even today I have the impression that the highly theoretically leaning side does not appreciate the fundamental contribution errors have on ensuring correctness properties. At least this was my impression of November 10th in Paris.

Just one personal recollection (from memory) which probably also influences my view on the Kowalski-Colmerauer relation. At a META 90 tutorial/talk about meta interpreters, Sterling attributed the origin of meta interpreters to Warren and the DEC10 manual. Kowalski responded (publicly during the talk) that this was well known to Colmerauer, well before Warren ever got into Prolog.

As to the lady you are referring to she is his widow, a linguist.

Re:Prolog at Work by falsissime on Wednesday January 04, 2023 @01:33PM (#34249493)
Just to note one error in I.2.1:

> ... whereas unification without the occur check is linear on the size of the smallest of the terms being unified.

This claim is incorrect, it goes far beyond what is possible. To see its incorrectness consider the unification problem X = Y. And just for illustrative purposes, think of them both as being very big and evolved. Now, consider a related unification problem Z-Z = X-Y with Z just a variable. According to above claim, the cost would be now independent of X and Y which cannot be.

Re:Prolog at Work by YeGoblynQueenne on Thursday January 05, 2023 @10:47AM (#34261369)
Yes, I see, that doesn't make sense.

I wonder if all that was more of a consideration in an older time, with weaker hardware. Anyway where I come from (ILP research, again) "polynomial time" is synonymous to "efficient" and the bigger problem is proofs failing to terminate.

I might actually try some learning experiments with the occurs check flag set to "true" just to see what happens. I mean, I wonder. I'm so used to leaving the flag to default false that I wonder if I haven't formed a completely wrong model about the execution of Prolog programs. I've been coding in Prolog for more than ten years now and it still catches me off-guard at times.

Re:Prolog at Work by falsissime on Thursday January 05, 2023 @12:43PM (#34263515)
Consider to set the flag to "error" to see if there are any cases where infinite terms would be created.
Re:Prolog at Work by YeGoblynQueenne on Thursday January 05, 2023 @10:38AM (#34261182)
>> See I.2.1. Occur Check of https://userweb.fct.unl.pt/~lmp/publications/online-papers/D...

>> A recent related discussion: https://stackoverflow.com/questions/65600226/what-occurs-che...

Thanks! I'll have a look.

>> As to the lady you are referring to she is his widow, a linguist.

Ah, thanks. A linguist. That figures :)

Re:Prolog at Work by falsissime on Thursday January 05, 2023 @12:41PM (#34263484)
> the occurs check is crucial for the performance of the algorithm (because without it unification can go on forever, whereas with the occurs check unification will terminate and find an mgu if one exists).

Many current systems perform rational tree unification. Like SICStus, SWI by default, Scryer by default etc. This claim that unification going on forever only holds for rather the minority of systems today.