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.
Files changed (309) hide show
  1. package/README.md +71 -0
  2. package/dist/bin/cli.d.ts +6 -0
  3. package/dist/bin/cli.d.ts.map +1 -0
  4. package/dist/bin/cli.js +61 -0
  5. package/dist/bin/cli.js.map +1 -0
  6. package/dist/mcp/index.d.ts +3 -0
  7. package/dist/mcp/index.d.ts.map +1 -0
  8. package/dist/mcp/index.js +8 -0
  9. package/dist/mcp/index.js.map +1 -0
  10. package/dist/src/cli/commands.d.ts +22 -0
  11. package/dist/src/cli/commands.d.ts.map +1 -0
  12. package/dist/src/cli/commands.js +87 -0
  13. package/dist/src/cli/commands.js.map +1 -0
  14. package/dist/src/discovery/find-sysml.d.ts +16 -0
  15. package/dist/src/discovery/find-sysml.d.ts.map +1 -0
  16. package/dist/src/discovery/find-sysml.js +30 -0
  17. package/dist/src/discovery/find-sysml.js.map +1 -0
  18. package/dist/src/discovery/load-order.d.ts +11 -0
  19. package/dist/src/discovery/load-order.d.ts.map +1 -0
  20. package/dist/src/discovery/load-order.js +85 -0
  21. package/dist/src/discovery/load-order.js.map +1 -0
  22. package/dist/src/graph/connection.d.ts +6 -0
  23. package/dist/src/graph/connection.d.ts.map +1 -0
  24. package/dist/src/graph/connection.js +7 -0
  25. package/dist/src/graph/connection.js.map +1 -0
  26. package/dist/src/graph/graph-store.d.ts +37 -0
  27. package/dist/src/graph/graph-store.d.ts.map +1 -0
  28. package/dist/src/graph/graph-store.js +108 -0
  29. package/dist/src/graph/graph-store.js.map +1 -0
  30. package/dist/src/graph/schema.d.ts +13 -0
  31. package/dist/src/graph/schema.d.ts.map +1 -0
  32. package/dist/src/graph/schema.js +21 -0
  33. package/dist/src/graph/schema.js.map +1 -0
  34. package/dist/src/index.d.ts +14 -0
  35. package/dist/src/index.d.ts.map +1 -0
  36. package/dist/src/index.js +14 -0
  37. package/dist/src/index.js.map +1 -0
  38. package/dist/src/indexer/indexer.d.ts +20 -0
  39. package/dist/src/indexer/indexer.d.ts.map +1 -0
  40. package/dist/src/indexer/indexer.js +56 -0
  41. package/dist/src/indexer/indexer.js.map +1 -0
  42. package/dist/src/indexer/pipeline-phases.d.ts +8 -0
  43. package/dist/src/indexer/pipeline-phases.d.ts.map +1 -0
  44. package/dist/src/indexer/pipeline-phases.js +14 -0
  45. package/dist/src/indexer/pipeline-phases.js.map +1 -0
  46. package/dist/src/mcp/resources/context.d.ts +6 -0
  47. package/dist/src/mcp/resources/context.d.ts.map +1 -0
  48. package/dist/src/mcp/resources/context.js +45 -0
  49. package/dist/src/mcp/resources/context.js.map +1 -0
  50. package/dist/src/mcp/resources/schema.d.ts +6 -0
  51. package/dist/src/mcp/resources/schema.d.ts.map +1 -0
  52. package/dist/src/mcp/resources/schema.js +14 -0
  53. package/dist/src/mcp/resources/schema.js.map +1 -0
  54. package/dist/src/mcp/server.d.ts +8 -0
  55. package/dist/src/mcp/server.d.ts.map +1 -0
  56. package/dist/src/mcp/server.js +175 -0
  57. package/dist/src/mcp/server.js.map +1 -0
  58. package/dist/src/mcp/tools/clean-index.d.ts +12 -0
  59. package/dist/src/mcp/tools/clean-index.d.ts.map +1 -0
  60. package/dist/src/mcp/tools/clean-index.js +22 -0
  61. package/dist/src/mcp/tools/clean-index.js.map +1 -0
  62. package/dist/src/mcp/tools/context.d.ts +14 -0
  63. package/dist/src/mcp/tools/context.d.ts.map +1 -0
  64. package/dist/src/mcp/tools/context.js +51 -0
  65. package/dist/src/mcp/tools/context.js.map +1 -0
  66. package/dist/src/mcp/tools/cypher.d.ts +13 -0
  67. package/dist/src/mcp/tools/cypher.d.ts.map +1 -0
  68. package/dist/src/mcp/tools/cypher.js +25 -0
  69. package/dist/src/mcp/tools/cypher.js.map +1 -0
  70. package/dist/src/mcp/tools/generate-map.d.ts +13 -0
  71. package/dist/src/mcp/tools/generate-map.d.ts.map +1 -0
  72. package/dist/src/mcp/tools/generate-map.js +96 -0
  73. package/dist/src/mcp/tools/generate-map.js.map +1 -0
  74. package/dist/src/mcp/tools/impact.d.ts +14 -0
  75. package/dist/src/mcp/tools/impact.d.ts.map +1 -0
  76. package/dist/src/mcp/tools/impact.js +47 -0
  77. package/dist/src/mcp/tools/impact.js.map +1 -0
  78. package/dist/src/mcp/tools/index-db-graph.d.ts +14 -0
  79. package/dist/src/mcp/tools/index-db-graph.d.ts.map +1 -0
  80. package/dist/src/mcp/tools/index-db-graph.js +32 -0
  81. package/dist/src/mcp/tools/index-db-graph.js.map +1 -0
  82. package/dist/src/mcp/tools/list-indexed.d.ts +9 -0
  83. package/dist/src/mcp/tools/list-indexed.d.ts.map +1 -0
  84. package/dist/src/mcp/tools/list-indexed.js +14 -0
  85. package/dist/src/mcp/tools/list-indexed.js.map +1 -0
  86. package/dist/src/mcp/tools/query.d.ts +14 -0
  87. package/dist/src/mcp/tools/query.d.ts.map +1 -0
  88. package/dist/src/mcp/tools/query.js +47 -0
  89. package/dist/src/mcp/tools/query.js.map +1 -0
  90. package/dist/src/mcp/tools/rename.d.ts +19 -0
  91. package/dist/src/mcp/tools/rename.d.ts.map +1 -0
  92. package/dist/src/mcp/tools/rename.js +46 -0
  93. package/dist/src/mcp/tools/rename.js.map +1 -0
  94. package/dist/src/parser/lsp-client.d.ts +52 -0
  95. package/dist/src/parser/lsp-client.d.ts.map +1 -0
  96. package/dist/src/parser/lsp-client.js +230 -0
  97. package/dist/src/parser/lsp-client.js.map +1 -0
  98. package/dist/src/parser/lsp-server-path.d.ts +10 -0
  99. package/dist/src/parser/lsp-server-path.d.ts.map +1 -0
  100. package/dist/src/parser/lsp-server-path.js +29 -0
  101. package/dist/src/parser/lsp-server-path.js.map +1 -0
  102. package/dist/src/parser/symbols.d.ts +13 -0
  103. package/dist/src/parser/symbols.d.ts.map +1 -0
  104. package/dist/src/parser/symbols.js +150 -0
  105. package/dist/src/parser/symbols.js.map +1 -0
  106. package/dist/src/parser/sysml-mcp-client.d.ts +109 -0
  107. package/dist/src/parser/sysml-mcp-client.d.ts.map +1 -0
  108. package/dist/src/parser/sysml-mcp-client.js +185 -0
  109. package/dist/src/parser/sysml-mcp-client.js.map +1 -0
  110. package/dist/src/storage/clean.d.ts +15 -0
  111. package/dist/src/storage/clean.d.ts.map +1 -0
  112. package/dist/src/storage/clean.js +44 -0
  113. package/dist/src/storage/clean.js.map +1 -0
  114. package/dist/src/storage/list.d.ts +9 -0
  115. package/dist/src/storage/list.d.ts.map +1 -0
  116. package/dist/src/storage/list.js +12 -0
  117. package/dist/src/storage/list.js.map +1 -0
  118. package/dist/src/storage/location.d.ts +22 -0
  119. package/dist/src/storage/location.d.ts.map +1 -0
  120. package/dist/src/storage/location.js +36 -0
  121. package/dist/src/storage/location.js.map +1 -0
  122. package/dist/src/storage/registry.d.ts +14 -0
  123. package/dist/src/storage/registry.d.ts.map +1 -0
  124. package/dist/src/storage/registry.js +59 -0
  125. package/dist/src/storage/registry.js.map +1 -0
  126. package/dist/src/symbol-to-graph/mapping.d.ts +17 -0
  127. package/dist/src/symbol-to-graph/mapping.d.ts.map +1 -0
  128. package/dist/src/symbol-to-graph/mapping.js +102 -0
  129. package/dist/src/symbol-to-graph/mapping.js.map +1 -0
  130. package/dist/src/types.d.ts +40 -0
  131. package/dist/src/types.d.ts.map +1 -0
  132. package/dist/src/types.js +35 -0
  133. package/dist/src/types.js.map +1 -0
  134. package/dist/src/worker/client.d.ts +21 -0
  135. package/dist/src/worker/client.d.ts.map +1 -0
  136. package/dist/src/worker/client.js +126 -0
  137. package/dist/src/worker/client.js.map +1 -0
  138. package/dist/src/worker/gateway.d.ts +79 -0
  139. package/dist/src/worker/gateway.d.ts.map +1 -0
  140. package/dist/src/worker/gateway.js +93 -0
  141. package/dist/src/worker/gateway.js.map +1 -0
  142. package/dist/src/worker/graph-worker.d.ts +7 -0
  143. package/dist/src/worker/graph-worker.d.ts.map +1 -0
  144. package/dist/src/worker/graph-worker.js +91 -0
  145. package/dist/src/worker/graph-worker.js.map +1 -0
  146. package/dist/src/worker/protocol.d.ts +21 -0
  147. package/dist/src/worker/protocol.d.ts.map +1 -0
  148. package/dist/src/worker/protocol.js +9 -0
  149. package/dist/src/worker/protocol.js.map +1 -0
  150. package/docs/INSTALL.md +16 -0
  151. package/docs/MCP_CLIENT_TEMPLATE_ANALYSIS.md +196 -0
  152. package/docs/MCP_INTERACTION_GUIDE.md +201 -0
  153. package/docs/MCP_SERVER_FOR_CURSOR.md +124 -0
  154. package/docs/PLAN.md +58 -0
  155. package/docs/PLAN_INDEPENDENT_LSP.md +145 -0
  156. package/docs/SKILL_DESIGN_PATTERNS.md +305 -0
  157. package/docs/TOOLS.md +317 -0
  158. package/lsp/README.md +41 -0
  159. package/lsp/node_modules/.bin/sysml-mcp +12 -0
  160. package/lsp/node_modules/.bin/sysml-mcp.cmd +9 -0
  161. package/lsp/node_modules/.bin/sysml-mcp.ps1 +16 -0
  162. package/lsp/node_modules/.package-lock.json +22 -0
  163. package/lsp/node_modules/sysml-v2-lsp/CHANGELOG.md +188 -0
  164. package/lsp/node_modules/sysml-v2-lsp/LICENSE +21 -0
  165. package/lsp/node_modules/sysml-v2-lsp/README.md +172 -0
  166. package/lsp/node_modules/sysml-v2-lsp/dist/server/mcpServer.js +167 -0
  167. package/lsp/node_modules/sysml-v2-lsp/dist/server/server.js +142 -0
  168. package/lsp/node_modules/sysml-v2-lsp/index.cjs +23 -0
  169. package/lsp/node_modules/sysml-v2-lsp/package.json +131 -0
  170. package/lsp/node_modules/sysml-v2-lsp/sysml.library/.project +17 -0
  171. package/lsp/node_modules/sysml-v2-lsp/sysml.library/.settings/org.eclipse.jdt.core.prefs +11 -0
  172. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
  173. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
  174. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
  175. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
  176. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
  177. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
  178. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
  179. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
  180. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
  181. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
  182. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
  183. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
  184. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
  185. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
  186. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
  187. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
  188. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
  189. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
  190. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
  191. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
  192. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
  193. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
  194. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
  195. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
  196. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
  197. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
  198. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
  199. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
  200. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
  201. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
  202. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
  203. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
  204. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
  205. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
  206. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
  207. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
  208. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
  209. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
  210. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
  211. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
  212. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
  213. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
  214. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
  215. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
  216. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
  217. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
  218. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
  219. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
  220. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
  221. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
  222. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
  223. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +147 -0
  224. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
  225. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
  226. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
  227. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
  228. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
  229. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
  230. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
  231. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
  232. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
  233. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
  234. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
  235. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
  236. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
  237. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
  238. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
  239. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
  240. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
  241. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
  242. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
  243. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
  244. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
  245. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
  246. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
  247. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
  248. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
  249. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
  250. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
  251. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
  252. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
  253. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
  254. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
  255. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
  256. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
  257. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
  258. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
  259. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
  260. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
  261. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
  262. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
  263. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.meta.json +27 -0
  264. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.project.json +19 -0
  265. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Actions.sysml +552 -0
  266. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Allocations.sysml +29 -0
  267. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
  268. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Attributes.sysml +25 -0
  269. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Calculations.sysml +37 -0
  270. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Cases.sysml +71 -0
  271. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Connections.sysml +60 -0
  272. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Constraints.sysml +44 -0
  273. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Flows.sysml +126 -0
  274. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Interfaces.sysml +89 -0
  275. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Items.sysml +153 -0
  276. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Metadata.sysml +32 -0
  277. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Parts.sysml +81 -0
  278. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Ports.sysml +54 -0
  279. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Requirements.sysml +194 -0
  280. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
  281. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/States.sysml +103 -0
  282. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/SysML.sysml +539 -0
  283. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/UseCases.sysml +57 -0
  284. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/VerificationCases.sysml +103 -0
  285. package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Views.sysml +164 -0
  286. package/lsp/package-lock.json +30 -0
  287. package/lsp/package.json +15 -0
  288. package/lsp/test-server.mjs +120 -0
  289. package/package.json +61 -0
  290. package/scripts/access-sysml-mcp.mjs +45 -0
  291. package/scripts/check-sysml-v2-lsp-version.mjs +39 -0
  292. package/scripts/clean.mjs +14 -0
  293. package/scripts/compare-mcp-vs-lsp-symbols.mjs +76 -0
  294. package/scripts/debug-index.mjs +23 -0
  295. package/scripts/debug-lsp-symbols.mjs +62 -0
  296. package/scripts/deploy-skills.mjs +43 -0
  297. package/scripts/example-sysml-mcp.mjs +27 -0
  298. package/scripts/export-graph.mjs +80 -0
  299. package/scripts/generate-map.mjs +110 -0
  300. package/scripts/index-and-map.mjs +43 -0
  301. package/scripts/index-and-query.mjs +39 -0
  302. package/scripts/query-one.mjs +34 -0
  303. package/scripts/setup-lsp.mjs +36 -0
  304. package/scripts/test-lsp.mjs +55 -0
  305. package/scripts/test-mcp-debug.mjs +32 -0
  306. package/scripts/test-mcp-sysml.mjs +75 -0
  307. package/scripts/test-mcp-tools.mjs +185 -0
  308. package/scripts/test-sysml-mcp-from-node_modules.mjs +56 -0
  309. package/scripts/validate-sysml-file.mjs +69 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * sysml-v2-lsp — SysML v2 Language Server
