**1. Introduction**

24 Petri Nets

[15] Patterson, D. [2002]. A simple way to estimate the cost of downtime, *Proceedings of the 16th USENIX conference on System administration*, LISA '02, USENIX Association, Berkeley,

[16] Petri, C. A. [1962]. *Kommunikation mit Automaten*, PhD Dissertation, Darmstad University,

[17] Reisig, W. [1985]. *Petri nets: an introduction*, Springer-Verlag New York, Inc., New York,

[18] Robidoux, R., Xu, H., Member, S., Xing, L., Member, S. & Zhou, M. [2010]. Automated modeling of dynamic reliability block diagrams using colored petri nets, *IEEE Transactions on Systems, Man, and Cybernetics, Part A: Systems and Humans* 40(2): 337–351. [19] *Service Level Agreement for Data Center Services* [2012].

[20] Silva, B., Maciel, P., Tavares, E., Araujo, C., Callou, G., Sousa, E., Rosa, N., Marwah, M., Sharma, R., Shah, A., Christian, T. & Pires, J. [2010]. Astro: A tool for dependability evaluation of data center infrastructures, *Systems Man and Cybernetics (SMC), 2010 IEEE*

[21] std., I. [1997]. *Gold Book 473 Design of Reliable Industrial and Commercial Power Systems*,

[22] Trivedi, K. [2002]. *Probability and Statistics with Reliability, Queueing, and Computer Science*

[23] Trivedi, K. & et al [1994]. Reliability analysis techniques explored through a communication network example, *International Workshop on Computer-Aided Design, Test,*

[24] Vilkomir, S. A., Parnas, D. L., Mendiratta, V. B. & Murphy, E. [2006]. Segregated failures model for availability evaluation of fault-tolerant system, *ACSC '06: Proceedings of the 29th Australasian Computer Science Conference*, Australian Computer Society, Inc.,

[25] Wei, B., Lin, C. & Kong, X. [2011]. Dependability modeling and analysis for the virtual data center of cloud computing, *High Performance Computing and Communications (HPCC),*

[26] Wiboonrat, M. [2008a]. An empirical study on data center system failure diagnosis, *Internet Monitoring and Protection, 2008. ICIMP '08. The Third International Conference on*,

[27] Wiboonrat, M. [2008b]. Risk anatomy of data center power distribution systems,

[28] Xu, H., Xing, L. & Robidoux, R. [2008]. Drbd: Dynamic reliability block diagrams for system reliability modeling, *International Journal of Computers and Applications* . [29] Zhou, L. & Grover, W. [2005]. A theory for setting the "safety margin" on availability guarantees in an sla, *Design of Reliable Communication Networks, 2005. (DRCN 2005).*

http://www.earthlinkbusiness.com/ \_static/\_files/\_pdfs/legal/DataCenterServiceSLA.pdf.

CA, USA, pp. 185–188.

Germany.

NY, USA.

IEEE.

pp. 103 –108.

*ICSET'08*.

URL: *http://dl.acm.org/citation.cfm?id=1050517.1050538*

*International Conference on*, pp. 783 –790.

*and Evaluation for Dependability*.

*Applications*, 2 edn, Wiley Interscience Publication.

Darlinghurst, Australia, Australia, pp. 55–61.

*2011 IEEE 13th International Conference on*, pp. 784 –789.

*Proceedings.5th International Workshop on*, p. 7 pp.

Formal language theory, introduced by Noam Chomsky in the 1950s as a tool for a description of natural languages [8–10], has also been widely involved in modeling and investigating phenomena appearing in computer science, artificial intelligence and other related fields because the symbolic representation of a modeled system in the form of strings makes its processes by information processing tools very easy: coding theory, cryptography, computation theory, computational linguistics, natural computing, and many other fields directly use sets of strings for the description and analysis of modeled systems. In formal language theory a model for a phenomenon is usually constructed by representing it as a set of words, i.e., a *language* over a certain alphabet, and defining a generative mechanism, i.e., a *grammar* which identifies exactly the words of this set. With respect to the forms of their rules, grammars and their languages are divided into four classes of *Chomsky hierarchy*: *recursively enumerable*, *context-sensitive*, *context-free* and *regular*.

