# Spiking Neural P Systems with Rules Dynamic Generation and Removal
## 3 The Turing Universality of SNP Systems with Rules Dynamic Generation and Removal
\begin{table}
\begin{tabular}{c c} \hline \hline
**Variants of SNP Systems** & **Number of Neurons** \\ \hline DSNP [38] & 4 \\ PASNP [39] & 9 \\ PSNRSP [40] & 8 \\ MPAIRSNP [41] & 8 \\ SNP-IR [42] & 5 \\ RDGRSNP & 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The comparison of the number of neurons required to construct the FIN module. four spikes to \(\sigma_{1}\); for neuron \(\sigma_{in_{6}}\), it applies rule \(r_{5}:a^{4}\rightarrow\lambda\) to forget the received four spikes. The above process will continue until the input neuron \(\sigma_{in}\) receives another spike. At step \(n\), \(\sigma_{in}\) receives another spike, so at step \(n+1\), \(\sigma_{in}\) applies \(r_{3}:a\to a\) again, sends one spike to \(\sigma_{in_{1}}\), \(\sigma_{in_{2}}\), \(\sigma_{in_{3}}\), and \(\sigma_{in_{4}}\). At step \(n+2\), \(\sigma_{in_{1}}\), \(\sigma_{in_{2}}\), \(\sigma_{in_{3}}\), and \(\sigma_{in_{4}}\) all apply the spiking rule with rules dynamic generation and removal \(r_{1}:a^{2}\to a^{2};r_{2},-r_{1}\), send two spikes to neurons \(\sigma_{in_{5}}\) and \(\sigma_{in_{6}}\), remove rule \(r_{1}\), and add rule \(r_{2}\). Thus, at step \(n+3\), these four auxiliary neurons apply rule \(r_{2}:a^{2}\rightarrow\lambda;r_{1},-r_{2}\) to forget two spikes. At step \(n+3\), both neurons \(\sigma_{in_{5}}\) and \(\sigma_{in_{6}}\) receive eight spikes. Neuron \(\sigma_{in_{5}}\) applies rule \(r_{7}:a^{8}\rightarrow\lambda\) to forget the spikes in it. Neuron \(\sigma_{1}\) receives four spikes at step \(n+2\), so it contains \(4n\) spikes. In \(\sigma_{in_{6}}\), rule \(r_{6}:a^{8}\to a^{4}\) is applied to send four spikes to \(\sigma_{l_{0}}\). Then, neuron \(\sigma_{l_{0}}\) contains four spikes, simulating the starting instruction \(l_{0}\). Table 4 lists five variants of SNP systems and the number of neurons they require to construct the INPUT module. From Table 4, it can be seen that DSNP, PASNP, PSNRSP, MPAIRSNP, and SNP-IR require 6, 6, 10, 6, and 9 neurons, respectively, while RDGRSNP requires 9. However, this is acceptable because the INPUT module will be used only once in the number-generating mode and will not have a great impact on the overall number of neurons. In the number-generating mode, the SUB instruction in \(M\) does not change, so we can continue to use the SUB module in Theorem 1 above. Since the system stop means that the input numbers are accepted, an additional FIN module is no longer needed to output the computation results. However, in the number-accepting mode, the ADD instruction in \(M\) is no longer in the non-deterministic form of \(l_{i}:(ADD(r),l_{j},k_{k})\), but in the deterministic form of \(l_{i}:(ADD(r),l_{j})\). Therefore, this paper provides a deterministic ADD module, as shown in Figure 8. This module consists of only three neurons and three rules. \begin{table}
\begin{tabular}{c c} \hline \hline
**Variants of SNP Systems** & **Number of Neurons** \\ \hline DSNP [38] & 6 \\ PASNP [39] & 6 \\ PSNRP [40] & 10 \\ MPAIRSNP [41] & 6 \\ SNP-IR [42] & 6 \\ RDGRSNP & 9 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The comparison of the number of neurons required to construct the INPUT module. Figure 7: INPUT module. In this deterministic ADD module, \(\sigma_{l_{i}}\) sends spikes to \(\sigma_{r}\), simulating the operation of adding one to the number of register \(r\) and, at the same time, sends spikes to \(\sigma_{l_{j}}\), causing instruction \(l_{j}\) to start being simulated. Table 5 lists five variants of SNP systems and the number of neurons they require to construct the deterministic ADD module. From Table 5, it can be seen that DSNP, PASNP, PSNRSP, MPAIRSNP, and SNP-IR require 4, 3, 5, 3, and 3 neurons, respectively, while RDGRSNP requires 3. Therefore, PASNP, MPAIRSNP, SNP-IR and the proposed RDGRSNP system in this paper require the least number of neurons.