Skip to content

Commit b0eb9bf

Browse files
committed
Updated Xpect library models.
1 parent 0ef9616 commit b0eb9bf

14 files changed

Lines changed: 134 additions & 91 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ standard library package Clocks {
1818
*/
1919
}
2020

21-
feature universalClock : UniversalClockLife[1] {
21+
readonly feature universalClock : UniversalClockLife[1] {
2222
doc
2323
/*
2424
* universalClock is a single Clock that can be used as a default universal
@@ -37,7 +37,7 @@ standard library package Clocks {
3737

3838
private thisClock : Clock :>> self;
3939

40-
readonly feature currentTime : NumericalValue[1] {
40+
feature currentTime : NumericalValue[1] {
4141
doc
4242
/*
4343
* A scalar time reference that advances over the lifetime of the Clock.
@@ -126,7 +126,7 @@ standard library package Clocks {
126126
* A BasicClock is a Clock whose currentTime is a Real number.
127127
*/
128128

129-
readonly feature :>> currentTime : Real;
129+
feature :>> currentTime : Real;
130130
}
131131

132132
function BasicTimeOf :> TimeOf {

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ standard library package KerML {
1111
metaclass AnnotatingElement specializes Element {
1212
feature annotation : Annotation[0..*];
1313
derived feature annotatedElement : Element[1..*] redefines annotatedElement;
14+
composite derived feature ownedAnnotatingRelationship : Annotation[0..*] subsets annotation, ownedRelationship;
1415
}
1516

1617
metaclass Annotation specializes Relationship {
1718
feature annotatingElement : AnnotatingElement[1..1] redefines source;
1819
feature annotatedElement : Element[1..1] redefines target, annotatedElement;
1920
derived feature owningAnnotatedElement : Element[0..1] subsets annotatedElement, owningRelatedElement;
21+
derived feature owningAnnotatingElement : AnnotatingElement[0..1] subsets annotatingElement, owningRelatedElement;
2022
}
2123

2224
metaclass Comment specializes AnnotatingElement {
@@ -222,6 +224,11 @@ standard library package KerML {
222224
feature redefinedFeature : Feature[1..1] redefines subsettedFeature;
223225
}
224226

227+
metaclass ReferenceSubsetting specializes Subsetting {
228+
feature referencedFeature : Feature[1..1] redefines subsettedFeature;
229+
derived feature referencingFeature : Feature[1..1] redefines subsettingFeature, owningFeature;
230+
}
231+
225232
metaclass Specialization specializes Relationship {
226233
feature general : Type[1..1] redefines target;
227234
feature specific : Type[1..1] redefines source;
@@ -237,7 +244,7 @@ standard library package KerML {
237244
metaclass Subsetting specializes Specialization {
238245
feature subsettedFeature : Feature[1..1] redefines general;
239246
feature subsettingFeature : Feature[1..1] redefines specific;
240-
derived feature owningFeature : Feature[1..1] subsets subsettingFeature redefines owningType;
247+
derived feature owningFeature : Feature[0..1] subsets subsettingFeature redefines owningType;
241248
}
242249

243250
metaclass Type specializes Namespace {
@@ -311,8 +318,6 @@ standard library package KerML {
311318
}
312319

313320
metaclass Connector specializes Feature, Relationship {
314-
feature isDirected : Boolean[1..1];
315-
316321
derived feature relatedFeature : Feature[0..*] redefines relatedElement;
317322
derived feature association : Association[0..*] redefines 'type';
318323
derived feature connectorEnd : Feature[0..*] redefines endFeature;
@@ -412,7 +417,7 @@ standard library package KerML {
412417
}
413418

414419
metaclass MetadataFeature specializes AnnotatingElement, Feature {
415-
derived feature 'metaclass' : Metaclass[0..1] redefines 'type';
420+
derived feature 'metaclass' : Metaclass[0..1] subsets 'type';
416421
}
417422

418423
metaclass MultiplicityRange specializes Multiplicity {
@@ -437,11 +442,6 @@ standard library package KerML {
437442

438443
metaclass Predicate specializes Function;
439444

440-
metaclass ReferenceSubsetting specializes Subsetting {
441-
feature referencedFeature : Feature[1..1] redefines subsettedFeature;
442-
derived feature referencingFeature : Feature[1..1] redefines subsettingFeature, owningFeature;
443-
}
444-
445445
metaclass ResultExpressionMembership specializes FeatureMembership {
446446
composite derived feature ownedResultExpression : Expression[1..1] redefines ownedMemberFeature;
447447
}
@@ -460,7 +460,7 @@ standard library package KerML {
460460
metaclass Structure specializes Class;
461461

462462
metaclass Succession specializes Connector {
463-
derived feature transitionStep : Step[0..1] subsets ownedFeature;
463+
derived feature transitionStep : Step[0..1];
464464
derived feature triggerStep : Step[0..*];
465465
derived feature effectStep : Step[0..*];
466466
derived feature guardExpression : Expression[0..*];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ standard library package Objects {
7272
}
7373
}
7474

75-
abstract assoc struct LinkObject specializes Link, Object disjoint from SelfLink, SelfSameLifeLink, HappensLink {
75+
abstract assoc struct LinkObject specializes Link, Object {
7676
doc
7777
/*
7878
* LinkObject is the most general association structure, being both a Link and an Object.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ standard library package Observation {
2424
*/
2525
}
2626

27-
feature defaultMonitor[1] : DefaultMonitorLife {
27+
readonly feature defaultMonitor[1] : DefaultMonitorLife {
2828
doc
2929
/*
3030
* defaultMonitor is a single ChangeMonitor that can be used as a default.

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,22 @@ standard library package Occurrences {
733733
end feature thatOccurrence: Occurrence[1..*] redefines longerOccurrence
734734
subsets thisOccurrence.timeCoincidentOccurrences;
735735
}
736+
737+
assoc SpaceLink specializes BinaryLink disjoint from Occurrence {
738+
doc
739+
/*
740+
* SpaceLink is the most general association that asserts spatial relationships between a
741+
* sourceOccurrence and a targetOccurrence. Because SpaceLinks assert spatial
742+
* relationships, they cannot also be Occurrences that happen in space. Therefore
743+
* SpaceLink is disjoint with LinkObject, that is, no SpaceLink can also be a
744+
* LinkObject.
745+
*/
746+
747+
end feature sourceOccurrence: Occurrence[0..*] redefines BinaryLink::source;
748+
end feature targetOccurrence: Occurrence[0..*] redefines BinaryLink::target;
749+
}
736750

737-
assoc all InsideOf specializes BinaryLink {
751+
assoc all InsideOf specializes SpaceLink {
738752
doc
739753
/*
740754
* InsideOf asserts that its largerSpace completely overlaps its smallerSpace in space (not
@@ -743,7 +757,7 @@ standard library package Occurrences {
743757
* Occurrence is InsideOf itself and that InsideOf is transitive.
744758
*/
745759

746-
end feature smallerSpace: Occurrence[1..*] redefines source, largerSpace.spaceEnclosedOccurrences;
760+
end feature smallerSpace: Occurrence[1..*] redefines source subsets largerSpace.spaceEnclosedOccurrences;
747761
end feature largerSpace: Occurrence[1..*] redefines target;
748762
}
749763

@@ -881,7 +895,7 @@ standard library package Occurrences {
881895
end feature laterOccurrence: Occurrence[0..*] redefines HappensBefore::laterOccurrence, binaryLinks::target;
882896
}
883897

884-
assoc all OutsideOf specializes Without {
898+
assoc all OutsideOf specializes SpaceLink, Without {
885899
doc
886900
/*
887901
* OutsideOf asserts that two occurrences do not overlap in space (not necessarily in time,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ standard library package SpatialFrames {
2222
* DefaultFrameLife is the classifier of the singleton Life of the defaultFrame.
2323
*/
2424
}
25-
feature defaultFrame : DefaultFrameLife[1] {
25+
26+
readonly feature defaultFrame : DefaultFrameLife[1] {
2627
doc
2728
/*
2829
* defaultFrame is a fixed SpatialFrame used as a universal default.

org.omg.sysml.xpect.tests/library.domain/Quantities and Units/ISQSpaceTime.sysml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,19 @@ standard library package ISQSpaceTime {
189189
/*
190190
* A singleton CartesianSpatial3dCoordinateFrame that can be used as a default universal Cartesian 3D coordinate frame.
191191
*/
192+
193+
attribute :>> mRefs default (SI::m, SI::m, SI::m) {
194+
doc /*
195+
* By default, the universalCartesianSpatial3dCoordinateFrame uses meters as the units on all three axes.
196+
*/
197+
}
198+
199+
attribute :>> transformation[0..0] {
200+
doc /*
201+
* The universalCartesianSpatial3dCoordinateFrame is the "top-level" coordinate frame, not nested in any other frame.
202+
*/
203+
}
204+
192205
}
193206

194207
attribute def CylindricalSpatial3dCoordinateFrame :> Spatial3dCoordinateFrame {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ standard library package Clocks {
1818
*/
1919
}
2020

21-
feature universalClock : UniversalClockLife[1] {
21+
readonly feature universalClock : UniversalClockLife[1] {
2222
doc
2323
/*
2424
* universalClock is a single Clock that can be used as a default universal
@@ -37,7 +37,7 @@ standard library package Clocks {
3737

3838
private thisClock : Clock :>> self;
3939

40-
readonly feature currentTime : NumericalValue[1] {
40+
feature currentTime : NumericalValue[1] {
4141
doc
4242
/*
4343
* A scalar time reference that advances over the lifetime of the Clock.
@@ -126,7 +126,7 @@ standard library package Clocks {
126126
* A BasicClock is a Clock whose currentTime is a Real number.
127127
*/
128128

129-
readonly feature :>> currentTime : Real;
129+
feature :>> currentTime : Real;
130130
}
131131

132132
function BasicTimeOf :> TimeOf {

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ standard library package KerML {
1111
metaclass AnnotatingElement specializes Element {
1212
feature annotation : Annotation[0..*];
1313
derived feature annotatedElement : Element[1..*] redefines annotatedElement;
14+
composite derived feature ownedAnnotatingRelationship : Annotation[0..*] subsets annotation, ownedRelationship;
1415
}
1516

1617
metaclass Annotation specializes Relationship {
1718
feature annotatingElement : AnnotatingElement[1..1] redefines source;
1819
feature annotatedElement : Element[1..1] redefines target, annotatedElement;
1920
derived feature owningAnnotatedElement : Element[0..1] subsets annotatedElement, owningRelatedElement;
21+
derived feature owningAnnotatingElement : AnnotatingElement[0..1] subsets annotatingElement, owningRelatedElement;
2022
}
2123

2224
metaclass Comment specializes AnnotatingElement {
@@ -222,6 +224,11 @@ standard library package KerML {
222224
feature redefinedFeature : Feature[1..1] redefines subsettedFeature;
223225
}
224226

227+
metaclass ReferenceSubsetting specializes Subsetting {
228+
feature referencedFeature : Feature[1..1] redefines subsettedFeature;
229+
derived feature referencingFeature : Feature[1..1] redefines subsettingFeature, owningFeature;
230+
}
231+
225232
metaclass Specialization specializes Relationship {
226233
feature general : Type[1..1] redefines target;
227234
feature specific : Type[1..1] redefines source;
@@ -237,7 +244,7 @@ standard library package KerML {
237244
metaclass Subsetting specializes Specialization {
238245
feature subsettedFeature : Feature[1..1] redefines general;
239246
feature subsettingFeature : Feature[1..1] redefines specific;
240-
derived feature owningFeature : Feature[1..1] subsets subsettingFeature redefines owningType;
247+
derived feature owningFeature : Feature[0..1] subsets subsettingFeature redefines owningType;
241248
}
242249

243250
metaclass Type specializes Namespace {
@@ -311,8 +318,6 @@ standard library package KerML {
311318
}
312319

313320
metaclass Connector specializes Feature, Relationship {
314-
feature isDirected : Boolean[1..1];
315-
316321
derived feature relatedFeature : Feature[0..*] redefines relatedElement;
317322
derived feature association : Association[0..*] redefines 'type';
318323
derived feature connectorEnd : Feature[0..*] redefines endFeature;
@@ -412,7 +417,7 @@ standard library package KerML {
412417
}
413418

414419
metaclass MetadataFeature specializes AnnotatingElement, Feature {
415-
derived feature 'metaclass' : Metaclass[0..1] redefines 'type';
420+
derived feature 'metaclass' : Metaclass[0..1] subsets 'type';
416421
}
417422

418423
metaclass MultiplicityRange specializes Multiplicity {
@@ -437,11 +442,6 @@ standard library package KerML {
437442

438443
metaclass Predicate specializes Function;
439444

440-
metaclass ReferenceSubsetting specializes Subsetting {
441-
feature referencedFeature : Feature[1..1] redefines subsettedFeature;
442-
derived feature referencingFeature : Feature[1..1] redefines subsettingFeature, owningFeature;
443-
}
444-
445445
metaclass ResultExpressionMembership specializes FeatureMembership {
446446
composite derived feature ownedResultExpression : Expression[1..1] redefines ownedMemberFeature;
447447
}
@@ -460,7 +460,7 @@ standard library package KerML {
460460
metaclass Structure specializes Class;
461461

462462
metaclass Succession specializes Connector {
463-
derived feature transitionStep : Step[0..1] subsets ownedFeature;
463+
derived feature transitionStep : Step[0..1];
464464
derived feature triggerStep : Step[0..*];
465465
derived feature effectStep : Step[0..*];
466466
derived feature guardExpression : Expression[0..*];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ standard library package Objects {
7272
}
7373
}
7474

75-
abstract assoc struct LinkObject specializes Link, Object disjoint from SelfLink, SelfSameLifeLink, HappensLink {
75+
abstract assoc struct LinkObject specializes Link, Object {
7676
doc
7777
/*
7878
* LinkObject is the most general association structure, being both a Link and an Object.

0 commit comments

Comments
 (0)