Context-free grammars are the most investigated type of Chomsky hierarchy which, in addition, have good mathematical properties and are extensively used in many applications of formal languages. However, they cannot cover all aspects which occur in modeling of phenomena. On the other hand, context-sensitive grammars, the next level in Chomsky hierarchy, are too powerful to be used in applications of formal languages, and have bad features, for instance, for context-sensitive grammars, the emptiness problem is undecidable and the existing algorithms for the membership problem, thus for the parsing, have exponential complexities. Moreover, such concepts as a derivation tree, which is an important tool for the analysis of context-free languages, cannot be transformed to context-sensitive grammars. Therefore, it is of interest to consider "intermediate" grammars which are more powerful than context-free grammars and have similar properties. One type of such grammars, called *grammars with regulated rewriting* (*controlled* or *regulated grammars* for short), is defined by considering grammars with some additional mechanisms which extract some subset of the generated language in order to cover some aspects of modeled phenomena. Due to the variety of investigated practical and theoretical problems, different additional mechanisms to grammars can be considered. Since Abraham [1] first defined matrix grammars in 1965, several grammars with restrictions such as programmed, random

©2012 Turaev et al., licensee InTech. This is an open access chapter distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0),which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. ©2012 Turaev et al., licensee InTech. This is a paper distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

context, valence grammars, and etc., have been introduced (see [16]). However, the rapid developments in present day technology, industry, medicine and other areas challenge to deal with more and more new and complex problems, and to look for new suitable tools for the modeling and investigation of these problems. *Petri net controlled grammars*, which introduce *concurrently parallel control mechanisms* in formal language theory, were proposed as a theoretical model for some problems appearing in systems biology and automated manufacturing systems (see [18–23, 56, 59–62]).

Control by Petri nets has also been introduced and studied in automata theory [26–28, 38] and

Grammars Controlled by Petri Nets 339

In this chapter we summarize the recent obtained results on Petri net controlled grammars

In Section 2 we recall some basic concepts and results from the areas formal languages and Petri nets: strings, grammars, languages, Petri nets, Petri net languages and so on, which will

In Section 3 we define a *context-free Petri net* (a *cf Petri net* for short), where places correspond to nonterminals, transitions are the counterpart of the production rules, the tokens reflect the occurrences of symbols in the sentential form, and there is a one-to-one correspondence between the application of (sequence of) rules and the firing of (sequence of) transitions. Further, we introduce grammars controlled by *k*-Petri nets, i.e., cf Petri nets with additional *k* places, and studies the computational power and closure properties of families of languages

In Section 4 we consider a generalization of the *k*-Petri net controlled grammars: we associate an arbitrary place/ transition net with a context-free grammar and require that the sequence of applied rules corresponds to an occurrence sequence of transitions in the Petri net. With respect to different labeling strategies and different definitions of final marking sets, we define various classes of Petri net controlled grammars. Here we study the influence of the labeling

It is known that many decision problems in formal language theory are equivalent to the reachability problem in Petri net theory, which has been shown that it is decidable, however, it has exponential time complexity. The result of this has been the definition of a number of structural subclasses of Petri nets with a smaller complexity and still adequate modeling power. Thus, it is interesting to consider grammars controlled by such kind of subclasses of Petri nets. In Section 5 we continue our study of arbitrary Petri net controlled grammars by restricting Petri nets to their structural subclasses, i.e., special Petri nets such as state machines,

In Section 6 we examine Petri net controlled grammars with respect to dynamical properties of Petri nets: we use (cf and arbitrary) Petri nets with place capacities. We also investigate capacity-bounded grammars which are counterparts of grammars controlled by Petri nets

In Section 7 we draw some general conclusions and present suggestions for further research.

In this section we recall some prerequisites, by giving basic notions and notations of the theories formal languages, Petri nets and Petri net languages which are used in the next sections. The reader is referred to [16, 34, 36, 42, 45, 47, 50, 52] for further information.

Throughout the chapter we use the following general notations. ∈ denotes the membership of an element to a set while the negation of set membership is denoted by �∈. The inclusion

functions and the effect of the final markings on the generative power.

grammar systems theory [6].

be used in the next sections.

and propose new problems for further research.

generated by *k*-Petri net controlled grammars.

marked graphs, and free-choice nets, and so on.

**2.1 General notions and notations**

with place capacities.

**2. Preliminaries**

