sysml-validate 0.11.0 → 0.14.3
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.
- package/LICENSE +27 -27
- package/README.md +200 -200
- package/out/main.js +598 -142
- package/out/main.js.map +4 -4
- package/package.json +57 -57
- package/resources/sysml.dimension-table.json +1 -1
- package/resources/sysml.library/Domain Libraries/Analysis/.meta.json +9 -9
- package/resources/sysml.library/Domain Libraries/Analysis/.project.json +26 -26
- package/resources/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +33 -33
- package/resources/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +118 -118
- package/resources/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -143
- package/resources/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +170 -170
- package/resources/sysml.library/Domain Libraries/Cause and Effect/.meta.json +7 -7
- package/resources/sysml.library/Domain Libraries/Cause and Effect/.project.json +22 -22
- package/resources/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +82 -82
- package/resources/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -81
- package/resources/sysml.library/Domain Libraries/Geometry/.meta.json +7 -7
- package/resources/sysml.library/Domain Libraries/Geometry/.project.json +26 -26
- package/resources/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +898 -898
- package/resources/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +167 -167
- package/resources/sysml.library/Domain Libraries/Metadata/.meta.json +9 -9
- package/resources/sysml.library/Domain Libraries/Metadata/.project.json +18 -18
- package/resources/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +77 -77
- package/resources/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +142 -142
- package/resources/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +38 -38
- package/resources/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +99 -99
- package/resources/sysml.library/Domain Libraries/Quantities and Units/.meta.json +28 -28
- package/resources/sysml.library/Domain Libraries/Quantities and Units/.project.json +22 -22
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -42
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -439
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -2726
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -206
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -1991
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -1353
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -1223
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -2333
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -958
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -1537
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -1564
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -1169
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -1256
- package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -30
- package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -526
- package/resources/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -107
- package/resources/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -70
- package/resources/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -378
- package/resources/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -48
- package/resources/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +49 -49
- package/resources/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -274
- package/resources/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -260
- package/resources/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -62
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +7 -7
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/.project.json +18 -18
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +62 -62
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +38 -38
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +8 -8
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +10 -10
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +176 -176
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -23
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +63 -63
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +22 -22
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +14 -14
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +79 -79
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -22
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -68
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -47
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +116 -116
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +42 -42
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -43
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -27
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +42 -42
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +153 -153
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -49
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -56
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +32 -32
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +110 -110
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -25
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +34 -34
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +272 -272
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +21 -21
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +14 -14
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +94 -94
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +155 -155
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +134 -134
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +189 -189
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -483
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +66 -66
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +57 -57
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -212
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +160 -160
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -992
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +292 -292
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +196 -196
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +144 -144
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +280 -280
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +65 -65
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +187 -187
- package/resources/sysml.library/LICENSE +276 -276
- package/resources/sysml.library/NOTICE.md +20 -20
- package/resources/sysml.library/Systems Library/Actions.sysml +556 -556
- package/resources/sysml.library/Systems Library/Allocations.sysml +28 -28
- package/resources/sysml.library/Systems Library/AnalysisCases.sysml +37 -37
- package/resources/sysml.library/Systems Library/Attributes.sysml +24 -24
- package/resources/sysml.library/Systems Library/Calculations.sysml +36 -36
- package/resources/sysml.library/Systems Library/Cases.sysml +70 -70
- package/resources/sysml.library/Systems Library/Connections.sysml +59 -59
- package/resources/sysml.library/Systems Library/Constraints.sysml +43 -43
- package/resources/sysml.library/Systems Library/Flows.sysml +125 -125
- package/resources/sysml.library/Systems Library/Interfaces.sysml +88 -88
- package/resources/sysml.library/Systems Library/Items.sysml +152 -152
- package/resources/sysml.library/Systems Library/Metadata.sysml +31 -31
- package/resources/sysml.library/Systems Library/Parts.sysml +80 -80
- package/resources/sysml.library/Systems Library/Ports.sysml +53 -53
- package/resources/sysml.library/Systems Library/Requirements.sysml +193 -193
- package/resources/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -123
- package/resources/sysml.library/Systems Library/States.sysml +102 -102
- package/resources/sysml.library/Systems Library/SysML.sysml +539 -539
- package/resources/sysml.library/Systems Library/UseCases.sysml +56 -56
- package/resources/sysml.library/Systems Library/VerificationCases.sysml +102 -102
- package/resources/sysml.library/Systems Library/Views.sysml +163 -163
- package/resources/sysml.library.index.json +1 -1
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
standard library package Base {
|
|
2
|
-
doc
|
|
3
|
-
/*
|
|
4
|
-
* This package defines the classifiers and features that provide the bases for the typing
|
|
5
|
-
* of all elements in the language.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
abstract classifier Anything {
|
|
9
|
-
doc
|
|
10
|
-
/*
|
|
11
|
-
* Anything is the top level generalized type in the language.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
feature self: Anything[1] subsets things chains things.that {
|
|
15
|
-
doc
|
|
16
|
-
/*
|
|
17
|
-
* The source of a SelfLink of this thing to itself. self is thus a feature that
|
|
18
|
-
* relates everything to itself. It is also the value of the nested "that" feature
|
|
19
|
-
* of all other things featured by this thing.
|
|
20
|
-
*/
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
abstract datatype DataValue specializes Anything {
|
|
25
|
-
doc
|
|
26
|
-
/*
|
|
27
|
-
* Value is the most general classifier of entities that are values that do not change
|
|
28
|
-
* over time.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
feature self: DataValue redefines Anything::self;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
abstract feature things: Anything [1..*] nonunique {
|
|
35
|
-
doc
|
|
36
|
-
/*
|
|
37
|
-
* things is the top-level feature in the language.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
feature that : Anything[1] {
|
|
41
|
-
doc
|
|
42
|
-
/*
|
|
43
|
-
* For each value of things, the "featuring instance" of that value.
|
|
44
|
-
* This is enforced by declaring Anything::self to be the chaining of things.that,
|
|
45
|
-
* restricting it the single value of self.
|
|
46
|
-
*/
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
abstract feature dataValues: DataValue[0..*] nonunique subsets things {
|
|
51
|
-
doc
|
|
52
|
-
/*
|
|
53
|
-
* dataValues is a specialization of things restricted to type DataValue.
|
|
54
|
-
*/
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
abstract feature naturals: ScalarValues::Natural[0..*] subsets dataValues {
|
|
58
|
-
doc
|
|
59
|
-
/*
|
|
60
|
-
* naturals is a specialization of dataValues restricted to type Natural.
|
|
61
|
-
* It is the root feature of all multiplicities, which map from a feature to
|
|
62
|
-
* the set of Natural numbers representing allowable cardinalities of the feature.
|
|
63
|
-
*/
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
multiplicity exactlyOne [1..1] {
|
|
67
|
-
doc
|
|
68
|
-
/*
|
|
69
|
-
* exactlyOne is a multiplicity range requiring a cardinality of exactly one.
|
|
70
|
-
*/
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
multiplicity zeroOrOne [0..1] {
|
|
74
|
-
doc
|
|
75
|
-
/*
|
|
76
|
-
* zeroOrOne is a multiplicity range requiring a cardinality of zero or one.
|
|
77
|
-
*/
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
multiplicity oneToMany [1..*] {
|
|
81
|
-
doc
|
|
82
|
-
/*
|
|
83
|
-
* oneToMany is a multiplicity range allowing any cardinality of one or more.
|
|
84
|
-
*/
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
multiplicity zeroToMany [0..*] {
|
|
88
|
-
doc
|
|
89
|
-
/*
|
|
90
|
-
* zeroToMany is a multiplicity range allowing any cardinality of zero or more
|
|
91
|
-
* (that is, no restriction).
|
|
92
|
-
*/
|
|
93
|
-
}
|
|
94
|
-
|
|
1
|
+
standard library package Base {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines the classifiers and features that provide the bases for the typing
|
|
5
|
+
* of all elements in the language.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
abstract classifier Anything {
|
|
9
|
+
doc
|
|
10
|
+
/*
|
|
11
|
+
* Anything is the top level generalized type in the language.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
feature self: Anything[1] subsets things chains things.that {
|
|
15
|
+
doc
|
|
16
|
+
/*
|
|
17
|
+
* The source of a SelfLink of this thing to itself. self is thus a feature that
|
|
18
|
+
* relates everything to itself. It is also the value of the nested "that" feature
|
|
19
|
+
* of all other things featured by this thing.
|
|
20
|
+
*/
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
abstract datatype DataValue specializes Anything {
|
|
25
|
+
doc
|
|
26
|
+
/*
|
|
27
|
+
* Value is the most general classifier of entities that are values that do not change
|
|
28
|
+
* over time.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
feature self: DataValue redefines Anything::self;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
abstract feature things: Anything [1..*] nonunique {
|
|
35
|
+
doc
|
|
36
|
+
/*
|
|
37
|
+
* things is the top-level feature in the language.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
feature that : Anything[1] {
|
|
41
|
+
doc
|
|
42
|
+
/*
|
|
43
|
+
* For each value of things, the "featuring instance" of that value.
|
|
44
|
+
* This is enforced by declaring Anything::self to be the chaining of things.that,
|
|
45
|
+
* restricting it the single value of self.
|
|
46
|
+
*/
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
abstract feature dataValues: DataValue[0..*] nonunique subsets things {
|
|
51
|
+
doc
|
|
52
|
+
/*
|
|
53
|
+
* dataValues is a specialization of things restricted to type DataValue.
|
|
54
|
+
*/
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
abstract feature naturals: ScalarValues::Natural[0..*] subsets dataValues {
|
|
58
|
+
doc
|
|
59
|
+
/*
|
|
60
|
+
* naturals is a specialization of dataValues restricted to type Natural.
|
|
61
|
+
* It is the root feature of all multiplicities, which map from a feature to
|
|
62
|
+
* the set of Natural numbers representing allowable cardinalities of the feature.
|
|
63
|
+
*/
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
multiplicity exactlyOne [1..1] {
|
|
67
|
+
doc
|
|
68
|
+
/*
|
|
69
|
+
* exactlyOne is a multiplicity range requiring a cardinality of exactly one.
|
|
70
|
+
*/
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
multiplicity zeroOrOne [0..1] {
|
|
74
|
+
doc
|
|
75
|
+
/*
|
|
76
|
+
* zeroOrOne is a multiplicity range requiring a cardinality of zero or one.
|
|
77
|
+
*/
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
multiplicity oneToMany [1..*] {
|
|
81
|
+
doc
|
|
82
|
+
/*
|
|
83
|
+
* oneToMany is a multiplicity range allowing any cardinality of one or more.
|
|
84
|
+
*/
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
multiplicity zeroToMany [0..*] {
|
|
88
|
+
doc
|
|
89
|
+
/*
|
|
90
|
+
* zeroToMany is a multiplicity range allowing any cardinality of zero or more
|
|
91
|
+
* (that is, no restriction).
|
|
92
|
+
*/
|
|
93
|
+
}
|
|
94
|
+
|
|
95
95
|
}
|
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
standard library package Clocks {
|
|
2
|
-
doc
|
|
3
|
-
/*
|
|
4
|
-
* This package models Clocks that provide an advancing numerical reference
|
|
5
|
-
* usable for quantifying the time of an Occurrence.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
private import ScalarValues::NumericalValue;
|
|
9
|
-
private import ScalarValues::Real;
|
|
10
|
-
private import Occurrences::Occurrence;
|
|
11
|
-
private import Occurrences::Life;
|
|
12
|
-
private import ControlFunctions::forAll;
|
|
13
|
-
|
|
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] {
|
|
22
|
-
doc
|
|
23
|
-
/*
|
|
24
|
-
* universalClock is a single Clock that can be used as a default universal
|
|
25
|
-
* time reference.
|
|
26
|
-
*/
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
abstract struct Clock {
|
|
30
|
-
doc
|
|
31
|
-
/*
|
|
32
|
-
* A Clock provides a numerical currentTime that advances montonically
|
|
33
|
-
* over its lifetime. Clock is an abstract base Structure that can be
|
|
34
|
-
* specialized for different kinds of time quantification (e.g., discrete
|
|
35
|
-
* time, continuous time, time with units, etc.).
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
private thisClock : Clock :>> self;
|
|
39
|
-
|
|
40
|
-
var feature currentTime : NumericalValue[1] {
|
|
41
|
-
doc
|
|
42
|
-
/*
|
|
43
|
-
* A scalar time reference that advances over the lifetime of the Clock.
|
|
44
|
-
*/
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
inv timeFlowConstraint {
|
|
48
|
-
doc
|
|
49
|
-
/*
|
|
50
|
-
* The currentTime of a snapshot of a Clock is equal to
|
|
51
|
-
* the TimeOf the snapshot relative to that Clock.
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
snapshots->forAll{in s : Clock;
|
|
55
|
-
TimeOf(s, thisClock) == s.currentTime
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
abstract function TimeOf {
|
|
61
|
-
doc
|
|
62
|
-
/*
|
|
63
|
-
* TimeOf returns a numerical timeInstant for a given Occurrence relative to
|
|
64
|
-
* a given Clock. The timeInstant is the time of the start of the Occurrence,
|
|
65
|
-
* which is considered to be synchronized with the snapshot of the Clock
|
|
66
|
-
* with a currentTime equal to the returned timeInstant.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
in o : Occurrence[1];
|
|
70
|
-
in clock : Clock[1] default localClock;
|
|
71
|
-
return timeInstant : NumericalValue[1];
|
|
72
|
-
|
|
73
|
-
inv startTimeConstraint {
|
|
74
|
-
doc
|
|
75
|
-
/*
|
|
76
|
-
* The TimeOf an Occurrence is equal to the time of its start snapshot.
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
timeInstant == TimeOf(o.startShot, clock)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
inv timeOrderingConstraint {
|
|
83
|
-
doc
|
|
84
|
-
/*
|
|
85
|
-
* If one Occurrence happens before another, then the TimeOf the end
|
|
86
|
-
* snapshot of the first Occurrence is no greater than the TimeOf the
|
|
87
|
-
* second Occurrence.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
o.predecessors->forAll{in p : Occurrence;
|
|
91
|
-
TimeOf(p.endShot, clock) <= timeInstant
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
inv timeContinuityConstraint {
|
|
96
|
-
doc
|
|
97
|
-
/*
|
|
98
|
-
* If one Occurrence happens immediately before another, then the TimeOf
|
|
99
|
-
* the end snapshot of the first Occurrence equals the TimeOf the second
|
|
100
|
-
* Occurrence.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
o.immediatePredecessors->forAll{in p : Occurrence;
|
|
104
|
-
TimeOf(p.endShot, clock) == timeInstant
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function DurationOf {
|
|
110
|
-
doc
|
|
111
|
-
/*
|
|
112
|
-
* DurationOf returns the duration of a given Occurrence relative to a
|
|
113
|
-
* given Clock, which is equal to the TimeOf the end snapshot of the
|
|
114
|
-
* Occurrence minus the TimeOf its start snapshot.
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
in o : Occurrence[1];
|
|
118
|
-
in clock : Clock[1] default localClock;
|
|
119
|
-
return duration : NumericalValue =
|
|
120
|
-
TimeOf(o.endShot, clock) - TimeOf(o.startShot, clock);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
struct BasicClock :> Clock {
|
|
124
|
-
doc
|
|
125
|
-
/*
|
|
126
|
-
* A BasicClock is a Clock whose currentTime is a Real number.
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
var feature :>> currentTime : Real;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function BasicTimeOf :> TimeOf {
|
|
133
|
-
doc
|
|
134
|
-
/*
|
|
135
|
-
* BasicTimeOf returns the TimeOf an Occurrence as a Real number relative
|
|
136
|
-
* to a BasicClock.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
in o : Occurrence[1];
|
|
140
|
-
in clock : BasicClock[1];
|
|
141
|
-
return : Real[1];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function BasicDurationOf :> DurationOf {
|
|
145
|
-
doc
|
|
146
|
-
/*
|
|
147
|
-
* BasicDurationOf returns the DurationOf an Occurrence as a Real number relative
|
|
148
|
-
* to a BasicClock.
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
in o : Occurrence[1];
|
|
152
|
-
in clock : BasicClock[1];
|
|
153
|
-
return : Real[1];
|
|
154
|
-
}
|
|
155
|
-
|
|
1
|
+
standard library package Clocks {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package models Clocks that provide an advancing numerical reference
|
|
5
|
+
* usable for quantifying the time of an Occurrence.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
private import ScalarValues::NumericalValue;
|
|
9
|
+
private import ScalarValues::Real;
|
|
10
|
+
private import Occurrences::Occurrence;
|
|
11
|
+
private import Occurrences::Life;
|
|
12
|
+
private import ControlFunctions::forAll;
|
|
13
|
+
|
|
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] {
|
|
22
|
+
doc
|
|
23
|
+
/*
|
|
24
|
+
* universalClock is a single Clock that can be used as a default universal
|
|
25
|
+
* time reference.
|
|
26
|
+
*/
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
abstract struct Clock {
|
|
30
|
+
doc
|
|
31
|
+
/*
|
|
32
|
+
* A Clock provides a numerical currentTime that advances montonically
|
|
33
|
+
* over its lifetime. Clock is an abstract base Structure that can be
|
|
34
|
+
* specialized for different kinds of time quantification (e.g., discrete
|
|
35
|
+
* time, continuous time, time with units, etc.).
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
private thisClock : Clock :>> self;
|
|
39
|
+
|
|
40
|
+
var feature currentTime : NumericalValue[1] {
|
|
41
|
+
doc
|
|
42
|
+
/*
|
|
43
|
+
* A scalar time reference that advances over the lifetime of the Clock.
|
|
44
|
+
*/
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
inv timeFlowConstraint {
|
|
48
|
+
doc
|
|
49
|
+
/*
|
|
50
|
+
* The currentTime of a snapshot of a Clock is equal to
|
|
51
|
+
* the TimeOf the snapshot relative to that Clock.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
snapshots->forAll{in s : Clock;
|
|
55
|
+
TimeOf(s, thisClock) == s.currentTime
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
abstract function TimeOf {
|
|
61
|
+
doc
|
|
62
|
+
/*
|
|
63
|
+
* TimeOf returns a numerical timeInstant for a given Occurrence relative to
|
|
64
|
+
* a given Clock. The timeInstant is the time of the start of the Occurrence,
|
|
65
|
+
* which is considered to be synchronized with the snapshot of the Clock
|
|
66
|
+
* with a currentTime equal to the returned timeInstant.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
in o : Occurrence[1];
|
|
70
|
+
in clock : Clock[1] default localClock;
|
|
71
|
+
return timeInstant : NumericalValue[1];
|
|
72
|
+
|
|
73
|
+
inv startTimeConstraint {
|
|
74
|
+
doc
|
|
75
|
+
/*
|
|
76
|
+
* The TimeOf an Occurrence is equal to the time of its start snapshot.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
timeInstant == TimeOf(o.startShot, clock)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
inv timeOrderingConstraint {
|
|
83
|
+
doc
|
|
84
|
+
/*
|
|
85
|
+
* If one Occurrence happens before another, then the TimeOf the end
|
|
86
|
+
* snapshot of the first Occurrence is no greater than the TimeOf the
|
|
87
|
+
* second Occurrence.
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
o.predecessors->forAll{in p : Occurrence;
|
|
91
|
+
TimeOf(p.endShot, clock) <= timeInstant
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
inv timeContinuityConstraint {
|
|
96
|
+
doc
|
|
97
|
+
/*
|
|
98
|
+
* If one Occurrence happens immediately before another, then the TimeOf
|
|
99
|
+
* the end snapshot of the first Occurrence equals the TimeOf the second
|
|
100
|
+
* Occurrence.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
o.immediatePredecessors->forAll{in p : Occurrence;
|
|
104
|
+
TimeOf(p.endShot, clock) == timeInstant
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function DurationOf {
|
|
110
|
+
doc
|
|
111
|
+
/*
|
|
112
|
+
* DurationOf returns the duration of a given Occurrence relative to a
|
|
113
|
+
* given Clock, which is equal to the TimeOf the end snapshot of the
|
|
114
|
+
* Occurrence minus the TimeOf its start snapshot.
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
in o : Occurrence[1];
|
|
118
|
+
in clock : Clock[1] default localClock;
|
|
119
|
+
return duration : NumericalValue =
|
|
120
|
+
TimeOf(o.endShot, clock) - TimeOf(o.startShot, clock);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
struct BasicClock :> Clock {
|
|
124
|
+
doc
|
|
125
|
+
/*
|
|
126
|
+
* A BasicClock is a Clock whose currentTime is a Real number.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
var feature :>> currentTime : Real;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function BasicTimeOf :> TimeOf {
|
|
133
|
+
doc
|
|
134
|
+
/*
|
|
135
|
+
* BasicTimeOf returns the TimeOf an Occurrence as a Real number relative
|
|
136
|
+
* to a BasicClock.
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
in o : Occurrence[1];
|
|
140
|
+
in clock : BasicClock[1];
|
|
141
|
+
return : Real[1];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function BasicDurationOf :> DurationOf {
|
|
145
|
+
doc
|
|
146
|
+
/*
|
|
147
|
+
* BasicDurationOf returns the DurationOf an Occurrence as a Real number relative
|
|
148
|
+
* to a BasicClock.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
in o : Occurrence[1];
|
|
152
|
+
in clock : BasicClock[1];
|
|
153
|
+
return : Real[1];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
156
|
}
|