The salvaged collection of animations (II)

UPDATE: Chemlambda collection of animations is the version of the collection hosted on github. The original site is under very heavy traffic (in Jan 2020).

UPDATE: much better now, although I seriously consider to jump directly to pure see. However is very rewarding to pass over blocks.

collection

(Continues the first post.) I forgot how much the first awk chemlambda scripts were honed, and how much the constants of the animations produced were further picked so to illustrate in a visually interesting way a point of view. The bad part of the animations first produced is that they are big html files, sometimes taking very long to execute.

The all-in-one js solution built by ishanpm, then modified and enhanced by me, works well and fast for graphs with a no of nodes up to 1000, approximatively. The physics is fixed, there are only two controls: gravity (slider) which allows to expand/contract the graphs, and the rewrites slider, which changes the probabilities of rewrites which increase/decrease the number of nodes. Although there is randomness (initially in the ishanpm js solution there was not), it is a weak and not very physical one (considering the idea that the rewrites are caused by enzymes). It is funny that the randomness is not taken seriously, see for example the short programs of formality.

After I revived the collection of animations from G+ (I kept about 300 of them), I still had to associate the animations with the mol files used (many of them actually not in the mol library available) and to use the js chemlambda version (i.e. this one) with the associated mol files. In this way the user would have the possibility to re-done the animations.

It turns out it does not work like this. The result is almost always of much lesser quality than the animation. However, the sources of the animations (obtained from the awk scripts) are available here.  But as I told at the beginning of the post, they are hard to play (fast enough for the goldfish attention), actually this was the initial reason for producing animations, because the first demos, even chosen to be rather short, were still too long…

So this is a more of a work of art, which has to be carefully restored. I have to extract the useful info from the old simulations and embed it into a full js solution. Coming back to randomness, in the original version there are random cascades of rewrites, not random rewrites, one at a time, like in the new js version… and they extinguish the randomly available pockets of enzymes, according to some exponential laws… and so on. That is why the animations look more impressive than the actual fast solution, at least for big graphs.

It is true that the js tools from the quine graphs repository have many advantages: interaction combinators are embedded, there is a lambda calculus to chemlambda parser… With these tools I discovered that the 10 nodes quine does reproduce, that the ouroboros is mortal, that there are many small quines (in interaction combinators too), etc.

And it turns out that I forgot that many interesting mols and other stuff was left unsaid or is not publicly available. My paranoid self in action.

In conclusion probably I’ll make available some 300 commented gifs from the collection and I’ll pass to the scientific part. I’d gladly expose the art part somewhere, but there seems to be no place for this art, technically, as there is no place, technically, for the science part, as a whole, beyond just words telling stories.

There will be, I’m sure.

The salvaged collection of animations

UPDATE: Chemlambda collection of animations is the version of the collection hosted on github. The original site is under very heavy traffic (in Jan 2020). Small images, about a 1/2 of the collection, due to memory limitations. But you can play the simulations in js!

UPDATE: As I progress into integrating more, I think I might sell microSD cards with the full experience. Who knows, in a year from now I might even think about a whole (real or game like) VR programming medium in a sort of chemlisp crossed with pure see. If anybody interested call me.

One more thing: as you shall see, the animations (and the originals) are the result of both a work of science and a work of art. Into the constraints (random evolution, only physical constants and colors are allowed to modify, only before, only cuts allowed) a world of dreams open.

____

Now I have a functional (local) version of the chemlambda collection of animations, salvaged from G+. A random slice:

salvaged-collection

On the short term todo list is:

  • integrate it with the quine graphs and with the lambda stuff.
  • add text to the chemlambda for the people and integrate with the rest.
  • to release the quine graphs article I still need a decorator, a deterministic reducer and a quine discoverer, all of them pretty standard. Make a chemlisp repl, perhaps? It would need only a small rewrite of the parser…
  • to release the hapax article I need to add a visual loop, also to rewrite some of the functions because I already need them in the quine discoverer.

… and then my dues will be finally paid and I can attack pure see and stochastic SBEN with full serenity.

Oh wait, I still have to make a big intro to em-convex, release the second part, describe the category CONICAL and related work in sub-riemannian geometry,  explain the solution of the computation power of emergent algebras … and then my dues will be paid and … 🙂

Open access in 2019: still bad for the career

Have you seen this: https://newsroom.publishers.org/researchers-and-publishers-oppose-immediate-free-distribution-of-peer-reviewed-journal-articles

