The Lattice of Chemical Organisations

The paper describes how, in an Artificial Chemistry under flow conditions, the set of organisations form a lattice. The consequences of this are described, in particular how a series of theorems, valid for lattices, can be applied to more easily discover the complete set of organisations. An algorithm is then developed that uses such theorems to explore such lattice. The algorithm is applied first to the NTop Artificial Chemistry and then to an extension of it. Due to its complexity this system is also suggested as a benchmark case to test new Artificial Chemistries’ algorithms.


Introduction
In 1994 Walter Fontana and Leo Buss introduced the concept of Organisation to represent the fixed points in Constructive Dynamical Systems (Fontana and Buss, 1994a, 1994b, 1996).Looking at Dynamical Systems they observed how they could predict only quantitative dynamics, and no qualitative development.True novelty could never appear through Ordinary Differential Equations.But novelty is inherent in this world.And it is unpredictability is what makes the world so interesting.So, to describe how a system could transform the qualitative space of possibilities, they presented the concept of Constructive Dynamical Systems.Those were a molecular based system, where new molecules could be generated through the interaction of existing ones.Such system was thought as a model for the macro-molecules inside a cell, but this was just one of the possible examples, of such a general theory.Using standard dynamical systems as a metaphor, they then went on describing what would be the equivalent fixed points in their system; points where no novelty would appear, and called such cases Organisations.A set of molecules would be an organisation if, and only if, for each molecule inside the set, there was a reaction among the molecules in the set that would produce it; and, given any reaction among the molecules of the set, the result would always be a molecule of the set.The first property was called Self-Maintenance and the second Closure.A set satisfying both of those properties would be called an Organisation.Later (Dittrich, Speroni di Fenizio, 2007) Organisations were then renamed Semi-Organisations when it became clear that those properties were not enough to permit to those sets to be dynamically stability.Organisations were so re-defined as special Semi-Organisations where it is possible for all the reactions among molecules inside them to be active, and have no molecule type diminish.Studying Organisations and Semi-Organisations, it was soon found that under quite common assumptions, those structures would form a Lattice.It should be noted that this it is not always true for every reaction system, but it is true if we assume that every molecule has a certain probability to disappear (i.e.every molecule would have an out-flux greater than zero).Those systems were every molecule has an out flux were called Flow Systems to distinguish them from the more general General Reaction Systems (Dittrich, Speroni, 2007).It should be noted how all of Fontana and Buss' models had an out-flux applied to each molecule that would destroy it at the same speed at which others were produced.So those models were Flow Systems, and the set of organisations would form a Lattice.Other Flow Systems are also possible; for example if we consider cells, and thus cell growth, although it is not true that each molecule has a certain probability higher than zero of being excreted, it is true that as the cell grows the relative concentration of each molecule that is not generates diminishes, having the same effective result as if each molecule was subject to an out-flux.Then when the cell reproduces the average amount of that molecule halves, eventually reaching zero after enough reproductions.Thus the set of molecules inside a cell form a Flow System, and the set of possible Organisations in a living system form a lattice.Vice-versa, the reaction system in the atmosphere of a planet is not a Flow System, but a General Reaction System, and the Organisations do not form a lattice but just a Partially Ordered Set.Flow Systems and General Reaction Systems are not the only possible type of Artificial Chemistries: a more detailed analysis can distinguish also Catalytic Flow Systems as a specific type of Flow System where each molecule reacts in a catalytic way.In other words they are not used up in the reaction, while the prime material that generates the result is supposedly coming from a substrate of basic material floating around.Substrate to which each molecule eventually decays through the out-flux.Catalytic Flow Systems, Flow Systems, and Reaction Systems are quite different in terms of their relative properties (see Table 1).This paper aims to investigate the consequences of the fact that under flow conditions, the set of Organisations form a lattice.

What does it mean to understand an Artificial Chemistry
In

