Exact discretization of 3-speed rational signal machines

. Cellular Automata (CA) operate in discrete time and space whereas Signal Machines (SM) have been developed as a continuous idealization of CA capturing the key concept of signals/particles and collisions. Inside a Euclidean space, dimensionless signals move freely; collisions are instantaneous. Today’s issue is the automatic generation of a CA mimicking a given SM. On the one hand, many ad hoc manual conversions exist. On the other hand, some irrational or 4+-speed SM exhibit Zeno-like behaviors / space-time compression or rely on information being locally unbounded, both being incompatible with CA. This article provides a solution to automatically generate an exactly mimicking CA for a restricted class of SM: the ones that uses only three rational speeds, and rational initial positions. In these SM, signals are always contained inside a regular mesh. The discretization brings forth the corresponding discrete mesh. The simulation is valid on any inﬁnite run and preserves the relative position of collisions.


Introduction
Cellular automata (CA) are massively synchronous, uniform and local discrete dynamical systems. Since their introduction by J. Von Neumann in the forties [17], a lot of research, from dynamics to algorithmic, have been made. However, a recurrent problem is to create CA for a specific purpose, exhibiting a given behavior. Dedicated CA are crafted by experts, in the same way that programming a computer used to be reserved to specialists. As of now, coding became easier and easier with more and more abstract languages. What would these be such for CA?
The model chosen to serve this purpose is the signal machines (SM). Signal machines, originally thought as an idealization of CA, focus on continuous counterparts of (discrete) signals and collisions in CA. Signals and collisions are indeed key concepts of CA. They provide a lot of insight on the fabric of CA and are the foundation of collision computing [1]. Some of their first usages stand in the generation of prime numbers by Fischer [13] and Goto's solution to the Firing Squad Synchronization Problem (FSSP) [14]. Signals are commonly used: to solve the FSSP [20], to compute with rule 110 [4] or with only four states [18], to understand one CA [5] and so on. In [19] one important question is the automatic positioning of discrete signals. Discrete signals are studied in [16].
In those references, as in many others, signals are represented by Euclidean lines to explain and reason as can be seen in Fischer's ( Fig. 1(a)) and in Goto's ( Fig. 1(b)) and Yunès's ( Fig. 1(c)). Those constructions are understood in the continuum before being implemented in a discrete setting. Resulting states and transition functions are often left out because they are not used in the proof of constructions, obnoxious to establish, and cumbersome to read.
It is possible to simulate a CA with a SM [11]. However, the other way round is done only on particular ad hoc cases, often leaving the technical details out. The present paper provides an automatic conversion for a sub-class of signal machines: 3-speed rational. After a normalization phase, the states and the transition function are generated as well as initial configurations. Signal machines are the formal tool for thinking about CA in the continuum and are inspired by the idealisation of discrete signals. They form an autonomous dynamical model where signals are dimensionless points moving with constant speed. They are completely described by their positions and natures called metasignals. Starting with a finite number of signals on the real axis, when two or more meet, they are destroyed and new signals are emitted. A set of collision rules defines which signals are emitted according to the colliding meta-signals. The dynamics is represented on a space-time diagram where signals appear as segments as in Fig. 2(b). In previous articles, one of the authors researched on the possibilities of the model, from its computational power [9,11], to its ability to simulate other models (like the BSS model [3] in [10]).
In signal machines, collisions are discrete steps related by signals: a collision is right before another if a signal generated by the first one ends in the second one. The dynamics of a run of a SM lies entirely in this causal order which can be represented as a Labeled Directed Acyclic Graph (LDAG). Figure 2 provides a LDAG identification of discrete and continuous space-time diagrams. The present paper considers 3-speed rational SM: only three possible speeds are available and speeds as well as positions of signals in initial configurations are rational numbers. The behavior of these machines is limited since signals are trapped inside a regular, periodic-like mesh [2,12] which is essentially discrete (ensuring the discretization).
The existence of such meshes is not guaranteed with four or more speeds or irrationality. Moreover, if discretization is always locally possible it is not at a large scale nor for an infinite computation. Zeno-like behaviors / space-time compression known as accumulation (which are highly unpredictable [8]) leads to an infinite number of "objects" in bounded portion of a space-time diagram as depicted in figures 3(a) and 3(b).
An accumulation-less space-time diagram may not be discretizable into a CA as shown the one in Fig. 3(c). On the left, one solid signal is sent after 0, 1, 2, 3. . . dotted ones. This means that any number can be "stored" in-between the solid vertical signals. Discretization would lead to a finite number of cells and a bounded "storage capacity".  Outside the case covered in the present article, discretization is only possible on special cases designed for with an extra piece of information (whatever it may be) ensuring the process to work.
The automatic conversion starts with a normalization to get simple speeds. Then meta-signals and collision rules are turned into states and transitions. The translation of configurations follows the same patterns: normalization into integer positions then conversion. Special care is taken so that the discrete signals evolve inside a discrete mesh. The correctness of the process comes from the "preservation" of it and the LDAG inside it.
In Section 2, the SM and CA models are defined as well as SM-meshes and CA-signals. Section 3 focuses on dynamics and simulation as well as normalization of SM. Section 4 describes the discretization: generated states and transitions and initial configurations. Section 5 deals with the correctness of the construction through CA-meshes and LDAG. Section 6 gathers concluding remarks.

