# Spiking Neural P Systems with Rules Dynamic Generation and Removal
## 3 The Turing Universality of SNP Systems with Rules Dynamic Generation and Removal
In addition, different rules are applied in neuron \(\sigma_{r}\) depending on whether the initial state contains spikes or not in the following two cases:  
1. If \(\sigma_{r}\) contains \(4n(n\geq 1)\) spikes, then at step \(t+1\), \(\sigma_{r}\) applies \(r_{3}:a(a^{4})^{+}/a\to a;r_{4}\), consumes one spike, and sends it to \(\sigma_{l_{i}^{(1)}}\) and \(\sigma_{l_{i}^{(2)}}\). Thus, at step \(t+2\), both \(\sigma_{l_{i}^{(1)}}\) and \(\sigma_{l_{i}^{(2)}}\) have three spikes. Additionally, neuron \(\sigma_{r}\) contains \(4n+2\) spikes with rules \(r_{3}\), \(r_{4}\) and \(r_{6}\). Thus, the spiking rule with rules dynamic generation and removal \(r_{4}:a^{2}(a^{4})^{+}/a^{2}\to a^{2};r_{5}\), \(-r_{4}\) is applied, sending two spikes to \(\sigma_{l_{i}^{(1)}}\) and \(\sigma_{l_{i}^{(2)}}\), adding rule \(r_{5}\), and removing rule \(r_{4}\). At step \(t+3\), \(\sigma_{r}\) applies \(r_{5}:(a^{4})^{+}/a^{4}\to\lambda;-r_{5}\), forgetting four spikes. Thus, at step \(t+4\), \(\sigma_{r}\) has \(4n-4\) spikes, corresponding to the number in register \(r\) subtracted by one. Additionally, at step \(t+3\), \(\sigma_{l_{i}^{(1)}}\) applies \(r_{11}:a^{5}\to a^{4}\) to send four spikes to \(\sigma_{l_{j}}\). In neuron \(\sigma_{l_{i}^{(2)}}\), the forgetting rule \(r_{12}:a^{5}\to\lambda\) is applied. At step \(t+4\), \(\sigma_{l_{j}}\) contains four spikes, simulating instruction \(l_{j}\). 2. If neuron \(\sigma_{r}\) does not contain spikes, then at step \(t+1\), the spiking rule with rules dynamic generation and removal \(r_{6}:a\to a;r_{7}\) is applied, sending one spike to  
Figure 4: SUB module. \begin{table}
\begin{tabular}{c c} \hline \hline
**Variants of SNP Systems** & **Number of Neurons** \\ \hline DSNP [38] & 7 \\ PASNP [39] & 8 \\ PSNRSP [40] & 11 \\ MPAIRSNP [41] & 9 \\ SNP-IR [42] & 8 \\ RDGRSNP & 6 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The comparison of the number of neurons required to construct the ADD module. and \(\sigma_{l_{i}^{(2)}}\) and adding \(\tau_{7}\). At step \(t+2\), \(\sigma_{r}\) has \(r_{3}\), \(r_{6}\), and \(r_{7}\) with two spikes, so the spiking rule with rules dynamic generation and removal \(r_{7}:a^{2}\to a;-r_{7}\) is applied, removing rule \(r_{7}\). Thus, at step \(t+3\), the auxiliary neuron \(\sigma_{l_{i}^{(1)}}\) applies rule \(r_{10}:a^{4}\rightarrow\lambda\), while \(\sigma_{l_{i}^{(2)}}\) applies rule \(r_{9}:a^{4}\to a^{4}\), sending spikes to \(\sigma_{l_{k}}\). At step \(t+4\), \(\sigma_{l_{k}}\) contains four spikes, simulating instruction \(l_{k}\). Table 2 lists five variants of SNP systems and the number of neurons they require to construct the SUB module. From Table 2, it can be seen that DSNP, PASNP, PSNR, MPAIRSNP, and SNP-IR require 7, 10, 15, 8, and 8 neurons, respectively, while RDGRSNP requires 6. Therefore, the proposed RDGRSNP system in this paper requires the least number of neurons. **FIN module:** The FIN module is used to simulate the halt instruction \(l_{h}:HALT\) and output the numbers generated by system \(\Pi\), as shown in Figure 5. The generated number \(n\) is represented by the time interval between the first two spikes sent to the environment \(env\) by the output neuron. The FIN module constructed in this paper consists of three neurons and six rules. Suppose that at step \(t\), \(\sigma_{l_{h}}\) has four spikes, starts simulating instruction \(l_{h}:HALT\) and outputting the computation results. Neuron \(\sigma_{l_{h}}\) applies the spiking rule with rules dynamic generation and removal \(r_{1}:a^{4}/a^{2}\to a;r_{2}\), sends one spike to \(\sigma_{1}\) and \(\sigma_{out}\), and adds \(r_{2}\) to it. Thus, at step \(t+1\), neuron \(\sigma_{l_{h}}\) applies \(r_{2}:a^{2}\to a;r_{2}\), sends one spike to \(\sigma_{1}\) and \(\sigma_{out}\), and removes \(r_{2}\).