source_raw
/
src
/sysml.library
/Domain Libraries
/Requirement Derivation
/DerivationConnections.sysml
| standard library package DerivationConnections { | |
| /* | |
| * This package provides a library model for derivation connections between requirements. | |
| */ | |
| private import SequenceFunctions::excludes; | |
| private import ControlFunctions::allTrue; | |
| requirement originalRequirements[*] { | |
| /* originalRequirements are the original requirements in Derivation connections. */ | |
| } | |
| requirement derivedRequirements[*] { | |
| /* derivedRequirements are the derived requirments in Derivation connections. */ | |
| } | |
| abstract connection def Derivation { | |
| /* | |
| * A Derivation connection asserts that one or more derivedRequirements are derived from | |
| * a single originalRequirement. This means that any subject that satisfies the | |
| * originalRequirement should, in itself or though other things related to it, satisfy | |
| * each of the derivedRequirements. | |
| * | |
| * A connection usage typed by Derivation must have requirement usages for all its ends. | |
| * The single end for the originalRequirement should subset originalRequirement, while | |
| * the rest of the ends should subset derivedRequirements. | |
| */ | |
| ref requirement :>> participant { | |
| /* All the participants in a Derivation must be requirements. */ | |
| } | |
| ref requirement originalRequirement[1] :>> originalRequirements :> participant { | |
| /* The single original requirement. */ | |
| } | |
| ref requirement :>> derivedRequirements[1..*] :> participant { | |
| /* The one or more requirements that are derived from the original requirement. */ | |
| } | |
| private assert constraint originalNotDerived { | |
| /* The original requirement must not be a derived requirement. */ | |
| derivedRequirements->excludes(originalRequirement) | |
| } | |
| private assert constraint originalImpliesDerived { | |
| /* | |
| * Whenever the originalRequirement is satisfied, all of the derivedRequirements must also | |
| * be satisfied. | |
| */ | |
| originalRequirement.result implies allTrue(derivedRequirements.result) | |
| } | |
| } | |
| abstract connection derivations : Derivation[*] { | |
| /* derivations is the base feature for Derivation connection usages. */ | |
| } | |
| } |