Skip to content

Basic examples

José A. Rodríguez Gallego edited this page Jan 24, 2023 · 2 revisions

Basic example 1 - P system generating all squares

Taken from [REF].

First we define the structure of the model and the rules it will follow:

@model<transition>
@include "transition_model.pli"
def main()
{
@mu = [[[]’3 []’4]’2]’1;
@ms(3) = a,f;
[a --> a,bp]’3;
[a --> bp,@d]’3;
[f --> f*2]’3;
[bp --> b]’2;

and then we add the syntax of the different rules involved:

!transition_evolution
{
[u -> v]’h;
[u -> v, @d]’h;
(?) [u -> v]’h;
(?) [u -> v, @d]’h;
[u [ ]’h1 --> v [w]’h1]’h;
[u [ ]’h1 --> v [w]’h1]’h;
(?) [u [ ]’h1 --> v [w]’h1]’h;
(?) [u [ ]’h1 --> v [w]’h1]’h;
[u [ ]’h1 [ ]’h2 --> v [w1]’h1 [w2]’h2]’h;
[u [ ]’h1 [ ]’h2 --> v [w1]’h1 [w2]’h2]’h;
(?) [u [ ]’h1 [ ]’h2 --> v [w1]’h1 [w2]’h2]’h;
(?) [u [ ]’h1 [ ]’h2 --> v [w1]’h1 [w2]’h2]’h;
[u [ ]’h1 [ ]’h2 [ ]’h3 --> v [w1]’h1 [w2]’h2 [w3]’h3]’h;
[u [ ]’h1 [ ]’h2 [ ]’h3 --> v [w1]’h1 [w2]’h2 [w3]’h3]’h;
(?) [u [ ]’h1 [ ]’h2 [ ]’h3 --> v [w1]’h1 [w2]’h2 [w3]’h3]’h;
(?) [u [ ]’h1 [ ]’h2 [ ]’h3 --> v [w1]’h1 [w2]’h2 [w3]’h3]’h;
}
@model(transition) = transition_evolution;
Clone this wiki locally