Cell-like Spiking Neural P systems generating odd numbers - First example

Let us pay attention to this Cell-like SN P system:

\(\Pi=(\{a\},[ \, \, ], 2,R_1,1)\),

where:

\(R_1=\{(a^2)^+/a^2\rightarrow (a^4,here),\ (a^2)^+/a^2\rightarrow (a,here)\}\).

The initial multiset in membrane \(1\), as specified in \(\Pi\), is \(a^2\).

The behaviour of the system is as follows: the first rule adds two more spikes, repeatedly, but when the second rule is used (this may happen also in the first step) the number of spikes becomes odd and no further rule can be used. Therefore, \(N_{in}(\Pi)=\{2n+1\mid n\ge 0\}\).

Model in P-Lingua

The corresponding P-Lingua file is the following:

@model<cell_like_snp>

def main()
{
        @mu = [a*2]'1;

        [a*2]'1  --> (a*4;here) "(a{2})+";
        [a*2]'1  --> (a;here) "(a{2})+";

        @mout = env;
}

It can be also written by in a simpler way, ommitting here targets:

@model<cell_like_snp>

def main()
{
        @mu = [a*2]'1;

        [a*2]'1  --> a*4 "(a{2})+";
        [a*2]'1  --> a "(a{2})+";
}

References

[1]
  1. Wu, Z. Zhang, G. Paun, L. Pan. Cell-like spiking neural P systems. Theoretical Computer Science, 623 (2016), 180-189.