Skip to content

Commit c3f455e

Browse files
committed
Merge pull request #631 from Systems-Modeling/ST6RI-828
ST6RI-827 Operation and Constraint Updates for 2025-02/Beta 3
2 parents 75b62cd + 2dc1687 commit c3f455e

25 files changed

Lines changed: 101 additions & 326 deletions

File tree

kerml/src/examples/Behavior Examples/TakePicture.kerml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ behavior TakePicture {
1111
step step1: Focus[1];
1212
step step2: Shoot[1];
1313

14-
succession flow exposure[1] from step1.xrsl to step2.xsf;
14+
succession flow exposure[1] of Exposure from step1.xrsl to step2.xsf;
1515

1616
succession step1 then camera.focusedState;
1717
succession step2 then camera.shotState;

kerml/src/examples/Simple Tests/Expressions.kerml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ package Expressions {
2121
behavior w { inout v : Integer;
2222
step : ControlPerformances::LoopPerformance {
2323
in expr whileTest {v > 3}
24-
in expr untilTest;
2524
in step body {
2625
step decrement {
2726
out v_decr : Integer = v - 1;
2827
}
2928
succession decrement then update;
3029
step update : FeatureReferencingPerformances::FeatureWritePerformance {
31-
in redefines onOccurrence = w::self {
30+
in onOccurrence = w::self {
3231
feature redefines startingAt : w {
3332
inout feature redefines accessedFeature redefines v;
3433
}

org.omg.kerml.xpect.tests/library/ControlPerformances.kerml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ standard library package ControlPerformances {
3131
* successions going out of a decision step.
3232
*/
3333

34-
feature redefines earlierOccurrence subsets that;
34+
end feature redefines earlierOccurrence subsets that;
3535
}
3636
}
3737

@@ -52,7 +52,7 @@ standard library package ControlPerformances {
5252
* successions coming into a merge step.
5353
*/
5454

55-
feature redefines laterOccurrence subsets that;
55+
end feature redefines laterOccurrence subsets that;
5656
}
5757
}
5858

@@ -116,8 +116,8 @@ standard library package ControlPerformances {
116116
*/
117117

118118
in whileTest : BooleanEvaluation[1..*];
119-
in untilTest : BooleanEvaluation[0..*];
120119
in body : Occurrence[0..*];
120+
in untilTest : BooleanEvaluation[0..*];
121121

122122
step whileDecision : IfThenPerformance[1..*];
123123
step untilDecision : IfElsePerformance[0..*];

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/parsing/ParsingTests_Expressions.kerml.xt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ package Expressions {
6262
inout v : Integer;
6363
step : ControlPerformances::LoopPerformance {
6464
in expr whileTest {v > 3}
65-
in expr untilTest;
6665
in step body {
6766
step decrement {
6867
out v_decr : Integer = v - 1;
6968
}
7069
succession decrement then update;
7170
step update : FeatureReferencingPerformances::FeatureWritePerformance {
72-
in redefines onOccurrence = w::self {
71+
in onOccurrence = w::self {
7372
feature redefines startingAt : w {
7473
inout feature redefines accessedFeature redefines v;
7574
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//*
2+
XPECT_SETUP org.omg.kerml.xpect.tests.validation.KerMLValidationTest
3+
ResourceSet {
4+
ThisFile {}
5+
File {from ="/library/Base.kerml"}
6+
File {from ="/library/Occurrences.kerml"}
7+
File {from ="/library/Objects.kerml"}
8+
File {from ="/library/Performances.kerml"}
9+
}
10+
Workspace {
11+
JavaProject {
12+
SrcFolder {
13+
ThisFile {}
14+
File {from ="/library/Base.kerml"}
15+
File {from ="/library/Occurrences.kerml"}
16+
File {from ="/library/Objects.kerml"}
17+
File {from ="/library/Performances.kerml"}
18+
}
19+
}
20+
}
21+
END_SETUP
22+
*/
23+
package RedefinitionEnd {
24+
classifier A {
25+
end feature e[1];
26+
}
27+
28+
classifier B :> A {
29+
// XPECT errors ---> "Redefining feature must be an end feature" at "e"
30+
feature :>> e;
31+
}
32+
33+
}

org.omg.kerml.xtext/src/org/omg/kerml/xtext/validation/KerMLValidator.xtend

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ class KerMLValidator extends AbstractKerMLValidator {
180180

181181
public static val INVALID_REDEFINITION_DIRECTION_CONFORMANCE = "validateRedefinitionDirectionConformance"
182182
public static val INVALID_REDEFINITION_DIRECTION_CONFORMANCE_MSG = "Redefining feature must have a compatible direction"
183+
public static val INVALID_REDEFINITION_END_CONFORMANCE = "validateRedefinitionEndConformance"
184+
public static val INVALID_REDEFINITION_END_CONFORMANCE_MSG = "Redefining feature must be an end feature"
183185
public static val INVALID_REDEFINITION_FEATURING_TYPES = 'validateRedefinitionFeaturingTypes'
184186
public static val INVALID_REDEFINITION_FEATURING_TYPES_MSG_1 = "A package-level feature cannot be redefined"
185187
public static val INVALID_REDEFINITION_FEATURING_TYPES_MSG_2 = "Owner of redefining feature cannot be the same as owner of redefined feature"
@@ -363,6 +365,7 @@ class KerMLValidator extends AbstractKerMLValidator {
363365
checkDistinguishibility(mem, aliasMemberships, INVALID_NAMESPACE_DISTINGUISHABILITY_MSG_1)
364366
}
365367
if (namesp instanceof Type) {
368+
ElementUtil.clearCachesOf(namesp)
366369
val inheritedMemberships = namesp.inheritedMembership
367370
for (mem: ownedMemberships) {
368371
checkDistinguishibility(mem, inheritedMemberships, INVALID_NAMESPACE_DISTINGUISHABILITY_MSG_2)
@@ -601,6 +604,13 @@ class KerMLValidator extends AbstractKerMLValidator {
601604
SysMLPackage.eINSTANCE.redefinition_RedefinedFeature, INVALID_REDEFINITION_FEATURING_TYPES)
602605
}
603606
}
607+
608+
// validatRedefinitionEndConformance
609+
610+
if (redefinedFeature.isEnd && !redefiningFeature.isEnd) {
611+
error(INVALID_REDEFINITION_END_CONFORMANCE_MSG, redef,
612+
SysMLPackage.eINSTANCE.redefinition_RedefinedFeature, INVALID_REDEFINITION_END_CONFORMANCE)
613+
}
604614
}
605615
}
606616

org.omg.sysml.xpect.tests/library.kernel/ControlPerformances.kerml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ standard library package ControlPerformances {
3131
* successions going out of a decision step.
3232
*/
3333

34-
feature redefines earlierOccurrence subsets that;
34+
end feature redefines earlierOccurrence subsets that;
3535
}
3636
}
3737

@@ -52,7 +52,7 @@ standard library package ControlPerformances {
5252
* successions coming into a merge step.
5353
*/
5454

55-
feature redefines laterOccurrence subsets that;
55+
end feature redefines laterOccurrence subsets that;
5656
}
5757
}
5858

@@ -116,8 +116,8 @@ standard library package ControlPerformances {
116116
*/
117117

118118
in whileTest : BooleanEvaluation[1..*];
119-
in untilTest : BooleanEvaluation[0..*];
120119
in body : Occurrence[0..*];
120+
in untilTest : BooleanEvaluation[0..*];
121121

122122
step whileDecision : IfThenPerformance[1..*];
123123
step untilDecision : IfElsePerformance[0..*];

org.omg.sysml.xpect.tests/library.systems/Actions.sysml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ standard library package Actions {
431431
* A LoopAction is the base type for all LoopActionUsages.
432432
*/
433433

434+
in ref iterator;
434435

435436
in action body[0..*] {
436437
doc
@@ -447,7 +448,7 @@ standard library package Actions {
447448
* It is the base type for all WhileLoopActionUsages.
448449
*/
449450

450-
in :>> whileTest default {true} {
451+
in whileTest default {true} {
451452
doc
452453
/*
453454
* A Boolean expression that must be true for the loop to continue.
@@ -456,15 +457,15 @@ standard library package Actions {
456457
*/
457458
}
458459

459-
in action body :>> LoopAction::body, LoopPerformance::body {
460+
in action body {
460461
doc
461462
/*
462463
* The action that is performed while the whileTest is true and the
463464
* untilTest is false.
464465
*/
465466
}
466467

467-
in :>> untilTest default {false} {
468+
in untilTest default {false} {
468469
doc
469470
/*
470471
* A Boolean expression that must be false for the loop to continue.
@@ -473,12 +474,7 @@ standard library package Actions {
473474
}
474475
}
475476

476-
private abstract action def ForLoopActionBase :> LoopAction {
477-
in action body;
478-
in ref seq[0..*] ordered nonunique;
479-
}
480-
481-
action def ForLoopAction :> ForLoopActionBase {
477+
action def ForLoopAction :> LoopAction {
482478
doc
483479
/*
484480
* A ForLoopAction is a LoopAction that iterates over an ordered sequence of values.
@@ -493,14 +489,14 @@ standard library package Actions {
493489
*/
494490
}
495491

496-
in ref :>> seq {
492+
in ref seq {
497493
doc
498494
/*
499495
* The sequence of values over which the loop iterates.
500496
*/
501497
}
502498

503-
in action :>> body {
499+
in action body {
504500
doc
505501
/*
506502
* The action that is performed on each iteration of the loop.

org.omg.sysml.xtext/src/org/omg/sysml/xtext/validation/SysMLValidator.xtend

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,6 @@ class SysMLValidator extends KerMLValidator {
13521352
protected def boolean checkReferenceType(Feature feature, Class<?> type, String msg, String eId) {
13531353
val subsetting = feature.ownedReferenceSubsetting
13541354

1355-
// NOTE: This is implemented using getBasicFeatureOf to account for feature chaining. (See SYSML2-307.)
13561355
if (subsetting !== null && !type.isInstance(FeatureUtil.getBasicFeatureOf(subsetting.referencedFeature))) {
13571356
error(msg, subsetting, null, eId)
13581357
return false

org.omg.sysml/src/org/omg/sysml/adapter/ActionDefinitionAdapter.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2021 Model Driven Solutions, Inc.
3+
* Copyright (c) 2021, 2025 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -21,11 +21,7 @@
2121

2222
package org.omg.sysml.adapter;
2323

24-
import java.util.Collections;
25-
import java.util.List;
26-
2724
import org.omg.sysml.lang.sysml.ActionDefinition;
28-
import org.omg.sysml.lang.sysml.Feature;
2925

3026
public class ActionDefinitionAdapter extends OccurrenceDefinitionAdapter {
3127

@@ -38,9 +34,4 @@ public ActionDefinition getTarget() {
3834
return (ActionDefinition)super.getTarget();
3935
}
4036

41-
@Override
42-
public List<Feature> getRelevantFeatures() {
43-
return Collections.emptyList();
44-
}
45-
4637
}

0 commit comments

Comments
 (0)