feature-is-variable
Available in: KerML, SysML
This checks that variable features are owned by occurrences.
Specification
A
Featurewithis_variable = truemust have anowning_typethat directly or indirectly specializes theClassOccurrences::Occurrencefrom the Kernel Semantic Library.
Example
This is impossible to trigger in SysML because variable is computed
automatically for relevant elements. Otherwise, in KerML:
var feature x; // error
feature a {
var feature x; // errr
}
feature b {
const feature x; // errr
}
Do not use var or const for features not owned by occurrences:
feature x; // ok
feature a { feature x; } // ok
feature b { feature x; } // ok
Otherwise, either add specialization to Occurrences::Occurrence, or change
owning type to a class:
class a { var feature x; } // ok
feature b : Occurrences::Occurrence { const feature x; } // ok