Skip to content

Commit 6f3aecc

Browse files
v4.0.1
1 parent 5037bb6 commit 6f3aecc

File tree

13 files changed

+135
-49
lines changed

13 files changed

+135
-49
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ where
1212

1313
Furthermore, SysMD Notebook's requirements are _executable_.
1414
With executable requirements and specification documents, we mean that
15-
an integrated constraint solver that checks the consistency of SysML v2 models and computes missing values.
16-
Excel in many cases does a similar job; SysMD does it a bit more sophisticated and integrated with SysML v2.
15+
an integrated constraint solver checks the consistency of SysML v2 models and computes missing values.
16+
Excel in early system analysis does a similar job;
17+
SysMD does it a bit more sophisticated and integrated with SysML v2.
1718
SysMD Notebook's UI looks as follows:
1819

1920
![SysMD](doc/pics/SysMD-Screenshot.png)
@@ -44,9 +45,7 @@ and returns an over-approximation of values that satisfy all constraints or an e
4445
- [List of supported units](doc/AvailableUnits.md)
4546
- [Modeling of time and date](doc/Time.md)
4647

47-
48-
Also, in the folder 'doc' some documentation is provided.
49-
48+
Also, in the folder 'doc' some documentation is provided.
5049

5150
## Running SysMD Notebook
5251

