predicate-result-type
Available in: KerML, SysML
This checks that predicate return parameters and results are boolean valued.
Predicates implicitly inherit boolean return parameters so they are ignored.
Specification
Per KerML 7.4.8.4:
Since a predicate must always return a
Booleanresult, it is not necessary to explicitly declare a result parameter for it. However, if a result parameter is declared, then it must have typeBooleanfrom theScalarValueslibrary model (see 9.3.2 ) and multiplicity1..1(see 7.4.12 ).
And:
If a result expression is included, then it must have a
Booleanresult.
Example
predicate {
"string" // error: Predicate result must be boolean evaluable
}
Predicates must return boolean values:
predicate {
true // ok
}