Skip to content

Commit 361d3c3

Browse files
committed
Updated the libraries for the Xpect tests.
1 parent 33c6e08 commit 361d3c3

28 files changed

Lines changed: 796 additions & 719 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ standard library package BaseFunctions {
3535
abstract function '#'{ in seq: Anything[0..*] ordered nonunique; in index: Positive[1..*] ordered nonunique;
3636
return : Anything[0..1];
3737
}
38-
abstract function ','{ in seq1: Anything[0..*] ordered nonunique; seq2: Anything[0..*] ordered nonunique;
38+
abstract function ','{ in seq1: Anything[0..*] ordered nonunique; in seq2: Anything[0..*] ordered nonunique;
3939
return : Anything[0..*] ordered nonunique;
4040
}
4141

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ standard library package Clocks {
88
private import ScalarValues::NumericalValue;
99
private import ScalarValues::Real;
1010
private import Occurrences::Occurrence;
11+
private import Occurrences::Life;
1112
private import ControlFunctions::forAll;
1213

13-
readonly feature universalClock : Clock[1] {
14+
private struct UniversalClockLife[1] :> Clock, Life {
15+
doc
16+
/*
17+
* UniversalClockLife is the classifier of the singleton Life of the universalClock.
18+
*/
19+
}
20+
21+
feature universalClock : UniversalClockLife[1] {
1422
doc
1523
/*
1624
* universalClock is a single Clock that can be used as a default universal

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,18 @@ standard library package ControlPerformances {
9292
inv { not ifTest() == elseClause->notEmpty() }
9393
}
9494

95-
behavior IfThenElsePerformance specializes IfThenPerformance, IfElsePerformance {
95+
behavior IfThenElsePerformance specializes IfThenPerformance {
9696
doc
9797
/*
98-
* An IfThenElsePerformance is an IfThenPerformance and an IfElsePerformance.
98+
* An IfThenElsePerformance is an IfThenPerformance with an additional elseClause that
99+
* occurs after and only after the ifTest evaluation is false.
99100
*/
101+
102+
in redefines ifTest;
103+
in redefines thenClause;
104+
in elseClause : Occurrence[0..1];
105+
succession ifTest[1] then elseClause[0..1];
106+
inv { not ifTest() == elseClause->notEmpty() }
100107
}
101108

102109
behavior LoopPerformance specializes Performance {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ standard library package DataFunctions {
3636
abstract function '<=' { in x: DataValue[1]; in y: DataValue[1]; return : Boolean[1]; }
3737
abstract function '>=' { in x: DataValue[1]; in y: DataValue[1]; return : Boolean[1]; }
3838

39-
abstract function Max { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
40-
abstract function Min { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
39+
abstract function max { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
40+
abstract function min { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
4141

4242
abstract function '..' { in lower: DataValue[1]; in upper: DataValue[1]; return : DataValue[0..*] ordered; }
4343
}
Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
standard library package Links {
2-
doc
3-
/*
4-
* This package defines associations and features that are related to the typing of links.
5-
*/
2+
doc
3+
/*
4+
* This package defines associations and features that are related to the typing of links.
5+
*/
66

7-
private import Base::Anything;
8-
private import Base::things;
9-
10-
abstract assoc Link specializes Anything {
11-
doc
12-
/*
13-
* Link is the most general association between two or more things.
14-
*/
7+
private import Base::Anything;
8+
private import Base::things;
9+
10+
abstract assoc Link specializes Anything {
11+
doc
12+
/*
13+
* Link is the most general association between two or more things.
14+
*/
1515

16-
readonly feature participant: Anything[2..*] nonunique ordered;
17-
}
18-
19-
assoc all BinaryLink specializes Link {
20-
doc
21-
/*
22-
* BinaryLink is the most general binary association between exactly two things,
23-
* nominally directed from source to target.
24-
*/
25-
26-
feature participant: Anything[2] nonunique ordered redefines Link::participant;
27-
28-
readonly end feature source: Anything[0..*] subsets participant;
29-
readonly end feature target: Anything[0..*] subsets participant;
30-
}
31-
32-
assoc all SelfLink specializes BinaryLink {
33-
doc
34-
/*
35-
* SelfLink is a binary association in which the things at the two ends are asserted
36-
* to be the same.
37-
*/
38-
39-
end feature thisThing: Anything[1] redefines source subsets sameThing, sameThing.self;
40-
end feature sameThing: Anything[1] redefines target subsets thisThing;
41-
}
42-
43-
abstract feature links: Link[0..*] nonunique subsets things {
44-
doc
45-
/*
46-
* links is the most general feature of links between individuals.
47-
*/
48-
}
49-
50-
abstract feature binaryLinks: BinaryLink[0..*] nonunique subsets links {
51-
doc
52-
/*
53-
* binaryLinks is a specialization of links restricted to type BinaryLink.
54-
*/
55-
}
56-
57-
abstract feature selfLinks: SelfLink[0..*] nonunique subsets binaryLinks {
58-
doc
59-
/*
60-
* selfLinks is a specialization of binaryLinks restricted to type SelfLink.
61-
*/
16+
readonly feature participant: Anything[2..*] nonunique ordered;
17+
}
18+
19+
assoc all BinaryLink specializes Link {
20+
doc
21+
/*
22+
* BinaryLink is the most general binary association between exactly two things,
23+
* nominally directed from source to target.
24+
*/
25+
26+
feature participant: Anything[2] nonunique ordered redefines Link::participant;
27+
28+
readonly end feature source: Anything[0..*] nonunique subsets participant;
29+
readonly end feature target: Anything[0..*] nonunique subsets participant;
30+
}
31+
32+
assoc all SelfLink specializes BinaryLink {
33+
doc
34+
/*
35+
* SelfLink is a binary association in which the things at the two ends are asserted
36+
* to be the same.
37+
*/
38+
39+
end feature thisThing: Anything[1] redefines source subsets sameThing, sameThing.self;
40+
end feature sameThing: Anything[1] redefines target subsets thisThing;
41+
}
42+
43+
abstract feature links: Link[0..*] nonunique subsets things {
44+
doc
45+
/*
46+
* links is the most general feature of links between individuals.
47+
*/
48+
}
49+
50+
abstract feature binaryLinks: BinaryLink[0..*] nonunique subsets links {
51+
doc
52+
/*
53+
* binaryLinks is a specialization of links restricted to type BinaryLink.
54+
*/
55+
}
56+
57+
abstract feature selfLinks: SelfLink[0..*] nonunique subsets binaryLinks {
58+
doc
59+
/*
60+
* selfLinks is a specialization of binaryLinks restricted to type SelfLink.
61+
*/
62+
63+
end feature thisThing: Anything[1] redefines SelfLink::thisThing, binaryLinks::source;
64+
end feature sameThing: Anything[1] redefines SelfLink::sameThing, binaryLinks::target;
65+
}
6266

63-
end feature thisThing: Anything[1] redefines SelfLink::thisThing, binaryLinks::source;
64-
end feature sameThing: Anything[1] redefines SelfLink::sameThing, binaryLinks::target;
65-
}
66-
6767
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ standard library package Observation {
77

88
private import ScalarValues::Boolean;
99
private import Occurrences::Occurrence;
10+
private import Occurrences::Life;
1011
private import SequenceFunctions::including;
1112
private import SequenceFunctions::excluding;
1213
private import ControlFunctions::select;
@@ -16,7 +17,14 @@ standard library package Observation {
1617
private import FeatureReferencingPerformances::BooleanEvaluationResultToMonitorPerformance;
1718
private import Transfers::TransferBefore;
1819

19-
readonly feature defaultMonitor[1] : ChangeMonitor {
20+
private struct DefaultMonitorLife[1] :> ChangeMonitor, Life {
21+
doc
22+
/*
23+
* DefaultMonitorLife is the classifier of the singleton Life of the defaultMonitor.
24+
*/
25+
}
26+
27+
feature defaultMonitor[1] : DefaultMonitorLife {
2028
doc
2129
/*
2230
* defaultMonitor is a single ChangeMonitor that can be used as a default.

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ standard library package Occurrences {
2020
private import SequenceFunctions::includes;
2121
private import SequenceFunctions::union;
2222

23-
/*
24-
* Occurrence is the most general classifier of entities that have identity and
25-
* occur over time and space.
26-
*
27-
* The features of Occurrence specify the semantics of associations between occurrences that
28-
* assert complete inclusion and exclusion in time or space, or both, which includes
29-
* portions of an occurrence (having the same identity). Portions include slices and shots
30-
* over time and space.
31-
*/
32-
abstract class Occurrence specializes Anything {
23+
abstract class Occurrence specializes Anything disjoint from DataValue {
24+
doc
25+
/*
26+
* Occurrence is the most general classifier of entities that have identity and
27+
* occur over time and space.
28+
*
29+
* The features of Occurrence specify the semantics of associations between occurrences that
30+
* assert complete inclusion and exclusion in time or space, or both, which includes
31+
* portions of an occurrence (having the same identity). Portions include slices and shots
32+
* over time and space.
33+
*/
34+
3335
private import SequenceFunctions::*;
3436

3537
feature portionOfLife: Life[1] subsets portionOf;
@@ -453,10 +455,10 @@ standard library package Occurrences {
453455
* same as taken by this occurrence (all four dimensional points in the minuend that are
454456
* not in any subtrahend are at the same time and space as those in this occurrence).
455457
*/
456-
feature redefines elements: Occurrence[0..*] = (minuend, subtrahend);
458+
feature redefines elements: Occurrence[0..*];
457459
feature difference: Occurrence[0..1];
458-
feature minuend: Occurrence [0..1] subsets elements, interdiff.elements;
459-
feature subtrahend: Occurrence[*] subsets elements;
460+
feature minuend: Occurrence [0..1] subsets elements, interdiff.elements = head(elements);
461+
feature subtrahend: Occurrence[*] subsets elements = tail(elements);
460462
feature interdiff: Set [0..1] {
461463
feature redefines elements: Occurrence[1..*];
462464
feature all notSubtrahend: Occurrence [0..*] subsets elements;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ standard library package Performances {
1919
private import ScalarValues::*;
2020
private import SequenceFunctions::includes;
2121

22-
abstract behavior Performance specializes Occurrence {
22+
abstract behavior Performance specializes Occurrence disjoint from Object {
2323
doc
2424
/*
2525
* Performance is the most general class of behavioral Occurrences that may be performed over time.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ standard library package ScalarFunctions {
2626
abstract function '<=' specializes DataFunctions::'<=' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : Boolean[1]; }
2727
abstract function '>=' specializes DataFunctions::'>=' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : Boolean[1]; }
2828

29-
abstract function max specializes DataFunctions::Max { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
30-
abstract function min specializes DataFunctions::Min { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
29+
abstract function max specializes DataFunctions::max { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
30+
abstract function min specializes DataFunctions::min { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
3131

3232
abstract function '..' specializes DataFunctions::'..' { in lower: ScalarValue[1]; in upper: ScalarValue[1]; return : ScalarValue[0..*]; }
3333
}

0 commit comments

Comments
 (0)