Socket
Socket
Sign inDemoInstall

p-system-simulate

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-system-simulate

Library to simulate P Systems


Maintainers
1

PSystem python library

The PSystem library allows you to create P Systems and evolve them, enabling complex simulations of these computational models.

PSystem Class and Its functions

Creating a PSystem Object

To create a PSystem object:

ps = PSystem(H, V, base_struct, m_objects, m_plasmids, m_rules, p_rules, i0)
ParameterTypeDescriptionDefault
HdictPlasmids' alphabet and its rules.None
VlistSystem's alphabet.[ ]
base_structstrInitial system's structure."[1]1"
m_objectsdictMembrane's objects.{ 0 : '' }
m_plasmidsdictMembranes' plasmids.None
m_rulesdictMembrane's rules.{ 0 : { } }
p_rulesdictRules priority in each membrane.{ 0: [ ] }
i0intOutput membrane.1

PSystem Methods

  • ps.steps(n, verbose=False): Evolve the system n steps. If verbose is True, prints the system's structure at each step. Returns the system dictionary after applying n steps.

  • ps.while_evolve(verbose=False): Evolve the system until all possible iterations are finished. If verbose is True, prints the system's structure at each step. Returns the system dictionary after applying all iterations.

  • ps.evolve(feasible_rules, verbose=False): Evolve the system by choosing a random membrane from feasible_rules list whose items are a tuple of membrane's id and their rules to apply. If verbose is True, prints the membrane where the rules are being applied, the rules applied, and the number of times each rule has been applied.

  • ps.get_feasible_rules(): Get feasible rules from all the membranes in the current state.

  • ps.get_memb_feasible_rules(memb_id): Get a combination of rules that can be applied all at once in the membrane with id memb_id. ps.accessible_plasmids(memb_id): Get the plasmids that could go into the membrane with id memb_id.

  • ps.print_system(): Print the system's structure.

  • ps.to_dict(): Returns the system structure in a dictionary.

Membrane Class and Its functions

Creating a Membrane Object

memb = Membrane(V, id, parent, objects, plasmids, rules, p_rules)
ParameterTypeDescriptionDefault
VlistMembrane's alphabet (same as system's)
idintMembrane's id
parentintParent Membrane's id.None
objectsstrMembrane's objects.''
plasmidslistMembrane's plasmids.[ ]
rulesdictMembrane's rules.{}
p_rulesdictRules priority in membrane.[ ]

Membrane Methods

  • memb.add_child(child_id): Add child with id child_id to the membrane.
  • memb.remove_child(child_id): Remove child with id child_id from the membrane.
  • memb.add_objects(objects): Add all the objects in objects to the membrane.

Examples without plasmids

n squared

A P System generating , n >= 1

A P System generating n², n >= 1

from p_system_simulate import *

alphabet = ['a','b','x','c','f']
struct = '[1[2[3]3[4]4]2]1'
m_objects = {
    3:'af',
}

r_2 = {
    1:('x','b'),
    2:('b','bc4'),
    3:('ff','f'),
    4:('f','a.')
}

r_3 = {
    1:('a','ax'),
    2:('a','x.'),
    3:('f','ff')
}

m_rules = {
    2:r_2,
    3:r_3,
}

p_rules = {
    2:[(3,4)],
}

i0 = 4

ps = PSystem(V=alphabet, base_struct=struct, m_objects=m_objects, m_rules=m_rules, p_rules=p_rules, i0=i0)

print(ps.while_evolve(verbose=True))
Output