Definitions and Properties
A signal machine regroups the definitions of its meta-signals and their dynamics: constant speed outside of collisions and rewriting rules at collisions.
is a finite set of meta-signals; S : M →R is the speed function (each meta-signal has a constant speed); and R is a finite set of collision rules written ρ = ρ − →ρ + where ρ − and ρ + are sets of meta-signals of distinct speeds. Each ρ − must have at least two meta-signals. R is deterministic: ρ =ρ implies ρ − =ρ − . If no collision rule is defined for a set of meta-signals, the collision is blank : the same meta-signals are output (ρ + = ρ − ).
A (A-)configuration, c, is a mapping from the real line to either a meta-signal, a collision rule or the value indicating that there is nothing there. There are finitely many non-locations.
If there is a signal of speed s at x, then after a duration ∆t its position is x + s·∆t, unless it enters a collision before. At a collision, all incoming signals are immediately replaced according to collision rules by outgoing signals in the following configurations.
A space-time diagram is the collection of consecutive configurations forming a two dimensional picture (time is always elapsing upwards as in Fig. 2).

Definition 2.
A signal machine is 3-speed rational (3S-Q) if: only three speeds are available for the meta-signals and all speeds are rational numbers as well as any non-position in any initial configuration.
These machines have their signals trapped inside a mesh made of the union of half-lines following the three speeds like the one in Fig. 4.
Definition 3. Let p, q and n be positive integers, p and q relatively prime, the (p, q, n)-(SM-)mesh corresponds to the union of the following half-lines of R×R + : depends on signals coming from e r+1 v−1 , e r v , and e r−1 v+1 (if they exist) or the initial configuration. The integers v and r are such that 0≤v≤n(p+q) and −n.q≤r. Encounters ordered according to dependencies form a well founded order used for inductive proofs.

Definition 4.
A (1-dimensional radius-1) cellular automaton (CA) is a triplet (Q, f, #) such that: Q is a finite set of states, f : Q 3 →Q is the local transition function, and # is a special state such that f (#, #, #) = # (the quiescent state). A configuration maps cells to states, i.e. it is an element of Q Z . In the evolution from a configuration c, the site, c t x , is the cell x (∈ Z) at time-step t (∈ N). It is computed by c t+1 Definition 5. Let W = M ∪ R be the set of meta-signals and collision rules of a signal machine A and Q be the set of states of a CA A. A A-A representation relation R relates W and Q with the intended meaning that λ R q iff λ is represented by q. A state representing a collision rule does not represent anything else. A meta-signal can be represented by many states and a state can represent more than one meta-signal. A state representing nothing corresponds to .
Definition 6. For any meta-signal µ, a µ-CA-signal is defined by (x, a, b, ϕ) where: x∈Z is the base position, a, b ∈ N with a≤b (b can be +∞) are the birth and death dates, and ϕ∈[0, 1) is the phase. It corresponds to the set of sites: ] }, otherwise (stationary signal). It must represent µ: µ R c t x for all (x, t) in the µ-CA-signal. Moreover it should be maximal (not extendable as a µ-CA-signal). Its speed is the one of µ.
After the normalization, the non-stationary speeds are of the form ±1/d. Any non-stationary CA-signal has a simple periodic dynamics: it moves one cell on the side every d iterations. Figure 5 provides examples of CA-signals.