Petri nets, which are graphical and mathematical modeling tools applicable to many concurrent, asynchronous, distributed, parallel, nondeterministic and stochastic systems, have widely been used in the study of formal languages. One of the fundamental approaches in this area is to consider Petri nets as language generators. If the transitions in a Petri net are labeled with a set of (not necessary distinct) symbols, a sequence of transition firing generates a string of symbols. The set of strings generated by all possible firing sequences defines a language called a Petri net language, which can be used to model the flow of information and control of actions in a system. With different kinds of labeling functions and different kinds of final marking sets, various classes of Petri net languages were introduced and investigated by Hack [34] and Peterson [46]. The relationship between Petri net languages and formal languages were thoroughly investigated by Peterson in [47]. It was shown that all regular languages are Petri net languages and the family of Petri net languages are strictly included in the family of context-sensitive languages but some Petri net languages are not context-free and some context-free languages are not Petri net languages. It was also shown that the complement of a free Petri net language is context-free [12].

Another approach to the investigation of formal languages was considered by Crespi-Reghizzi and Mandrioli [11]. They noticed the similarity between the firing of a transition and application of a production rule in a derivation in which places are nonterminals and tokens are separate instances of the nonterminals. The major difference of this approach is the lack of ordering information in the Petri net contained in the sentential form of the derivation. To accommodate it, they defined the commutative grammars, which are isomorphic to Petri nets. In addition, they considered the relationship of Petri nets to matrix, scattered-context, nonterminal-bounded, derivation-bounded, equal-matrix and Szilard languages in [13].

The approach proposed by Crespi-Reghizzi and Mandrioli was used in the following works. By extending the type of Petri nets introduced in [11] with the places for the terminal symbols and arcs for the control of nonterminal occurrences in sentential forms, Marek and Ceška showed that for every random-context grammar, an isomorphic Petri net can be ˇ constructed, where each derivation of the grammar is simulated by some occurrence sequence of transitions of the Petri net, and vice versa. In [39] the relationship between vector grammars and Petri nets was investigated, partially, hybrid Petri nets were introduced and the equality of the family of hybrid Petri net languages and the family of vector languages was shown. By reduction to Petri net reachability problems, Hauschildt and Jantzen [35] could solve a number of open problems in regulated rewriting systems, specifically, every matrix language without appearance checking over one letter alphabet is regular and the finiteness problem for the families of matrix and random context languages is decidable; In several papers [2, 14, 25], Petri nets are used as minimization techniques for context-free (graph) grammars. For instance, in [2], algorithms to eliminate erasing and unit (chain) rules, algorithms to remove useless rules using the Petri net concept are introduced.

Control by Petri nets has also been introduced and studied in automata theory [26–28, 38] and grammar systems theory [6].

In this chapter we summarize the recent obtained results on Petri net controlled grammars and propose new problems for further research.

In Section 2 we recall some basic concepts and results from the areas formal languages and Petri nets: strings, grammars, languages, Petri nets, Petri net languages and so on, which will be used in the next sections.

In Section 3 we define a *context-free Petri net* (a *cf Petri net* for short), where places correspond to nonterminals, transitions are the counterpart of the production rules, the tokens reflect the occurrences of symbols in the sentential form, and there is a one-to-one correspondence between the application of (sequence of) rules and the firing of (sequence of) transitions. Further, we introduce grammars controlled by *k*-Petri nets, i.e., cf Petri nets with additional *k* places, and studies the computational power and closure properties of families of languages generated by *k*-Petri net controlled grammars.

In Section 4 we consider a generalization of the *k*-Petri net controlled grammars: we associate an arbitrary place/ transition net with a context-free grammar and require that the sequence of applied rules corresponds to an occurrence sequence of transitions in the Petri net. With respect to different labeling strategies and different definitions of final marking sets, we define various classes of Petri net controlled grammars. Here we study the influence of the labeling functions and the effect of the final markings on the generative power.

It is known that many decision problems in formal language theory are equivalent to the reachability problem in Petri net theory, which has been shown that it is decidable, however, it has exponential time complexity. The result of this has been the definition of a number of structural subclasses of Petri nets with a smaller complexity and still adequate modeling power. Thus, it is interesting to consider grammars controlled by such kind of subclasses of Petri nets. In Section 5 we continue our study of arbitrary Petri net controlled grammars by restricting Petri nets to their structural subclasses, i.e., special Petri nets such as state machines, marked graphs, and free-choice nets, and so on.

In Section 6 we examine Petri net controlled grammars with respect to dynamical properties of Petri nets: we use (cf and arbitrary) Petri nets with place capacities. We also investigate capacity-bounded grammars which are counterparts of grammars controlled by Petri nets with place capacities.

In Section 7 we draw some general conclusions and present suggestions for further research.
