# Spiking Neural P Systems for Basic Arithmetic Operations
## 2 Related Research
### Spiking Neural P Systems  
A Spiking Neural P system of degree m (m \(\geq\) 1) is formally defined as Formula (1) [14; 17; 29; 30; 31; 32]:  
\[\mathbf{\Pi}=(\text{O},\,\sigma_{1},\,\sigma_{2},\,\ldots,\,\sigma_{m},\,syn, \,in,out) \tag{1}\]  
where:  
1. \(\text{O}=[a]\) is a singleton alphabet, where \(a\) is called a spike; \(\sigma_{1},\,\sigma_{2},\,\ldots,\,\sigma_{m}\) are neurons of the form \(\sigma_{i}=(\text{n}_{i},\,\text{R}_{i})\) in the \(\mathbf{\Pi}\) system, with \(1\leq i\leq\) m. Where \(\text{n}_{i}\geq 0\) is the number of spikes in neuron \(\sigma_{i}\) in the initial configuration, \(\text{R}_{i}\) is a finite set of rules of the following two forms: 1. \(\text{spiking rule: }\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\), where E is a regular expression over O, and \(c\geq 1\), \(d\geq 0\), \(p\geq 1\), \(c\geq p\); 2. \(\text{forgetting rule: }\text{E}^{\prime}/a^{s}\!\!\rightarrow\!\!\lambda\), where \(\text{E}^{\prime}\) is a regular expression over O, s \(\geq 1\), furthermore, for each rule \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\) in the rule set R\({}_{i}\) of type (\(i\)), it holds that \(\text{L}(\text{E})\cap\text{L}\big{(}\,\text{E}^{\prime}\big{)}=\,\), where L(E) is the language generated by E.
2. \(syn\subseteq\,\{\sigma_{1},\sigma_{2},\ldots,\sigma_{m}\}\times\{\sigma_{1}, \sigma_{2},\ldots,\sigma_{m}\}\) is a finite set of synapses between neurons, \((\sigma_{i},\,\sigma_{j})\in syn\) means that there is a synaptic connection from \(\sigma_{i}\) to neuron \(\sigma_{j}\). For any \(i\), \(1\leq i\leq m\), \((\sigma_{i},\,\sigma_{i})\
otin syn\); 3. \(in,\text{out}\in\{\sigma_{1},\sigma_{2},\ldots,\sigma_{m}\}\) indicate the input and output neurons, respectively. In particular, we use \(\sigma_{0}\) to denote the environment of the system. The explanation of the rules is as follows: if a firing rule \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\) satisfies \(p=1\) and a forgetting rule \(\text{E}^{\prime}/a^{s}\!\!\rightarrow\!\!\lambda\) satisfies \(\text{E}^{\prime}=a^{s}\), they are respectively called a standard firing rule and standard forgetting rule. If the firing rule \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\) satisfies \(\text{E}=a^{c}\), it is usually written as \(a^{c}\!\!\rightarrow\!\!a^{p};\,d\). If the firing rule \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\) satisfies \(d=0\), it is called a no-delay firing rule and written as \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p}\). If the firing rule \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\) satisfies both \(\text{E}=a^{c}\) and \(d=0\), it is abbreviated as \(a^{c}\!\!\rightarrow\!\!a^{p}\). Similarly, if the forgetting rule \(\text{E}^{\prime}/a^{s}\!\!\rightarrow\!\!\lambda\) satisfies \(\text{E}^{\prime}=a^{s}\), it can be abbreviated as \(a^{s}\!\!\rightarrow\!\!\lambda\). The usage of a spiking rule is as follows: at a certain moment, if the neuron \(\sigma_{i}\) contains spikes and there exists \(a^{k}\in\text{L}(\text{E})\) and \(k\geq c\), then the neuron \(\sigma_{i}\) can activate the spiking rule \(\text{E}/a^{c}\!\!\rightarrow\!\!a^{p};\,d\), consuming \(c\) spikes (leaving \(k-c\) spikes), and after \(d\) time slices, emit \(p\) spikes to all the neurons it is connected to. Additionally, during the period of sending \(d\) spikes after using this rule, the neuron \(\sigma_{i}\) is in a closed state, which means it cannot use any rules or receive spikes from other neurons. Only after \(\sigma_{i}\) becomes open (after \(d\) time slices) can it use rules and receive spikes. If a neuron sends spikes to a closed neuron, these spikes will naturally disappear. For an output neuron, it can send spikes to the environment. The usage of the forgetting rule is as follows: at a certain moment, if the neuron \(\sigma_{i}\) contains \(k^{\prime}\) spikes and satisfies \(a^{k^{\prime}}\in\text{L}(\text{E}^{\prime})\) and \(k^{\prime}\geq\text{s}\), this neuron can use the forgetting rule \(\text{E}^{\prime}/a^{s}\!\!\rightarrow\!\!\lambda\), which consumes \(s\) spikes and does not generate new spikes.