Dynamics, Simulation and Normalization
The causal order of collisions in a space-time diagram can be represented as a Labeled Directed Acyclic Graph (LDAG) as illustrated in Fig. 2(c). If the LDAG's of two runs are identical, then the runs are dynamic-wise identical.
Formally, a A-DAG is a LDAG where edges (resp. vertices) are labeled with elements of M (resp. R ∪ {⊥, }). Bottom (resp. top) leaves are exactly the vertices labeled with ⊥ (resp. ). The label ⊥ is used for signals present in the initial configuration. The label is used for never-ending signals. The LDAG generated from an initial configuration c is denoted c.
A signal machine B simulates a SM A if there exist a conversion function ζ : C A → C B and a relabeling function ψ : M B ∪R B → M A ∪R A such that: ∀c ∈ C A , c = ψ( ζ(c)) where ψ is canonically extended to LDAG as relabeling each edge and vertex.
Linearly (with positive coefficients) changing the speeds of the meta-signals or the initial positions does not affect the dynamics [7,Chap. 5]. Examples of such transformations are provided in Fig. 6.
A 3-speed rational signal machine is normalized with a positive linear operation so that its speeds are − 1 q , 0, 1 p with p and q relatively prime. From now on, p and q are always used to refer to these denominators. Similarly, the positions in initial configurations are lifted onto N. Let R be a A-A representation relation, and c a A-configuration. The LDAG c R , as illustrated in Fig. 2(c), is formed as follows. The edges correspond to all the CA-signals in the space-time diagram. The vertices correspond to all the sites that represent a collision rule plus one ⊥ vertex for each CA-signal present in the initial configurations and one vertex for each infinite CA-signal. The edges are in-incident to vertices if the vector from the topmost site of the signal to the vertex site is (−1, 1), (0, 1) or (1, 1) (or an infinite CA-signal and the dedicated vertex). The edges are out-incident to vertices if the vector from the bottom-most site of the signal to the vertex site is (−1, −1), (0, −1) or (1, −1) (or present in the initial configuration and the dedicated ⊥ vertex). The labels correspond to µ for µ-CA-signal and the (unique) collision rule represented by the vertex. If the LDAG is ill formed or non-unique, then c R is undefined.
A cellular automaton A simulates a SM A if there exists a conversion function ζ : C A → C A and a A-A representation relation R such that: ∀c ∈ C A , c = ζ(c) R . Dynamic-wise simulation preserves collision interactions but discard anything relevant to positions. Nothing prevents the resulting space-time diagrams to be "bent" (as in [6]) and one might want to preserve the geometry up to some linear operator (like grouping for CA in [15]).
To cope with this, we say that a simulation is geometry-preserving if the positions of the CA-collisions can be computed from the one of the corresponding SM-collision with a linear function (plus some integral rounding). The construction presented here is geometry-preserving.

Formal Discretization
The notation a b c d defines the CA-transition f (a, b, c) → d. The quiescent state # is left blank in the pictures. Any non-specified transition results in #. It is understood that r and r are any rightward meta-signals, l and l are any leftward ones and z and z are any stationary ones.
The following states and transitions ensure the movement of isolated signals as illustrated in Let ρ : {r, z, l} → {l , z , r } be any collision rule (any single r, z, l could be missing and any r , z , l could be missing). When signals enter the same cell, the following phase hypothesis is assumed: non-stationary signals start with phase 0 and stationary ones with phase θ. The continuous signals are considered to locate precisely the collision. They correspond to the lines y = px (rightward), y = −qx+q (leftward) and x = θ (stationary). Resolving this system gives: x= q p+q and y= p·q p+q . The collisions always happen inside a cell because p·q p+q / ∈ Z (since p and q are relatively prime). The delay from getting in the same cell to the actual collision is denoted κ 0 .
The states ρ k represent the steps of the collision when two or more signals are inside the same cell: ρ k means (r k :z θ :l k ) when k<κ 0 and (l k :z θ :r k ) when κ 0 <k. Let κ 1 be the last time-step at which all the out-signals are inside the same cell and κ 2 the last time-step at which two out-signals are inside the same cell. Their values are given on Table 1 and illustrated in Fig. 8. Table 1. Main steps of a collision.
Emitted signals z and r l and z l and r l and z and r κ1 The signals enter the same cell (under the hypothesis) with # If the collision emits no signal, # ρκ 0 # # is added. If the collision emits one signal as illustrated in Fig. 9(a), add: otherwise; If the collision emits more than one signal, it progresses until a signal leaves: . If the collision emits two signals as illustrated in Fig. 9(b): , and -∀k, m, 0≤m<q − 1 and 0≤k<p − 1: l m z θ r k z θ . A scale is used to ensure that the continuous mesh is correctly discretized: spaces between stationary signals should be integers as well as times of collisions. From the definition of encounter, any (positive) multiple of p + q is enough. Let δ = 3(p + q) be the discretization scale.
Let c be an initial configuration of the discretized SM. The corresponding initial CA-configuration, c 0 , is defined by: ∀i∈Z, c 0 (i)=ψ(c(i/δ)) where ψ( )=#, ψ(z)=z θ for any stationary meta-signal, and ψ(µ)=µ 0 for any other. This ensures the validity of the phase hypothesis at the first round of collisions.

