**1. Introduction**

Sequential object Petri nets are the newly introduced class of Petri nets, whose definition is the main topics of this article; they feature certain original concepts and can be successfully used at a design, modeling and verification of multithreading object-oriented programming systems executing in highly-parallel or distributed environment. In this article basic characteristics of sequential object Petri nets are very briefly presented including possibilities in their definition of newly introduced tokens as non-empty finite recursive sequences over the set of non-negative integer numbers, functionalities of multiarcs and the mechanism of the firing of transitions. These properties significantly increase modeling capabilities of this class of Petri nets at the modeling of multithreading object-oriented programming systems. Sequential object Petri nets can be used also in the area of recursive algorithms modeling and they are also the initial step to explicitly represent paradigms of functional programming. The fusion of object-oriented and functional programming enables to express new kinds of programming patterns and component abstractions.

The theory of sequential object Petri nets proceeds from the theories of various types of Petri nets, starting with Place/Transition nets (Diaz, 2009) and their sub-classes, followed by High-Level nets (Jensen & Rozenberg, 1991), (Reisig, 2009) such as Predicate-Transition nets and Coloured nets (Jensen & Kristensen, 2009)*,* enabling to model apart from the management structure of the system even data processing, and in connection with modeling of object-oriented programming systems it is Object nets (Agha et. al., 2001), (Köhler & Rölke, 2007), which are being studied lately. But practical usability of Petri nets (in their original form) in the role of the parallel programming language is mainly impeded by the static nature of their structure. They are missing standard mechanisms for description of methods alone, programming modules, classes, data types, hierarchical structures, etc.

© 2012 Martiník, 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 Martiník, 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.

Positive characteristics of Petri nets demonstrate only in not too much large-scale modules at high abstraction level. That is why Petri nets are often understood as the theoretical abstract module only, whose applicability for design, analysis and verification of extensive programming systems is limited. Therefore, this article briefly describes a special class of sequential object Petri nets and its possibilities of multithreading object-oriented programming systems modeling, which eliminates the stated shortcomings required for design, analysis and verification of these systems in several directions.

Sequential Object Petri Nets and the Modeling of Multithreading Object-Oriented Programming Systems 197

The **length of the sequence** *σ = <a1*, *a2*, …, *an>*, where *σ A*ERQ, *n N*, is equal to the natural number *n*, the length of the empty sequence *ε* is equal to the number 0. The length of the sequence *σ* we represent by the notation *length*(*σ*), or @*σ*, the set of all the elements of the sequence *σ* we represent by the notation *elem*(*σ*), ie. *elem*(*σ*) = {*ai* | *ai = σ*(*i*) for 1 ≤ *i* ≤ *n*}, *elem*(*ε*) = . The **subsequences of the sequence** *σ* is the mapping *subsq*: *A*ERQ *P*(*A*ERQ)*,* such that for *i*, 1 ≤ *i* ≤ *n*: ((*σ subsq*(*σ*)) (((*ai* == *ε*) (*ai A*)) *ai subsq*(*σ*)) (((*ai* != *ε*) (*ai A*)) ((*ai subsq*(*σ*)) (*subsq*(*ai*) *subsq*(*σ*))). The **members of the sequence** *σ* is the mapping

If *σ = <a1*, *a2*, …, *an>* and *τ = <b1*, *b2*, …, *bm>* are the finite sequences, where *σ A*ERQ, *τ A*ERQ, *n N, m N,* then by the **concatenation of the sequences** *σ* and *τ*, denoted by *στ*, we understand the finite sequence *στ* = <*a1*, *a2*, …, *an*, *b1*, *b2*, …, *bm>* and its length is equal to *n + m*. We say, that the sequences *σ* and *τ* are **equal**, denoted by *σ* == *τ*, if the following is simultaneously true: (*n* = *m*) (*i*, 1 ≤ *i* ≤ *n*: (((*ai* = *ε*) (*bi* = *ε*)) ((*ai A*) (*bi A*) (*ai* = *bi*))

If, for instance, *τ A*ERQ*, τ* = <<*a*, <*a*, *b*>>, <*a*, <*c*>, *b*>, <>>, then *length*(*τ*) = 3, *elem*(*τ*) = {<*a*, <*a*, *b*>>, <*a*, <*c*>, *b*>, <>}, *subsq*(*τ*) = {<<*a*, <*a*, *b*>>, <*a*, <*c*>, *b*>, <>>, <*a*, <*a*, *b*>>, <*a*, <*c*>, *b*>, <*a*, *b*>,

When operating with sequences, notation in the form of *n*\*(*σ*) can be utilized, where *σ A*ERQ, *n N*. Informally, that notation expresses sequence consisting of *n* concatenations of the sequence *σ*. If, for example *A* = *N0*, *σ =* <1, 2>, then notation 3\*(*σ*) represents the sequence

**Multiset** *M* over a non-empty set *S* is a function *m*: *S N0.* By the non-negative number *m*(*a*) *N0, a S,* we denote the number of occurrences of the element *a* in the multiset *m.* We

non-empty multisets over the set *S*, by *S*EMS we denote the set of all multisets over the set *S*. *IDENT* denotes the set of all **identifiers** and it is understood to be a set of non-empty finite sequences over the set of all letters of the selected national alphabet and the set of all decadic digits that starts with a letter. Identifiers are recorded in a way usual for standard programming languages. Examples of correctly formed identifiers for example involve the

not identifiers. Moreover is it true, that if ID1, ID2, …, IDn *IDENT*, where n *N*, n > 1, then we call the sequence in the form ID1.ID2. … .IDn **compound identifier** (i.e. for example the sequence *Main.Thread.Variable1* is a compound identifier). *#IDENT* set is understood to be the set of all non-empty finite sequences in the form #A, where A *IDENT*. Then, elements

The **s**et (*N0***)**RQ we will denote by the symbol *Tokens*. The set *ArcSeq* (*arc sequences*) is defined

*a S*

*ma a*

, etc. On the contrary, for example sequences *2main*, *first goal*, *\_input*, are

, etc.

. By *S*MS we denote the set of all

*memb*: *A*ERQ *P*(*A*)*,* so that *memb*(*σ*) = {*a* | (*a subsq*(*σ*)) (*a A*)}, *memb*(*ε*) = .

((*ai* ≠ *ε*) (*bi* ≠ *ε*) (*ai A*) (*bi A*) (*ai* == *bi*)))).

3\*(<1, 2>) == <1, 2><1, 2><1, 2> == <1, 2, 1, 2, 1, 2>.

usually represent the multiset *m* by the formal sum ( )`

of *#IDENT* set for example include sequences *#thread*, *#var22*, *#*

i. if *x* (*IDENT #IDENT*), then <*x*> *ArcSeq*,

<*a*>, <*b*>, <*c*>, <>} and *memb*(*τ*) = {*a*, *b*, *c*}.

*thread*, *var22*,

by the following:

ii. if *x Tokens*, then *x ArcSeq*,

This chapter is arranged into the following sections: in the section 2 is described the term of the sequence over the finite set and its properties which denominates the class of the sequential object Petri nets; section 3 explains the base term of this chapter, ie. sequential object Petri net and its properties; section 4 explains in details implementation of the mechanism of firing of transitions in a sequential object Petri net; section 5 then discusses the area of object-oriented programming systems and their representation by the sequential object Petri nets; section 6 explains the example of simple class hierarchy represented by the sequential object Petri net and it is inspired by the several base classes of the Java programming language class hierarchy. Finally, the section 7 gives the conclusions of the research to conclude the chapter.
