sysml-validate 0.11.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/LICENSE +27 -27
  2. package/README.md +200 -200
  3. package/out/main.js +596 -141
  4. package/out/main.js.map +4 -4
  5. package/package.json +57 -57
  6. package/resources/sysml.dimension-table.json +1 -1
  7. package/resources/sysml.library/Domain Libraries/Analysis/.meta.json +9 -9
  8. package/resources/sysml.library/Domain Libraries/Analysis/.project.json +26 -26
  9. package/resources/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +33 -33
  10. package/resources/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +118 -118
  11. package/resources/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -143
  12. package/resources/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +170 -170
  13. package/resources/sysml.library/Domain Libraries/Cause and Effect/.meta.json +7 -7
  14. package/resources/sysml.library/Domain Libraries/Cause and Effect/.project.json +22 -22
  15. package/resources/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +82 -82
  16. package/resources/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -81
  17. package/resources/sysml.library/Domain Libraries/Geometry/.meta.json +7 -7
  18. package/resources/sysml.library/Domain Libraries/Geometry/.project.json +26 -26
  19. package/resources/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +898 -898
  20. package/resources/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +167 -167
  21. package/resources/sysml.library/Domain Libraries/Metadata/.meta.json +9 -9
  22. package/resources/sysml.library/Domain Libraries/Metadata/.project.json +18 -18
  23. package/resources/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +77 -77
  24. package/resources/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +142 -142
  25. package/resources/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +38 -38
  26. package/resources/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +99 -99
  27. package/resources/sysml.library/Domain Libraries/Quantities and Units/.meta.json +28 -28
  28. package/resources/sysml.library/Domain Libraries/Quantities and Units/.project.json +22 -22
  29. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -42
  30. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -439
  31. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -2726
  32. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -206
  33. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -1991
  34. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -1353
  35. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -1223
  36. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -2333
  37. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -958
  38. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -1537
  39. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -1564
  40. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -1169
  41. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -1256
  42. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -30
  43. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -526
  44. package/resources/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -107
  45. package/resources/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -70
  46. package/resources/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -378
  47. package/resources/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -48
  48. package/resources/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +49 -49
  49. package/resources/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -274
  50. package/resources/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -260
  51. package/resources/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -62
  52. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +7 -7
  53. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.project.json +18 -18
  54. package/resources/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +62 -62
  55. package/resources/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +38 -38
  56. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +8 -8
  57. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +10 -10
  58. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +176 -176
  59. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -23
  60. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +63 -63
  61. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +22 -22
  62. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +14 -14
  63. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +79 -79
  64. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -22
  65. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -68
  66. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -47
  67. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +116 -116
  68. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +42 -42
  69. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -43
  70. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -27
  71. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +42 -42
  72. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +153 -153
  73. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -49
  74. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -56
  75. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +32 -32
  76. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +110 -110
  77. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -25
  78. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +34 -34
  79. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +272 -272
  80. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +21 -21
  81. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +14 -14
  82. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +94 -94
  83. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +155 -155
  84. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +134 -134
  85. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +189 -189
  86. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -483
  87. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +66 -66
  88. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +57 -57
  89. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -212
  90. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +160 -160
  91. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -992
  92. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +292 -292
  93. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +196 -196
  94. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +144 -144
  95. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +280 -280
  96. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +65 -65
  97. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +187 -187
  98. package/resources/sysml.library/LICENSE +276 -276
  99. package/resources/sysml.library/NOTICE.md +20 -20
  100. package/resources/sysml.library/Systems Library/Actions.sysml +556 -556
  101. package/resources/sysml.library/Systems Library/Allocations.sysml +28 -28
  102. package/resources/sysml.library/Systems Library/AnalysisCases.sysml +37 -37
  103. package/resources/sysml.library/Systems Library/Attributes.sysml +24 -24
  104. package/resources/sysml.library/Systems Library/Calculations.sysml +36 -36
  105. package/resources/sysml.library/Systems Library/Cases.sysml +70 -70
  106. package/resources/sysml.library/Systems Library/Connections.sysml +59 -59
  107. package/resources/sysml.library/Systems Library/Constraints.sysml +43 -43
  108. package/resources/sysml.library/Systems Library/Flows.sysml +125 -125
  109. package/resources/sysml.library/Systems Library/Interfaces.sysml +88 -88
  110. package/resources/sysml.library/Systems Library/Items.sysml +152 -152
  111. package/resources/sysml.library/Systems Library/Metadata.sysml +31 -31
  112. package/resources/sysml.library/Systems Library/Parts.sysml +80 -80
  113. package/resources/sysml.library/Systems Library/Ports.sysml +53 -53
  114. package/resources/sysml.library/Systems Library/Requirements.sysml +193 -193
  115. package/resources/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -123
  116. package/resources/sysml.library/Systems Library/States.sysml +102 -102
  117. package/resources/sysml.library/Systems Library/SysML.sysml +539 -539
  118. package/resources/sysml.library/Systems Library/UseCases.sysml +56 -56
  119. package/resources/sysml.library/Systems Library/VerificationCases.sysml +102 -102
  120. package/resources/sysml.library/Systems Library/Views.sysml +163 -163
  121. package/resources/sysml.library.index.json +1 -1