Basic Known Definitions from Previous Work
In a reaction system a closed set C is a set of molecules such that given any two molecules their reaction is still contained in C. A semi-self-maintaining set S is a set such that given any molecule m that is consumed in S, there exist a reaction inside S such that m is produced.Any set that is both semi-selfmaintaining and closed is a semi-organisation.A selfmaintaining set S is a semi-self-maintaining set such that there exist a reaction speed for all reactions among the molecules in S, with each reaction speed higher than zero, and such that each molecule has a production rate higher or equal to zero.In laymen's terms, a semi-self-maintaining set is a set where all molecules can be produced, and a self-maintaining one is one where this is globally possible.In Catalytic Flow systems the two coincide as every semi-self-maintaining set is selfmaintaining [Speroni di Fenizio, 2007].
Given any set F, we can generate its closure as the smallest closed set containing F. This always exists (albeit it can be infinite in size, if the AC contains an infinite diversity of molecules) and it is unique; we will indicate this as GC(F).
Given two closed sets, we can define the closed union (⨆C) as the closed set generate by the union of the two sets.Thus ∀A, B, closed sets; A ⨆C B ≡ GC ( A∪B ).Similarly we can define, A ⨅C B ≡ GC ( A∩B ).And then if C is the set of Closed Sets, <C, ⨆C, ⨅C> will be a Lattice.
Given any set F we can generate its semi-self-maintenance subset GsSM(F) as the biggest semi-self-maintaining subset contained in F. Again this exists and is unique.In a Flow System (but not in always in a reaction system), if we take a closed set C and we apply the operator GsSM(C) the result is still closed.So given any set F we can associate a semiorganisation to it as GsO (F) = GsSM (GC (F) ).This can be expanded by defining the operator Generate Self Maintaining set: GSM (T) as the operator that returns the biggest Self Maintaining Set contained in T.
Applying the equivalent definition of union and intersection among semi-self-maintaining sets, self maintaining sets, semiorganisations, and organisations, we obtain that in Flow Systems the set of semi-self maintaining sets, self maintaining sets, semi-organisations and organisations are all lattices with their respective union and intersection.Thus if O is the set of organisations in a Flow System <O, ⨆O, ⨅O> is a lattice.But not necessarily in a reaction system.We shall now explore the consequences of this.Note: In the rest of the paper we shall use ⨆ to mean ⨆O and ⨅ to mean ⨅O.

Useful Theorems
There are several theorems from Lattice theory which can help in mapping the lattice of organisations, and thus understanding better an Artificial Chemistry.Generally speaking if we have two organisations A, B then A ⨆O B = GSM (GsSM (GC (A ∪ B))).Those calculations can be long, so if we can shortcut the calculations just by working on the knowledge we already have this speeds up sensibly the work.In passing we note that in a Flow System for all sets A, although GSM (GsSM (A)) = GSM (A), it is usually faster to calculate it as GSM (GsSM (A) ) as |GsSM (A)| < |A|, and GsSM being an algebraic operator is usually faster to calculate than GSM.Since R = B " C then S " C = A " R.So calculating the union of one of those relations will solve also the other.Same reasoning can be applied for the intersection.

Pietro Speroni di
Theorem 2: Suppose we have three organisations, A, B and C with A contained into B and B contained into C (thus A < B < C ).And let R be a fourth organisation.If we want to calculate B " R; and we know that A " R = C " R then B " R = A " R. In other words if we have two organisations, A and B and, when interacting with an external organisation R both will give a particular result S (that is S = A " R = C " R), then every other organisation in between A and C if united with R will be equal to S.
Theorem 3: Suppose we have two organisations, A, S with A < S then A " S = S then we can consider that given any other organisations B, such that A " B = S, for every organisation C such that A < C < S then C " B = S. Symmetrically for every D such that B < D < S, A " D = S.But since C " B = C " S, and B < D < S then C " D = S.So once we calculate a single union we can fill in several entries of the Union Table .The same symmetric reasoning, with exactly the same dual theorem, can be applied for the intersection.We will now use those theorems to find the lattice of all organisations.

