09.09.2014 Views

13th International Conference on Membrane Computing - MTA Sztaki

13th International Conference on Membrane Computing - MTA Sztaki

13th International Conference on Membrane Computing - MTA Sztaki

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.

Using a kernel P system to solve the 3-Col problem<br />

asserting the validity of a set of properties/invariants. In this secti<strong>on</strong> we address<br />

the implementati<strong>on</strong> of the kP system model defined earlier, into Spin’s Promela.<br />

There are two essential antinomic aspects usually c<strong>on</strong>sidered when implementing<br />

a specificati<strong>on</strong>. On the <strong>on</strong>e hand, an implementati<strong>on</strong> must target coherence,<br />

structural clarity and a granularity that c<strong>on</strong>fers a certain flexibility<br />

for potential alterati<strong>on</strong>s and/or extensi<strong>on</strong>s. On the other hand, the developer is<br />

challenged by the performance requirements, the demand for a reas<strong>on</strong>ably fast<br />

and efficient executi<strong>on</strong>. The importance of the latter is particularly augmented<br />

in the c<strong>on</strong>text of NP complete problems. There is an evident trade-off between<br />

the level of abstracti<strong>on</strong> and an optimal representati<strong>on</strong> given by exploiting the<br />

particularities of the problem. Additi<strong>on</strong>ally, we must take into c<strong>on</strong>siderati<strong>on</strong> the<br />

issue of property specificati<strong>on</strong> in our implementati<strong>on</strong>; that is, we must be able to<br />

relate to variables denoting P system elements (i.e. membranes, objects, links).<br />

In accordance with these c<strong>on</strong>siderati<strong>on</strong>s, we set our primary focus <strong>on</strong> the<br />

development of a model specific implementati<strong>on</strong>, taking into account particularities<br />

such as the existence of <strong>on</strong>ly two types of membranes, the absence of link<br />

creati<strong>on</strong>/destructi<strong>on</strong> rules, the absence of a composite executi<strong>on</strong> strategy, the<br />

use of indexed object symbols.<br />

The Spin model checker was successfully used <strong>on</strong> various other case studies<br />

employing membrane systems [8, 7, 10]. We can identify certain (re-usable) patterns<br />

of corresp<strong>on</strong>dence between P system features and Promela statements and<br />

instructi<strong>on</strong> blocks. For example, the guarded parallel rewriting of P systems can<br />

be translated using Promela’s n<strong>on</strong>-deterministic c<strong>on</strong>diti<strong>on</strong>al statements (i.e if,<br />

do); the projecti<strong>on</strong> of a membrane to a Promela data type definiti<strong>on</strong>. However,<br />

our approach differs from existing implementati<strong>on</strong>s due to the direct mapping<br />

of a membrane’s set of rules (the instructi<strong>on</strong> set) to an individual process in<br />

Promela. Spin executes processes asynchr<strong>on</strong>ously (the programs are interleaved<br />

behind the scene, simulating a parallel executi<strong>on</strong>) which makes it a natural<br />

support for membrane rules. Hence, we have an expandable set of membrane<br />

instances which store a multiset of objects - the program data; and a finite set of<br />

instructi<strong>on</strong>s encapsulated in independent processes - the parallel instructi<strong>on</strong> set.<br />

Each process will run for each membrane instance it is associated with, performing<br />

rewriting and communicati<strong>on</strong> but also creating new instances (membrane<br />

divisi<strong>on</strong>). In order to distinguish a computati<strong>on</strong>al step in a P system and prevent<br />

a rather chaotic process executi<strong>on</strong>, an auxiliary process is introduced as a<br />

coordinator: for each step the Scheduler process will launch each set of instructi<strong>on</strong>s<br />

<strong>on</strong> the instances and will block until all processes have completed (for all<br />

membrane instances). The scheduler plays the role of a clock which synchr<strong>on</strong>ises<br />

executi<strong>on</strong> into steps. This task is repeated until the envir<strong>on</strong>ment is flagged with<br />

either ”yes” or ”no”, signalling the computati<strong>on</strong> has halted and a result was<br />

generated, or until it reaches a maximum number of steps specified by the user.<br />

The input is also defined through a global parameter - the number of vertices<br />

and an initial c<strong>on</strong>figurati<strong>on</strong> of A ij objects which denote the edges of the graph.<br />

In Table 1 we illustrate the mapping of kP system features to Promela elements.<br />

Figure 1 describes the algorithm devised for this kP system soluti<strong>on</strong> in<br />

251

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

Saved successfully!

Ooh no, something went wrong!