3
+ *
4
+ * Exports the filesystem path to the bundled language server module.
5
+ * Use this to start the server with vscode-languageclient:
6
+ *
7
+ * const { serverPath } = require('sysml-v2-lsp');
8
+ * const serverOptions = { module: serverPath, transport: TransportKind.ipc };
9
+ */
10
+ 'use strict';
11
+
12
+ const path = require('path');
13
+
14
+ /** Absolute path to the bundled language server entry point. */
15
+ const serverPath = path.join(__dirname, 'dist', 'server', 'server.js');
16
+
17
+ /** Absolute path to the bundled worker module (used internally by the server). */
18
+ const workerPath = path.join(__dirname, 'dist', 'server', 'parser', 'parseWorker.js');
19
+
20
+ /** Absolute path to the bundled MCP server entry point (stdio transport). */
21
+ const mcpServerPath = path.join(__dirname, 'dist', 'server', 'mcpServer.js');
22
+
23
+ module.exports = { serverPath, workerPath, mcpServerPath };
@@ -0,0 +1,131 @@
1
+ {
2
+ "name": "sysml-v2-lsp",
3
+ "displayName": "SysML v2 Language Server",
4
+ "description": "Language Server Protocol implementation for SysML v2, powered by ANTLR4",
5
+ "version": "0.7.0",
6
+ "publisher": "JamieD",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/daltskin/sysml-v2-lsp.git"
11
+ },
12
+ "engines": {
13
+ "node": ">=20",
14
+ "vscode": "^1.85.0"
15
+ },
16
+ "categories": [
17
+ "Programming Languages"
18
+ ],
19
+ "keywords": [
20
+ "sysml",
21
+ "sysml2",
22
+ "systems modeling",
23
+ "mbse",
24
+ "lsp",
25
+ "language server",
26
+ "mcp",
27
+ "model context protocol"
28
+ ],
29
+ "bin": {
30
+ "sysml-mcp": "dist/server/mcpServer.js"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "require": "./index.cjs",
35
+ "default": "./index.cjs"
36
+ }
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "main": "./dist/client/extension.js",
42
+ "contributes": {
43
+ "commands": [
44
+ {
45
+ "command": "sysml.restartServer",
46
+ "title": "SysML: Restart Language Server"
47
+ }
48
+ ],
49
+ "languages": [
50
+ {
51
+ "id": "sysml",
52
+ "aliases": [
53
+ "SysML",
54
+ "sysml"
55
+ ],
56
+ "extensions": [
57
+ ".sysml",
58
+ ".kerml"
59
+ ],
60
+ "configuration": "./language-configuration.json"
61
+ }
62
+ ],
63
+ "configuration": {
64
+ "type": "object",
65
+ "title": "SysML v2 Language Server",
66
+ "properties": {
67
+ "sysml.trace.server": {
68
+ "scope": "window",
69
+ "type": "string",
70
+ "enum": [
71
+ "off",
72
+ "messages",
73
+ "verbose"
74
+ ],
75
+ "default": "off",
76
+ "description": "Traces the communication between VS Code and the SysML language server."
77
+ },
78
+ "sysml.maxNumberOfProblems": {
79
+ "scope": "resource",
80
+ "type": "number",
81
+ "default": 100,
82
+ "description": "Maximum number of problems reported per file."
83
+ },
84
+ "sysml.inlayHints.enabled": {
85
+ "scope": "window",
86
+ "type": "boolean",
87
+ "default": true,
88
+ "description": "Enable or disable inlay hints (ghost text showing inferred types and supertypes)."
89
+ },
90
+ "sysml.library.path": {
91
+ "scope": "resource",
92
+ "type": "string",
93
+ "default": "",
94
+ "description": "Path to SysML v2 standard library directory."
95
+ }
96
+ }
97
+ }
98
+ },
99
+ "scripts": {
100
+ "generate": "antlr-ng -D language=TypeScript -o server/src/generated --generate-visitor true --generate-listener true grammar/SysMLv2Lexer.g4 grammar/SysMLv2Parser.g4",
101
+ "compile": "tsc -b",
102
+ "watch": "tsc -b -w",
103
+ "build": "npm run generate && npm run compile && node esbuild.mjs",
104
+ "build:production": "npm run clean && npm run generate && npm run compile && node esbuild.mjs --production",
105
+ "lint": "eslint ./clients/vscode/src ./server/src",
106
+ "test": "vitest run",
107
+ "test:watch": "vitest",
108
+ "test:e2e": "node ./clients/vscode/out/test/runTest.js",
109
+ "package": "vsce package",
110
+ "package:server": "npm run build:production && npm pack",
111
+ "clean": "rm -rf clients/vscode/out server/out dist *.vsix *.tgz",
112
+ "update-grammar": "curl -fsSL https://raw.githubusercontent.com/daltskin/grammars-v4/master/sysml-v2/SysMLv2Lexer.g4 -o grammar/SysMLv2Lexer.g4 && curl -fsSL https://raw.githubusercontent.com/daltskin/grammars-v4/master/sysml-v2/SysMLv2Parser.g4 -o grammar/SysMLv2Parser.g4 && echo '✅ Grammar files updated from daltskin/grammars-v4'",
113
+ "prepublishOnly": "npm run build:production",
114
+ "postinstall": "[ -f tsconfig.json ] && [ -d clients/vscode ] && cd clients/vscode && npm install && cd ../.. && cd server && npm install || true"
115
+ },
116
+ "devDependencies": {
117
+ "@modelcontextprotocol/sdk": "^1.26.0",
118
+ "@types/node": "^22.0.0",
119
+ "@vscode/vsce": "^3.7.0",
120
+ "antlr-ng": "^1.0.10",
121
+ "esbuild": "^0.27.0",
122
+ "eslint": "^9.39.0",
123
+ "typescript": "^5.9.0",
124
+ "typescript-eslint": "^8.55.0",
125
+ "vite": "^7.3.0",
126
+ "vitest": "^4.0.0",
127
+ "vscode-languageserver": "^9.0.1",
128
+ "vscode-languageserver-textdocument": "^1.0.12",
129
+ "zod": "^4.3.6"
130
+ }
131
+ }
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>sysml.library</name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ <buildCommand>
9
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
10
+ <arguments>
11
+ </arguments>
12
+ </buildCommand>
13
+ </buildSpec>
14
+ <natures>
15
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
16
+ </natures>
17
+ </projectDescription>
@@ -0,0 +1,11 @@
1
+ eclipse.preferences.version=1
2
+ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3
+ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4
+ org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5
+ org.eclipse.jdt.core.compiler.compliance=1.8
6
+ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7
+ org.eclipse.jdt.core.compiler.debug.localVariable=generate
8
+ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9
+ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10
+ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11
+ org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,10 @@
1
+ {
2
+ "index": {
3
+ "AnalysisTooling": "AnalysisTooling.sysml",
4
+ "SampledFunctions": "SampledFunctions.sysml",
5
+ "StateSpaceRepresentation": "StateSpaceRepresentation.sysml",
6
+ "TradeStudies": "TradeStudies.sysml"
7
+ },
8
+ "created": "2025-03-13T00:00:00Z",
9
+ "metamodel": "https://www.omg.org/spec/SysML/20250201"
10
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "SysML Analysis Library",
3
+ "version": "2.0.0",
4
+ "description": "Standard analysis 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/Data-Type-Library.kpar",
12
+ "versionConstraint": "1.0.0"
13
+ },
14
+ {
15
+ "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar",
16
+ "versionConstraint": "1.0.0"
17
+ },
18
+ {
19
+ "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar",
20
+ "versionConstraint": "2.0.0"
21
+ },
22
+ {
23
+ "resource": "https://www.omg.org/spec/KerML/20250201/Quantities-and-Units-Library.kpar",
24
+ "versionConstraint": "2.0.0"
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,34 @@
1
+ standard library package AnalysisTooling {
2
+ doc
3
+ /*
4
+ * This package contains definitions for metadata annotations related
5
+ * to analysis tool integration.
6
+ */
7
+
8
+ private import ScalarValues::*;
9
+
10
+ metadata def ToolExecution {
11
+ doc
12
+ /*
13
+ * ToolExecution metadata identifies an external analysis tool to be
14
+ * used to implement the annotated action.
15
+ */
16
+
17
+ attribute toolName : String;
18
+ attribute uri : String;
19
+ }
20
+
21
+ metadata def ToolVariable {
22
+ doc
23
+ /*
24
+ * ToolVariable metadata is used in the context of an action that has
25
+ * been annotated with ToolExecution metadata. It is used to annotate
26
+ * a parameter or other feature of the action with the name of the
27
+ * variable in the tool that is to correspond to the annotated
28
+ * feature.
29
+ */
30
+
31
+ attribute name : String;
32
+ }
33
+
34
+ }
@@ -0,0 +1,119 @@
1
+ standard library package SampledFunctions {
2
+ doc
3
+ /*
4
+ * This package provides a library model of discretely sampled mathematical functions.
5
+ */
6
+
7
+ private import Base::Anything;
8
+ private import ScalarValues::Positive;
9
+ private import Collections::KeyValuePair;
10
+ private import Collections::OrderedMap;
11
+ private import SequenceFunctions::size;
12
+ private import ControlFunctions::forAll;
13
+ private import ControlFunctions::collect;
14
+ private import ControlFunctions::select;
15
+
16
+ attribute def SamplePair :> KeyValuePair {
17
+ doc
18
+ /*
19
+ * SamplePair is a key-value pair of a domain-value and a range-value, used as a sample element in SampledFunction.
20
+ */
21
+
22
+ attribute domainValue :>> key;
23
+ attribute rangeValue :>> val;
24
+ }
25
+
26
+ attribute def SampledFunction :> OrderedMap {
27
+ doc
28
+ /*
29
+ * SampledFunction is a variable-size, ordered collection of 'SamplePair' elements that represents a generic, discretely sampled,
30
+ * uni-variate or multi-variate mathematical function. The function must be montonic, either strictly increasing or strictly
31
+ * decreasing.
32
+ *
33
+ * It maps discrete domain values to discrete range values.
34
+ * The domain of the function is represented by the sequence of 'domainValue' of each 'SamplePair' in 'samples', and
35
+ * the range of the function is represented by the sequence of 'rangeValue' of each 'SamplePair' in 'samples'.
36
+ */
37
+
38
+ attribute samples: SamplePair[0..*] ordered :>> elements;
39
+
40
+ assert constraint {
41
+ // Note: Assumes the functions '<' and '>' are defined for the domain type.
42
+ (1..size(samples)-1)->forAll { in i; (samples.domainValue#(i) < samples.domainValue#(i+1)) } or // Strictly increasing
43
+ (1..size(samples)-1)->forAll { in i; (samples.domainValue#(i) > samples.domainValue#(i+1)) } // Strictly decreasing
44
+ }
45
+ }
46
+
47
+ calc def Domain {
48
+ doc
49
+ /*
50
+ * Domain returns the sequence of the domainValues of all samples in a SampledFunction.
51
+ */
52
+
53
+ in fn : SampledFunction;
54
+ return : Anything[0..*] = fn.samples.domainValue;
55
+ }
56
+
57
+ calc def Range {
58
+ doc
59
+ /*
60
+ * Range returns the sequence of the rangeValues of all samples in a SampledFunction.
61
+ */
62
+
63
+ in fn : SampledFunction;
64
+ return : Anything[0..*] = fn.samples.rangeValue;
65
+ }
66
+
67
+ calc def Sample {
68
+ doc
69
+ /*
70
+ * Sample returns a SampledFunction that samples a given calculation over a sequence of domainValues.
71
+ */
72
+
73
+ in calc calculation { in x; }
74
+ in attribute domainValues [0..*];
75
+ return sampling = new SampledFunction (
76
+ samples = domainValues->collect { in x; new SamplePair(x, calculation(x)) }
77
+ );
78
+ }
79
+
80
+ calc def Interpolate {
81
+ doc
82
+ /*
83
+ * An Interpolate calculation returns an interpolated range value from a given SampledFunction for a given domain value.
84
+ * If the input domain value is outside the bounds of the domainValues of the SampleFunction, null is returned.
85
+ */
86
+
87
+ in attribute fn : SampledFunction;
88
+ in attribute value;
89
+ return attribute result;
90
+ }
91
+
92
+ calc interpolateLinear : Interpolate {
93
+ doc
94
+ /*
95
+ * interpolateLinear is an Interpolate calculation assuming a linear functional form between SamplePairs.
96
+ */
97
+
98
+ in attribute fn : SampledFunction;
99
+ in attribute value;
100
+
101
+ private attribute domainValues = Domain(fn);
102
+ private attribute index : Positive[0..1] =
103
+ (1..size(domainValues))->select { in i : Positive; domainValues#(i) <= value }#(1);
104
+
105
+ private calc def Linear {
106
+ in attribute lowerSample : SamplePair;
107
+ in attribute upperSample : SamplePair;
108
+ in attribute value;
109
+ private attribute f = (value - lowerSample.domainValue) / (lowerSample.domainValue - upperSample.domainValue);
110
+ return result = upperSample.rangeValue + f * (lowerSample.rangeValue - upperSample.rangeValue);
111
+ }
112
+
113
+ return result [0..1] =
114
+ if index == null or index == size(domainValues)? null
115
+ else if domainValues#(index) < domainValues#(index+1)? Linear(fn.samples#(index), fn.samples#(index+1), value)
116
+ else Linear(fn.samples#(index+1), fn.samples#(index), value);
117
+ }
118
+
119
+ }
@@ -0,0 +1,143 @@
1
+ standard library package StateSpaceRepresentation {
2
+ doc
3
+ /*
4
+ * This package provides a model of the foundational state-space system representation,
5
+ * commonly used in control systems.
6
+ */
7
+
8
+ private import ISQ::DurationValue;
9
+ private import Quantities::VectorQuantityValue;
10
+ private import VectorCalculations::*;
11
+
12
+ abstract attribute def StateSpace :> VectorQuantityValue;
13
+ abstract attribute def Input :> VectorQuantityValue;
14
+ abstract attribute def Output :> VectorQuantityValue;
15
+
16
+ abstract calc def GetNextState {
17
+ in input: Input;
18
+ in stateSpace: StateSpace;
19
+ in timeStep: DurationValue;
20
+ return : StateSpace;
21
+ }
22
+ abstract calc def GetOutput {
23
+ in input: Input;
24
+ in stateSpace: StateSpace;
25
+ return : Output;
26
+ }
27
+
28
+ abstract action def StateSpaceEventDef {
29
+ doc
30
+ /*
31
+ * Events to be received.
32
+ */
33
+ }
34
+ action def ZeroCrossingEventDef :> StateSpaceEventDef;
35
+
36
+ item def StateSpaceItem {
37
+ doc
38
+ /*
39
+ * Item for SSR connection
40
+ */
41
+ }
42
+
43
+ abstract action def StateSpaceDynamics {
44
+ doc
45
+ /*
46
+ * StateSpaceDynamics is the simplest form of State Space Representation,
47
+ * and nextState directly computes the stateSpace of the next timestep.
48
+ */
49
+
50
+ in attribute input: Input;
51
+
52
+ abstract calc getNextState: GetNextState;
53
+ abstract calc getOutput: GetOutput;
54
+ attribute stateSpace: StateSpace;
55
+
56
+ out attribute output: Output = getOutput(input, stateSpace);
57
+ }
58
+
59
+ abstract attribute def StateDerivative :> VectorQuantityValue {
60
+ doc
61
+ /*
62
+ * The definition of the time derivative of StateSpace, which means dx/dt, where x is StateSpace
63
+ */
64
+
65
+ ref stateSpace: StateSpace;
66
+ constraint { stateSpace.order == order }
67
+ }
68
+
69
+ abstract calc def GetDerivative {
70
+ doc
71
+ /*
72
+ * Computes the time derivative of stateSpace, which corresponds dx/dt = f(u, x), where u is input and x is stateSpace.
73
+ */
74
+
75
+ in input: Input;
76
+ in stateSpace: StateSpace;
77
+ return : StateDerivative;
78
+ }
79
+
80
+ abstract calc def Integrate {
81
+ doc
82
+ /*
83
+ * Integrates stateSpace to compute the next stateSpace, which corresponds to x + int dx/dt dt.
84
+ * Its actual implementation should be given by a solver.
85
+ */
86
+
87
+ in getDerivative: GetDerivative;
88
+ in input: Input;
89
+ in initialState: StateSpace;
90
+ in timeInterval: DurationValue;
91
+ return result: StateSpace;
92
+ }
93
+
94
+ abstract action def ContinuousStateSpaceDynamics :> StateSpaceDynamics {
95
+ doc
96
+ /*
97
+ * ContinuousStateSpaceDynamics represents continuous behavior.
98
+ * derivative needs to return a time derivative of stateSpace, i.e. dx/dt.
99
+ */
100
+
101
+ abstract calc getDerivative: GetDerivative;
102
+ calc :>> getNextState: GetNextState {
103
+ /* We compute nextState by Integrate defined above by giving derivative calc. */
104
+ calc integrate: Integrate {
105
+ in getDerivative = ContinuousStateSpaceDynamics::getDerivative;
106
+ in input = GetNextState::input;
107
+ in initialState = GetNextState::stateSpace;
108
+ in timeInterval = GetNextState::timeStep;
109
+ }
110
+ return result = integrate.result;
111
+ }
112
+
113
+ event occurrence zeroCrossingEvents[0..*] : ZeroCrossingEventDef {
114
+ /* ContinuousStateSpaceDynamics may cause zero crossings anomaly. */
115
+ }
116
+ }
117
+
118
+ abstract calc def GetDifference {
119
+ doc
120
+ /*
121
+ * Computes difference of stateSpace by one timestep, that is x(k+1) - x(k),
122
+ * where k is the timestep number.
123
+ */
124
+
125
+ in input: Input;
126
+ in stateSpace: StateSpace;
127
+ return : StateSpace;
128
+ }
129
+
130
+ abstract action def DiscreteStateSpaceDynamics :> StateSpaceDynamics {
131
+ doc
132
+ /*
133
+ * DiscreteStateSpaceDynamics represents discrete behavior.
134
+ * differences needs to return difference of the stateSpace for each timestep.
135
+ */
136
+
137
+ abstract calc getDifference: GetDifference;
138
+ calc :>> getNextState: GetNextState {
139
+ attribute diff: StateSpace = getDifference(input, stateSpace);
140
+ return result = stateSpace + diff;
141
+ }
142
+ }
143
+ }
@@ -0,0 +1,171 @@
1
+ standard library package TradeStudies {
2
+ doc
3
+ /*
4
+ * This package provides a simple framework for defining trade-off study analysis cases.
5
+ */
6
+
7
+ private import Base::Anything;
8
+ private import ScalarValues::*;
9
+ private import ScalarFunctions::*;
10
+ private import ControlFunctions::*;
11
+
12
+ abstract calc def EvaluationFunction {
13
+ doc
14
+ /*
15
+ * An EvaluationFunction is a calculation that evaluates a TradeStudy alternative,
16
+ * producing a ScalarValue that can be comparted with the evaluation of other
17
+ * alternatives.
18
+ */
19
+
20
+ in ref alternative : Anything {
21
+ doc
22
+ /*
23
+ * The alternative to be evaluated.
24
+ */
25
+ }
26
+
27
+ return attribute result : ScalarValue[1] {
28
+ doc
29
+ /*
30
+ * A ScalarValue representing the evaluation of the given alternative.
31
+ */
32
+ }
33
+ }
34
+
35
+ abstract requirement def TradeStudyObjective {
36
+ doc
37
+ /*
38
+ * A TradeStudyObjective is the base definition for the objective of a TradeStudy.
39
+ * The requirement is to choose from a given set of alternatives the selectedAlternative
40
+ * for that has the best evaluation according to a given EvaluationFunction. What
41
+ * value is considered "best" is not defined in the abstract base definition but must be
42
+ * computed in any concrete specialization.
43
+ */
44
+
45
+ subject selectedAlternative : Anything {
46
+ doc
47
+ /*
48
+ * The alternative that should be selected, as evaluated using the given
49
+ * ObjectiveFunction.
50
+ */
51
+ }
52
+
53
+ in ref alternatives : Anything[1..*] {
54
+ doc
55
+ /*
56
+ * The alternatives being considered in the TradeStudy for which this TradeStudyObjective
57
+ * is the objective.
58
+ */
59
+ }
60
+
61
+ in calc eval : EvaluationFunction {
62
+ doc
63
+ /*
64
+ * The EvaluationFunction to be used in evaluating the given alternatives.
65
+ */
66
+ }
67
+
68
+ attribute best : ScalarValue {
69
+ doc
70
+ /*
71
+ * Out of the evaluation results of all the given alternatives, the one that is considered
72
+ * "best", in the sense that it is the value the selectedAlternative should have. This
73
+ * value must be computed in any concrete specialization of TradeStudyObjective.
74
+ */
75
+ }
76
+
77
+ require constraint { eval(selectedAlternative) == best }
78
+ }
79
+
80
+ requirement def MinimizeObjective :> TradeStudyObjective {
81
+ doc
82
+ /*
83
+ * A MinimizeObjective is a TradeStudyObjective that requires that the
84
+ * selectedAlternative have the minimum ObjectiveFunction value of all the
85
+ * given alternatives.
86
+ */
87
+
88
+ attribute :>> best = alternatives->minimize {
89
+ doc
90
+ /*
91
+ * For a MinimizeObjective, the best value is the minimum one.
92
+ */
93
+
94
+ in x; eval(x)
95
+ };
96
+ }
97
+
98
+ requirement def MaximizeObjective :> TradeStudyObjective {
99
+ doc
100
+ /*
101
+ * A MaximizeObjective is a TradeStudyObjective that requires that the
102
+ * selectedAlternative have the maximum ObjectiveFunction value of all the
103
+ * given alternatives.
104
+ */
105
+
106
+ attribute :>> best = alternatives->maximize {
107
+ doc
108
+ /*
109
+ * For a MinimizeObjective, the best value is the maximum one.
110
+ */
111
+
112
+ in x; eval(x)
113
+ };
114
+ }
115
+
116
+ abstract analysis def TradeStudy {
117
+ doc
118
+ /*
119
+ * A TradeStudy is an analysis case whose subject is a set of alternatives
120
+ * (at least one) and whose result is a selection of one of those alternatives.
121
+ * The alternatives are evaluated based on a given ObjectiveFunction and the
122
+ * selection is made such that it satisfies the objective of the TradeStudy
123
+ * (which must be a TradeStudyObjective).
124
+ */
125
+
126
+ subject studyAlternatives : Anything[1..*] {
127
+ doc
128
+ /*
129
+ * The set of alternatives being considered in this TradeStudy.
130
+ *
131
+ * In a TradeStudy usage, bind this feature to the actual collection of
132
+ * alternatives to be considered.
133
+ */
134
+ }
135
+
136
+ abstract calc evaluationFunction : EvaluationFunction {
137
+ doc
138
+ /*
139
+ * The EvaluationFunction to be used to evaluate the alternatives.
140
+ *
141
+ * In a TradeStudy usage, redefine this feature to provide the desired
142
+ * calculation (or bind it to a calculation usage that does so).
143
+ */
144
+ }
145
+
146
+ objective tradeStudyObjective : TradeStudyObjective {
147
+ doc
148
+ /*
149
+ * The objective of this TradeStudy.
150
+ *
151
+ * Redefine this feature to give it a definition that is a concrete
152
+ * specialization of TradeStudyObjective. That can either be one of the
153
+ * specializations provided in this package, or a more specific user-
154
+ * defined one.
155
+ */
156
+
157
+ subject :>> selectedAlternative;
158
+ in ref :>> alternatives = studyAlternatives;
159
+ in calc :>> eval = evaluationFunction;
160
+ }
161
+
162
+ return selectedAlternative : Anything = studyAlternatives->selectOne {in ref a {
163
+ doc
164
+ /*
165
+ * The alternative selected by this TradeStudy, which is the one that meets the
166
+ * requirement of the tradeStudyObjective.
167
+ */
168
+ } tradeStudyObjective(selectedAlternative = a)};
169
+ }
170
+
171
+ }