Finding the Lattice of Organisations
Let M be a set of Molecules, with a reaction * such that " a, b # M: a*b # M !$.Let <M, *> be an Artificial Chemistry.Let <O, ", #> be the lattice of Organisations over <M, *>.We need to find all the organisations in O. Let us start by assuming that we have two basic organisations, the empty set $, and M: $, M # O.Those will be the top and the bottom organisations in the lattice.Every lattice with a finite number of elements has always a top element (the union of all the elements, also called the 1) and a bottom element (the intersection of all the elements, also called the 0).So we start by taking the bottom element as the organisation generated by the empty set, and the top element as the organisation generated by the set of all molecules.One obvious solution to find all organisations is to check every single subset of M, which means checking 2 |M| subsets.
If M is big this could be impractical or simply impossible.Let's look at ways in which we can exclude some sets without testing them.In fact without even listing them.
To reach O we are going to build a chain of sub-lattices of organisations, N0 < N1 < … < Nm = O, with N0 the sub-lattice generated by the empty set and by the set of all molecules: N0=<{G0($),GO(M)},",#>.Note that given a set of organisations P, it is trivial to build a sub-lattice out of it just by taking the closure respect to " and #.
Thus once we have the sub-lattice Ni, and we find another organisation H, we can calculate Ni+1 as GC"# (Ni !H).Where with GC#" (P) we indicate the set of all organisations that can be generated by recursively applying the organisation union, ", and the organisation intersection, #, between organisations in P and the organisations generated in this process.
When we are doing this we also store two tables, the Table of Unions of Ni: T"i, and the Table of Intersections of Ni: T#i.In general for every A, B in Ni, T"i will store A " B and T#i will store A # B. And being Ni a sub-lattice, we know that both A " B, A # B # Ni.Thus we know that if the tables T"i T#i are complete with every union and interaction calculated, and the result is an organisation known we do not have to proceed further, and we have found a sub-lattice.It is important that this process of calculating all the organisation union and intersection is made as efficient as possible.In this we are helped by the fact that O is a lattice, and thus we can apply the theorems listed above.

Adding one molecule at a time
Let us start by assuming we have a sub-lattice of organisations Ni, then " B # Ni, we need to test all the molecules that are not in B, so " e # M \ B, we need to study Be .Calculating 1 Be leads to 3 possible outcomes: 1) Be = B; 2) Be = C with e % C and B < C; 3) Be = C with e # C and B < C. In the first case we will say that e, in the context of B, goes down (case 1); goes by the side (case 2); or goes up (case 3).So we go through all the molecules and we store for each molecule e, if in the context of B, e goes upward, downward, or sideward.We also store the generated organisation Be.For each new organisation H that we find, we expand Ni into Ni+1 by adding the organisation to the list of known organisations, and calculating the union and intersection closure.Of course, if B ! {e} = C, with C already a known organisation, we don't need to test Be at all, and we know we are in case 3.

Note:
In this paper we will indicate briefly GO({e}!B) as Be, for every molecule e, and similarly if we need to test a set adding 1 two molecules, e, f, we will indicate GO({e}!{f}!B) as Bef.At this point a sub lattice Ln will be discovered with a general structure with all the organisations that can be reached by adding one molecule at a time, and applying the union and intersection operations.This is not the complete lattice yet.For each organisation O we need to add the organisations generated by adding to O to every possible set S made up with molecules from Down [O].In this case we can distinguish in four possible results (one more than before): 1) downward case: OS = B; 2) upward case: S ⊂ OS; 3) sideward case: S ⊄ OS, S ∩ OS = ∅; 4) diagonal case: S ⊄ OS, S ∩ OS ≠ ∅.The fourth case, the diagonal case, is the new one and happens when S is partially contained in OS.Again, as we build the sets S from the smallest to the biggest we do not need to check the organisation generated by any set that has a subset T such that O < OT.The proof follows the exact same structure as the proof above.So given any organisation discovered we need to test it by trying to expand it with the molecules not in it, one by one.And with every subset of the "downward" molecules.While we do not need to test a set of "downward" molecules if it contains any subset which is upward, sideward, or diagonal.So the obvious thing to do, is to start with the smaller organisations, with the smaller subsets, and slowly build our way up.The "No Organisation Left Behind" theorem.
We need now to prove that once the algorithm is followed, every organisation in the lattice of organisations will be found.This can easily be shown.Suppose by contradiction that C is an organisation in the Lattice that has not been found with the algorithm.Suppose that B is the maximal organisation contained in C found by the algorithm.Such organisation is unique because if there were multiple maximal organisations, the union of them would also be contained in C and would be known because (as part of the algorithm) we are studying the union of all the known organisations.

