next up previous contents
Next: Macro COSY Up: COSY Previous: Introduction

Basic COSY

A basic COSY path program is a collection of paths in and parentheses. A path is an expression, similar to a regular expression built from event names, semicolons, commas, conventional parentheses and Kleene stars, enclosed by and parentheses. For instance:

displaymath5106

In every expression as described above, the semicolon specifies sequential occurrences of the events named or subexpressions, and comma specifies a mutually exclusive occurrence of one of the events named or subexpressions. The comma binds more strongly than the semicolon, so that the expression ``a;b,c'' means ``first event a must occur, after which exclusively either event b or event c must occur''. An expression may be enclosed in conventional parentheses with Kleene star appended, as for instance ``(d;e)*'' which means that the enclosed specification applies zero or more times.

Formally, a basic COSY path program is a string derived from the production rules given below. The following meta-linguistic conventions have been used in stating the syntactic rules. The symbols ``='',`` tex2html_wrap_inline5124 '',`` tex2html_wrap_inline5126 '',``|'', `` tex2html_wrap_inline5130 '',`` tex2html_wrap_inline5132 '', are used as meta-symbols. The symbol ``='' indicates replacement of its left hand side by the string on its right hand side. The braces `` tex2html_wrap_inline5136 '' are used to group items together, ``|'' indicates alternative productions, `` tex2html_wrap_inline5140 '' indicates production of ``item'' zero or more times, and `` tex2html_wrap_inline5144 '' indicates production of ``item'' one or more times([JL92]p.19-p.20).

The syntax of a basic COSY path program is given by the following rules:

B1.
tex2html_wrap_inline5148
B2.
tex2html_wrap_inline5150
B3.
tex2html_wrap_inline5152
B4.
tex2html_wrap_inline5154
B5.
tex2html_wrap_inline5156
B6.
tex2html_wrap_inline5158
B7.
tex2html_wrap_inline5160
B8.
tex2html_wrap_inline5162
B9.
tex2html_wrap_inline5164
B10.
tex2html_wrap_inline5166
B11.
tex2html_wrap_inline5168

Similarly, the syntax of a basic COSY program is given by the following rules:

B1.
tex2html_wrap_inline5170
B2.
tex2html_wrap_inline5150
B3.
tex2html_wrap_inline5152
B4.
tex2html_wrap_inline5176
B5.
tex2html_wrap_inline5178
B6.
tex2html_wrap_inline5180
B7.
tex2html_wrap_inline5182
B8.
tex2html_wrap_inline5184
B9.
tex2html_wrap_inline5162
B10.
tex2html_wrap_inline5164
B11.
tex2html_wrap_inline5166
B12.
tex2html_wrap_inline5168

The standard formal semantics of path programs was expressed by means of vectors of strings. The collection of paths and processes determines a set of vectors of strings of operations. Vectors of strings of operations may be considered as a labelled partial order of operations, modelling a non-sequential behaviour of operation executions, and for this reason they have been called Vector Firing Sequences (VFS). Vector firing sequences may be shown to have the same modelling power as more conventional models for concurrent behaviour, such as occurrence graphs but have the advantage that they may be manipulated in the same manner as strings. The vector firing sequence semantics does not reduce concurrency to arbitrary interleaving and provides a mathematical environment for the formal definition of system properties and for the analysis of programs, determining whether the system they specify possesses such properties.

The following example is a specification of simplified real non-sequential system. It consists of a linereader and lineprinter communicating accross a ring buffer. We also provide the system with an interrupt handler. What this does is to register an error message arriving from somewhere, halts the whole system and then restarts it again. We might picture the situation as one in which both the registering of an error and the restarting of the system results from an intervention from the system's environment, say a human operator. The path program tex2html_wrap_inline5062 which specifies this system is presented in Figure 2.1, where event names stand for their meanings.[JL92]p.133.

  figure767
Figure 2.1: tex2html_wrap_inline5062 Reader and printer with n-frame ring buffer and interrupt handler 

In order to show the system more clearly, we suppose n has the value 5. Therefore, the system will become tex2html_wrap_inline5066 which is shown in Figure 2.2.

  figure859
Figure 2.2: tex2html_wrap_inline5066 Reader and printer with 5-frame ring buffer and interrupt handler

The part of tex2html_wrap_inline5066 called tex2html_wrap_inline5212 describes the ring buffer with 5 frames. We suppose that we are not concerned with the actual content of the buffer at any time. Given this, the only operations associated with it are deposits and removes involving the various frames. Assuming that all the frames are empty initially, the desired pattern of behaviour of an individual frame must be a sequence of alternating deposits and removes beginning with a deposit. This constraint is expressed by the paths tex2html_wrap_inline5216 for frames 1,2,3,4,5, respectively. The paths tex2html_wrap_inline5220 and tex2html_wrap_inline5222 impose a ring discipline on deposits and removes. The path tex2html_wrap_inline5224 expresses the constraint that after performing readline, the message (line) read must be deposited in one of the frames, and the path tex2html_wrap_inline5226 says that after removing a message (line) from any frame, the message must be printed by executing printline. The paths tex2html_wrap_inline5228 to tex2html_wrap_inline5230 express the fact that the system may be interrupted and restarted after any event.

In order to express long basic COSY programs in a succinct and structured way, we introduce the macro COSY notation in the following section.


next up previous contents
Next: Macro COSY Up: COSY Previous: Introduction

Peter Lauer
Mon Jul 22 17:29:46 EDT 1996