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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Now we construct the above mentioned function State(h i1 i 2 ...i n, n) which computesthe state of a membrane h i1 i 2 ...i nafter n computational steps of Π.(1) If n = 0 then return the state of membrane h in the initial configurationand exit.(2) Calculate recursively State(h i1 ...i n−1, n − 1) and store it in the variable S.(3) If S = nil or S = dissolved then return S and exit./* If membrane h i1 ...i n−1did not exist after (n−1) steps, then neither aftern steps exists membrane h i1 i 2 ...i nwhich could only evolve from h i1 i 2 ...i n−1during step n. */(4) Initialize the variable S ′ which will contain a final state of the membraneafter n-th computational step: set S ′ .M to ∅ and S ′ .p to S.p.(5) Initialize auxiliary variables X, X ′ : set X.M and X ′ .M to ∅ and set X.pand X ′ .p to 0.(6) /* Now we calculate how the membranes embedded in h i1 ...i n−1influenceits content at n-th step. */For each membrane g contained directly in h i1 ...i n−1calculate recursivelyState(g, n − 1) and store the result in X. Then:(a) Try to apply rules of type (a) <strong>with</strong> parameters g, X, X ′ , X ′ (see bellow).(b) Try to apply rules of type (b) <strong>with</strong> parameters g, X, X ′ , S. If any rulewas applied, skip steps (c) and (d).(c) Try to apply rules of type (c) <strong>with</strong> parameters g, X, X ′ , S ′ . If any rulewas applied, skip step (d).(d) Try to apply rules of type (d) <strong>with</strong> parameters g, X, X ′ , S ′ .(7) /* We calculate state of the parent membrane of h. */If h is not the skin membrane, then:– set g = Parent(h i1 ...i n−1, n − 1);– calculate recursively State(g, n − 1) and store the result to X.(8) /* Now we simulate evolution of membrane h i1 ...i n−1at step n. */(a) Try to apply rules of type (a) <strong>with</strong> parameters h, S, S ′ , X.(b) Try to apply rules of type (b) <strong>with</strong> parameters h, S, S ′ , X. If any rulewas applied, go to step 9.(c) Try to apply rules of type (c) <strong>with</strong> parameters h, S, S ′ , X. If any rulewas applied, go to step 9.(d) Try to apply rules of type (d) <strong>with</strong> parameters h, S, S ′ , X. If any rulewas applied, go to step 9.(e) If h i1 ...i n−1is an elementary membrane, try to apply rules of type (e) asfollows:– if i n = 1, then parameters are h, S, S ′ , X;– if i n = 2, then parameters are h, S, X, S ′ .(9) If i n = 2 and a rule of type (e) was not applied, set S ′ to nil./* If i n = 2, then membrane h i1 i 2 ...i ncould only be created by an applicationof an (e)-type rule during n-th step. */(10) If S ′ ≠ nil and S ′ ≠ dissolved then add the remaining content of S.M toS ′ .M.8

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

Saved successfully!

Ooh no, something went wrong!