Testing the Algorithm on the NTop
To test out the system it was used the NTop Artificial Chemistry (Banzhaf, 1993(Banzhaf, , 1994)).This artificial Chemistry uses boolean vectors of size 4 as molecules, which are then folded into 2x2 matrixes, to react.This results are 16 reacting molecules.One of those acts as an algebraic zero (0 * a = a * 0 = 0, for every a) and it is usually eliminated.With the 15 remaining molecules it is possible to obtain 54 organisations out of a space of 32.768 possible subsets.The Brute Force algorithm tests all those subsets.Instead the algorithm developed above was applied.The first step is to take two trivial organisations and the top, o1, and the bottom, o2, were taken.Then the bottom one was expanded, by adding one by one the 15 molecules.The first molecules led to o3.But the 3 organisations (o1, o2, and o3) formed a sub-lattice so it was not possible to expand this further.Second, and third molecules also generated o3.The fourth molecule, added to o2, generated o4.But now it was possible to find o5 as o5 = o3 " o4.Again o1-o5 formed a sub-lattice.The next molecule generated o6 and permitted to find o7, o8 and o9.o10 lead to o11-o14; o15 all the way to o23.So each organisation found would usually bring others with it, easily calculated.Once the o1-o23 sub-lattice of organisations was found, all the organisations, that could be found by adding a single molecule to o2 had been discovered.Also each molecule tested was divided into downward, upward and sideward, thus simplifying the tests to do later on.Then the algorithm started expanding on those organisations.Expanding o3 did not discover any new organisation.As did o4, o5, …, o9.expanding o10 lead to o24 (and nothing else).Expanding o15 lead to o27, then to o32 and finally to o42.And then nothing else.At this point a sub-lattice was found where adding a single molecule to each of the known 42 existing organisation would always lead back to a known organisation.o1-o42 was not just any sub-lattice, but a sub lattice that could not be pierced by adding a single molecule at a time.Then the algorithm started adding 2 molecules at a time.Expanding o6 it was possible to find o43 which then interacting with the other organisations generated o44 to o54.It was important to follow the algorithm, not just to understand it better, but because it showed a number of informations about the lattice.First and foremost the fact that the lattice has indeed a number of sub-lattices.Each new organisation found permit us to expand the space of the known organisations to the next sub-lattice in a chain that leads to the complete lattice.Although only 10 basic organisations calculated were necessary to generate the whole lattice, nothing tells us how to find those generators.Indeed finding a minimum number of generators, or just even any set of generators of organisations, is an open problem.It was also interesting to count how many relations among organisations needed to be calculated, and how many could be derived from the theorems.The results (figure 2) suggests that as the number of organisations grows the number of organisations that needs to be calculated drops following a power law (making a straight line on a log-log plot).While the remaining relations can all be derived theoretically.

Testing the Algorithm on the Expanded NTop
To try the algorithm on a more challenging artificial chemistry, it was applied to an expansion of the NTop.This time molecules of size 9 were used, which then were folded as 3x3 molecules.This gave 512 molecules.The folding can be done in 9! ways, and this both for the molecule on the right side and on the left side, thus producing 9! * 9! possible Artificial Chemistries.Then the resulting matrix will contain numbers between 0 and 3, and this will be mapped onto the set {0, 1}.This mapping can be done in 2 4 possible ways.The resulting boolean 3x3 matrix must then be unfolded, and this also can be done in 9! ways.So in total there are 2 4 * (9!) 3 =1.9* 10 17 possible Artificial Chemistries.Many of those chemistries produce only a trivial lattice of organisation.
For example a lattice that would only contain few organisations, or where every set was an organisation.