@@ -77,12 +76,24 @@ To create a platform-specific installer, use the gradle target ```sysMDPackage`
7776
./gradlew sysMDPackage
7877
```
7978

79+
# Supported and unsupported parts of KerML and SysML v2
80+
81+
SysMD Notebook is a work in progress and does not (yet) support the full range of KerML and SysML v2.
82+
However, a significant subset is supported with a focus on the intended use case.
83+
The following gives some indications on what is supported:
84+
85+
- _Supported_: modeling of packages, parts, ports, attributes, calculations, expressions, interfaces, requirements and constraints; both usages and definitions.
86+
- _Not supported_: modeling of automata, states, time slices, user-defined keywords, etc.
87+
88+
Note that automata and states might compile, but the constraint propagation mechanism does not use the respective parts properly.
89+
Also, KerML is implemented with support for features, classes, packages, expressions, etc. -- but with some restrictions for expressions.
90+
8091
# Release notes (only major versions)
8192

82-
- SysMD 4.0 implements the platform-specific REST API of SysML v2.
83-
For this purpose, SysMD 4.0 includes Spring Boot for the REST API.
93+
- SysMD 4.0 implements parts of the platform-specific REST API of SysML v2 (projects endpoint, but not versioning). For this purpose, SysMD 4.0 includes Spring Boot for the REST API.
8494

8595
# Acknowledgements
96+
8697
SysMD was developed and is maintained by
8798
- University of Kaiserslautern-Landau
8899
- HOOD Group

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
1616
* - also set the value standalone according to your setup
1717
*/
1818
group = "com.github.tukcps"
19-
version = "4.0.0" // must be number.number.number
19+
version = "4.0.1" // must be number.number.number
2020
val aaddVersion = "0.1.9"
2121
val sysmlapiVersion = "3.9.4"
2222
val useMavenAADD = true
@@ -33,11 +33,11 @@ if (JavaVersion.current() < JavaVersion.VERSION_21) {
3333
// Plugins needed: id and versions.
3434
plugins {
3535
// Plugin that checks for updates:
36-
id("com.github.ben-manes.versions") version "0.51.0"
36+
id("com.github.ben-manes.versions") version "0.52.0"
3737
id("idea")
3838
kotlin("jvm") version "2.1.20"
3939
kotlin("plugin.serialization") version "2.1.20"
40-
id("org.springframework.boot") version "3.4.3"
40+
id("org.springframework.boot") version "3.4.4"
4141
id("io.spring.dependency-management") version "1.1.7"
4242
alias(libs.plugins.jetbrainsCompose) apply true
4343
alias(libs.plugins.compose.compiler) apply true
@@ -123,7 +123,7 @@ dependencies {
123123

124124
// compose ui tests
125125
testImplementation(kotlin("test"))
126-
testImplementation("org.springframework.boot:spring-boot-starter-test:3.4.3") {
126+
testImplementation("org.springframework.boot:spring-boot-starter-test:3.4.4") {
127127
exclude(group = "org.mockito", module = "mockito-core")
128128
}
129129

doc/SysMDLanguageExtensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ SysMD includes Units as part of the value (quantity), and not as a data type.
109109
Units are hard-coded and not yet fully compliant with SysML v2.
110110

111111
For example, in SysML v2 one writes ```[micro*m]```, in SysMD ```"[µm]"```.
112-
See description of the units for details.
112+
See description of the units for details.

src/main/kotlin/com/github/tukcps/sysmd/compiler/parser/kerml/KerMLKernel.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fun KerML.Metaclass() {
167167
*
168168
* Note: PrefixMetadataMember is a qualified Name or FeatureChain
169169
*/
170-
fun KerML.PrefixMetadataFeature() {
170+
fun KerML.PrefixMetadataAnnotation() {
171171
HASHTAG.consume()
172172
QualifiedName()
173173
}
@@ -244,12 +244,15 @@ fun KerML.MetadataBody(owner: FeatureActions<Feature>) {
244244
}
245245

246246
/**
247-
* MetadataBodyElement = NonFeatureMember | MetadataBodyFeatureMember
248-
* | AliasMember | Import
247+
* MetadataBodyElement =
248+
* NonFeatureMember
249+
* | MetadataBodyFeatureMember
250+
* | AliasMember
251+
* | Import
249252
*/
250253
fun KerML.MetadataBodyElement() {
251254
alternatives {
252-
// TODO: NonFeatureMember
255+
nonFeatureElementStart starts { NonFeatureElement() }
253256
METADATA starts { MetadataFeature() }
254257
ALIAS starts { AliasMember() }
255258
IMPORT starts { Import() }
@@ -354,7 +357,6 @@ fun KerML.LibraryPackage() {
354357
}
355358

356359

357-
358360
/**
359361
* 8.2.5.7.1 Functions
360362
*

src/main/kotlin/com/github/tukcps/sysmd/compiler/parser/kerml/KerMLRoot.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ fun KerML.MemberPrefix() {
140140
fun KerML.NamespaceBodyElement() {
141141
MemberPrefix() // Consume and remember them in context
142142
FeaturePrefix() // Optional anyhow, we just consume and remember them in context
143+
optional(HASHTAG) { PrefixMetadataMember() }
143144
alternatives {
144145
nonFeatureElementStart starts { NonFeatureElement() }
145146
featureElementStart starts { FeatureElement() }
@@ -401,8 +402,8 @@ fun KerML.AnnotatingElement() {
401402
* | Subclassification | Disjoining | FeatureInverting | FeatureTyping
402403
* | Subsetting | Redefinition | TypeFeaturing
403404
*/
404-
405405
fun KerML.NonFeatureElement() {
406+
noOrMore(start = HASHTAG) { PrefixMetadataMember() }
406407
alternatives {
407408
annotatingElementStart starts { AnnotatingElement() }
408409
DEPENDENCY starts { Dependency() }
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.github.tukcps.sysmd.compiler.parser.sysmlv2
2+
3+
import com.github.tukcps.sysmd.compiler.SysMLv2
4+
import com.github.tukcps.sysmd.compiler.parser.util.Unsupported
5+
6+
7+
/**
8+
* 8.2.2.27 Metadata Textual Notation
9+
*
10+
* MetadataDefinition =
11+
* ('abstract')? DefinitionExtensionKeyWord*
12+
* 'metadata' 'def' Definition
13+
*/
14+
fun SysMLv2.MetadataDefinition() {
15+
Unsupported()
16+
}
17+
18+
19+
/**
20+
* PrefixMetadataUsage = OwnedFeatureTyping
21+
*/
22+
fun SysMLv2.PrefixMetadataUsage() {
23+
Unsupported()
24+
}
25+
26+
27+
/**
28+
* MetadataUsage =
29+
* UsageExtensionKeyword* ( '@' | 'metadata' )
30+
* MetadataUsageDeclaration
31+
* ( 'about' ownedRelationship += Annotation
32+
* ( ',' ownedRelationship += Annotation )*
33+
* )?
34+
* MetadataBody
35+
* MetadataUsageDeclaration : MetadataUsage =
36+
* ( Identification ( ':' | 'typed' 'by' ) )?
37+
* ownedRelationship += OwnedFeatureTyping
38+
* MetadataBody : Type =
39+
* ';' |
40+
* '{' ( ownedRelationship += DefinitionMember
41+
* | ownedRelationship += MetadataBodyUsageMember
42+
* | ownedRelationship += AliasMember
43+
* | ownedRelationship += Import
44+
* )*
45+
* '}'
46+
*/
47+
48+
/**
49+
* MetadataBodyUsageMember : FeatureMembership =
50+
* ownedMemberFeature = MetadataBodyUsage
51+
* MetadataBodyUsage : ReferenceUsage :
52+
* 'ref'? ( ':>>' | 'redefines' )? ownedRelationship += OwnedRedefinition
53+
* FeatureSpecializationPart? ValuePart?
54+
* MetadataBody
55+
* ExtendedDefinition : Definition =
56+
* BasicDefinitionPrefix? DefinitionExtensionKeyword+
57+
* 'def' Definition
58+
* ExtendedUsage : Usage =
59+
* UnextendedUsagePrefix UsageExtensionKeyword+
60+
* Usage
61+
*/

src/main/kotlin/com/github/tukcps/sysmd/compiler/parser/sysmlv2/Package.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,25 @@ fun SysMLv2.DefinitionElement() {
8585
PACKAGE starts { Package() }
8686
LIBRARY starts { Package() }
8787
annotatingElementStart starts { AnnotatingElement() }
88-
DEPENDENCY starts { Dependency() }
88+
DEPENDENCY or HASHTAG starts { Dependency() }
8989
ATTRIBUTE then DEF starts { AttributeDefinition() }
90-
// ENUM not supported
90+
ENUM starts { Unsupported("Enumerations are not yet supported") }
9191
OCCURRENCE then DEF starts { OccurrenceDefinition() }
9292
INDIVIDUAL then DEF starts { Unsupported() }
9393
ITEM then DEF starts { ItemDefinition() }
9494
PART then DEF starts { PartDefinition() }
9595
CONNECTION then DEF starts { ConnectionDefinition() }
9696
ALLOCATION then DEF starts { AllocationDefinition() }
97-
// FLOW isn't supported
97+
FLOW starts { "Flows are not yet supported" }
9898
INTERFACE then DEF starts { InterfaceDefinition() }
9999
PORT then DEF starts { PortDefinition() }
100100
ACTION then DEF starts { ActionDefinition() }
101101
CALC then DEF starts { CalculationDefinition() }
102102
STATE then DEF starts { StateDefinition() }
103103
CONSTRAINT then DEF starts { ConstraintDefinition() }
104104
REQUIREMENT then DEF starts { RequirementDefinition() }
105-
METADATA then DEF starts { Unsupported() }
105+
VIEW then DEF starts { Unsupported("Views are not yet supported") }
106+
METADATA then DEF starts { MetadataDefinition() }
106107
others { throwSyntaxError("Invalid definition") }
107108
}
108109
}

src/main/kotlin/com/github/tukcps/sysmd/compiler/scanner/Token.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ class Token(
5656
READONLY, REF, REGULAR_COMMENT, RELATIONSHIP, REQUIRE, REP, RETURN, REDEFINES, REFERENCES, REQUIREMENT,
5757
SATISFY, SEND, SNAPSHOT, SPECIALIZATION, SPECIALIZES, STAKEHOLDER, STANDARD, STATE, STEP, STRUCT, STRUCTURE, SUBJECT, SUCCESSION, SUBSETS, SUBTYPE,
5858
THEN, TIMESLICE, TO, TRANSITION, TYPE, TYPED,
59-
UNIQUE, UNIONS, VARIATION,
60-
// SysMLv2 Keywords Digital Twin
61-
MEASURABLE, CONTROLLABLE, VARIABLE,
59+
UNIQUE, UNIONS,
60+
VARIATION, VIEW,
6261

6362
// Operators
6463
LCURBRACE { override fun toString() = "{" },
@@ -269,10 +268,8 @@ class Token(
269268
"unions" to Kind.UNIONS,
270269
"package" to Kind.PACKAGE,
271270
"part" to Kind.PART,
272-
"measurable" to Kind.MEASURABLE,
273-
"controllable" to Kind.CONTROLLABLE,
274-
"variable" to Kind.VARIABLE,
275271
"variation" to Kind.VARIATION,
272+
"view" to Kind.VIEW,
276273
"message" to Kind.MESSAGE,
277274
"return" to Kind.RETURN,
278275
)

src/main/kotlin/com/github/tukcps/sysmd/exceptions/Issue.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@ class Issue(
6060
result = 31 * result + (elementPath?.hashCode() ?: 0)
6161
return result
6262
}
63+
64+
override fun toString() = message
6365
}

src/main/kotlin/com/github/tukcps/sysmd/ui/paneleft/projectlist/Project.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ fun Project(
4141

4242
if (projectViewModel.showSaveDialog.value) {
4343
SaveDialog(projectViewModel.showSaveDialog,
44-
onSave = { projectListViewModel.editorTabsViewModel.save(); projectViewModel.showSaveDialog.value = false },
45-
onDrop = {}
44+
onSave = { projectListViewModel.editorTabsViewModel.save(); projectViewModel.openProject(); projectViewModel.showSaveDialog.value = false },
45+
onDrop = { projectViewModel.openProject(); projectViewModel.showSaveDialog.value = false }
4646
)
4747
}
4848

4949
Card(
5050
modifier = Modifier
5151
.fillMaxWidth()
5252
.padding(all = 5.dp)
53-
.selectable(selected = false) { projectViewModel.openProject() },
53+
.selectable(selected = false) {
54+
if (projectViewModel.unsavedChangesExist()) projectViewModel.showSaveDialog.value = true
55+
else projectViewModel.openProject() },
5456
shape = RoundedCornerShape(12.dp),
5557
) {
5658
Box {

0 commit comments

Comments
 (0)