![]() ![]() |
||||||||||||||||||||
|
||||||||||||||||||||
Here
we revisit the AADL specification and describe the advanced features of property
associations and how they affect property values. These features motivate the more
complicated aspects of the OSATE property value API discussed next. |
||||||||||||||||||||
A
property may be associated with a particular value for a subset of a components modes.
This is specified by adding an in modes clause to the property association. An in modes
clause names one or more modes of the surrounding component implementation declaration for
which the property association applies. A properties clause or a subcomponent properties
clause may have more than one property association for a particular property if the property
associations have non-intersecting lists of modes. When a property has both a modal and a
non-modal property association, the non-modal association is considered to apply for those
modes not explicitly named in a modal association.
The
value associated with a property for a component may be affected by the modes of
components other than the component it is associated with. Consider the following AADL
specification, for example:
system implementation Inner.Impl
modes
InnerMode1: initial
mode;
InnerMode2: mode;
properties
PS::x => 1 in modes
(InnerMode1);
PS::x => 2 in modes
(InnerMode2);
end Inner.Impl;
system implementation Outer.Impl
subcomponents
sub: system Inner.Impl
{
PS::y =>
3 in modes (OuterMode1);
PS::y =>
4 in modes (OuterMode2); };
modes
OuterMode1: initial
mode;
OuterMode2: mode;
end Outer.Impl;
system Main.Impl
subcomponents
sub: system S.I;
...
modes:
M1: initial mode;
M2: mode;
properties
PS::z => 5 applies
to sub.a.b.c.d in modes (M1);
end Main.Impl;
For
component implementation Inner.Impl, the value associated
with property PS::x depends
on the mode of the component itself. But the property value associated with PS::y of
subcomponent sub of Outer.Impl depends on the mode of
the Outer.Impl component
implementation. When Main.Impl is instantiated, the contained property association in
Main.Impl makes the value of PS::z of a component instance
five levels down the containment
hierarchy depend on the mode of the root system component. |
||||||||||||||||||||
The value associated with a property may also depend on the modes of the resulting
system
because subcomponents can be declared to exist in certain modes only. If a component does
not exist in a particular mode, then it does not make sense to look up the values associated
with properties for that component. The value, in such cases, is said to be nonexistent.
The
modes in which a component exists can interact with the modes of its property associations,
as shown in the following example:
system
implementation ModalSubcomponents.Impl
subcomponents
sub1: system S1.Impl {
PS::x => 0;
} in modes (M1, M2);
sub2: system S2.Impl {
PS::x => 1 in modes (M1);
} in modes (M1, M3);
sub3: system S3.Impl {
PS::x => 2 in modes (M2);
PS::x => 3 in modes (M3);
} in modes (M2, M3);
modes
M1: initial mode;
M2: mode;
M3: mode;
end
ModalSubcomponents.Impl;
Here, property PS::x of subcomponent sub1 effectively has a modal property association
because sub1 only exists in modes M1 and M2. In particular,
for sub1, the value of PS::x is
nonexistent in mode M3. Similarly, the
property value of PS::x is nonexistent for
subcomponent sub2 in mode M2, and for subcomponent sub3 in mode M1. The following
table summarizes the value associated with property PS::x for the three subcomponents
across the modes of ModalSubcomponents.Impl:
|
||||||||||||||||||||
The value associated with a property may also depend on the modes of the system
because
the value references the values of other properties that are modal. This is shown in the
following example:
property
set PS is
bool1: aadlboolean => true applies to (system);
bool2: aadlboolean => false applies to (system);
bool3: aadlboolean applies to (system);
end
PS;
system
Example
properties
PS::bool3 => value(PS::bool1) and value(PS::bool2);
end
Example;
system
implementation Example.Impl
modes
M1: initial mode;
M2: mode;
properties
PS::bool1 => false in modes (M1);
PS::bool2 => true in modes (M2);
end
Example.Impl;
For system type Example, the value associated with property PS::bool3 is false: this value is
the result of evaluating the property expression value(PS::bool1) and value(PS::bool2).
To evaluate the expression, the values associated with PS::bool1 and PS::bool2 for
Example are used: true and false, respectively. The
property association is not modal, and
in fact cannot be because modes do not apply to component types.
The system implementation Example.Impl associates new values with properties PS::bool1
and PS::bool2, but only in modes M1 and M2, respectively. The
value associated with
PS::bool3 for Example.Impl thus depends on the mode
of the component because it
depends on the values of PS::bool1 and PS::bool2:
|
||||||||||||||||||||