Results
The algorithm described in this paper was applied.For now it was not possible to find all organisations.As with the NTop the algorithm started with the lattice which just included the empty and the complete organisations.Then it expanded the set of organisations going through 29 sub-lattices of respectively of 3,5,9,17,33,84,107,133,173,238,365,672,1604,1612,1703,1978,2066,3284,3522,3557,4711,4713,9377,9641,10090,10196, and 10288 organisations (figure 4).After which no new organisation was found expanding the empty organisation.So 10288 organisations were found just by adding 29 times a single molecule to the empty organisation.This created also two symmetric tables with all the intersection and unions.As the algorithm went on those tables were completed more and more using only the theorems.Again as the number of known organisations grew the percentage of organisations that needed to be calculated by hand decreased following a power law (figure 5).As such the more the lattice is known, the more powerful those theorems are to find the remaining organisations.Of the 510 molecules 29 permit us to find all the organisations that could be generated by the empty set.Then those organisations started to be expanded themselves.After the 10288 organisations sub lattice was found the algorithm tested one by one each of those organisations, and for the first 83 organisations, adding a single molecule would keep generating well known organisations.Then on the 84th organisation a molecule was added that expanded the sub lattice, from 10288 to over 69000.And then at 69779 the system could not handle the data using more than 150 gigabyte of RAM and crashed.It should be noted that in a space of 2 510 molecules it was realistically impossible to map the whole space of all the organisations.

Testing the Algorithm against the Brute Force
As a final test the Brute Force Algorithm was applied to this Artificial Chemistry.On a home laptop it only found 263 Organisations before crashing.And the average time to find each organisation was 42 seconds.While the home laptop could find 3000 organisations keeping an average of 0.2 seconds per organisation.In figure 6