Correctness
In this section, q ≤ p is assumed (the rest follows by symmetry).
A discrete mesh is the discrete counterpart of the continuous meshes as illustrated in Fig. 11. The (δ, p, q, n)-CA-Mesh corresponds to the union of: Each set corresponds to a CA-signal (not necessary issued from the initial configuration). They can overlap for consecutive iterations (as in Figs. 9 and 12).
In the (δ=3(p+q), p, q, n)-(CA-)mesh, the CA-encounter of coordinates (v, r), e r v , corresponds to: where the (v, r) coordinates are integers such that 0 ≤ v ≤ n(p+q) and −n.q ≤ r. The last term in the formula comes from the phases.  Under the hypothesis that the κ 0 site is located at some e r v , ρ 0 has coordinates (3v, 3pv + rδ) and thus corresponds to the SM-encounter e r v at scale δ. This relates discrete and continuous meshes.    With the same hypothesis, the following holds: ρ 0 belongs to V v , R r and L v+r , ρ κ2 belongs to R r , and ρ κ1 belongs to L v+r . This fixes all three CAsignals over a period. The whole collision is in the (δ, p, q, n)-CA-Mesh. As can be seen in Fig. 12, meta-signals extend out of the collision from both ends so that CA-signals directly connect into.
The hypothesis is always satisfied as can be proved by induction: CA-signals in the initial configuration are in the CA-Mesh with the right phases and if CAsignals from the mesh collide, so are the collisions and the resulting CA-signals. Altogether, it proves that: Theorem 1. All the non-quiescent sites of the run from the simulating CAconfiguration are located inside the (δ, p, q, n)-CA-Mesh. Up to scaling, this mesh coincides with the continuous (p, q, n)-SM-mesh.
The A-A representation relation is defined straightforwardly from the construction. Let l, z and r be any leftward, stationary and rightward meta-signals: Let ρ = {r, z, l} → {l , z , r } be any rule.
A structural induction on the mesh proves that the SM and CA LDAG's are identical, so that: Theorem 2. Any 3-speed rational signal machine can be simulated exactly by a cellular automaton on any infinite run preserving the geometry.

Conclusion
The exact conversion of a 3-speed rational signal machine into a cellular automata has been proved and implemented in Java. The construction relies on preserving a dynamics that is trapped inside a discrete-like mesh. Moreover this is valid on any infinite run and preserves the relative position of collisions.
This result is tight: as soon as either irrationality [2] or four speeds is allowed, Zeno-like phenomena (infinitely many collisions in finite duration) is possible and there is no hope for exact discretization. Even if the techniques presented here can be extended to any number of (rational) speeds, there is no information on how long the discretization remains valid. We believe that testing the validity for a given amount of time is as complex as running the signal machine and its simulation.
The construction presented here naturally extends to any SM computation that is constrained to remain on a mesh (we do not expect such a property to be decidable whether the mesh is provided or not in the general case). One perspective is to either work with some extra piece of information proving the containment into a mesh or the non-existence of an accumulation (which is highly non decidable [8]) or other problematic behavior. One important step would be to discretize rational signal machines with four or more speeds known to be Turing complete without accumulating as in [11].
Another perspective is to provide approximation. The quality of the approximation would have to be defined and if possible a bound guaranteed.