Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_prefer_static_local_function = true:suggestion
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_properties = false:none
csharp_style_expression_bodied_indexers = false:none
csharp_style_expression_bodied_accessors = false:none
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
csharp_style_expression_bodied_local_functions = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_prefer_primary_constructors = false:none
resharper_accessor_owner_body = expression_body

#### 8. XML documentation formatting — Rider: XmlDocFormatter
resharper_xmldoc_indent_size = 1
Expand Down
47 changes: 32 additions & 15 deletions Resources/KerML_only_xmi.uml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_mcxnIFn3EfG_XZTXp4TXuA" name="KerML" URI="https://www.omg.org/spec/KerML/20250201">
<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_1BECgI9WEfGTIPR1UWDcqw" name="KerML" URI="https://www.omg.org/spec/KerML/20250201">
<packagedElement xmi:type="uml:Package" xmi:id="_18_5_3_12e503d9_1562427331290_651623_19809" name="Root" visibility="public" URI="">
<ownedComment xmi:id="_19_0_2_12e503d9_1584042059016_401103_80" annotatedElement="_18_5_3_12e503d9_1562427331290_651623_19809">
<body>The Root layer provides the syntactic foundation for KerML.
Expand Down Expand Up @@ -1824,12 +1824,14 @@ endif</body>
</ownedRule>
<ownedRule xmi:id="_19_0_4_12e503d9_1651078182904_998823_593" name="deriveTypeFeatureMembership" visibility="public" constrainedElement="_18_5_3_71301a1_1537895141427_270492_15579">
<ownedComment xmi:id="_19_0_4_12e503d9_1651078925643_68633_611" annotatedElement="_19_0_4_12e503d9_1651078182904_998823_593">
<body>&lt;p>The &lt;code>featureMemberships&lt;/code> of a &lt;code>Type&lt;/code> is the union of the &lt;code>ownedFeatureMemberships&lt;/code> and those &lt;code>inheritedMemberships&lt;/code> that are &lt;code>FeatureMemberships&lt;/code>.&lt;/p></body>
<body>&lt;p>The &lt;code>featureMemberships&lt;/code> of a &lt;code>Type&lt;/code> is the union of the &lt;code>ownedFeatureMemberships&lt;/code> and those &lt;code>inheritedMemberships&lt;/code> that are &lt;code>FeatureMemberships&lt;/code> owned by a direct or indirect supertype of this &lt;code>Type&lt;/code>.&lt;/p></body>
</ownedComment>
<specification xmi:type="uml:OpaqueExpression" xmi:id="_19_0_4_12e503d9_1651078182923_270790_594" name="" visibility="public">
<language>OCL2.0</language>
<body>featureMembership = ownedFeatureMembership->union(
inheritedMembership->selectByKind(FeatureMembership))</body>
<body>featureMembership = ownedFeatureMembership->
union(inheritedMembership->
selectByKind(FeatureMembership)->
select(mem | self.specializes(mem.owningType)))</body>
</specification>
</ownedRule>
<ownedRule xmi:id="_19_0_4_12e503d9_1651078935606_616630_612" name="deriveTypeOwnedFeature" visibility="public" constrainedElement="_18_5_3_71301a1_1537895141427_270492_15579">
Expand Down Expand Up @@ -3012,11 +3014,15 @@ featuringTypes->forAll(t |
</ownedRule>
<ownedRule xmi:id="_2022x_2_12e503d9_1740200857783_345036_1324" name="validateRedefinitionEndConformance" visibility="public" constrainedElement="_18_5_3_12e503d9_1533160651690_251835_42168">
<ownedComment xmi:id="_2022x_2_12e503d9_1740200920121_818447_1326" annotatedElement="_2022x_2_12e503d9_1740200857783_345036_1324">
<body>&lt;p>If the redefinedFeature of a Redefinition has isEnd = true, then the redefiningFeature must have isEnd = true.&lt;/p></body>
<body>&lt;p>If the &lt;code>redefinedFeature&lt;/code> of a &lt;code>Redefinition&lt;/code> has &lt;code>isEnd = true&lt;/code> and the &lt;code>owningType&lt;/code> of the &lt;code>redefiningFeature&lt;/code> is an &lt;code>Association&lt;/code> or &lt;code>Connector&lt;/code>, then the &lt;code>redefiningFeature&lt;/code> must have &lt;code>isEnd = true&lt;/code>.&lt;/p></body>
</ownedComment>
<specification xmi:type="uml:OpaqueExpression" xmi:id="_2022x_2_12e503d9_1740200857786_322853_1325" name="" visibility="public">
<language>OCL2.0</language>
<body>redefinedFeature.isEnd implies redefiningFeature.isEnd</body>
<body>redefinedFeature.isEnd and
redefiningFeature.owningType &lt;> null and
(redefiningFeature.owningType.oclIsKindOf(Association) or
redefiningFeature.owningType.oclIsKindOf(Connector)) implies
redefiningFeature.isEnd</body>
</specification>
</ownedRule>
<generalization xmi:id="_18_5_3_12e503d9_1533160674973_792005_43244" general="_18_5_3_12e503d9_1533160651710_980688_42209"/>
Expand Down Expand Up @@ -4115,7 +4121,7 @@ owningNamespace.oclAsType(Feature).ownedCrossFeature() = self</body>
</ownedOperation>
<ownedOperation xmi:id="_2022x_2_12e503d9_1734673931282_837421_314" name="ownedCrossFeature" visibility="public" bodyCondition="_2022x_2_12e503d9_1734674066018_775009_320">
<ownedComment xmi:id="_2022x_2_12e503d9_1734674026505_761479_319" annotatedElement="_2022x_2_12e503d9_1734673931282_837421_314">
<body>&lt;p>If this &lt;code>Feature&lt;/code> is an end &lt;code>Feature&lt;/code> of its &lt;code>owningType&lt;/code>, then return the first &lt;code>ownedMember&lt;/code> of the &lt;code>Feature&lt;/code> that is a &lt;code>Feature&lt;/code>, but not a &lt;code>Multiplicity&lt;/code> or a &lt;code>MetadataFeature&lt;/code>, and whose &lt;code>owningMembership&lt;/code> is &lt;em>not&lt;/em> a &lt;code>FeatureMembership&lt;/code>. If this exists, it is the &lt;code>crossFeature&lt;/code> of the end &lt;code>Feature&lt;/code>.&lt;/p></body>
<body>&lt;p>If this &lt;code>Feature&lt;/code> is an end &lt;code>Feature&lt;/code> of its &lt;code>owningType&lt;/code>, then return the first &lt;code>ownedMember&lt;/code> of the &lt;code>Feature&lt;/code> that is a &lt;code>Feature&lt;/code>, but &lt;em>not&lt;/em> a &lt;code>Multiplicity&lt;/code>, &lt;code>MetadataFeature&lt;/code>, or &lt;code>BindingConnector&lt;/code>, and whose &lt;code>owningMembership&lt;/code> is &lt;em>not&lt;/em> a &lt;code>FeatureMembership&lt;/code> or &lt;code>FeatureValue&lt;/code>. If this exists, it is the &lt;code>crossFeature&lt;/code> of the end &lt;code>Feature&lt;/code>.&lt;/p></body>
</ownedComment>
<ownedRule xmi:id="_2022x_2_12e503d9_1734674066018_775009_320" name="unnamed1" visibility="public">
<specification xmi:type="uml:OpaqueExpression" xmi:id="_2022x_2_12e503d9_1734674066018_691992_321" name="" visibility="public">
Expand All @@ -4124,13 +4130,16 @@ owningNamespace.oclAsType(Feature).ownedCrossFeature() = self</body>
else
let ownedMemberFeatures: Sequence(Feature) =
ownedMember->selectByKind(Feature)->
reject(oclIsKindOf(Multiplicity) or
reject(oclIsKindOf(Multiplicity) or
oclIsKindOf(MetadataFeature) or
oclIsKindOf(FeatureValue))->
reject(owningMembership.oclIsKindOf(FeatureMembership)) in
oclIsKindOf(BindingConnector))->
reject(owningMembership.oclIsKindOf(FeatureMembership) or
owningMembership.oclIsKindOf(FeatureValue)) in
if ownedMemberFeatures.isEmpty() then null
else ownedMemberFeatures->first()
endif</body>
endif
endif
</body>
</specification>
</ownedRule>
<ownedParameter xmi:id="_2022x_2_12e503d9_1734673952638_506403_316" name="" visibility="public" type="_18_5_3_12e503d9_1533160651684_893483_42160" direction="return">
Expand Down Expand Up @@ -5919,12 +5928,12 @@ endif</body>
</ownedComment>
<ownedRule xmi:id="_2022x_2_12e503d9_1735773712779_910396_22" name="checkIndexExpressionResultSpecialization" visibility="public">
<ownedComment xmi:id="_2022x_2_12e503d9_1735773810657_715734_24" annotatedElement="_2022x_2_12e503d9_1735773712779_910396_22">
<body>&lt;p>The &lt;code>result&lt;/code> of an &lt;code>IndexExpression&lt;/code> must specialize the &lt;code>result&lt;/code> parameter of the first &lt;code>argument&lt;/code> of the &lt;code>IndexExpression&lt;/code>, unless that &lt;code>result&lt;/code> already directly or indirectly specializes the &lt;code>DataType&lt;/code> &lt;em>&lt;code>Collections::Array&lt;/code>&lt;/em> from the Kernel Data Type Library.&lt;/p></body>
<body>&lt;p>The &lt;code>result&lt;/code> of an &lt;code>IndexExpression&lt;/code> must specialize the &lt;code>result&lt;/code> parameter of the first &lt;code>argument&lt;/code> of the &lt;code>IndexExpression&lt;/code>, unless that &lt;code>result&lt;/code> already directly or indirectly specializes the &lt;code>DataType&lt;/code> &lt;em>&lt;code>Collections::Collection&lt;/code>&lt;/em> from the Kernel Data Type Library.&lt;/p></body>
</ownedComment>
<specification xmi:type="uml:OpaqueExpression" xmi:id="_2022x_2_12e503d9_1735773712782_737365_23" name="" visibility="public">
<language>OCL2.0</language>
<body>arguments->notEmpty() and
not arguments->first().result.specializesFromLibrary('Collections::Array') implies
not arguments->first().result.specializesFromLibrary('Collections::Collection') implies
result.specializes(arguments->first().result)</body>
</specification>
</ownedRule>
Expand Down Expand Up @@ -6629,11 +6638,19 @@ endif</body>
</ownedComment>
<ownedRule xmi:id="_19_0_4_12e503d9_1605479418509_764031_220" name="checkMultiplicityRangeExpressionTypeFeaturing" visibility="public" constrainedElement="_19_0_2_12e503d9_1573086225407_540120_4572">
<ownedComment xmi:id="_19_0_4_12e503d9_1605479535025_49461_222" annotatedElement="_19_0_4_12e503d9_1605479418509_764031_220">
<body>&lt;p>The &lt;code>bounds&lt;/code> of a &lt;code>MultiplicityRange&lt;/code> must have the same &lt;code>featuringTypes&lt;/code> as the &lt;code>MultiplicityRange&lt;/code>.&lt;/p></body>
<body>&lt;p>If the &lt;code>owningNamespace&lt;/code> of a &lt;code>MultiplicityRange&lt;/code> is a &lt;code>Feature&lt;/code>, but not an owned cross &lt;code>Feature&lt;/code>, then the &lt;code>bounds&lt;/code> of the &lt;code>MultiplicityRange&lt;/code> must have the same &lt;code>featuringTypes&lt;/code> as the &lt;code>MultiplicityRange&lt;/code>. If the &lt;code>owningNamespace&lt;/code> is an owned cross &lt;code>Feature&lt;/code>, then the &lt;code>bounds&lt;/code> must have the same &lt;code>featuringTypes&lt;/code> as the owning end &lt;code>Feature&lt;/code> of the &lt;code>owningNamespace&lt;/code>. (This allows a cross multiplicity to be evaluated in the same context as the multiplicity of the end &lt;code>Feature&lt;/code>.)&lt;/p></body>
</ownedComment>
<specification xmi:type="uml:OpaqueExpression" xmi:id="_19_0_4_12e503d9_1605479418510_892864_221" name="" visibility="public">
<language>OCL2.0</language>
<body>bound->forAll(b | b.featuringType = self.featuringType)</body>
<body>let boundsFeaturingType : OrderedSet(Type) =
if owningNamespace &lt;> null and owningNamespace.oclIsKindOf(Feature) and
owningNamespace.oclAsType(Feature).isOwnedCrossFeature() then
owningNamespace.oclAsType(Feature).owningNamespace.oclAsType(Feature).featuringType
else
featuringType
endif in
bound->forAll(b | b.featuringType = boundsFeaturingType)
</body>
</specification>
</ownedRule>
<ownedRule xmi:id="_19_0_4_12e503d9_1676524580375_237724_570" name="validateMultiplicityRangeBoundResultTypes" visibility="public" constrainedElement="_19_0_2_12e503d9_1573086225407_540120_4572">
Expand Down
16 changes: 14 additions & 2 deletions Resources/SysML-textual-bnf.kebnf
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ RefPrefix : Usage =
BasicUsagePrefix : Usage =
RefPrefix
( isReference ?= 'ref' )?

// (See Note 1)

EndUsagePrefix : Usage =
isEnd ?= 'end' ( ownedRelationship += OwnedCrossFeatureMember )?

// (See Note 1)
// (See Note 2)

OwnedCrossFeatureMember : OwningMembership =
ownedRelatedElement += OwnedCrossFeature
Expand Down Expand Up @@ -329,7 +331,17 @@ FeatureValue =
ownedRelatedElement += OwnedExpression

// Notes:
// 1. A Usage parsed with isEnd = true for which mayTimeVary = true must also have isConstant set to true, even though this is not explicitly notated in the textual notation, in order to satisfy the KerML constraint checkFeatureEndIsConstant.
// 1. The Boolean property Usage::isReference has a value derived as the logical negation of Feature::isComposite (see constraint deriveUsageIsReference in 8.3.6.4). In general, unless otherwise stated in the following, if the declaration of any kind of Usage does not include the keyword ref, the Usage shall be parsed with isReference = false and isComposite = true. Conversely, the Usage shall be parsed with isReference = true and isComposite = false in any of the following cases:
// • The declaration includes the keyword ref, explicitly constraining isReference to be true, which shall be considered to require isComposite be set to false. (This includes the case of a ReferenceUsage; see 8.3.6.3.)
// • It is an AttributeUsage (see 8.3.7.3). (Note that an EnumerationUsage is a kind of AttributeUsage; see 8.3.8.3)
// • It is a PortUsage not owned by a PortDefinition or PortUsage (see 8.3.12.6).
// • It would otherwise not satisfy one or more of the abstract syntax validation constraints validateUsageIsReferential (see 8.3.6.8), validateAttributeDefinitionFeature (see 8.3.7.2), and/or validateAttributeUsageFeature (see 8.3.7.3); that is, when any of the following are true:
// • direction is non-null.
// • isEnd is true.
// • owningType is null (so featuringTypes is empty).
// • owningType is an AttributeDefinition.
// • owningType is an AttributeUsage.
// 2. A Usage parsed with isEnd = true for which mayTimeVary = true must also have isConstant set to true, even though this is not explicitly notated in the textual notation, in order to satisfy the KerML constraint checkFeatureEndIsConstant.

// Clause 8.2.2.6.3 Reference Usages

Expand Down
Loading
Loading