“The American publishing industry invests billions of dollars financing, organizing, and executing the world’s leading peer-review process in order to ensure the quality, reliability, and integrity of the scientific record,” said Maria A. Pallante, President & CEO of the Association of American Publishers. “The result is a public-private partnership that advances America’s position as the global leader in research, innovation, and scientific discovery. If the proposed policy goes into effect, not only would it wipe out a significant sector of our economy, it would also cost the federal government billions of dollars, undermine our nation’s scientific research and innovation, and significantly weaken America’s trade position. Nationalizing this essential function—that our private, non-profit scientific societies and commercial publishers do exceedingly well—is a costly, ill-advised path.”

Yes, well, this is true! It is bad for publishers, like Elsevier, it is bad for some learned societies which sign this letter, like the ACM.

But it would be a small step towards a more normal, 21st century style of communication among researchers. Because researchers do no longer need scientific publishers of this kind.

What is more important? That a useless industry loose money, or that researchers could discuss normally, without the mediation of this parasite from an older age?

Obviously, researchers have careers, which depend on the quantification of their scientific production. The quantification is made according to rules dictated by academic management. The same management who decides to buy from the publishers something the researchers already have (access).

So, no matter how evil the publishers may be, management is worse. Because suppose I make a social media app which asks 1$ for each word one types into it. Would you buy it, in case you want to exchange messages with your colleagues? No, obviously. No matter how evil I am by making this app, I would have no clients. But suppose now that your boss decides that the main criterion of career advancement is the number of words you typed into this app. Would you buy it, now? Perhaps.

Why, tell me why the boss would decide to make such a decision? There has to be a reason!

Who is the most evil? I or the boss?

There was a coincidence that the same day I learned about the letter against open access, I also read Scott Aaronson post about the utmost important problem of the name “quantum supremacy”.

The post starts with a good career news:

“Yay! I’m now a Fellow of the ACM. […] I will seek to use this awesome responsibility to steer the ACM along the path of good rather than evil.”

Then Scott spends more than 3100 words discussing the “supremacy” word. Very important subject. People in the media are concerned about this.

First Robert Rand comment, then mine, asked about Scott’ opinion  as a new member of the ACM, concerning the open access letter.

The answer has a 100 words, the gist being:

“Anyone who knows the ACM better than I do: what would be some effective ways to register one’s opposition to this?”

A  possible answer for my question concerning bosses is: OA is still bad for the career, in 2019.

 

Use the lambda to chemlambda parser to see when the translation doesn’t work

I use the parser page mainly and other pages will be mentioned in the text.

So chemlambda does not solve the problem of finding a purely local conversion of lambda terms to graphs, which can be further reduced by a purely local random algorithm, always. This is one of the reasons I insist both into going outside lambda calculus and into looking at possible applications in real chemistry, where some molecules (programs) do reduce predictively and the span of the cascade of reactions (reductions) is much larger than one can achieve via massive brutal try-everything on a supercomputer strategy.

Let’s see: choose

(\a.a a)(\x.((\b.b b)(\y.y x)))

it should reduce to the omega combinator, but read the comment too. I saw this lambda term, with a similar behaviour, in [arXiv:1701.04691], section 4.

Another example took me by surprise. Now you can choose “omega from S,I combinators”, i.e. the term

(\S.\I.S I I (S I I)) (\x.\y.\z.(x z) (y z)) \x.x

It works well, but l previously used a related term, actually a mol file, which corresponds to the term where I replace I by S K K in S I I (S I I), i.e. the term

S (S K K) (S K K) (S (S K K) (S K K))

To see the reduction of this term (mol file) go to this page and choose “omega from S,K combinators”. You can also see how indeed S K K reduces to I.

But initially in the parser page menu I had  the term

(\S.\K.S (S K K) (S K K) (S (S K K) (S K K))) (\x.\y.\z.(x z) (y z)) (\x.(\y.x))

It should reduce well but it does not. The reason is close to the reason the first lambda term does not reduce well.

Now some bright side of it. Look at this page to see that the ouroboros quine is mortal. I believed it is obviously imortal until recently. Now I started to believe that imortal quines in chemlambda are rare. Yes, there are candidates like (the graph obtained from) omega, or why not (try with the parser) 4 omega

(\f.(\x.(f(f (f (f x)))))) ((\x.x x) (\x.x x))

and there are quines like the “spark_243501” (shown in the menu of this page) with a small range of behaviours. On the contrary, all quines in IC are imortal.

Lambda calculus to chemlambda parser (2) and more slides

This post has two goals: (1) to explain more about the lambda to chemlambda parser and (2) to talk about slides of presentations which are connected one with the other across different fileds of research.

(1) There are several incremental improvements to the pages from the quine graphs repository. All pages, including the parser one, have two sliders, each giving you control about some parameters.

The “gravity” slider is kind of obvious. Recall that you can use your mose (or pinching gestures) to zoom in or out the graph you see. With the gravity slider you control gravity. This allows you to see better the edges of the graph, for example, by moving the gravity slider to the minimum and then by zooming out. Or, on the contrary, if you have a graph which is too spreaded, you can increase gravity, which will have as aeffect a more compactly looking graph.