@@ -1,126 +1,126 @@
1
- standard library package Flows {
2
- doc
3
- /*
4
- * This package defines the base types for flows and related behavioral elements
5
- * in the SysML language.
6
- */
7
-
8
- private import Links::Link;
9
- private import Occurrences::Occurrence;
10
- private import Occurrences::HappensDuring;
11
- private import Objects::binaryLinkObjects;
12
- private import Transfers::Transfer;
13
- private import Transfers::transfers;
14
- private import Transfers::FlowTransfer;
15
- private import Transfers::flowTransfers;
16
- private import Transfers::FlowTransferBefore;
17
- private import Transfers::flowTransfersBefore;
18
- private import Actions::Action;
19
- private import Actions::actions;
20
- private import ScalarValues::Natural;
21
-
22
- abstract flow def MessageAction :> Action, Link {
23
- doc
24
- /*
25
- * MessageAction is the most general class of actions that represent
26
- * interactions between linked things. It is the base type of all
27
- * FlowDefinitions.
28
- */
29
-
30
- ref payload [0..*] {
31
- doc
32
- /*
33
- * A payload that may be transferred during the interaction.
34
- */
35
- }
36
- }
37
-
38
- abstract flow def Message :> MessageAction, Transfer {
39
- doc
40
- /*
41
- * Message is the subclass of message connections that represent
42
- * a transfer of objects or values between two occurrences. It is
43
- * the base type of all FlowUsages.
44
- */
45
-
46
- ref payload :>> MessageAction::payload, Transfer::payload;
47
-
48
- private ref action thisConnection = self;
49
-
50
- in event occurrence sourceEvent [1] default thisConnection.start {
51
- doc
52
- /*
53
- * An occurrence happening during the source of this message
54
- * that is either the start of the mssage or happens before it.
55
- */
56
- }
57
- in event occurrence targetEvent [1] default thisConnection.done {
58
- doc
59
- /*
60
- * An occurrence happening during the target of this message
61
- * that is either the end of the message or happens after it.
62
- */
63
- }
64
-
65
- connection :HappensDuring connect sourceEvent to [1] source;
66
- connection :HappensDuring connect targetEvent to [1] target;
67
-
68
- private attribute seBeforeNum: Natural[1] = if sourceEvent==thisConnection.start ? 0 else 1;
69
- private attribute teAfterNum: Natural[1] = if targetEvent==thisConnection.done ? 0 else 1;
70
- succession [seBeforeNum] first [0..1] sourceEvent then [0..1] self;
71
- succession [teAfterNum] first [0..1] self then [0..1] targetEvent;
72
- }
73
-
74
- abstract flow def Flow :> Message, FlowTransfer {
75
- doc
76
- /*
77
- * Flow is a subclass of messages that are also flow transfers.
78
- * It is the base type for FlowUsages that identify their source output and
79
- * target input.
80
- */
81
-
82
- end occurrence source: Occurrence :>> Message::source, FlowTransfer::source;
83
- end occurrence target: Occurrence :>> Message::target, FlowTransfer::target;
84
- }
85
-
86
- abstract flow def SuccessionFlow :> Flow, FlowTransferBefore {
87
- doc
88
- /*
89
- * SuccessionFlow is a subclass of flowss that appen after their source and
90
- * before their target. It is the base type for all SuccessionFlowUsages.
91
- */
92
-
93
- ref self : SuccessionFlow :>> Flow::self, FlowTransferBefore::self;
94
-
95
- end occurrence source: Occurrence :>> Flow::source, FlowTransferBefore::source;
96
- end occurrence target: Occurrence :>> Flow::target, FlowTransferBefore::target;
97
- }
98
-
99
- abstract message messages: Message[0..*] nonunique :> transfers, actions {
100
- doc
101
- /*
102
- * messages is the base feature of all FlowUsages.
103
- */
104
- }
105
-
106
- abstract flow flows: Flow[0..*] nonunique :> messages, flowTransfers {
107
- doc
108
- /*
109
- * flows is the base feature for FlowUsages that identify their source output
110
- * and target input.
111
- */
112
-
113
- end occurrence source: Occurrence :>> Flow::source, messages::source, flowTransfers::source;
114
- end occurrence target: Occurrence :>> Flow::target, messages::target, flowTransfers::target;
115
- }
116
-
117
- abstract flow successionFlows: SuccessionFlow[0..*] nonunique :> flows, flowTransfersBefore {
118
- doc
119
- /*
120
- * successionFlows is the base feature of all SuccessionFlowUsages.
121
- */
122
-
123
- end occurrence source: Occurrence :>> SuccessionFlow::source, flows::source, flowTransfersBefore::source;
124
- end occurrence target: Occurrence :>> SuccessionFlow::target, flows::target, flowTransfersBefore::target;
125
- }
1
+ standard library package Flows {
2
+ doc
3
+ /*
4
+ * This package defines the base types for flows and related behavioral elements
5
+ * in the SysML language.
6
+ */
7
+
8
+ private import Links::Link;
9
+ private import Occurrences::Occurrence;
10
+ private import Occurrences::HappensDuring;
11
+ private import Objects::binaryLinkObjects;
12
+ private import Transfers::Transfer;
13
+ private import Transfers::transfers;
14
+ private import Transfers::FlowTransfer;
15
+ private import Transfers::flowTransfers;
16
+ private import Transfers::FlowTransferBefore;
17
+ private import Transfers::flowTransfersBefore;
18
+ private import Actions::Action;
19
+ private import Actions::actions;
20
+ private import ScalarValues::Natural;
21
+
22
+ abstract flow def MessageAction :> Action, Link {
23
+ doc
24
+ /*
25
+ * MessageAction is the most general class of actions that represent
26
+ * interactions between linked things. It is the base type of all
27
+ * FlowDefinitions.
28
+ */
29
+
30
+ ref payload [0..*] {
31
+ doc
32
+ /*
33
+ * A payload that may be transferred during the interaction.
34
+ */
35
+ }
36
+ }
37
+
38
+ abstract flow def Message :> MessageAction, Transfer {
39
+ doc
40
+ /*
41
+ * Message is the subclass of message connections that represent
42
+ * a transfer of objects or values between two occurrences. It is
43
+ * the base type of all FlowUsages.
44
+ */
45
+
46
+ ref payload :>> MessageAction::payload, Transfer::payload;
47
+
48
+ private ref action thisConnection = self;
49
+
50
+ in event occurrence sourceEvent [1] default thisConnection.start {
51
+ doc
52
+ /*
53
+ * An occurrence happening during the source of this message
54
+ * that is either the start of the mssage or happens before it.
55
+ */
56
+ }
57
+ in event occurrence targetEvent [1] default thisConnection.done {
58
+ doc
59
+ /*
60
+ * An occurrence happening during the target of this message
61
+ * that is either the end of the message or happens after it.
62
+ */
63
+ }
64
+
65
+ connection :HappensDuring connect sourceEvent to [1] source;
66
+ connection :HappensDuring connect targetEvent to [1] target;
67
+
68
+ private attribute seBeforeNum: Natural[1] = if sourceEvent==thisConnection.start ? 0 else 1;
69
+ private attribute teAfterNum: Natural[1] = if targetEvent==thisConnection.done ? 0 else 1;
70
+ succession [seBeforeNum] first [0..1] sourceEvent then [0..1] self;
71
+ succession [teAfterNum] first [0..1] self then [0..1] targetEvent;
72
+ }
73
+
74
+ abstract flow def Flow :> Message, FlowTransfer {
75
+ doc
76
+ /*
77
+ * Flow is a subclass of messages that are also flow transfers.
78
+ * It is the base type for FlowUsages that identify their source output and
79
+ * target input.
80
+ */
81
+
82
+ end occurrence source: Occurrence :>> Message::source, FlowTransfer::source;
83
+ end occurrence target: Occurrence :>> Message::target, FlowTransfer::target;
84
+ }
85
+
86
+ abstract flow def SuccessionFlow :> Flow, FlowTransferBefore {
87
+ doc
88
+ /*
89
+ * SuccessionFlow is a subclass of flowss that appen after their source and
90
+ * before their target. It is the base type for all SuccessionFlowUsages.
91
+ */
92
+
93
+ ref self : SuccessionFlow :>> Flow::self, FlowTransferBefore::self;
94
+
95
+ end occurrence source: Occurrence :>> Flow::source, FlowTransferBefore::source;
96
+ end occurrence target: Occurrence :>> Flow::target, FlowTransferBefore::target;
97
+ }
98
+
99
+ abstract message messages: Message[0..*] nonunique :> transfers, actions {
100
+ doc
101
+ /*
102
+ * messages is the base feature of all FlowUsages.
103
+ */
104
+ }
105
+
106
+ abstract flow flows: Flow[0..*] nonunique :> messages, flowTransfers {
107
+ doc
108
+ /*
109
+ * flows is the base feature for FlowUsages that identify their source output
110
+ * and target input.
111
+ */
112
+
113
+ end occurrence source: Occurrence :>> Flow::source, messages::source, flowTransfers::source;
114
+ end occurrence target: Occurrence :>> Flow::target, messages::target, flowTransfers::target;
115
+ }
116
+
117
+ abstract flow successionFlows: SuccessionFlow[0..*] nonunique :> flows, flowTransfersBefore {
118
+ doc
119
+ /*
120
+ * successionFlows is the base feature of all SuccessionFlowUsages.
121
+ */
122
+
123
+ end occurrence source: Occurrence :>> SuccessionFlow::source, flows::source, flowTransfersBefore::source;
124
+ end occurrence target: Occurrence :>> SuccessionFlow::target, flows::target, flowTransfersBefore::target;
125
+ }
126
126
  }
@@ -1,89 +1,89 @@
1
- standard library package Interfaces {
2
- doc
3
- /*
4
- * This package defines the base types for interfaces and related structural elements in the SysML language.
5
- */
6
-
7
- private import Connections::Connection;
8
- private import Connections::connections;
9
- private import Connections::BinaryConnection;
10
- private import Connections::binaryConnections;
11
- private import Ports::Port;
12
-
13
- private import ScalarValues::Natural;
14
- private import SequenceFunctions::size;
15
- private import SequenceFunctions::excludingAt;
16
- private import ControlFunctions::selectOne;
17
-
18
- private import SequenceFunctions::notEmpty;
19
-
20
- private calc def excludingOnce {
21
- doc
22
- /*
23
- * Return a sequence that is the same as the input sequence, but with a single
24
- * instance of a given value removed. The given value must be in the input sequence.
25
- */
26
- in seq[1..*] nonunique ordered;
27
- in value[1] :> seq;
28
-
29
- private attribute position : Natural[1] = (1..size(seq))->selectOne{in i; seq#(i) == value};
30
- seq->excludingAt(position)
31
- }
32
-
33
- abstract interface def Interface :> Connection {
34
- doc
35
- /*
36
- * Interface is the most general class of links between Ports on Parts
37
- * within some containing structure. Interface is the base type of all
38
- * InterfaceDefinitions.
39
- *
40
- * Transfers outgoing from any one of the participant Ports of an Interface
41
- * may be targeted to one of the other participant Ports (depending on any
42
- * other Interfaces in which the Port is also participating).
43
- */
44
-
45
- ref port :>> participant : Port [2..*] nonunique ordered {
46
- doc
47
- /*
48
- * The participants of an Interface must be Ports. The interfacingPorts of
49
- * each participant Port include all the other participants in the Interface.
50
- */
51
-
52
- protected ref thisParticipant :>> self;
53
- protected ref otherParticipants : Port [1..*] nonunique :> interfacingPorts
54
- default participant->excludingOnce(thisParticipant);
55
- }
56
- }
57
-
58
- abstract interface def BinaryInterface :> Interface, BinaryConnection {
59
- doc
60
- /*
61
- * BinaryInterface is the most general class of links between two Ports
62
- * on Parts within some containing structure. BinaryInterface is the base
63
- * type of all binary InterfaceDefinitions which have exactly two ends.
64
- *
65
- * Transfers outgoing from each participant Port of a BinaryInterface may be
66
- * targeted to the other participant Port (depending on any other Interfaces
67
- * in which the Port is also participating).
68
- */
69
-
70
- ref port :>> Interface::participant, BinaryConnection::participant[2] nonunique ordered;
71
-
72
- end port source: Port :>> BinaryConnection::source;
73
- end port target: Port :>> BinaryConnection::target;
74
- }
75
-
76
- abstract interface interfaces: Interface[0..*] nonunique :> connections {
77
- doc
78
- /*
79
- * interfaces is the base feature of all InterfaceUsages.
80
- */
81
- }
82
-
83
- abstract interface binaryInterfaces: BinaryInterface[0..*] nonunique :> interfaces, binaryConnections {
84
- doc
85
- /*
86
- * interfaces is the base feature of all binary InterfaceUsages.
87
- */
88
- }
1
+ standard library package Interfaces {
2
+ doc
3
+ /*
4
+ * This package defines the base types for interfaces and related structural elements in the SysML language.
5
+ */
6
+
7
+ private import Connections::Connection;
8
+ private import Connections::connections;
9
+ private import Connections::BinaryConnection;
10
+ private import Connections::binaryConnections;
11
+ private import Ports::Port;
12
+
13
+ private import ScalarValues::Natural;
14
+ private import SequenceFunctions::size;
15
+ private import SequenceFunctions::excludingAt;
16
+ private import ControlFunctions::selectOne;
17
+
18
+ private import SequenceFunctions::notEmpty;
19
+
20
+ private calc def excludingOnce {
21
+ doc
22
+ /*
23
+ * Return a sequence that is the same as the input sequence, but with a single
24
+ * instance of a given value removed. The given value must be in the input sequence.
25
+ */
26
+ in seq[1..*] nonunique ordered;
27
+ in value[1] :> seq;
28
+
29
+ private attribute position : Natural[1] = (1..size(seq))->selectOne{in i; seq#(i) == value};
30
+ seq->excludingAt(position)
31
+ }
32
+
33
+ abstract interface def Interface :> Connection {
34
+ doc
35
+ /*
36
+ * Interface is the most general class of links between Ports on Parts
37
+ * within some containing structure. Interface is the base type of all
38
+ * InterfaceDefinitions.
39
+ *
40
+ * Transfers outgoing from any one of the participant Ports of an Interface
41
+ * may be targeted to one of the other participant Ports (depending on any
42
+ * other Interfaces in which the Port is also participating).
43
+ */
44
+
45
+ ref port :>> participant : Port [2..*] nonunique ordered {
46
+ doc
47
+ /*
48
+ * The participants of an Interface must be Ports. The interfacingPorts of
49
+ * each participant Port include all the other participants in the Interface.
50
+ */
51
+
52
+ protected ref thisParticipant :>> self;
53
+ protected ref otherParticipants : Port [1..*] nonunique :> interfacingPorts
54
+ default participant->excludingOnce(thisParticipant);
55
+ }
56
+ }
57
+
58
+ abstract interface def BinaryInterface :> Interface, BinaryConnection {
59
+ doc
60
+ /*
61
+ * BinaryInterface is the most general class of links between two Ports
62
+ * on Parts within some containing structure. BinaryInterface is the base
63
+ * type of all binary InterfaceDefinitions which have exactly two ends.
64
+ *
65
+ * Transfers outgoing from each participant Port of a BinaryInterface may be
66
+ * targeted to the other participant Port (depending on any other Interfaces
67
+ * in which the Port is also participating).
68
+ */
69
+
70
+ ref port :>> Interface::participant, BinaryConnection::participant[2] nonunique ordered;
71
+
72
+ end port source: Port :>> BinaryConnection::source;
73
+ end port target: Port :>> BinaryConnection::target;
74
+ }
75
+
76
+ abstract interface interfaces: Interface[0..*] nonunique :> connections {
77
+ doc
78
+ /*
79
+ * interfaces is the base feature of all InterfaceUsages.
80
+ */
81
+ }
82
+
83
+ abstract interface binaryInterfaces: BinaryInterface[0..*] nonunique :> interfaces, binaryConnections {
84
+ doc
85
+ /*
86
+ * interfaces is the base feature of all binary InterfaceUsages.
87
+ */
88
+ }
89
89
  }