SYROCO,
a CoOperative Object Compiler
SYROCO is an environment dedicated to CoOperative
Objects, allowing to edit classes, to compile
them and to execute a COO system.
SYROCO relies upon the C++ language, and it
is supported by any computer provided with a C++ compiler. First, the tools
of SYROCO are written in C++. Secondly, this language is used to write
both the additional code which is shared by the classes of a system
and the embedded code which takes place in the definition of COO
classes. Finally, SYROCO translates each COO class into a C++ class. The
generated code is very standard, and it may be compiled by most of the
C++ compilers (namely the gnu, SCO, Sun Solaris, Borland, Visual and Symantec
C++ compilers).
Supported features
SYROCO supports many features which extend the
CoOperative Objects formalism, such as:
-
each COO owns a clock; the clocks of the
COOs of a system are synchronized on the occasion of service requests.
-
arcs from place toward transition are temporized
by a minimum and a maximum delay; these delays indicate the minimum / maximum
length of time that a token must stay into the place in order to be allowed
to follow the arc.
-
arcs from transition toward place are temporized
by a delay indicating the length of time between the transition occurrence
and the arrival of the token into the place. These delays may be dynamically
changed.
-
a priority level may be associated to
transitions. This level may be dynamically changed, as well as the number
of priority levels.
-
tokens of each place are ranked according
to one of the four policies: queue, stack, random, or an order relation
(coded by the designer) upon the value of tokens. The actual policy of
each place may be dynamically changed.
-
an if-added daemon and an if-removed
daemon may be associated with each place; they are coded by the designer,
and are executed at each depositing / removal of a token in / from the
place. Also, a supervising function which is called after each transition
occurrence, may be defined by the designer.
Using SYROCO to build a COO system
SYROCO generates a C++ class for each COO class,
so that a COO system is implemented as a C++ program. If threads are supported
by the environment, each Object executes its OBCS within a thread; if not,
SYROCO includes a scheduler which activates Objects in turn.
To build a COO system, the designer uses the
SYROCO’s utilities in the following way:
-
create the environment required for a system,
using newproj;
-
edit each class of the system, either with a
program editor or with the graphical PN editor MACAO,
and state the name of the file(s) containing the additional code;
-
edit the C++ files containing the additional
code, or reuse existing C++ files or libraries;
-
generate the code of each class, using gencode;
-
generate a makefile for each class, using genmake;
-
generate a main program for the class of the
initial instance of the system, using gentest, and edit this file
if needed (for instance to instantiate other Objects);
-
edit the option file, which sets the compilation
conditions to be used for the system;
-
compile the code of the initial class, and run
it.
In fact, 6) and 8) can be repeated for each class
of the system, allowing to test them apart.
Debugging a COO system
SYROCO provides the designer with a debugger
offering about 40 commands. This debugger does not deal with the C++ code
written by the designer in operations, transitions and places, but with
PN aspects of COOs. Each Object has its own debugger; it enables to examine
the OBCS, for instance the value of tokens, the list of enabled transitions,
or some standard statistics. It also enables to change the value of some
parameters of a COO. It is possible to call the debugger of any Object
from the debugger of another one. Break points may be set according to
various conditions such as the marking of places, the occurrence of transitions,
the lack of enabled transition, or any condition checked in the C++ code.
Performance
The size of the code shared by all the COO classes
of a system is around 50 to 100 K, whereas the specific code of a class
is mainly the one provided by the designer. The memory required to allocate
a new instance is a few K. The token game player executing the OBCS of
each COO is quite efficient, since it may fire several thousands of transitions
per second. This speed doesn’t depend on the size of the net, but it may
depend on the number of tokens if the transition’s preconditions are strict.
Overview of COOs,
How to get
SYROCO
The
Stack example, The
Dynamic Philosopher example
IRIT, DAIMI
Mail to: C.
Sibertin-Blanc
Refences
C.Sibertin-Blanc, N. Hameurlain, P. Touzeau
SYROCO: A C++ implementation of CoOperative Objects;
Proceedings of the 1st Workshop on Object-Oriented Programming and Models
of Concurrency; Turino (I), June 27 1995. (
download)
[BREST96] C.Sibertin-Blanc
Un environnement pour la simulation de Systèmes
Temps Réels modélisés par Objets Coopératifs.
Actes du congrès de l’AFCET Modélisation des Systèmes
Réactifs, Brest, 28-29 mars 1996.
[ATPNTOOL97] C. Sibertin-Blanc
An overview of SYROCO; Proceedings of the Tool Presentation
Session, 18th International Conference on Application and Theory of Petri
Nets, Toulouse (F), June 23-27 1997. (download)