assignment-action-usage-referent-is-time-varying
Available in: SysML
This checks that assignment actions are only ever used to assign to time-varying usages, i.e. variable (mutable) usages.
Specification
The
feature_targetof thereferentof anAssignmentActionUsagemust be able to have time-varying values.
Usages are time-varying if and only if all are true:
It has an
owning_typethat specializesOccurrences::Occurrence.It is not a portion.
It does not specialize
Links::SelfLinkorOccurrences::HappensLink.If
is_composite = true, it does not specializeActions::Action.
Example
attribute x : ScalarValues::Integer;
action def A {
assign x := 3; // error: An assignment action referent must be able to have time-varying values
}
Use only time-varying usages:
action def A {
attribute x : ScalarValues::Integer;
assign x := 3; // ok
}