Tuple-based Coordination of Stochastic Systems with Uniform Primitives Stefano Mariani DISI, ALMA MATER STUDIORUM–Universit` a di Bologna via Sacchi 3, 47521 Cesena, Italy Email: s.mariani@unibo.it Andrea Omicini DISI, ALMA MATER STUDIORUM–Universit` a di Bologna via Sacchi 3, 47521 Cesena, Italy Email: andrea.omicini@unibo.it Abstract—Complex computational systems – such as perva- sive, adaptive, and self-organising ones – typically rely on simple yet expressive coordination mechanisms: this is why coordination models and languages can be exploited as the sources of the essential abstractions and mechanisms to build such systems. While the features of tuple-based models make them well suited for complex system coordination, they lack the probabilistic mechanisms for modelling the stochastic behaviours typically required by adaptivity and self-organisation. To this end, in this paper we explicitly introduce uniform primitives as a probabilistic specialisation of standard tuple-based coordination primitives, replacing don’t know non-determinism with uniform distribution. We define their semantics and discuss their expressiveness and their impact on system predictability. I. I NTRODUCTION While computational systems grow in complexity, coordi- nation models and technologies are more and more essential to harness the intricacies of intra- and inter-system interaction [1], [2]. In particular, tuple-based coordination models – derived from the original LINDA [3] – have shown their power in the coordination of pervasive, adaptive, and self-organising systems [4], such as SAPERE [5] and MoK [6]. A foremost feature of computational models for open, adaptive and self-* systems is non-determinism.LINDA fea- tures don’t know non-determinism in the access to tuples in tuple spaces, handled with a don’t care approach: (i) a tuple space is a multiset of tuples where multiple tuples possibly match a given template; (ii) which tuple among the matching ones is actually retrieved by a getter operation (in, rd) can be neither specified nor predicted (don’t know); (iii) nonetheless, the coordinated system is designed so as to keep on working whichever is the matching tuple returned (don’t care). The latter assumption requires that when a process uses a template matching multiple tuples, which specific tuple is actually retrieved is not relevant for that process. This is not the case, however, in many of today adaptive and self- organising systems, where processes may need to implement stochastic behaviours like “most of the time do this” or “not always do that”—which obviously do not cope well with don’t know non-determinism. For instance, all the nature- inspired models and systems emerged in the last decade – such as chemical, biochemical, stigmergic, and field-based – are examples of the broad class of self-organising systems that precisely require such a sort of behaviour [7]—which by no means can be enabled by the canonical LINDA model and its direct derivatives. To this end, in this paper we define uniform coordination primitives (uin, urd) – first mentioned in [8] – as the special- isation of LINDA getter primitives featuring probabilistic non- determinism instead of don’t know non-determinism. Roughly speaking, uniform primitives allow programmers to both spec- ify and (statistically) predict the probability to retrieve one specific tuple among a bag of matching tuples, thus making it possible to statistically control non-deterministic systems. Accordingly, in this paper we first define uniform prim- itives based on the probabilistic framework from [9] (Sec- tion II), then demonstrate their expressive power both formally – by exploiting probabilistic modular embedding [10] – and by discussing some examples (Section III). Finally, we compare uniform primitives with other approaches in probabilistic and stochastic coordination (Section IV). II. UNIFORM PRIMITIVES LINDA getter primitives – that is, data-retrieval primitives in and rd – are shared by all tuple-based coordination models, and provide them with don’t know non-determinism: when one or more tuples in a tuple space match a given template, any of the matching tuples can be non-deterministically returned. In a single getter operation, only a point-wise property affects tuple retrieval: that is, the conformance of a tuple to the template, independently of the spatial context—namely, the other tuples in the same space. Furthermore, in a sequence of getter operations, don’t know non-determinism makes any prediction of the overall behaviour impossible: e.g., reading one thousand times the same template in a tuple space with ten matching tuples could possibly lead to retrieving the same tuple all times, or one hundred times each, or whatever admissible combination one could think of—no prediction possible, according to the model. Again, then, only a point- wise property can be ensured even in time: that is, only the mere compliance to the model of each individual operation in the sequence. Instead, uniform primitives enrich tuple-based coordination models with the ability of performing operations that ensure global system properties instead of point-wise ones, both in space and in time. More precisely, uniform primitives replace don’t know non-determinism with probabilistic non- determinism to situate a primitive invocation in space – the tuple actually retrieved depends on the other tuples in the space – and to predict its behaviour in time — statistically,