12.07.2015 Views

P Systems with Active Membranes Characterize PSPACE

P Systems with Active Membranes Characterize PSPACE

P Systems with Active Membranes Characterize PSPACE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(11) Return S ′ and exit.The application of rules of the types (a)–(e) is implemented as follows:Parameters:h – label of the membrane processedS – original state of the membraneS ′ – final state of the membraneT – state of another membrane eventually acting at the operation(a) For each rule [ h a → v] α h in R such that S.p = α, remove all the occurrencesof a from S.M and add to S ′ .M the corresponding number of occurrencesof v (i.e. of multisets corresponding to v).(b) For each rule a[ h] α 1h → [ h b] α 2hin R such that S.p = α 1: if T.M containsa, then remove a from T.M, add b to S ′ .M, set S ′ .p to α 2 and skip allother applicable rules.(c) For each rule [ ha ] α 1h → [ h ] α 2h b in R such that S.p = α 1: if S.M containsa, then remove a from S.M, add b to T.M, set S ′ .p to α 2 and skip allother applicable rules.(d) For each rule [ ha ] α → b in R such that S.p = α: if S.M contains a, thenhremove a from S.M, add b to S ′ .M, add S.M ∪ S ′ .M to T.M, set S ′ todissolved and skip all other applicable rules.(e) For each rule [ ha ] α 1h → [ h b ] α 2h [ h c ] α 3hin R such that S.p = α 1 : if S.Mcontains a, then– remove a from S.M– add b to S ′ .M and set S ′ .p to α 2 ,– add c to T.M and set T.p to α 3 ,– skip all other applicable rules.Observe that, <strong>with</strong> the aid of the function State, we can uniquely determinethe parent and the children (in terms of the membrane structure tree) of agiven membrane h i1 i 2 ...i n, <strong>with</strong>out actually storing the membrane structure ofΠ after n-th step. The function Parent can be implemented as follows:Parameters:h i1 i 2 ...i n– a membrane whose parent is searched forn – a number of step(a) Let g be the parent membrane of h in the initial membrane structure µ.Calculate State(g 1...1 , n).(b) If the state of g 1...1 was dissolved then calculate recursively Parent(g 1...1 , n)and return the result, else return g 1...1 .Similarly, at step 6 we needed to find all children membranes of h i1 ...i n−1. Ifg is a child of h in the initial configuration, then each membrane g j1 j 2 ...j n,9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!