# Spiking Neural P Systems with Rules Dynamic Generation and Removal
## 3 The Turing Universality of SNP Systems with Rules Dynamic Generation and Removal
In neuron \(\sigma_{l_{i}}\), the spiking rule with rules dynamic generation and removal \(r_{1}:a^{4}/a^{2}\to a^{2};r_{2}\) is applied, consuming two spikes, sending two spikes, sending two spikes to \(\sigma_{r}\), \(\sigma_{l_{i}^{(1)}}\), and \(\sigma_{l_{i}^{(2)}}\) and adding \(r_{2}:a^{2}\to a^{2};-r_{2}\). At step \(t+1\), \(\sigma_{l_{i}}\) has two spikes with \(r_{1}\), \(r_{2}\), and \(r_{7}\). Therefore, \(\sigma_{l_{i}}\) applies rule \(r_{2}:a^{2}\to a^{2};-r_{2}\), sending two spikes to \(\sigma_{r}\), \(\sigma_{l_{i}^{(1)}}\), and \(\sigma_{l_{i}^{(2)}}\) and removing \(r_{2}\). At step \(t+1\), \(\sigma_{r}\) receives two spikes again, for a total of four spikes, corresponding to the number in register \(r\) add one. In addition, \(\sigma_{l_{i}^{(1)}}\) has four spikes with rules \(r_{1}\) and \(r_{2}\). Since both rules can be applied, neuron \(\sigma_{l_{i}^{(1)}}\) non-deterministically chooses one to apply. The situations are as follows:  
1. When neuron \(\sigma_{l_{i}^{(1)}}\) chooses rule \(r_{1}:a^{4}/a^{2}\to a^{2};r_{2}\) to apply, it consumes two spikes, sends two spikes to neurons \(\sigma_{l_{j}}\) and \(\sigma_{l_{i}^{(2)}}\), and adds rule \(r_{2}:a^{2}\to a^{2};-r_{2}\). At step \(t+3\), \(\sigma_{l_{i}^{(2)}}\) applies the forgetting rule with rules dynamic generation and removal \(r_{5}:a^{6}\to\lambda;r_{6}\), consumes the six spikes it contains, and adds rule \(r_{6}:a^{2}\to\lambda;-r_{6}\). In neuron \(\sigma_{l_{i}^{(1)}}\), since it contains two spikes with rules \(r_{1}\), \(r_{2}\), and \(r_{3}\), rule \(r_{2}:a^{2}\to a^{2};-r_{2}\) is applied, sending two spikes to neurons \(\sigma_{l_{j}}\) and \(\sigma_{l_{i}^{(2)}}\), and removing rule \(r_{2}\). At step \(t+4\), \(\sigma_{l_{i}^{(2)}}\) applies \(r_{6}:a^{2}\to\lambda;-r_{6}\), consuming two spikes and removing rule \(r_{6}\). In addition, neuron \(\sigma_{l_{j}}\) receives two spikes, containing four spikes in total and starts simulating \(l_{j}\). 2. When neuron \(\sigma_{l_{i}^{(1)}}\) chooses rule \(r_{3}:a^{4}/a^{2}\to\lambda;r_{4}\) to apply, it consumes two spikes and adds rule \(r_{4}\). At step \(t+3\), \(\sigma_{l_{i}^{(1)}}\) contains two spikes with rules \(r_{1}\), \(r_{3}\), and \(r_{4}\). Thus, the spiking rule with rules dynamic generation and removal \(r_{4}:a^{2}\to a;-r_{4}\) is applied, sending one spike to neurons \(\sigma_{l_{j}}\) and \(\sigma_{l_{i}^{(2)}}\), respectively, and removing rule \(r_{4}\). At step \(t+4\), \(\sigma_{l_{j}}\) applies \(a\to\lambda\), forgetting the one spike from neuron \(\sigma_{l_{i}^{(1)}}\). In addition, \(r_{8}:a^{5}\to a^{4}\) is applied in neuron \(\sigma_{l_{i}^{(2)}}\), sending four spikes to \(\sigma_{l_{k}}\). At step \(t+5\), \(\sigma_{l_{k}}\) contains four spikes and starts simulating \(l_{k}\). Table 1 lists five variants of SNP systems and the number of neurons they require to construct the ADD module. From Table 1, it can be seen that DSNP, PASNP, PSNR, MPAIRSNP, and SNP-IR require 7, 8, 11, 9, and 8 neurons, respectively, while DRGRSNP  
Figure 3: ADD module. requires 6. Therefore, the proposed RDGRSNP system in this paper requires the least number of neurons. Suppose that neuron \(\sigma_{l_{i}}\) contains four spikes at step \(t\) and starts simulating instruction \(l_{i}:(SUB(r),l_{j},l_{k})\). Neuron \(\sigma_{l_{i}}\) applies the spiking rule with rules dynamic generation and removal \(r_{1}:a^{4}/a\to a;r_{2}\), sends one spike to \(\sigma_{l_{i}^{(1)}}\), \(\sigma_{l_{i}^{(2)}}\), and \(\sigma_{r}\), and adds \(r_{2}\) to the rule set. At step \(t+1\), \(\sigma_{l_{i}}\) remains with three spikes with rules \(r_{1}\), \(r_{2}\), and \(r_{8}\), so \(\sigma_{l_{i}}\) applies the spiking rule with rules dynamic generation and removal \(r_{2}:a^{3}\to a^{2};-r_{2}\), sends two spikes to the postsynaptic neuron, and removes the rule \(r_{2}\). In \(\sigma_{l_{i}^{(1)}}\) and \(\sigma_{l_{i}^{(2)}}\), the forgetting rule is applied, forgetting one spike.