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

The previous example computed odd numbers, that is, \(N_{in}(\Pi)=\{2n+1\mid n\ge 0\}\).

The following example obtains the same result, but using a different structure involving target indicators in and out instead of here:

../../_images/cellsnp2.png

Model in P-Lingua

The corresponding P-Lingua file is the following:

@model<cell_like_snp>

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

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

        [a*4]'2  --> (a*4;out);
        [a]'2  --> (a;out);

        @mout = 1;
}

References

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