Next: Semantics for the model
Up: Semantical Aspects of an
Previous: Syntax of a Splice-like
Semantics for the model with a global dataspace
In this section we define the semantics of our coordination language
under the assumption that there is a single global dataspace.
We refer to it as the global semantics.
The values of internal variables of a process are represented by a state,
which is a function from variables to
. Furthermore, let
be a set of events.
The meaning of a program
, given an initial state representing
the values of the variables at the start of the program,
is a set of semantic primitives. Each semantic primitive corresponds to a
terminated execution. For simplicity we do not model
blocking or infinite computations.
Semantic primitives, denoted
, are records in PVS with three fields:
: the final state of the program, representing the situation
after the execution.
-
: a subset of
containing those events that occur
during the execution of
. An event represents the occurrence of an
action.
Let
be a global function that yields for each event in the set
the corresponding action.
Here we have actions of the form
and
denoting
the reading and writing, resp., of data element
.
Note that if we replace
and
by a multiset of actions,
then we cannot order events with the same action and
hence it is not possible to distinguish them.
-
: a strict (irreflexive & transitive) partial order on
the set of events (
).
Intuitively, we have
iff
is a read event
occurring before
; if
is a read event then anything available
in the dataspace at the moment of execution of
will also be
available at the moment of execution of
,
and if
is a write event then
the value written by
can not be available in the dataspace at the
moment of execution of
(unless there is another write action
writing the same value).
Next we present the formal semantics of the language constructs in
the setting of the conceptual model with a single global dataspace.
This is done by defining a function
which maps a program P,
given an initial state s,
to a set of semantic primitives, denoted
.
Here, a semantic primitive, represented in PVS by a record, is
denoted by a triple
, where
is a state,
a set
of events and
a strict partial order on
.
The functions
,
and
are used to access the first, second and third field of these
triples.
The skip statement performs no visible actions. Hence, the set of events
(and its order) are empty, and the final state is equal to the initial
state
.
A write statement
performs
a single event
that corresponds to
a write action with the value of
evaluated in the state
. The initial state
is unaffected.
To understand the semantics of statement
, it is
important to recall that we aim at a denotational, i.e. compositional,
framework. This means that the semantics of a read statement should
allow the combination with any context, where in principle every
possible data item could be written. So we have to take an arbitrary
environment into account. This is done by including semantic
primitives for all data items
that satisfy the query in the
initial state (i.e.,
holds).
So the semantics includes all possibilities and only at the point of
applying a closure operation we decide about the actual values read.
We use
to denote the state that equals
except
that the value of
has been replaced by
.
Here
is an abbreviation for
.
The meaning of
expresses that the final state of this construct
is produced by
, starting in the final state of
. The latter
executes from the original initial state
.
We require that the event sets of the two components be different. This
requirement can always be met simply by renaming common events, assuming
that there are sufficiently many events to make this possible.
The events of
are those performed by
or
.
The order on the resulting event set respects the orders of
and
;
additionally, the order requires that each read action by
occurs
before any event of
.
In
both processes start from the initial state
and, since there are no shared variables, the final state of the
parallel construct is obtained by simply combining the two final
states.
Similar to sequential composition, the event sets of
and
are assumed to be disjoint, and the events of
are those
that occur in
or
.
No additional ordering is imposed by the parallel composition.
The semantics of the
operation formalizes the relation
between read and write actions.
Recall that the semantics of a read statement includes all possible
data items and only at closure it can be checked which data items are
actually available.
This is done by imposing a strict total order on the events of
,
extending the existing order
,
such that each read action
is preceded by a corresponding write action
. Only the
semantic primitives from
for which such a total order exists are
retained in the semantics of
.
Examples
We present a few simple examples to illustrate the semantics.
In the following program, the variable
might become
or
, which
is reflected in its denotational semantics.
The following example illustrates how read actions are
delayed until the requested data item arrives in the shared dataspace.
Let
be the program
Then
Next: Semantics for the model
Up: Semantical Aspects of an
Previous: Syntax of a Splice-like
Roel Bloo
1999-11-26