The “rewrites weights slider” has as extrema the mysterious words “grow” and “slim”. It works like this. The rewrites (excepting COMB, which are done preferentially anyway) are grouped into those which increase the number of nodes (“grow”) and the other ones, which decrease the number of nodes (“slim”).

At each step, the algorithm tries to pick at random a rewrite. If there is a COMB rewrite to pick, then it is done. Else, the algorithm will try to pick at random one “grow” and one “slim” rewrite. If there is only one of these available, i.e. if there a “grow” but no “slim” rewrite, then this rewrite is done. Else, if there is a choice between two randomly choses “grow” and “slim” rewrites, we flip a coin to choose among them. The coin is biased towards “grow” or “slim” with the rewrites weights slider.

This is interesting to use, for example with the graphs which come from lambda terms. Many times, but not always, we are interested in reducing the number of nodes as fast as possible. A strategy would be to move the slider to “slim”.

In the case of quines, or quine fights, it is interesting to see how they behave under “grow” or “slim” regime.

Now let’s pass to the parser. Now it works well, you can write lambda terms in a human way, but mind that “xy” will be seen as a variable, not as the application of “x” to “y”. Application is “x y”. Otherwise, the parser understands correctly terms like

(\x.\y.\z.z y x) (\x.x x)(\x. x x)\x.x

Then I followed the suggestion of my son Matei to immediately do the COMB rewrites, thus eliminating the Arrow nodes given by the parser.

About the parser itself. It is not especially short, because of several reasons. One reason is that it is made as a machine with 3 legs, moving along the string given by the lexer. Just like the typical 3-valent node. So that is why it will be interesting to see it in action, visually. Another reason is that the parser first builds the graph without fanout FO and termination T nodes, then adds the FO and and T nodes. Finally, the lambda term is not prepared in advance by any global means (excepting the check for balanced parantheses). For example no de Bruijn indices.

Another reason is that it allows to understand what edges of the (mol) graph are, or more precisely what port variables (edge variables) correspond to. The observation is that the edges are in correspondence with the position of the item (lparen, rparen, operation, variable) in the string. We need at most N edge names at this stage, where N is the length of the string. Finally, the second stage, which adds the FO and T nodes, needs at most N new edge names, practically much less: the number of duplicates of variables.

This responds to the question: how can we efficiently choose edge names? We could use as edge name the piece of the string up to the item and we can duble this number by using an extra special character. Or if we want to be secretive, now that we now how to constructively choose names, we can try to use and hide this procedure.

Up to now there is no “decorator”, i.e. the inverse procedure to obtain a lambda term from a graph, when it is possible. This is almost trivial, will be done.

I close here this subject, by mentioning that my motivation was not to write a parser from lambda to chemlambda, but to learn how to make a parser from a programming language in the making. You’ll see and hopefully you’ll enjoy 🙂

(2) Slides, slides, slides. I have not considered slides very interesting as a mean of communication before. But hey. slides are somewhere on the route to an interactive book, article, etc.

So I added to my page links to 3 related presentations, which with a 4th available and popular (?!) on this blog, give together a more round image of what I try to achieve.

These are:

  • popular slides of a presentation about hamiltonian systems with dissipation, in the form baptized “symplectic Brezis-Ekeland-Nayroles”.  Read them in conjuction with arXiv:1902.04598, see further why
  • (Artificial physics for artificial chemistry)   is a presentation which, first, explains what chemlambda is in the context of artificial chemistries, then proceeds with using a stochastic formulation of hamiltonian systems with dissipation as an artificial physics for this artificial chemistry. An example about billiard ball computers is given. Sure, there is an article to be written about the details, but it is nevertheless interesting to infer how this is done.
  • (A kaleidoscope of graph rewrite systems in topology, metric geometry and computer science)  are the most evolved technically slides, presenting the geometrical roots of chemlambda and related efforts. There are many things to pick from there, like: what is the geometrical problem, how is it related to emergent algebras, what is computation, knots,  why standard frames in categorical logic can’t help (but perhaps it can if they start thinking about it), who was the first programmer in chemlambda, live pages where you can play with the parser, closing with an announcement that indeed anharmonic lambda (in the imperfect form of kali, or kaleidoscope) soves the initial problem after 10 years of work. Another article will be most satisfactory, but you see, people rarely really read articles on subjects they are not familiar with. These slides may help.
  • and for a general audience my old (Chemlambda for the people)  slides, which you may appreciate more and you may think about applications of chemlambda in the real world. But again, what is the real world, else than a hamiltonian system with dissipation? And who does the computation?