sysmledgraph 0.7.0
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/README.md +71 -0
- package/dist/bin/cli.d.ts +6 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +61 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/src/cli/commands.d.ts +22 -0
- package/dist/src/cli/commands.d.ts.map +1 -0
- package/dist/src/cli/commands.js +87 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/discovery/find-sysml.d.ts +16 -0
- package/dist/src/discovery/find-sysml.d.ts.map +1 -0
- package/dist/src/discovery/find-sysml.js +30 -0
- package/dist/src/discovery/find-sysml.js.map +1 -0
- package/dist/src/discovery/load-order.d.ts +11 -0
- package/dist/src/discovery/load-order.d.ts.map +1 -0
- package/dist/src/discovery/load-order.js +85 -0
- package/dist/src/discovery/load-order.js.map +1 -0
- package/dist/src/graph/connection.d.ts +6 -0
- package/dist/src/graph/connection.d.ts.map +1 -0
- package/dist/src/graph/connection.js +7 -0
- package/dist/src/graph/connection.js.map +1 -0
- package/dist/src/graph/graph-store.d.ts +37 -0
- package/dist/src/graph/graph-store.d.ts.map +1 -0
- package/dist/src/graph/graph-store.js +108 -0
- package/dist/src/graph/graph-store.js.map +1 -0
- package/dist/src/graph/schema.d.ts +13 -0
- package/dist/src/graph/schema.d.ts.map +1 -0
- package/dist/src/graph/schema.js +21 -0
- package/dist/src/graph/schema.js.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/indexer/indexer.d.ts +20 -0
- package/dist/src/indexer/indexer.d.ts.map +1 -0
- package/dist/src/indexer/indexer.js +56 -0
- package/dist/src/indexer/indexer.js.map +1 -0
- package/dist/src/indexer/pipeline-phases.d.ts +8 -0
- package/dist/src/indexer/pipeline-phases.d.ts.map +1 -0
- package/dist/src/indexer/pipeline-phases.js +14 -0
- package/dist/src/indexer/pipeline-phases.js.map +1 -0
- package/dist/src/mcp/resources/context.d.ts +6 -0
- package/dist/src/mcp/resources/context.d.ts.map +1 -0
- package/dist/src/mcp/resources/context.js +45 -0
- package/dist/src/mcp/resources/context.js.map +1 -0
- package/dist/src/mcp/resources/schema.d.ts +6 -0
- package/dist/src/mcp/resources/schema.d.ts.map +1 -0
- package/dist/src/mcp/resources/schema.js +14 -0
- package/dist/src/mcp/resources/schema.js.map +1 -0
- package/dist/src/mcp/server.d.ts +8 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +175 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/clean-index.d.ts +12 -0
- package/dist/src/mcp/tools/clean-index.d.ts.map +1 -0
- package/dist/src/mcp/tools/clean-index.js +22 -0
- package/dist/src/mcp/tools/clean-index.js.map +1 -0
- package/dist/src/mcp/tools/context.d.ts +14 -0
- package/dist/src/mcp/tools/context.d.ts.map +1 -0
- package/dist/src/mcp/tools/context.js +51 -0
- package/dist/src/mcp/tools/context.js.map +1 -0
- package/dist/src/mcp/tools/cypher.d.ts +13 -0
- package/dist/src/mcp/tools/cypher.d.ts.map +1 -0
- package/dist/src/mcp/tools/cypher.js +25 -0
- package/dist/src/mcp/tools/cypher.js.map +1 -0
- package/dist/src/mcp/tools/generate-map.d.ts +13 -0
- package/dist/src/mcp/tools/generate-map.d.ts.map +1 -0
- package/dist/src/mcp/tools/generate-map.js +96 -0
- package/dist/src/mcp/tools/generate-map.js.map +1 -0
- package/dist/src/mcp/tools/impact.d.ts +14 -0
- package/dist/src/mcp/tools/impact.d.ts.map +1 -0
- package/dist/src/mcp/tools/impact.js +47 -0
- package/dist/src/mcp/tools/impact.js.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts +14 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.js +32 -0
- package/dist/src/mcp/tools/index-db-graph.js.map +1 -0
- package/dist/src/mcp/tools/list-indexed.d.ts +9 -0
- package/dist/src/mcp/tools/list-indexed.d.ts.map +1 -0
- package/dist/src/mcp/tools/list-indexed.js +14 -0
- package/dist/src/mcp/tools/list-indexed.js.map +1 -0
- package/dist/src/mcp/tools/query.d.ts +14 -0
- package/dist/src/mcp/tools/query.d.ts.map +1 -0
- package/dist/src/mcp/tools/query.js +47 -0
- package/dist/src/mcp/tools/query.js.map +1 -0
- package/dist/src/mcp/tools/rename.d.ts +19 -0
- package/dist/src/mcp/tools/rename.d.ts.map +1 -0
- package/dist/src/mcp/tools/rename.js +46 -0
- package/dist/src/mcp/tools/rename.js.map +1 -0
- package/dist/src/parser/lsp-client.d.ts +52 -0
- package/dist/src/parser/lsp-client.d.ts.map +1 -0
- package/dist/src/parser/lsp-client.js +230 -0
- package/dist/src/parser/lsp-client.js.map +1 -0
- package/dist/src/parser/lsp-server-path.d.ts +10 -0
- package/dist/src/parser/lsp-server-path.d.ts.map +1 -0
- package/dist/src/parser/lsp-server-path.js +29 -0
- package/dist/src/parser/lsp-server-path.js.map +1 -0
- package/dist/src/parser/symbols.d.ts +13 -0
- package/dist/src/parser/symbols.d.ts.map +1 -0
- package/dist/src/parser/symbols.js +150 -0
- package/dist/src/parser/symbols.js.map +1 -0
- package/dist/src/parser/sysml-mcp-client.d.ts +109 -0
- package/dist/src/parser/sysml-mcp-client.d.ts.map +1 -0
- package/dist/src/parser/sysml-mcp-client.js +185 -0
- package/dist/src/parser/sysml-mcp-client.js.map +1 -0
- package/dist/src/storage/clean.d.ts +15 -0
- package/dist/src/storage/clean.d.ts.map +1 -0
- package/dist/src/storage/clean.js +44 -0
- package/dist/src/storage/clean.js.map +1 -0
- package/dist/src/storage/list.d.ts +9 -0
- package/dist/src/storage/list.d.ts.map +1 -0
- package/dist/src/storage/list.js +12 -0
- package/dist/src/storage/list.js.map +1 -0
- package/dist/src/storage/location.d.ts +22 -0
- package/dist/src/storage/location.d.ts.map +1 -0
- package/dist/src/storage/location.js +36 -0
- package/dist/src/storage/location.js.map +1 -0
- package/dist/src/storage/registry.d.ts +14 -0
- package/dist/src/storage/registry.d.ts.map +1 -0
- package/dist/src/storage/registry.js +59 -0
- package/dist/src/storage/registry.js.map +1 -0
- package/dist/src/symbol-to-graph/mapping.d.ts +17 -0
- package/dist/src/symbol-to-graph/mapping.d.ts.map +1 -0
- package/dist/src/symbol-to-graph/mapping.js +102 -0
- package/dist/src/symbol-to-graph/mapping.js.map +1 -0
- package/dist/src/types.d.ts +40 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +35 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/worker/client.d.ts +21 -0
- package/dist/src/worker/client.d.ts.map +1 -0
- package/dist/src/worker/client.js +126 -0
- package/dist/src/worker/client.js.map +1 -0
- package/dist/src/worker/gateway.d.ts +79 -0
- package/dist/src/worker/gateway.d.ts.map +1 -0
- package/dist/src/worker/gateway.js +93 -0
- package/dist/src/worker/gateway.js.map +1 -0
- package/dist/src/worker/graph-worker.d.ts +7 -0
- package/dist/src/worker/graph-worker.d.ts.map +1 -0
- package/dist/src/worker/graph-worker.js +91 -0
- package/dist/src/worker/graph-worker.js.map +1 -0
- package/dist/src/worker/protocol.d.ts +21 -0
- package/dist/src/worker/protocol.d.ts.map +1 -0
- package/dist/src/worker/protocol.js +9 -0
- package/dist/src/worker/protocol.js.map +1 -0
- package/docs/INSTALL.md +16 -0
- package/docs/MCP_CLIENT_TEMPLATE_ANALYSIS.md +196 -0
- package/docs/MCP_INTERACTION_GUIDE.md +201 -0
- package/docs/MCP_SERVER_FOR_CURSOR.md +124 -0
- package/docs/PLAN.md +58 -0
- package/docs/PLAN_INDEPENDENT_LSP.md +145 -0
- package/docs/SKILL_DESIGN_PATTERNS.md +305 -0
- package/docs/TOOLS.md +317 -0
- package/lsp/README.md +41 -0
- package/lsp/node_modules/.bin/sysml-mcp +12 -0
- package/lsp/node_modules/.bin/sysml-mcp.cmd +9 -0
- package/lsp/node_modules/.bin/sysml-mcp.ps1 +16 -0
- package/lsp/node_modules/.package-lock.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/CHANGELOG.md +188 -0
- package/lsp/node_modules/sysml-v2-lsp/LICENSE +21 -0
- package/lsp/node_modules/sysml-v2-lsp/README.md +172 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/mcpServer.js +167 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/server.js +142 -0
- package/lsp/node_modules/sysml-v2-lsp/index.cjs +23 -0
- package/lsp/node_modules/sysml-v2-lsp/package.json +131 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.project +17 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.settings/org.eclipse.jdt.core.prefs +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +147 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.meta.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Actions.sysml +552 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Allocations.sysml +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Attributes.sysml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Calculations.sysml +37 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Cases.sysml +71 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Connections.sysml +60 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Constraints.sysml +44 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Flows.sysml +126 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Interfaces.sysml +89 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Items.sysml +153 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Metadata.sysml +32 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Parts.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Ports.sysml +54 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Requirements.sysml +194 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/States.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/SysML.sysml +539 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/UseCases.sysml +57 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/VerificationCases.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Views.sysml +164 -0
- package/lsp/package-lock.json +30 -0
- package/lsp/package.json +15 -0
- package/lsp/test-server.mjs +120 -0
- package/package.json +61 -0
- package/scripts/access-sysml-mcp.mjs +45 -0
- package/scripts/check-sysml-v2-lsp-version.mjs +39 -0
- package/scripts/clean.mjs +14 -0
- package/scripts/compare-mcp-vs-lsp-symbols.mjs +76 -0
- package/scripts/debug-index.mjs +23 -0
- package/scripts/debug-lsp-symbols.mjs +62 -0
- package/scripts/deploy-skills.mjs +43 -0
- package/scripts/example-sysml-mcp.mjs +27 -0
- package/scripts/export-graph.mjs +80 -0
- package/scripts/generate-map.mjs +110 -0
- package/scripts/index-and-map.mjs +43 -0
- package/scripts/index-and-query.mjs +39 -0
- package/scripts/query-one.mjs +34 -0
- package/scripts/setup-lsp.mjs +36 -0
- package/scripts/test-lsp.mjs +55 -0
- package/scripts/test-mcp-debug.mjs +32 -0
- package/scripts/test-mcp-sysml.mjs +75 -0
- package/scripts/test-mcp-tools.mjs +185 -0
- package/scripts/test-sysml-mcp-from-node_modules.mjs +56 -0
- package/scripts/validate-sysml-file.mjs +69 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SysML Requirement Derivation Library",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Standard requirements derivation domain library for the Systems Modeling Language (SysML)",
|
|
5
|
+
"usage": [
|
|
6
|
+
{
|
|
7
|
+
"resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar",
|
|
8
|
+
"versionConstraint": "1.0.0"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar",
|
|
12
|
+
"versionConstraint": "1.0.0"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar",
|
|
16
|
+
"versionConstraint": "2.0.0"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
standard library package DerivationConnections {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package provides a library model for derivation connections between requirements.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
private import SequenceFunctions::excludes;
|
|
8
|
+
private import ControlFunctions::allTrue;
|
|
9
|
+
|
|
10
|
+
requirement originalRequirements[*] {
|
|
11
|
+
doc /* originalRequirements are the original requirements in Derivation connections. */
|
|
12
|
+
}
|
|
13
|
+
requirement derivedRequirements[*] {
|
|
14
|
+
doc /* derivedRequirements are the derived requirments in Derivation connections. */
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
abstract connection def Derivation {
|
|
18
|
+
doc
|
|
19
|
+
/*
|
|
20
|
+
* A Derivation connection asserts that one or more derivedRequirements are derived from
|
|
21
|
+
* a single originalRequirement. This means that any subject that satisfies the
|
|
22
|
+
* originalRequirement should, in itself or though other things related to it, satisfy
|
|
23
|
+
* each of the derivedRequirements.
|
|
24
|
+
*
|
|
25
|
+
* A connection usage typed by Derivation must have requirement usages for all its ends.
|
|
26
|
+
* The single end for the originalRequirement should subset originalRequirement, while
|
|
27
|
+
* the rest of the ends should subset derivedRequirements.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// Note: This redefinition causes a distinguishibility problem for binary connections, becuse
|
|
31
|
+
// participant is already redefined for them to limit the multiplicity to 2.
|
|
32
|
+
// ref requirement :>> participant {
|
|
33
|
+
// doc /* All the participants in a Derivation must be requirements. */
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
ref requirement originalRequirement[1] :>> originalRequirements :> participant {
|
|
37
|
+
doc /* The single original requirement. */
|
|
38
|
+
}
|
|
39
|
+
ref requirement :>> derivedRequirements[1..*] :> participant {
|
|
40
|
+
doc /* The one or more requirements that are derived from the original requirement. */
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private assert constraint originalNotDerived {
|
|
44
|
+
doc /* The original requirement must not be a derived requirement. */
|
|
45
|
+
|
|
46
|
+
derivedRequirements->excludes(originalRequirement)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private assert constraint originalImpliesDerived {
|
|
50
|
+
doc
|
|
51
|
+
/*
|
|
52
|
+
* Whenever the originalRequirement is satisfied, all of the derivedRequirements must also
|
|
53
|
+
* be satisfied.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
originalRequirement.result implies allTrue(derivedRequirements.result)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
abstract connection derivations : Derivation[*] {
|
|
61
|
+
doc /* derivations is the base feature for Derivation connection usages. */
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
standard library package RequirementDerivation {
|
|
2
|
+
doc /* This package provides language-extension metadata for modeling requirement derivation. */
|
|
3
|
+
|
|
4
|
+
public import DerivationConnections::*;
|
|
5
|
+
private import Metaobjects::SemanticMetadata;
|
|
6
|
+
|
|
7
|
+
metadata def <original> OriginalRequirementMetadata :> SemanticMetadata {
|
|
8
|
+
doc
|
|
9
|
+
/*
|
|
10
|
+
* OriginalRequirementMetadata identifies a usage as an original requirement.
|
|
11
|
+
* It is intended to be used to tag the original requirement end of a Derivation.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
:> annotatedElement : SysML::Usage;
|
|
15
|
+
:>> baseType = originalRequirements meta SysML::Usage;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
metadata def <derive> DerivedRequirementMetadata :> SemanticMetadata {
|
|
19
|
+
doc
|
|
20
|
+
/*
|
|
21
|
+
* DerivedRequirementMetadata identifies a usage as a derived requirement.
|
|
22
|
+
* It is intended to be used to tag the derived requirement ends of a Derivation.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
:> annotatedElement : SysML::Usage;
|
|
26
|
+
:>> baseType = derivedRequirements meta SysML::Usage;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
metadata def <derivation> DerivationMetadata :> SemanticMetadata {
|
|
30
|
+
doc
|
|
31
|
+
/*
|
|
32
|
+
* DerivationMetadata is SemanticMetadata for a Derivation connection.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
:> annotatedElement : SysML::ConnectionDefinition;
|
|
36
|
+
:> annotatedElement : SysML::ConnectionUsage;
|
|
37
|
+
:>> baseType = derivations meta SysML::Usage;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Kernel Data Type Library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Standard data type library for the Kernel Modeling Language (KerML)",
|
|
5
|
+
"usage": [
|
|
6
|
+
{
|
|
7
|
+
"resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar",
|
|
8
|
+
"versionConstraint": "1.0.0"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
standard library package Collections {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines a standard set of Collection data types. Unlike sequences of values
|
|
5
|
+
* defined directly using multiplicity, these data types allow for the possibility of collections
|
|
6
|
+
* as elements of collections.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
private import Base::*;
|
|
10
|
+
private import ScalarValues::*;
|
|
11
|
+
private import SequenceFunctions::size;
|
|
12
|
+
private import IntegerFunctions::*;
|
|
13
|
+
private import ControlFunctions::*;
|
|
14
|
+
|
|
15
|
+
abstract datatype Collection {
|
|
16
|
+
doc
|
|
17
|
+
/*
|
|
18
|
+
* Collection is the top level abstract supertype of all collection types.
|
|
19
|
+
* The name elements is used to denote the members or contents of the collection.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
feature elements[0..*] nonunique;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
abstract datatype OrderedCollection :> Collection {
|
|
26
|
+
doc
|
|
27
|
+
/*
|
|
28
|
+
* OrderedCollection is the abstract supertype for all ordered collection types.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
feature elements[0..*] ordered nonunique :>> Collection::elements;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
abstract datatype UniqueCollection :> Collection {
|
|
35
|
+
doc
|
|
36
|
+
/*
|
|
37
|
+
* UniqueCollection is the abstract supertype for all collection types with unique elements.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
feature elements[0..*] :>> Collection::elements {
|
|
41
|
+
/* Note: Redefinition of 'elements' is unique by default. */
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
datatype Array :> OrderedCollection {
|
|
46
|
+
doc
|
|
47
|
+
/*
|
|
48
|
+
* An Array is a fixed size, multi-dimensional Collection of which the elements are nonunique and ordered.
|
|
49
|
+
* Its dimensions specify how many dimensions the array has, and how many elements there are in each dimension.
|
|
50
|
+
* The rank is equal to the number of dimensions. The flattenedSize is equal to the total number of elements
|
|
51
|
+
* in the array.
|
|
52
|
+
*
|
|
53
|
+
* Feature elements is a flattened sequence of all elements of an Array and can be accessed by a tuple of indices.
|
|
54
|
+
* The number of indices is equal to rank. The elements are packed according to row-major convention, as in the C programming language.
|
|
55
|
+
*
|
|
56
|
+
* The elements of an Array can be assessed by a tuple of indices. The number of indices in such tuple is equal to rank.
|
|
57
|
+
* The packing of the elements, i.e. the flattened representation, follows the row-major convention,
|
|
58
|
+
* as in the C programming language.
|
|
59
|
+
*
|
|
60
|
+
* Note 1. Feature dimensions may be empty, which denotes a zero dimensional array, allowing an Array to collapse to a single element.
|
|
61
|
+
* This is useful to allow for specialization of an Array into a type restricted to represent a scalar.
|
|
62
|
+
* The flattenedSize of a zero dimensional array is 1.
|
|
63
|
+
*
|
|
64
|
+
* Note 2: An Array can represent the generalized mathematical concept of an infinite matrix of any rank, i.e. not limited to rank two.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
feature dimensions: Positive[0..*] ordered nonunique {
|
|
68
|
+
doc
|
|
69
|
+
/* Feature `dimensions` defines the N-dimensional shape of the Array
|
|
70
|
+
* The alternative name `shape` (as used in many programming languages) is not used as it would interfere with a geometric shape feature.
|
|
71
|
+
*/
|
|
72
|
+
}
|
|
73
|
+
feature rank: Natural[1] = size(dimensions);
|
|
74
|
+
feature flattenedSize: Positive[1] = dimensions->reduce '*' ?? 1;
|
|
75
|
+
inv { flattenedSize == size(elements) }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
datatype Bag :> Collection {
|
|
79
|
+
doc
|
|
80
|
+
/*
|
|
81
|
+
* Bag is a variable-size, unordered collection of nonunique elements.
|
|
82
|
+
*/
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
datatype Set :> UniqueCollection {
|
|
86
|
+
doc
|
|
87
|
+
/*
|
|
88
|
+
* Set is a variable-size, unordered collection of unique elements.
|
|
89
|
+
*/
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
datatype OrderedSet :> OrderedCollection, UniqueCollection
|
|
93
|
+
intersects OrderedCollection, UniqueCollection {
|
|
94
|
+
doc
|
|
95
|
+
/*
|
|
96
|
+
* OrderedSet is a variable-size, ordered collection of unique elements.
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
feature elements[0..*] ordered :>> OrderedCollection::elements, UniqueCollection::elements {
|
|
100
|
+
/* Note: Redefinition of `elements` is unique by default. */
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
datatype List :> OrderedCollection {
|
|
105
|
+
doc
|
|
106
|
+
/*
|
|
107
|
+
* List is a variable-size, ordered collection of nonunique elements.
|
|
108
|
+
*/
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
datatype KeyValuePair {
|
|
112
|
+
doc
|
|
113
|
+
/*
|
|
114
|
+
* KeyValuePair is a tuple of a key and a value for use in Map collections.
|
|
115
|
+
* The key must be immutable.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
feature key: Anything[0..*] ordered nonunique;
|
|
119
|
+
feature val: Anything[0..*] ordered nonunique;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
datatype Map :> Collection {
|
|
123
|
+
doc
|
|
124
|
+
/*
|
|
125
|
+
* Map is a variable-size, unordered collection of elements that are key-value pairs.
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
feature elements: KeyValuePair[0..*] :>> Collection::elements {
|
|
129
|
+
/* Note: Redefinition of `elements` is unique by default.
|
|
130
|
+
* The `key` of any `KeyValuePair` must be unique over the collection of `KeyValuePair`.
|
|
131
|
+
* The `val` does not need to be unique.
|
|
132
|
+
*/
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
datatype OrderedMap :> Map {
|
|
137
|
+
doc
|
|
138
|
+
/*
|
|
139
|
+
* OrderedMap is a variable-size, ordered collection of elements that are key-value pairs.
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
feature elements: KeyValuePair[0..*] ordered :>> Map::elements {
|
|
143
|
+
/* Note: Redefinition of `elements` is unique by default. */
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
standard library package ScalarValues {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package contains a basic set of primitive scalar (non-collection) data types.
|
|
5
|
+
* These include Boolean and String types and a hierarchy of concrete Number types, from
|
|
6
|
+
* the most general type of Complex numbers to the most specific type of Positive integers.</p>
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
private import Base::DataValue;
|
|
10
|
+
|
|
11
|
+
abstract datatype ScalarValue specializes DataValue;
|
|
12
|
+
datatype Boolean specializes ScalarValue;
|
|
13
|
+
datatype String specializes ScalarValue;
|
|
14
|
+
abstract datatype NumericalValue specializes ScalarValue;
|
|
15
|
+
|
|
16
|
+
abstract datatype Number specializes NumericalValue;
|
|
17
|
+
datatype Complex specializes Number;
|
|
18
|
+
datatype Real specializes Complex;
|
|
19
|
+
datatype Rational specializes Real;
|
|
20
|
+
datatype Integer specializes Rational;
|
|
21
|
+
datatype Natural specializes Integer;
|
|
22
|
+
datatype Positive specializes Natural;
|
|
23
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
standard library package VectorValues {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package provides a basic model of abstract vectors as well as concrete vectors
|
|
5
|
+
* whose components are numerical values. The package VectorFunctions defines the
|
|
6
|
+
* corresponding vector-space functions.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
private import ScalarValues::NumericalValue;
|
|
10
|
+
private import ScalarValues::Real;
|
|
11
|
+
private import Collections::Array;
|
|
12
|
+
|
|
13
|
+
abstract datatype VectorValue {
|
|
14
|
+
doc
|
|
15
|
+
/*
|
|
16
|
+
* A VectorValue is an abstract data type whose values may be operated on using
|
|
17
|
+
* VectorFunctions.
|
|
18
|
+
*/
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
datatype NumericalVectorValue :> VectorValue, Array intersects VectorValue, Array {
|
|
22
|
+
doc
|
|
23
|
+
/*
|
|
24
|
+
* A NumericalVectorValue is a kind of VectorValue that is specifically represented
|
|
25
|
+
* as a one-dimensional array of NumericalValues. The dimension is allowed to be empty,
|
|
26
|
+
* permitting a NumericalVectorValue of rank 0, which is essentially isomorphic to a
|
|
27
|
+
* scalar NumericalValue.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
feature dimension[0..1] :>> dimensions;
|
|
31
|
+
feature :>> elements : NumericalValue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
datatype CartesianVectorValue :> NumericalVectorValue {
|
|
35
|
+
doc
|
|
36
|
+
/*
|
|
37
|
+
* CartesianVectorValue is a specialization Numerical VectorValue for which there are
|
|
38
|
+
* specific implementations in VectorFunctions of the abstract vector-space functions.
|
|
39
|
+
*
|
|
40
|
+
* Note: The restriction of the element type to Real is to facilitate
|
|
41
|
+
* the complete definition of these functions.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
feature :>> elements : Real;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
datatype ThreeVectorValue :> NumericalVectorValue {
|
|
48
|
+
doc
|
|
49
|
+
/*
|
|
50
|
+
* A ThreeVectorValue is a NumericalVectorValue that has dimension 3.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
feature :>> dimension = 3;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
datatype CartesianThreeVectorValue :> CartesianVectorValue, ThreeVectorValue
|
|
57
|
+
intersects CartesianVectorValue, ThreeVectorValue {
|
|
58
|
+
doc
|
|
59
|
+
/*
|
|
60
|
+
* A CartesianThreeVectorValue is a NumericalVectorValue that is both Cartesian and
|
|
61
|
+
* has dimension 3.
|
|
62
|
+
*/
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"index": {
|
|
3
|
+
"BaseFunctions": "BaseFunctions.kerml",
|
|
4
|
+
"BooleanFunctions": "BooleanFunctions.kerml",
|
|
5
|
+
"CollectionFunctions": "CollectionFunctions.kerml",
|
|
6
|
+
"ComplexFunctions": "ComplexFunctions.kerml",
|
|
7
|
+
"ControlFunctions": "ControlFunctions.kerml",
|
|
8
|
+
"DataFunctions": "DataFunctions.kerml",
|
|
9
|
+
"IntegerFunctions": "IntegerFunctions.kerml",
|
|
10
|
+
"NaturalFunctions": "NaturalFunctions.kerml",
|
|
11
|
+
"NumericalFunctions": "NumericalFunctions.kerml",
|
|
12
|
+
"OccurrenceFunctions": "OccurrenceFunctions.kerml",
|
|
13
|
+
"RationalFunctions": "RationalFunctions.kerml",
|
|
14
|
+
"RealFunctions": "RealFunctions.kerml",
|
|
15
|
+
"ScalarFunctions": "ScalarFunctions.kerml",
|
|
16
|
+
"SequenceFunctions": "SequenceFunctions.kerml",
|
|
17
|
+
"StringFunctions": "StringFunctions.kerml",
|
|
18
|
+
"TrigFunctions": "TrigFunctions.kerml",
|
|
19
|
+
"VectorFunctions": "VectorFunctions.kerml"
|
|
20
|
+
},
|
|
21
|
+
"created": "2025-03-13T00:00:00Z",
|
|
22
|
+
"metamodel": "https://www.omg.org/spec/KerML/20250201"
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Kernel Function Library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Standard function library for the Kernel Modeling Language (KerML)",
|
|
5
|
+
"usage": [
|
|
6
|
+
{
|
|
7
|
+
"resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar",
|
|
8
|
+
"versionConstraint": "1.0.0"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar",
|
|
12
|
+
"versionConstraint": "1.0.0"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
standard library package BaseFunctions {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines a basic set of functions defined on all kinds of values.
|
|
5
|
+
* Most correspond to similarly named operators in the KerML expression syntax.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
private import Base::Anything;
|
|
9
|
+
private import Objects::Object;
|
|
10
|
+
private import Metaobjects::Metaobject;
|
|
11
|
+
private import KerML::Metaclass;
|
|
12
|
+
private import ScalarValues::*;
|
|
13
|
+
|
|
14
|
+
abstract function '=='{ in x: Anything[0..1]; in y: Anything[0..1];
|
|
15
|
+
return : Boolean[1];
|
|
16
|
+
}
|
|
17
|
+
function '!='{ in x: Anything[0..1]; in y: Anything[0..1];
|
|
18
|
+
return : Boolean[1] = not (x == y);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
abstract function '==='{ in x: Anything[0..1]; in y: Anything[0..1];
|
|
22
|
+
return : Boolean[1];
|
|
23
|
+
}
|
|
24
|
+
function '!=='{ in x: Anything[0..1]; in y: Anything[0..1];
|
|
25
|
+
return : Boolean[1] = not (x === y);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
abstract function ToString{ in x: Anything[0..1];
|
|
29
|
+
return : String;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
abstract function '['{ in x: Anything[0..*] nonunique; in y: Anything[0..*] nonunique;
|
|
33
|
+
return : Anything[0..*] nonunique;
|
|
34
|
+
}
|
|
35
|
+
abstract function '#'{ in seq: Anything[0..*] ordered nonunique; in index: Positive[1..*] ordered nonunique;
|
|
36
|
+
return : Anything[0..1];
|
|
37
|
+
}
|
|
38
|
+
abstract function ','{ in seq1: Anything[0..*] ordered nonunique; in seq2: Anything[0..*] ordered nonunique;
|
|
39
|
+
return : Anything[0..*] ordered nonunique;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
abstract function 'all'{
|
|
43
|
+
return : Object[0..*];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
abstract function 'istype'{
|
|
47
|
+
in seq: Anything[0..*];
|
|
48
|
+
in 'type': Anything;
|
|
49
|
+
return : Boolean[1];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
abstract function 'hastype'{
|
|
53
|
+
in seq: Anything[0..*];
|
|
54
|
+
in 'type': Anything;
|
|
55
|
+
return : Boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
abstract function '@'{
|
|
59
|
+
in seq: Anything[0..*];
|
|
60
|
+
in 'type': Anything;
|
|
61
|
+
return : Boolean[1];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
abstract function '@@'{
|
|
65
|
+
in seq: Metaobject[0..*];
|
|
66
|
+
in 'type': Metaobject;
|
|
67
|
+
return : Boolean[1];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
abstract function 'as'{
|
|
71
|
+
in seq: Anything[0..*] ordered nonunique;
|
|
72
|
+
return : Anything[0..*] ordered nonunique;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
abstract function 'meta'{
|
|
76
|
+
in seq: Metaobject[0..*] ordered nonunique;
|
|
77
|
+
return : Metaobject[0..*] ordered nonunique;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
standard library package BooleanFunctions {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines functions on Boolean values, including those corresponding to
|
|
5
|
+
* (non-conditional) logical operators in the KerML expression notation.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
public import ScalarValues::*;
|
|
9
|
+
|
|
10
|
+
function 'not' specializes ScalarFunctions::'not' { in x: Boolean[1]; return : Boolean[1]; }
|
|
11
|
+
function 'xor' specializes ScalarFunctions::'xor' { in x: Boolean[1]; in y: Boolean[1]; return : Boolean[1]; }
|
|
12
|
+
|
|
13
|
+
function '|' specializes ScalarFunctions::'|' { in x: Boolean[1]; in y: Boolean[1]; return : Boolean[1]; }
|
|
14
|
+
function '&' specializes ScalarFunctions::'&' { in x: Boolean[1]; in y: Boolean[1]; return : Boolean[1]; }
|
|
15
|
+
|
|
16
|
+
function '==' specializes DataFunctions::'==' { in x: Boolean[0..1]; in y: Boolean[0..1]; return : Boolean[1]; }
|
|
17
|
+
|
|
18
|
+
function ToString specializes BaseFunctions::ToString { in x: Boolean[1]; return : String[1]; }
|
|
19
|
+
function ToBoolean { in x: String[1]; return : Boolean[1]; }
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
standard library package CollectionFunctions {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines functions on Collections (as defined in the Collections package).
|
|
5
|
+
* For functions on general sequences of values, see the SequenceFunctions package.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
private import Base::Anything;
|
|
9
|
+
private import ScalarValues::*;
|
|
10
|
+
private import SequenceFunctions::equals;
|
|
11
|
+
private import SequenceFunctions::includes;
|
|
12
|
+
private import ControlFunctions::exists;
|
|
13
|
+
public import Collections::*;
|
|
14
|
+
|
|
15
|
+
function '==' specializes BaseFunctions::'==' { in col1: Collection[0..1]; in col2: Collection[0..1];
|
|
16
|
+
return : Boolean[1] = col1.elements->equals(col2.elements);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function size { in col: Collection[1];
|
|
20
|
+
return : Natural[1] = SequenceFunctions::size(col.elements);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isEmpty { in col: Collection[1];
|
|
24
|
+
return : Boolean[1] = SequenceFunctions::isEmpty(col.elements);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function notEmpty { in col: Collection[1];
|
|
28
|
+
return : Boolean[1] = SequenceFunctions::notEmpty(col.elements);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function contains { in col: Collection[1]; in values: Anything[*];
|
|
32
|
+
return : Boolean[1] = col.elements->includes(values);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function containsAll { in col1: Collection[1]; in col2: Collection[2];
|
|
36
|
+
return : Boolean[1] = contains(col1, col2.elements);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function head { in col: OrderedCollection[1];
|
|
40
|
+
return : Anything[0..1] = SequenceFunctions::head(col.elements);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function tail { in col: OrderedCollection[1];
|
|
44
|
+
return : Anything[0..*] ordered nonunique = SequenceFunctions::tail(col.elements);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function last { in col: OrderedCollection[1];
|
|
48
|
+
return : Anything[0..1] = SequenceFunctions::last(col.elements);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function '#' specializes BaseFunctions::'#' { in col: OrderedCollection[1]; in index: Positive[1];
|
|
52
|
+
// Cast ensures this function is not called recursively if the elements of col are OrderedCollections.
|
|
53
|
+
return : Anything[0..1] = (col.elements as Anything)#(index);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function 'array#' specializes BaseFunctions::'#' { in arr: Array[1]; in indexes: Positive[n] ordered nonunique;
|
|
57
|
+
private feature n : Natural[1] = arr.rank;
|
|
58
|
+
|
|
59
|
+
// Assumes row-major ordering for elements.
|
|
60
|
+
private function index { in arr: Array[1]; in i : Natural; in indexes : Positive[1..*];
|
|
61
|
+
if i <= 1? indexes#(1) else arr.dimensions#(i) * (index(arr, i-1, indexes) - 1) + indexes#(i)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return : Anything[0..1] =
|
|
65
|
+
if n == 0 or (1..n)->exists {in i; indexes#(i) > arr.dimensions#(i)}? null
|
|
66
|
+
else arr.elements#(index(arr, n, indexes));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
standard library package ComplexFunctions {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines functions on Complex values, including concrete specializations of the
|
|
5
|
+
* general arithmetic and comparison operations.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
public import ScalarValues::*;
|
|
9
|
+
|
|
10
|
+
feature i: Complex[1] = rect(0.0, 1.0);
|
|
11
|
+
|
|
12
|
+
function rect { in re: Real[1]; in im: Real[1]; return : Complex[1]; }
|
|
13
|
+
function polar { in abs: Real[1]; in arg: Real[1]; return : Complex[1]; }
|
|
14
|
+
|
|
15
|
+
function re { in x: Complex[1]; return : Real[1]; }
|
|
16
|
+
function im { in x: Complex[1]; return : Real[1]; }
|
|
17
|
+
|
|
18
|
+
function isZero specializes NumericalFunctions::isZero { in x : Complex[1];
|
|
19
|
+
return : Boolean[1] = re(x) == 0.0 and im(x) == 0.0;
|
|
20
|
+
}
|
|
21
|
+
function isUnit specializes NumericalFunctions::isUnit { in x : Complex[1];
|
|
22
|
+
return : Boolean[1] = re(x) == 1.0 and im(x) == 0.0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function abs specializes NumericalFunctions::abs { in x: Complex[1]; return : Real[1]; }
|
|
26
|
+
function arg { in x: Complex[1]; return : Real[1]; }
|
|
27
|
+
|
|
28
|
+
function '+' specializes NumericalFunctions::'+' { in x: Complex[1]; in y: Complex[0..1]; return : Complex[1]; }
|
|
29
|
+
function '-' specializes NumericalFunctions::'-' { in x: Complex[1]; in y: Complex[0..1]; return : Complex[1]; }
|
|
30
|
+
function '*' specializes NumericalFunctions::'*' { in x: Complex[1]; in y: Complex[1]; return : Complex[1]; }
|
|
31
|
+
function '/' specializes NumericalFunctions::'/' { in x: Complex[1]; in y: Complex[1]; return : Complex[1]; }
|
|
32
|
+
function '**' specializes NumericalFunctions::'**' { in x: Complex[1]; in y: Complex[1]; return : Complex[1]; }
|
|
33
|
+
function '^' specializes NumericalFunctions::'^' { in x: Complex[1]; in y: Complex[1]; return : Complex[1]; }
|
|
34
|
+
|
|
35
|
+
function '==' specializes DataFunctions::'==' { in x: Complex[0..1]; in y: Complex[0..1]; return : Boolean[1]; }
|
|
36
|
+
|
|
37
|
+
function ToString specializes BaseFunctions::ToString { in x: Complex[1]; return : String[1]; }
|
|
38
|
+
function ToComplex { in x: String[1]; return : Complex[1]; }
|
|
39
|
+
|
|
40
|
+
function sum specializes NumericalFunctions::sum { in collection: Complex[0..*];
|
|
41
|
+
return : Complex[1] default NumericalFunctions::sum0(collection, rect(0.0, 0.0));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function product specializes NumericalFunctions::product { in collection: Complex[0..*];
|
|
45
|
+
return : Complex[1] default NumericalFunctions::product1(collection, rect(1.0, 0.0));
|
|
46
|
+
}
|
|
47
|
+
}
|