**7. Conclusion**

222 Petri Nets – Manufacturing and Computer Science

Method **down** acquires a permit from this semaphore, blocking until one is available. Following entry into the critical section of the object instance the programming thread acquires a permit from this semaphore (ie. token in the place **Semaphore.value** can be bound to the arc sequence **<O, 1, #x>** after at least one execution of the method **up**) and will leave the critical section of the object. If no permit is available then the current thread becomes disabled for thread scheduling purposes and waits (i.e. the transition **Semaphore.T7** is executed and the method **Object.wait** is invoked, the programming thread will release the monitor of the object in order to enable execution of the method **up** by other programming thread) until some other thread invokes the **up** method for this semaphore

and the current thread is next to be assigned a permit (see Figure 26).

**Figure 26.** Declaration of class **Semaphore** in sequential object Petri net

**Figure 27.** Declaration of class **Semaphore** in sequential object Petri net

Method **up** releases a permit, increasing the number of available permits by one. If any threads are trying to acquire a permit, then one is selected and given the permit that was just

released. That thread is (re)enabled for thread scheduling purposes (see Figure 27).

Sequential object Petri nets represent an interesting class in the area of object Petri net classes, which can be applied at design, modeling, analysis and verification of generally distributed multithreading object-oriented programming systems. A newly introduced term of token as finite non-empty recursive sequence over the set of non-negative integer numbers, functionalities of multiarcs and the mechanism of the firing of transitions do not increase demands on performance of analysis of characteristics, as seen in other classes of high-level or colored Petri Nets.

Functional programming is one of the most important paradigms of programming that looks back on a long history. The recent interest in functional programming started as a response to the growing pervasiveness of concurrency as a way of scaling horizontally. Multithreaded programming is difficult to do well in practice and functional programming offers (in many ways) better strategies than object-oriented programming for writing robust, concurrent software. Functional programming is generally regarded a paradigm of programming that can be applied in many languages - even those that were not originally intended to be used with that paradigm. Like the name implies, it focuses on the application of functions. Functional programmers use functions as building blocks to create new functions and the function is the main construct that architecture is built from. Several programming languages (like Scala, C#, Java, Delphi, etc) are a blend of object-oriented and functional programming concepts in a statically typed language in the present time. The fusion of object-oriented and functional programming makes it possible to express new kinds of programming patterns and component abstractions. It also leads to a legible and concise programming style. Sequential object Petri nets then also fully support design, modeling, analysis and verification of programming systems based on this fusion of objectoriented and functional programming paradigms.