Consequences and Conclusions
Reaction networks appear everywhere.And in their exploration the study of organisations, and their lattice is a necessary step to really understand their global behaviour as constructive dynamical system.The fact that organisations form a Lattice permit us to compute them faster.Although several results claim to be able to find all the organisations of a reaction network (Centler at al 2008, Centler at al 2010) they never used the algebraic properties of the Artificial Chemistry (namely that it is a lattice).Another important aspects that was uncovered in this work is the concept of sub-lattice, as a subset of organisations such that each union and intersection is an organisation inside the sub-lattice.From mathematics we know that if we consider the space of all sub-lattices of a lattice, they form a lattice, too: the lattice of sub-lattices of the lattice of organisations.Such lattice is not explored here, instead we merely extract a chain inside such lattice of sub-lattices and use this to build the lattice of organisations.Interestingly on the NTop system we could identify a sub lattice of organisations that was closed respect to the operation of adding a single molecule to any organisation.This shows that if we must find all the organisations, we cannot simply consider adding 1 molecule.But it also means that in some situations we are not interested in the complete lattice of organisations, but only in a sublattice since the the artificial chemistry will only explore that.For example in a Flow System both organisations and semi organisations form a lattice.But while each organisation is a semi-organisation the opposite is generally not true.Thus the lattice of organisations is a sub-lattice of the lattice of semiorganisation.And this fact could be used to map it.Similarly, Artificial Chemistries are not the only case of lattice present in the fields of Bioinformatics, Artificial Life and Systems Biology.Researchers looking at autocatalytic cycles and closed sets also are looking at sets of molecules that form lattices.Thus the same procedures that were exposed here, and the same theorems, can be applied over there, with comparable results.Every research clarifies some elements, while opening new questions.
-In particular it is still unclear what is the most effective way to apply the lattice theorems to study the lattice of organisations.Yes, theorems can shortcut the calculations, and we could see that the algorithm was at least three orders of magnitude faster than the Brute Force algorithm (and the difference was increasing), but finding which theorems can be applied can be time consuming as well.So a smart strategy might need to be applied to chose when to try to apply the theorems, as a further improvement of the algorithm.
-Also it is unclear why the number of times the theorems are not applicable follows so closely a power law.This might be related to the nature of the Lattice of Organisations as a graph.
But the details are still missing.
-The roles of sub-lattices, what is the sub-lattice of sublattices, and how the sub-lattices of the lattice or organisations can be used to study an ecology of different experiments on one artificial chemistry is also an open question.
-And finally the artificial chemistry presented here is very vast and exploring it all is at the moment impossible.It could as such be used as a benchmark for future work.Lattice Algorithm Brute Force Algorithm Fenizio (2015)  The Lattice of Chemical Organisations.Proceedings of the European Conference on Artificial Life 2015, pp.242-248Theorem 1: If A, B and C are elements in a Lattice <L, !, !>, then we know that (A !B) !C = A ! (B !C).Now suppose that we have two organisations, S, C, and we are interested in calculating T = S " C. If we can express S as S = A " B then T = S " C = (A " B) " C =A " (B " C).And if we know the value of B " C (for example, B " C = R) then T = S " C = A " R. Similarly if we need to calculate A " R.

Figure 1 :
Figure 1: Theorem 3. If A " B = S, any organisation C between A and S united with any organisation D between B and S will always produce S. We do not need to calculate C " D.

Figure 2 :Figure 3 :
Figure 2: NTop Original: Number of organisations in each subsequent sub-lattice; the complete lattice, 54 organisations, was found in 10 subsequent expansions.

Figure 5 :Figure 4 :
Figure 5: Percentage of Union or Intersection calculated by hand as opposed to extrapolated with the theorems.

Figure 6 :
Figure 6: Average time needed to find an organisation, for the first 263 organisations as the number of organisations grows.

Table 1 :
Different type of Artificial Chemistries produce sets of organisations with different properties.
Once we have finished exploring what happens by adding one molecule to a specific organisation, we continue with the next organisation, still maintaining the memory of all the molecules that added to B go up, on the side, or down.Also note that if Be goes sidewards generating C, then Ce will go downward, so we do not need to test it.Once we have finished exploring for each known organisations (which included the new ones we might have found in the meantime), what happens when we add one molecule, we need to consider what happens when we add two molecules.This is where some shortcuts will be possible.We need now to explore case 4 and 5. Let us suppose that e goes sideward, while f goes downward.So we are in case 5; do we need to test Bef?Since Be goes sideward, there exist an organisation C such that Be = C with e ∉ C and B < C.So Bef will be equivalent to test Cef.And since C > B than we will simply test this as part of testing C. Finally let us consider the case where both e and f go sideward.In this case Be = C; Bf = D. Thus there exist an organisation H such that C ⨆ D = H.Now Bef = Hef, but B < H, so we do not need to test it as part of B. And the result is that we only need to test sets of molecules such that all the molecules in this set go downward (table3).
Pietro Speroni diFenizio (2015)The Lattice of Chemical Organisations.Proceedings of the European Conference on Artificial Life 2015, pp.242-248Adding more than one molecule at a timeLet us start by saying that if we have two sets of molecules x, y, and two organisations B and C, with B < C, we do not need to test Bx if we can prove that Bx = Cy.Because we will already consider the organisation generated by Bx, when we consider the organisation generated by Cy.Let us suppose we take an organisation B, and two molecules e, f in M\B.Do we need to test Bef?We need now to look at the combinations depending if e or f of upward, downward or sideward: here we find a symmetric matrix with 6 different cases (see table2): If e goes up, than Be = C thus for every f, Bef = Cf.So any organisation that would be found through Bef will be found through Cf.So if either e or f goes upward, we do not need to test Bef.This clarifies cases 1, 2 and 3. We will immediately state that we are going to test Bef in case that both e, f go downward.And this clarifies case 6.

Table 2 :
Will adding two molecules at the same time to an organisation produce novelty?Depends on what each molecule does by itself.Six cases are possible.

Table 3 :
If we consider two molecules at the same time and add them to an organisation, this can produce novelty that would not be found through other ways only in one case.
Pietro Speroni di Fenizio (2015) The Lattice of Chemical Organisations.Proceedings of the European Conference on Artificial Life 2015, pp.242-248 although the difference kept increasing.Also it is important to remember that the Brute Force only returns a set of organisations.No informations about the relative relations between the organisations, is returned.What organisations are above or below which others; what is the union or intersections of two organisations, is an information which is equally missing.All information that the Lattice Algorithm can easily return as it needs them to compute the lattice.So not only is the Brute Force much slower and generally unefficient algorithm.But it also is insufficient to really let us know an artificial chemistry.