SearcharxivSearch

arXiv · 2512.22067

Random state comonads encode cellular automata evaluation

Abstract

Cellular automata (CA) are quintessential ALife and ubiquitous in many studies of collective behaviour and emergence, from morphogenesis to social dynamics and even brain modelling. Recently, there has been an increased interest in formalising CA, theoretically through category theory and practically in terms of a functional programming paradigm. Unfortunately, these remain either in the realm of simple implementations lacking important practical features, or too abstract and conceptually inaccessible to be useful to the ALife community at large. In this paper, we present a brief and accessible introduction to a category-theoretical model of CA computation through a practical implementation in Haskell. We instantiate arrays as comonads with state and random generators, allowing stochastic behaviour not currently supported in other known implementations. We also emphasise the importance of functional implementations for complex systems: thanks to the Curry-Howard-Lambek isomorphism, functional programs facilitate a mapping between simulation, system rules or semantics, and categorical descriptions, which may advance our understanding and development of generalised theories of emergent behaviour. Using this implementation, we show case studies of four famous CA models: first Wolfram's CA in 1D, then Conway's game of life, Greenberg-Hasings excitable cells, and the stochastic Forest Fire model in 2D, and present directions for an extension to N dimensions. Finally, we suggest that the comonadic model can encode arbitrary topologies and propose future directions for a comonadic network.

Explore related subjects

Keep this discovery

BibTeXRIS

Madalina I Sas, Julian H J Sutherland. 2025-12-26. Random state comonads encode cellular automata evaluation. https://arxiv.org/abs/2512.22067

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Optical free space extreme learning machine for the implementation of emergent complex systems

Cellular automata conform a set of computational models which evolve with a reduced set of simple rules, yet still are able to show extremely complex emergent phenomena such as fractals and universal computation. Despite their apparent simplicity, they have shown great potential in simulating natural systems and solving challenging computational tasks such as classification and image generation. Instead of implementing cellular automata purely at the software level, it is desirable to design novel analog computing platforms that physically evolve following the automata's underlying rules, thereby reducing power requirements and latency. Here, we introduce an optical extreme learning machine for the simulation of a wide range of cellular automata. Our system operates in free space, and uses a spatial light modulator to encode the evolution rules of the system, while coherent wave propagation performs the corresponding computations. Our results demonstrate a simple, fully-programmable, cost and power efficient, and easy to build and align platform for the implementation of a wide range of complex computational systems such as elementary cellular automata, Conway's Game of Life, and two-dimensional Turing machines.

nlin.CG

The istr-graph: Interactive Visualisation of any Classic-Graph in DDLab

Any type of attractor basin (classic-graph) created in DDLab can now be visualised, manipulated, and deconstructed as a drag/drop ``interactive state transition graph'' (istr-graph). The new istr-graph applies to subtrees, single basins, the basin of attraction field, compression, and all other classic-graph parameters. This is an important update on the pre-existing ``interactive basin of attraction field graph'' (ibaf-graph) specific to just the complete uncompressed field, but the ibaf-graph is nevertheless retained for some of its unique attributes. These issues are discussed with a focus on the scope and implementation of the new istr-graph.

nlin.CG

Game of Life on Archimedean Lattices: Glider Guns and Phase Dynamics

I explore Conway's Game of Life (GoL) on six composite Archimedean lattices. On the Kagome lattice, on which small gliders and puffers appear particularly frequently across inputs, I use the output of a symmetry-constrained evolutionary search algorithm to construct a novel glider gun. The glider gun comprises four interacting bouncers and stably emits a small glider every 276th generation. Serving as an extension of classical GoL, I also propose cells with a phase degree of freedom and an associated local phase rule, which on the Kagome lattice is demonstrated to host phase-periodic gliders. This enables the possibility of phase-sensitive and interference-based computations.

nlin.CG