Regarding the Peano version of the Ackermann-Péter function, I checked again to
make sure and I never used the word "elegant" anywhere, either on HN or on
Rosetta Code. I would never be so presumptuous, you know? On Rosetta code I
pointed out that my version is "pure" because that's what Prolog code without
side-effects is usually called. I put it in "quotes" because I personally don't
care about purity.
What I care about is simplicity of structure. That's because the simpler the
structure of a program, the easier the prorgam can be learned. You see, my
PhD studies and my research interest are about writing Prolog programs that
learn Prolog programs from Prolog programs and to do that it really helps if all
the Prolog programs are veeery simple, for combinatorial explosion ever lurks.
For example, I'm so delighted that I figured out how to write that "pure"
version of the Ackermann-Péter function not because I'm so full of myself I
think it's "elegant" but because it is simple, and thanks to its simplicity I
could then get my ILP system, Louise, to learn it from a single example:
The is/2 version would be much harder to learn, because of the more complex
structure. Although I think Louise can do that too. Btw, I got Louise to learn
the Function because I was challenged to do it by one of the examiners in my
viva, who figured the Function's furious combinatorial complexity makes it
unlearnable. That's right, but Louise can get around that because it can learn
recursive programs with arbitrary structure from a single example, so it doesn't
have to be trained on any example that triggers the Function's combinatorial
fury. In any case, Ackermann is a toy function only really useful to make a
point about recursion, and that's exactly how I use it also. Who cares if it
blows up with n = 2, m = 4, or with n = 5, m = 6? It blows up quickly anyway.
That's the whole point.
So, your comment above is very stream-of-consciousness and I wonder what
motivated you to write such a mad rant of the internets. I guess you must be
really passionate about the subject you discuss. If so, I understand. You are
not alone :) No, really, I generally agree with you. I asked above what is
"usefulness" because for me Prolog is useful and I don't understand why anyone
would say it isn't. Reading your other comment in the thread, I got the
impression you would agree with me on that.
But it's not about agreement. Aye, the night is long and full of errors and we
must somehow deal with the dirty, dirty real world. Personally, I'm happy with
that. But I do like my tools to also be nice to look at and I find that when I
can make them so, they also tend to work better. For example, cleaner, better
commented code, is easier to read and maintain. I mean, duh. In any case, in my
mind, a well-made tool is a thing of beauty anyway you look at it.
Re: "quality of life", well yea, that. If you were to look at my Louise, I think
you'd find that I've gone out of my way to make it into a system that people can
used. I'm totally inspired to do that by SWI-Prolog, btw. So for example, Louise
has logging facilities up the wazoo and so everytime someone tries to use it and
it breaks, they send me a nice, friendly dump of their logs, and then I can
trudge through them and help my user. Because I want to help my user. I wish
people sent me more bug reports, but I guess the majority find that something
breaks and they don't bother to tell me. Oh mon dieu, la cruelle tourmente.
As another example, I spent considerable effort to make sure that Louise's
"metarules" (second-order background knowledge) are easy to read and use. For
that purpose there's three metarule formats that Louise's pretty-printer can
produce. One is the internal representation of the metarule that's useful for
debugging, one is the user-friendly format where metarules are declared at the
user-level and a final one is the formal notation, with quantifiers, used in the
literature, so users can directly relate the metarules they use to a paper they
read. Here's what that looks like ("chain" is the friendly identifier of that
particular metarule):
By contrast, if you look at the original Meta-Interpretive Learning system,
Metagol (https://github.com/metagol/metagol), this is what "chain" looks like:
If I understand your comments about "quality of life" work correctly, then
that's pretty much what I always try to do and what most people in academia
never do. Guess what, I'm out of the game now. But, well, at least I tried :)
What I care about is simplicity of structure. That's because the simpler the structure of a program, the easier the prorgam can be learned. You see, my PhD studies and my research interest are about writing Prolog programs that learn Prolog programs from Prolog programs and to do that it really helps if all the Prolog programs are veeery simple, for combinatorial explosion ever lurks.
For example, I'm so delighted that I figured out how to write that "pure" version of the Ackermann-Péter function not because I'm so full of myself I think it's "elegant" but because it is simple, and thanks to its simplicity I could then get my ILP system, Louise, to learn it from a single example:
https://github.com/stassa/louise/blob/master/data/examples/a...
The is/2 version would be much harder to learn, because of the more complex structure. Although I think Louise can do that too. Btw, I got Louise to learn the Function because I was challenged to do it by one of the examiners in my viva, who figured the Function's furious combinatorial complexity makes it unlearnable. That's right, but Louise can get around that because it can learn recursive programs with arbitrary structure from a single example, so it doesn't have to be trained on any example that triggers the Function's combinatorial fury. In any case, Ackermann is a toy function only really useful to make a point about recursion, and that's exactly how I use it also. Who cares if it blows up with n = 2, m = 4, or with n = 5, m = 6? It blows up quickly anyway. That's the whole point.
So, your comment above is very stream-of-consciousness and I wonder what motivated you to write such a mad rant of the internets. I guess you must be really passionate about the subject you discuss. If so, I understand. You are not alone :) No, really, I generally agree with you. I asked above what is "usefulness" because for me Prolog is useful and I don't understand why anyone would say it isn't. Reading your other comment in the thread, I got the impression you would agree with me on that.
But it's not about agreement. Aye, the night is long and full of errors and we must somehow deal with the dirty, dirty real world. Personally, I'm happy with that. But I do like my tools to also be nice to look at and I find that when I can make them so, they also tend to work better. For example, cleaner, better commented code, is easier to read and maintain. I mean, duh. In any case, in my mind, a well-made tool is a thing of beauty anyway you look at it.
Re: "quality of life", well yea, that. If you were to look at my Louise, I think you'd find that I've gone out of my way to make it into a system that people can used. I'm totally inspired to do that by SWI-Prolog, btw. So for example, Louise has logging facilities up the wazoo and so everytime someone tries to use it and it breaks, they send me a nice, friendly dump of their logs, and then I can trudge through them and help my user. Because I want to help my user. I wish people sent me more bug reports, but I guess the majority find that something breaks and they don't bother to tell me. Oh mon dieu, la cruelle tourmente.
As another example, I spent considerable effort to make sure that Louise's "metarules" (second-order background knowledge) are easy to read and use. For that purpose there's three metarule formats that Louise's pretty-printer can produce. One is the internal representation of the metarule that's useful for debugging, one is the user-friendly format where metarules are declared at the user-level and a final one is the formal notation, with quantifiers, used in the literature, so users can directly relate the metarules they use to a paper they read. Here's what that looks like ("chain" is the friendly identifier of that particular metarule):
By contrast, if you look at the original Meta-Interpretive Learning system, Metagol (https://github.com/metagol/metagol), this is what "chain" looks like: If I understand your comments about "quality of life" work correctly, then that's pretty much what I always try to do and what most people in academia never do. Guess what, I'm out of the game now. But, well, at least I tried :)