Next: Access Modes of External
Up: Informal Semantics of ``accesses''
Previous: Accessed and updated functions
The more complicated case is given when an asm B being
used as an external function in A accesses and updates functions
declared in A. Due to the fact that A doesn't make any step during
the run of B, rules in B
updating dynamic functions declared in
A are actually not performed from B's point
of view. Therefore, in XASM the semantics of updated functions in external asm
functions is defined in a way, that these kind of unintuitive
behavior is avoided:
- For each function f being marked as ``updated'' a local
function with the same name is (internally) declared in B;
- this local function is initialized with the values of the
original function in A;
- during the run of B, the functions marked as ``updated'' can
be accessed like any other local function in B;
- on termination of B the updated locations of these
function are propagated to the original function declared in the
parent asm A.
This ensures, that all updates of an ``updates'' function are
accessible in B, and that only the last updates are forwarded
to the parent A. In general, the updates of functions declared in
A and updated in B are treated as being part of the update set of
A's current step. As a consequence, multiple invocations of B in the
same step of A do not influence each other.
Consider the following - somewhat artificial - example:
In each step of the run of asm B the value of the updated
function f(0) is updated with a new value. The semantics of the
``updates'' declaration in XASM ensures that all updates of f are
accessible in B and that only the last update of f in B is
propagated to the parent asm A. In this example, the
update f(0) := 2 is propagated to A, while all other updates
occurring in the ``internal'' steps in B have only local effects in
B.
Next: Access Modes of External
Up: Informal Semantics of ``accesses''
Previous: Accessed and updated functions
Philipp Kutter
2002-03-18