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,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,9 @@
1
+ {
2
+ "index": {
3
+ "Collections": "Collections.kerml",
4
+ "ScalarValues": "ScalarValues.kerml",
5
+ "VectorValues": "VectorValues.kerml"
6
+ },
7
+ "created": "2025-03-13T00:00:00Z",
8
+ "metamodel": "https://www.omg.org/spec/KerML/20250201"
9
+ }
@@ -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
+ }