[1 '' [2 '' [3 'fa' ]3[4 '' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 3 | n_times: 1 -> rule '1':  ('a', 'ax')
membrane: 3 | n_times: 1 -> rule '3':  ('f', 'ff')
[1 '' [2 '' [3 'ffxa' ]3[4 '' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 3 | n_times: 1 -> rule '1':  ('a', 'ax')
membrane: 3 | n_times: 2 -> rule '3':  ('f', 'ff')
[1 '' [2 '' [3 'ffffxxa' ]3[4 '' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 3 | n_times: 1 -> rule '1':  ('a', 'ax')
membrane: 3 | n_times: 4 -> rule '3':  ('f', 'ff')
[1 '' [2 '' [3 'ffffffffxxxa' ]3[4 '' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 3 | n_times: 1 -> rule '2':  ('a', 'x.')
membrane: 3 | n_times: 8 -> rule '3':  ('f', 'ff')
[1 '' [2 'ffffffffffffffffxxxx' [4 '' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '1':  ('x', 'b')
membrane: 2 | n_times: 8 -> rule '3':  ('ff', 'f')
[1 '' [2 'ffffffffbbbb' [4 '' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '2':  ('b', 'bc4')
membrane: 2 | n_times: 4 -> rule '3':  ('ff', 'f')
[1 '' [2 'ffffbbbb' [4 'cccc' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '2':  ('b', 'bc4')
membrane: 2 | n_times: 2 -> rule '3':  ('ff', 'f')
[1 '' [2 'ffbbbb' [4 'cccccccc' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '2':  ('b', 'bc4')
membrane: 2 | n_times: 1 -> rule '3':  ('ff', 'f')
[1 '' [2 'fbbbb' [4 'cccccccccccc' ]4]2]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '2':  ('b', 'bc4')
membrane: 2 | n_times: 1 -> rule '4':  ('f', 'a.')
[1 'abbbb' [4 'cccccccccccccccc' ]4]1

============================================================================================

{'environment': {'childs': {1: {'childs': {4: {'objects': {'c': 16}}},
                                'objects': {'a': 1, 'b': 4}}},
                 'objects': {}}}

k divides n

A P system that checks if a number n is divisible by another number k.

A P system deciding whether k divides n

In this case k = 3 divides n = 15 .

from p_system_simulate import *

n = 15
k = 3

alphabet = ['a','c','x','d']
struct = '[1[2]2[3]3]1'
m_objects = {
    2:'a'*n+'c'*k+'d',
    3:'a'
}

r_1 = {
    1:('dcx','a3')
}

r_2 = {
    1:('ac','x'),
    2:('ax','c'),
    3:('d','d.')
}

m_rules = {
    1:r_1,
    2:r_2,
}

p_rules = {
    2 : [(1,3),(2,3)],
}

i0 = 3
ps = PSystem(V=alphabet, base_struct=struct, m_objects=m_objects, m_rules=m_rules, p_rules=p_rules, i0=i0)

print(ps.while_evolve(verbose=True))
Output

[1 '' [2 'cccdaaaaaaaaaaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 3 -> rule '1':  ('ac', 'x')
[1 '' [2 'xxxdaaaaaaaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 3 -> rule '2':  ('ax', 'c')
[1 '' [2 'cccdaaaaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 3 -> rule '1':  ('ac', 'x')
[1 '' [2 'xxxdaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 3 -> rule '2':  ('ax', 'c')
[1 '' [2 'cccdaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 3 -> rule '1':  ('ac', 'x')
[1 '' [2 'xxxd' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 1 -> rule '3':  ('d', 'd.')
[1 'xxxd' [3 'a' ]3]1

============================================================================================

{'environment': {'childs': {1: {'childs': {3: {'objects': {'a': 1}}},
                                'objects': {'d': 1, 'x': 3}}},
                 'objects': {}}}

In this other case k = 4 not divides n = 15.


[1 '' [2 'ccccdaaaaaaaaaaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '1':  ('ac', 'x')
[1 '' [2 'xxxxdaaaaaaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '2':  ('ax', 'c')
[1 '' [2 'ccccdaaaaaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule '1':  ('ac', 'x')
[1 '' [2 'xxxxdaaa' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 3 -> rule '2':  ('ax', 'c')
[1 '' [2 'cccxd' ]2[3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 1 -> rule '3':  ('d', 'd.')
[1 'cccxd' [3 'a' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '1':  ('dcx', 'a3')
[1 'cc' [3 'aa' ]3]1

============================================================================================

{'environment': {'childs': {1: {'childs': {3: {'objects': {'a': 2}}},
                                'objects': {'c': 2}}},
                 'objects': {}}}

Examples with plasmids

Arithmetical substraction. m - n

A P System that makes an arithmetic substraction operation between m and n.

A P System doing m - n

from p_system_simulate import *

n = 4
m = 10

alphabet = ['a','b','c','p','q']
plasmids = {
    "P_1":{"P_1_1":('a','a0')},
    "P_2":{"P_2_1":('ab','c0')}
}
struct = '[1[2]2[3]3]1'
m_objects = {
    1:'pq',
    2:'a'*n,
    3:'b'*m
}

m_plasmids = {
    0: set(['P_1','P_2'])
}

r_0 = {
    1:("P_1[p]1","p[P_1]1"),
    2:("P_2[q]1","q[P_2]1"),
}

r_1 = {
    1:("P_1[]2","[P_1]2"),
    2:("P_2[]3","[P_2]3"),
    3:("a","a3"),
}

m_rules = {
    0:r_0,
    1:r_1,
}

i0 = 3
ps = PSystem(H=plasmids, V=alphabet, base_struct=struct, m_objects=m_objects, m_plasmids=m_plasmids, m_rules=m_rules, i0=i0)

print(ps.while_evolve(verbose=True))
Output

 'P_1P_2' ''  [1 '' 'pq'  [2 '' 'aaaa' ]2 [3 '' 'bbbbbbbbbb' ]3]1

--------------------------------------------------------------------------------------------

enviroment | n_times: 1 -> rule '1':  ('P_1[p]1', 'p[P_1]1')
enviroment | n_times: 1 -> rule '2':  ('P_2[q]1', 'q[P_2]1')
 '' 'pq'  [1 'P_1P_2' ''  [2 '' 'aaaa' ]2 [3 '' 'bbbbbbbbbb' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '1':  ('P_1[]2', '[P_1]2')
membrane: 1 | n_times: 1 -> rule '2':  ('P_2[]3', '[P_2]3')
 '' 'pq'  [1 '' ''  [2 'P_1' 'aaaa' ]2 [3 'P_2' 'bbbbbbbbbb' ]3]1

--------------------------------------------------------------------------------------------

membrane: 2 | n_times: 4 -> rule 'P_1_1':  ('a', 'a0')
 '' 'pq'  [1 '' 'aaaa'  [2 'P_1' '' ]2 [3 'P_2' 'bbbbbbbbbb' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 4 -> rule '3':  ('a', 'a3')
 '' 'pq'  [1 '' ''  [2 'P_1' '' ]2 [3 'P_2' 'aaaabbbbbbbbbb' ]3]1

--------------------------------------------------------------------------------------------

membrane: 3 | n_times: 4 -> rule 'P_2_1':  ('ab', 'c0')
 '' 'pq'  [1 '' 'cccc'  [2 'P_1' '' ]2 [3 'P_2' 'bbbbbb' ]3]1

============================================================================================

{'environment': {'childs': {1: {'childs': {2: {'objects': {},
                                               'plasmids': {'P_1'}},
                                           3: {'objects': {'b': 6},
                                               'plasmids': {'P_2'}}},
                                'objects': {'c': 4}}},
                 'objects': {'p': 1, 'q': 1}}}

Mathematical product. m * n

A P System that makes product operation between m and n.

A P System doing m * n

from p_system_simulate import *

n = 4
m = 5

alphabet = ['a','b','p','x','q','r','t','s']
plasmids = {
    "P_1":{"P_1_1":('ba','b')},
    "P_2":{"P_2_1":('a',"ab0")},
}
struct = '[1[2]2[3]3]1'
m_objects = {
    1:'p',
    2:'b' + 'a'*n,
    3:'b' + 'a'*m,
}

m_plasmids = {
    0: set(['P_1','P_2']),
}

r_0 = {
    1:("P_1[p]1","[P_1,x]1"),
    2:("P_2[x]1","[P_2,q]1"),
}

r_1 = {
    1:("P_1,q[a]2","r[P_1,a]2"),
    2:("r[P_1]2","P_1,s[]2"),
    3:("P_2,s[]3","t[P_2]3"),
    4:("t[P_2]3","P_2,q[]3"),
}

m_rules = {
    0:r_0,
    1:r_1,
}

i0 = 1
ps = PSystem(H=plasmids, V=alphabet, base_struct=struct, m_objects=m_objects, m_plasmids=m_plasmids, m_rules=m_rules, i0=i0)

print(ps.while_evolve(verbose=True))
Output

 'P_1P_2' ''  [1 '' 'p'  [2 '' 'aaaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

enviroment | n_times: 1 -> rule '1':  ('P_1[p]1', '[P_1,x]1')
 'P_2' ''  [1 'P_1' 'x'  [2 '' 'aaaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

enviroment | n_times: 1 -> rule '2':  ('P_2[x]1', '[P_2,q]1')
 '' ''  [1 'P_1P_2' 'q'  [2 '' 'aaaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '1':  ('P_1,q[a]2', 'r[P_1,a]2')
 '' ''  [1 'P_2' 'r'  [2 'P_1' 'aaaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '2':  ('r[P_1]2', 'P_1,s[]2')
membrane: 2 | n_times: 1 -> rule 'P_1_1':  ('ba', 'b')
 '' ''  [1 'P_1P_2' 's'  [2 '' 'aaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '3':  ('P_2,s[]3', 't[P_2]3')
 '' ''  [1 'P_1' 't'  [2 '' 'aaab' ]2 [3 'P_2' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '4':  ('t[P_2]3', 'P_2,q[]3')
membrane: 3 | n_times: 5 -> rule 'P_2_1':  ('a', 'ab0')
 '' ''  [1 'P_1P_2' 'bbbbbq'  [2 '' 'aaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '1':  ('P_1,q[a]2', 'r[P_1,a]2')
 '' ''  [1 'P_2' 'bbbbbr'  [2 'P_1' 'aaab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '2':  ('r[P_1]2', 'P_1,s[]2')
membrane: 2 | n_times: 1 -> rule 'P_1_1':  ('ba', 'b')
 '' ''  [1 'P_1P_2' 'bbbbbs'  [2 '' 'aab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '3':  ('P_2,s[]3', 't[P_2]3')
 '' ''  [1 'P_1' 'bbbbbt'  [2 '' 'aab' ]2 [3 'P_2' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '4':  ('t[P_2]3', 'P_2,q[]3')
membrane: 3 | n_times: 5 -> rule 'P_2_1':  ('a', 'ab0')
 '' ''  [1 'P_1P_2' 'bbbbbbbbbbq'  [2 '' 'aab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '1':  ('P_1,q[a]2', 'r[P_1,a]2')
 '' ''  [1 'P_2' 'bbbbbbbbbbr'  [2 'P_1' 'aab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '2':  ('r[P_1]2', 'P_1,s[]2')
membrane: 2 | n_times: 1 -> rule 'P_1_1':  ('ba', 'b')
 '' ''  [1 'P_1P_2' 'bbbbbbbbbbs'  [2 '' 'ab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '3':  ('P_2,s[]3', 't[P_2]3')
 '' ''  [1 'P_1' 'bbbbbbbbbbt'  [2 '' 'ab' ]2 [3 'P_2' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '4':  ('t[P_2]3', 'P_2,q[]3')
membrane: 3 | n_times: 5 -> rule 'P_2_1':  ('a', 'ab0')
 '' ''  [1 'P_1P_2' 'bbbbbbbbbbbbbbbq'  [2 '' 'ab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '1':  ('P_1,q[a]2', 'r[P_1,a]2')
 '' ''  [1 'P_2' 'bbbbbbbbbbbbbbbr'  [2 'P_1' 'ab' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '2':  ('r[P_1]2', 'P_1,s[]2')
membrane: 2 | n_times: 1 -> rule 'P_1_1':  ('ba', 'b')
 '' ''  [1 'P_1P_2' 'bbbbbbbbbbbbbbbs'  [2 '' 'b' ]2 [3 '' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '3':  ('P_2,s[]3', 't[P_2]3')
 '' ''  [1 'P_1' 'bbbbbbbbbbbbbbbt'  [2 '' 'b' ]2 [3 'P_2' 'aaaaab' ]3]1

--------------------------------------------------------------------------------------------

membrane: 1 | n_times: 1 -> rule '4':  ('t[P_2]3', 'P_2,q[]3')
membrane: 3 | n_times: 5 -> rule 'P_2_1':  ('a', 'ab0')
 '' ''  [1 'P_1P_2' 'bbbbbbbbbbbbbbbbbbbbq'  [2 '' 'b' ]2 [3 '' 'aaaaab' ]3]1

============================================================================================

{'environment': {'childs': {1: {'childs': {2: {'objects': {'b': 1}},
                                           3: {'objects': {'a': 5, 'b': 1}}},
                                'objects': {'b': 20, 'q': 1},
                                'plasmids': {'P_2', 'P_1'}}},
                 'objects': {}}}

Notation

Parameters

Using as example a P system deciding whether k divides n, which was used as example of use before:

A P system deciding whether k divides n

ObjectParameterIn codeIn traditional notation
PSystem
All membs
alphabet['a','c','x','d']{ a, c, x, d }
PSystemstruct'[1[2]2[3]3]1'[1 [2 ]2 [3 ]3 ]1
memb1objects''λ
memb2objects'a'*n+'c'*k+'d'anckd
memb3objects'a'a
memb1rules{ 1: ( 'dcx', 'a3' )}dcx → (a, in3)
memb2rules{ 1: ( 'ac', 'x' ),
2: ( 'ax', 'c' ),
3: ( 'd', 'd.' ) }
r1: ac → x,
r2: ax → c,
r3: d → dδ
memb3rules{ }Ø
memb1p_rules[ ]Ø
memb2p_rules[ ( 1, 3 ), ( 2, 3 ) ]{ r1 > r3, r2 > r3 }
memb3p_rules[ ]Ø
PSystemm_rules{ 1 : memb1.rules,
2 : memb2.rules,
3 : memb3.rules }
R1, R2, R3
PSystemp_rules{ 1 : memb1.p_rules,
2 : memb2.p_rules,
3 : memb3.p_rules }
ρ1, ρ2, ρ3

Rules

DescriptionIn codeIn traditional notation
Add an object to a membraneUsing 2 to enter to memb2
( 'a', 'ab2' )
Using in2 to enter to memb2
a → a ( b, in2 )
An object will exit the membraneUsing 0 to exit the membrane
( 'a', 'a0' )
Using out to exit the membrane
a → ( a, out )
Remove a membrane (dissolve)Using '.' to dissolve
( 'b', '.' )
Using δ to dissolve
b → δ
Priority
DescriptionIn codeIn traditional notation
rule1 more priority than rule2( 1, 2 )r1 > r2
Plasmids

When using plasmids in rules, they must be listed before the objects. For example, ("P_1a", "P_1a0") indicates that if the plasmid 'P_1' and an object 'a' are present in the membrane, the plasmid 'P_1' will be retained, and the object 'a' will be removed. Interactions between plasmids across different membranes are not handled in the same way as objects. However, it is possible to interact with objects in the same way as with plasmids.

Alternative Rule Representation with Plasmids and Multiple Membranes

This format allows for operations involving plasmids across different membranes and also supports checking across multiple membranes. To achieve this, the structure of the membranes is defined, along with the objects/plasmids within each membrane.

The structure is defined by specifying the elements in the membrane that the rule applies to, followed by opening square brackets to represent a child membrane. Inside the brackets, list the elements of the child membrane, then close the square bracket and indicate the child membrane ID.

For example:

  • ("P_1q[a]2", "r[P_1a]2") means that if plasmid 'P_1' and object 'q' are in the parent membrane, and object 'a' is in child membrane 2, then object 'q' is replaced with 'r' in the parent membrane, and 'a' is removed from child membrane 2, while retaining plasmid 'P_1'.
  • A more complex example: ("P_1P_2ac[P_3b[d]2[e]3]1", "P_2P_3b[P_1ac[e]2[d]3]1").

The best way to understand this is through an example, such as the Mathematical Product P System mentioned earlier.

A P System doing m * n

ObjectParameterIn codeIn traditional notation
PSystem
All membs
alphabet['a','b','p','x','q','r','t','s']{ a, b, p, x, q, r, t, s }
PSystemplasmids & its rules{ "P_1" : { "P_1_1" : ( 'ba', 'b' ) },
"P_2" : { "P_2_1" : ( 'a', "ab0" ) } }
P_1: { ba → b }
P_2: { a → a, ( b, out ) }
PSystemstruct'[1[2]2[3]3]1'[1 [2 ]2 [3 ]3 ]1
enviromentplasmids[ 'P_1', 'P_2' ]P_1, P_2
memb1objects'p'p
memb2objectsb + 'a'*nb an
memb3objectsb + 'a'*mb am
enviromentrules{ 1 : ( "P_1[p]1", "[P_1x]1" ),
2 : ( "P_2[x]1", "[P_2q]1" ) }
P_1 [1 p ]1 → [1 P_1x ]1
P_2 [1 x ]1 → [1 P_2q ]1
memb1rules{ 1 : ( "P_1q[a]2", "r[P_1a]2" ),
2 : ( "r[P_1]2", "P_1s[]2" ),
3 : ( "P_2s[]3", "t[P_2]3" ),
4 : ( "t[P_2]3", "P_2q[]3" ) }
P_1q [2 a ]2 → r [2 P_1a ]2
r [2 P_1 ]2 → P_1s [2 ]2
P_2s [3 ]3 → t [3 P_2 ]3
t [3P_2 ]3 → P_2q [3 ]3
memb2rules{ }Ø
memb3rules{ }Ø
PSystemm_rules{ 0 : enviroment.rules,
1 : memb1.rules,
2 : memb2.rules,
3 : memb3.rules }
R1, R2, R3

Authors

  • Pablo García López

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc