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,117 @@
1
+ standard library package ControlFunctions {
2
+ doc
3
+ /*
4
+ * This package defines functions that correspond to operators in the KerML expression notation
5
+ * for which one or more operands are expressions whose evaluation is determined by another operand.
6
+ */
7
+
8
+ private import Base::Anything;
9
+ private import ScalarValues::ScalarValue;
10
+ private import ScalarValues::Boolean;
11
+ private import ScalarFunctions::min;
12
+ private import ScalarFunctions::max;
13
+
14
+ abstract function '.' {
15
+ in feature source : Anything[0..*] nonunique {
16
+ abstract feature target : Anything[0..*] nonunique;
17
+ }
18
+ private feature chain chains source.target;
19
+ chain
20
+ }
21
+
22
+ abstract function 'if' {
23
+ in test: Boolean[1];
24
+ in expr thenValue[0..1] { return : Anything[0..*] ordered nonunique; }
25
+ in expr elseValue[0..1] { return : Anything[0..*] ordered nonunique; }
26
+ return : Anything[0..*] ordered nonunique;
27
+ }
28
+
29
+ abstract function '??' {
30
+ in firstValue: Anything[0..*] ordered nonunique;
31
+ in expr secondValue[0..1] { return : Anything[0..*] ordered nonunique; }
32
+ return : Anything[0..*] ordered nonunique;
33
+ }
34
+
35
+ function 'and' {
36
+ in firstValue: Boolean[1];
37
+ in expr secondValue[0..1] { return : Boolean[1]; }
38
+ return : Boolean[1];
39
+ }
40
+
41
+ function 'or'{
42
+ in firstValue: Boolean[1];
43
+ in expr secondValue[0..1] { return : Boolean[1]; }
44
+ return : Boolean[1];
45
+ }
46
+
47
+ function 'implies'{
48
+ in firstValue: Boolean[1];
49
+ in expr secondValue[0..1] { return : Boolean[1]; }
50
+ return : Boolean[1];
51
+ }
52
+
53
+ abstract function collect {
54
+ in collection: Anything[0..*] ordered nonunique;
55
+ in expr mapper[0..*] { in argument: Anything[1]; return : Anything[0..*] ordered nonunique; }
56
+ return : Anything[0..*] ordered nonunique;
57
+ }
58
+
59
+ abstract function select {
60
+ in collection: Anything[0..*] ordered nonunique;
61
+ in expr selector[0..*] { in argument: Anything[1]; return : Boolean[1]; }
62
+ return : Anything[0..*] ordered nonunique;
63
+ }
64
+
65
+ function selectOne {
66
+ in collection: Anything[0..*] ordered nonunique;
67
+ in expr selector1[0..*] { in argument: Anything[1]; return : Boolean[1]; }
68
+ return : Anything[0..1] = collection->select {in x; selector1(x)}#(1);
69
+ }
70
+
71
+ abstract function reject{
72
+ in collection: Anything[0..*] ordered nonunique;
73
+ in expr rejector[0..*] { in argument: Anything[1]; return : Boolean[1]; }
74
+ return : Anything[0..*] ordered nonunique;
75
+ }
76
+
77
+ abstract function reduce {
78
+ in collection: Anything[0..*] ordered nonunique;
79
+ in expr reducer[0..*] { in firstArg: Anything[1]; in secondArg: Anything[1]; return : Anything[1]; }
80
+ return : Anything[0..*] ordered nonunique;
81
+ }
82
+
83
+ abstract function forAll {
84
+ in collection: Anything[0..*] ordered nonunique;
85
+ in expr test[0..*] { in argument: Anything[1]; return : Boolean[1]; }
86
+ return : Boolean[1];
87
+ }
88
+
89
+ abstract function exists {
90
+ in collection: Anything[0..*] ordered nonunique;
91
+ in expr test[0..*] { in argument: Anything[1]; return : Boolean[1]; }
92
+ return : Boolean[1];
93
+ }
94
+
95
+ function allTrue {
96
+ in collection: Boolean[0..*];
97
+ return : Boolean[1] = collection->forAll {in x; x};
98
+ }
99
+
100
+ function anyTrue {
101
+ in collection: Boolean[0..*];
102
+ return : Boolean[1] = collection->exists {in x; x};
103
+ }
104
+
105
+ function minimize {
106
+ in collection: ScalarValue[1..*];
107
+ in expr fn[0..*] { in argument: ScalarValue[1]; return : ScalarValue[1]; }
108
+ return : ScalarValue[1] = collection->collect {in x; fn(x)}->reduce min;
109
+ }
110
+
111
+ function maximize {
112
+ in collection: ScalarValue[1..*];
113
+ in expr fn[0..*] { in argument: ScalarValue[1]; return : ScalarValue[1]; }
114
+ return : ScalarValue = collection->collect {in x; fn(x)}->reduce max;
115
+ }
116
+
117
+ }
@@ -0,0 +1,43 @@
1
+ standard library package DataFunctions {
2
+ doc
3
+ /*
4
+ * This package defines the abstract base functions corresponding to all the unary and binary operators
5
+ * in the KerML expression notation that might be defined on various kinds of DataValues.
6
+ */
7
+
8
+ private import Base::DataValue;
9
+ private import ScalarValues::Boolean;
10
+ private import ControlFunctions::reduce;
11
+
12
+ abstract function '==' specializes BaseFunctions::'==' { in x: DataValue[0..1]; in y: DataValue[0..1];
13
+ return : Boolean[1];
14
+ }
15
+ function '===' specializes BaseFunctions::'==='{ in x: DataValue[0..1]; in y: DataValue[0..1];
16
+ return : Boolean[1] = x == y;
17
+ }
18
+
19
+ abstract function '+' { in x: DataValue[1]; in y: DataValue[0..1]; return : DataValue[1]; }
20
+ abstract function '-' { in x: DataValue[1]; in y: DataValue[0..1]; return : DataValue[1]; }
21
+ abstract function '*' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
22
+ abstract function '/' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
23
+ abstract function '**' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
24
+ abstract function '^' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
25
+ abstract function '%' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
26
+
27
+ abstract function 'not' { in x: DataValue[1]; return : DataValue[1]; }
28
+ abstract function 'xor' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
29
+
30
+ abstract function '~' { in x: DataValue[1]; return : DataValue[1]; }
31
+ abstract function '|' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
32
+ abstract function '&' { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
33
+
34
+ abstract function '<' { in x: DataValue[1]; in y: DataValue[1]; return : Boolean[1]; }
35
+ abstract function '>' { in x: DataValue[1]; in y: DataValue[1]; return : Boolean[1]; }
36
+ abstract function '<=' { in x: DataValue[1]; in y: DataValue[1]; return : Boolean[1]; }
37
+ abstract function '>=' { in x: DataValue[1]; in y: DataValue[1]; return : Boolean[1]; }
38
+
39
+ abstract function max { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
40
+ abstract function min { in x: DataValue[1]; in y: DataValue[1]; return : DataValue[1]; }
41
+
42
+ abstract function '..' { in lower: DataValue[1]; in upper: DataValue[1]; return : DataValue[0..*] ordered; }
43
+ }
@@ -0,0 +1,43 @@
1
+ standard library package IntegerFunctions {
2
+ doc
3
+ /*
4
+ * This package defines functions on Integer values, including concrete specializations of the
5
+ * general arithmetic and comparison operations.
6
+ */
7
+
8
+ public import ScalarValues::*;
9
+
10
+ function abs specializes RationalFunctions::abs { in x: Integer[1]; return : Natural[1]; }
11
+
12
+ function '+' specializes RationalFunctions::'+' { in x: Integer[1]; in y: Integer[0..1]; return : Integer[1]; }
13
+ function '-' specializes RationalFunctions::'-' { in x: Integer[1]; in y: Integer[0..1]; return : Integer[1]; }
14
+ function '*' specializes RationalFunctions::'*' { in x: Integer[1]; in y: Integer[1]; return : Integer[1]; }
15
+ function '/' specializes RationalFunctions::'/' { in x: Integer[1]; in y: Integer[1]; return : Rational[1]; }
16
+ function '**' specializes RationalFunctions::'**' { in x: Integer[1]; in y: Natural[1]; return : Integer[1]; }
17
+ function '^' specializes RationalFunctions::'^' { in x: Integer[1]; in y: Natural[1]; return : Integer[1]; }
18
+ function '%' specializes NumericalFunctions::'%' { in x: Integer[1]; in y: Integer[1]; return : Integer[1]; }
19
+
20
+ function '<' specializes RationalFunctions::'<' { in x: Integer[1]; in y: Integer[1]; return : Boolean[1]; }
21
+ function '>' specializes RationalFunctions::'>' { in x: Integer[1]; in y: Integer[1]; return : Boolean[1]; }
22
+ function '<=' specializes RationalFunctions::'<=' { in x: Integer[1]; in y: Integer[1]; return : Boolean[1]; }
23
+ function '>=' specializes RationalFunctions::'>=' { in x: Integer[1]; in y: Integer[1]; return : Boolean[1]; }
24
+
25
+ function max specializes RationalFunctions::max { in x: Integer[1]; in y: Integer[1]; return : Integer[1]; }
26
+ function min specializes RationalFunctions::min { in x: Integer[1]; in y: Integer[1]; return : Integer[1]; }
27
+
28
+ function '==' specializes DataFunctions::'==' { in x: Integer[0..1]; in y: Integer[0..1]; return : Boolean[1]; }
29
+
30
+ function '..' specializes ScalarFunctions::'..' { in lower: Integer[1]; in upper: Integer[1]; return : Integer[0..*]; }
31
+
32
+ function ToString specializes RationalFunctions::ToString { in x: Integer[1]; return : String[1]; }
33
+ function ToNatural { in x: Integer[1]; return : Natural[1]; }
34
+ function ToInteger { in x: String[1]; return : Integer[1]; }
35
+
36
+ function sum specializes RationalFunctions::sum { in collection: Integer[0..*];
37
+ return : Integer[1] default NumericalFunctions::sum0(collection, 0);
38
+ }
39
+
40
+ function product specializes RationalFunctions::product { in collection: Integer[0..*];
41
+ return : Integer[1] default NumericalFunctions::product1(collection, 1);
42
+ }
43
+ }
@@ -0,0 +1,27 @@
1
+ standard library package NaturalFunctions {
2
+ doc
3
+ /*
4
+ * This package defines functions on Natural values, including concrete specialization of the
5
+ * general arithmetic and comparison operations.
6
+ */
7
+
8
+ public import ScalarValues::*;
9
+
10
+ function '+' specializes IntegerFunctions::'+' { in x: Natural[1]; in y: Natural[0..1]; return : Natural[1]; }
11
+ function '*' specializes IntegerFunctions::'*' { in x: Natural[1]; in y: Natural[1]; return : Natural[1]; }
12
+ function '/' specializes IntegerFunctions::'/' { in x: Natural[1]; in y: Natural[1]; return : Natural[1]; }
13
+ function '%' specializes IntegerFunctions::'%' { in x: Natural[1]; in y: Natural[1]; return : Natural[1]; }
14
+
15
+ function '<' specializes IntegerFunctions::'<' { in x: Natural[1]; in y: Natural[1]; return : Boolean[1]; }
16
+ function '>' specializes IntegerFunctions::'>' { in x: Natural[1]; in y: Natural[1]; return : Boolean[1]; }
17
+ function '<=' specializes IntegerFunctions::'<=' { in x: Natural[1]; in y: Natural[1]; return : Boolean[1]; }
18
+ function '>=' specializes IntegerFunctions::'>=' { in x: Natural[1]; in y: Natural[1]; return : Boolean[1]; }
19
+
20
+ function max specializes IntegerFunctions::max { in x: Natural[1]; in y: Natural[1]; return : Natural[1]; }
21
+ function min specializes IntegerFunctions::min { in x: Natural[1]; in y: Natural[1]; return : Natural[1]; }
22
+
23
+ function '==' specializes IntegerFunctions::'==' { in x: Natural[0..1]; in y: Natural[0..1]; return : Boolean[1]; }
24
+
25
+ function ToString specializes IntegerFunctions::ToString { in x: Natural[1]; return : String[1]; }
26
+ function ToNatural{ in x: String[1]; return : Natural[1]; }
27
+ }
@@ -0,0 +1,43 @@
1
+ standard library package NumericalFunctions {
2
+ doc
3
+ /*
4
+ * This package defines abstract functions on Numerical values for general arithmetic and comparison operations.
5
+ */
6
+
7
+ public import ScalarValues::*;
8
+ private import ControlFunctions::reduce;
9
+
10
+ abstract function isZero{ in x: NumericalValue[1]; return : Boolean; }
11
+ abstract function isUnit{ in x : NumericalValue[1]; return : Boolean; }
12
+
13
+ abstract function abs{ in x: NumericalValue[1]; return : NumericalValue[1]; }
14
+
15
+ abstract function '+' specializes ScalarFunctions::'+' { in x: NumericalValue[1]; in y: NumericalValue[0..1]; return : NumericalValue[1]; }
16
+ abstract function '-' specializes ScalarFunctions::'-' { in x: NumericalValue[1]; in y: NumericalValue[0..1]; return : NumericalValue[1]; }
17
+ abstract function '*' specializes ScalarFunctions::'*' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
18
+ abstract function '/' specializes ScalarFunctions::'/' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
19
+ abstract function '**' specializes ScalarFunctions::'**' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
20
+ abstract function '^' specializes ScalarFunctions::'^' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
21
+ abstract function '%' specializes ScalarFunctions::'%' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
22
+
23
+ abstract function '<' specializes ScalarFunctions::'<' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : Boolean[1]; }
24
+ abstract function '>' specializes ScalarFunctions::'>' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : Boolean[1]; }
25
+ abstract function '<=' specializes ScalarFunctions::'<=' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : Boolean[1]; }
26
+ abstract function '>=' specializes ScalarFunctions::'>=' { in x: NumericalValue[1]; in y: NumericalValue[1]; return : Boolean[1]; }
27
+
28
+ abstract function max specializes ScalarFunctions::max { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
29
+ abstract function min specializes ScalarFunctions::min { in x: NumericalValue[1]; in y: NumericalValue[1]; return : NumericalValue[1]; }
30
+
31
+ abstract function sum { in collection: ScalarValue[0..*]; return : ScalarValue[1]; }
32
+ abstract function product { in collection: ScalarValue[0..*]; return : ScalarValue[1]; }
33
+
34
+ function sum0 { in collection: NumericalValue[0..*]; in zero: ScalarValue[1];
35
+ inv { isZero(zero) }
36
+ return : ScalarValue = collection->reduce '+' ?? zero;
37
+ }
38
+
39
+ function product1 { in collection: ScalarValue[0..*]; in one: ScalarValue[1];
40
+ inv { isUnit(one) }
41
+ return : ScalarValue = collection->reduce '*' ?? one;
42
+ }
43
+ }
@@ -0,0 +1,154 @@
1
+ standard library package OccurrenceFunctions {
2
+ doc
3
+ /*
4
+ * This package defines utility functions that operate on occurrences, primarily related to
5
+ * time during which those occurrences exist.
6
+ */
7
+
8
+ private import Occurrences::Occurrence;
9
+ private import Occurrences::HappensDuring;
10
+ private import ScalarValues::Boolean;
11
+ private import ScalarValues::Positive;
12
+ private import SequenceFunctions::notEmpty;
13
+ private import SequenceFunctions::size;
14
+ private import SequenceFunctions::add;
15
+ private import SequenceFunctions::addAt;
16
+ private import SequenceFunctions::remove;
17
+ private import SequenceFunctions::removeAt;
18
+ private import ControlFunctions::forAll;
19
+
20
+ function '===' specializes BaseFunctions::'===' {
21
+ doc
22
+ /*
23
+ * Test whether two occurrences are portions of the same life. That is, whether they
24
+ * represent different portions of the same entity (colloquially, whether they have
25
+ * the same "identity").
26
+ */
27
+
28
+ in x: Occurrence[0..1];
29
+ in y: Occurrence[0..1];
30
+
31
+ return : Boolean[1] = x.portionOfLife == y.portionOfLife;
32
+ }
33
+
34
+ function isDuring {
35
+ doc
36
+ /*
37
+ * Test whether a performance of this function happens during the input occurrence.
38
+ */
39
+
40
+ in occ: Occurrence[1];
41
+
42
+ private connector all during: HappensDuring[0..1] from self to occ;
43
+
44
+ return : Boolean[1] = notEmpty(during);
45
+ }
46
+
47
+ function create {
48
+ doc
49
+ /*
50
+ * Ensure that the start of a given occurrence happens during a performance of this
51
+ * function. The occurrence is also returned from the function.
52
+ */
53
+
54
+ inout occ: Occurrence[1];
55
+
56
+ private connector : HappensDuring from occ.startShot to self;
57
+
58
+ return : Occurrence[1] = occ;
59
+ }
60
+
61
+ function destroy {
62
+ doc
63
+ /*
64
+ * Ensure that the end of a given occurrence happens during a performance of this
65
+ * function. The occurrence is also returned from the function.
66
+ */
67
+
68
+ inout occ: Occurrence[0..1];
69
+
70
+ private connector : HappensDuring from [0..1] occ.endShot to self;
71
+
72
+ return : Occurrence[0..1] = occ;
73
+ }
74
+
75
+ function addNew {
76
+ doc
77
+ /*
78
+ * Add a newly created occurrence to the given group of occurrences and return the
79
+ * new occurrence.
80
+ */
81
+
82
+ inout group: Occurrence[0..*] nonunique;
83
+ inout occ: Occurrence[1];
84
+
85
+ private composite step : add {
86
+ inout seq1 = group;
87
+ in seq2 = create(occ);
88
+ }
89
+
90
+ return : Occurrence[1] = occ;
91
+ }
92
+
93
+ function addNewAt {
94
+ doc
95
+ /*
96
+ * Add a newly created occurrence to the given ordered group of occurrences at the given
97
+ * index and return the new occurrence.
98
+ */
99
+
100
+ inout group: Occurrence[0..*] ordered nonunique;
101
+ inout occ: Occurrence[1];
102
+ in index: Positive[1];
103
+
104
+ private composite step : addAt {
105
+ inout seq = group;
106
+ in values = create(occ);
107
+ in startIndex = index;
108
+ }
109
+
110
+ return : Occurrence[1] = occ;
111
+ }
112
+
113
+ behavior removeOld {
114
+ doc
115
+ /*
116
+ * Remove a given occurrence from a group of occurrences and destroy it.
117
+ */
118
+
119
+ inout group: Occurrence[0..*] nonunique;
120
+ inout occ: Occurrence[0..1];
121
+
122
+ private composite step removeStep : remove {
123
+ inout seq = group;
124
+ in values = occ;
125
+ }
126
+ private succession removeStep then destroyStep;
127
+ private composite step destroyStep : destroy {
128
+ inout occ = removeOld::occ;
129
+ }
130
+
131
+ }
132
+
133
+ behavior removeOldAt {
134
+ doc
135
+ /*
136
+ * Removes the occurrence at a given index in an ordered group of occurrences
137
+ * and destroy it.
138
+ */
139
+ inout group: Occurrence[0..*] ordered nonunique;
140
+ in index: Positive[1];
141
+
142
+ private feature oldOcc = group#(index);
143
+
144
+ private composite step removeStep : remove {
145
+ inout seq = group;
146
+ in index = removeOldAt::index;
147
+ }
148
+ private succession removeStep then destroyStep;
149
+ private composite step destroyStep : destroy {
150
+ inout occ = oldOcc;
151
+ }
152
+
153
+ }
154
+ }
@@ -0,0 +1,49 @@
1
+ standard library package RationalFunctions {
2
+ doc
3
+ /*
4
+ * This package defines Functions on Rational values, including concrete specializations of the
5
+ * general arithmetic and comparison operations.
6
+ */
7
+
8
+ public import ScalarValues::*;
9
+
10
+ function rat { in numer: Integer[1]; in denum: Integer[1]; return : Rational[1]; }
11
+ function numer { in rat: Rational[1]; return : Integer[1]; }
12
+ function denom { in rat: Rational[1]; return : Integer[1]; }
13
+
14
+ function abs specializes RealFunctions::abs { in x: Rational[1]; return : Rational[1]; }
15
+
16
+ function '+' specializes RealFunctions::'+' { in x: Rational[1]; in y: Rational[0..1]; return : Rational[1]; }
17
+ function '-' specializes RealFunctions::'-' { in x: Rational[1]; in y: Rational[0..1]; return : Rational[1]; }
18
+ function '*' specializes RealFunctions::'*' { in x: Rational[1]; in y: Rational[1]; return : Rational[1]; }
19
+ function '/' specializes RealFunctions::'/' { in x: Rational[1]; in y: Rational[1]; return : Rational[1]; }
20
+ function '**' specializes RealFunctions::'**' { in x: Rational[1]; in y: Rational[1]; return : Rational[1]; }
21
+ function '^' specializes RealFunctions::'^' { in x: Rational[1]; in y: Rational[1]; return : Rational[1]; }
22
+
23
+ function '<' specializes RealFunctions::'<' { in x: Rational[1]; in y: Rational[1]; return : Boolean[1]; }
24
+ function '>' specializes RealFunctions::'>' { in x: Rational[1]; in y: Rational[1]; return : Boolean[1]; }
25
+ function '<=' specializes RealFunctions::'<=' { in x: Rational[1]; in y: Rational[1]; return : Boolean[1]; }
26
+ function '>=' specializes RealFunctions::'>=' { in x: Rational[1]; in y: Rational[1]; return : Boolean[1]; }
27
+
28
+ function max specializes RealFunctions::max { in x: Rational[1]; in y: Rational[1]; return : Rational[1]; }
29
+ function min specializes RealFunctions::min { in x: Rational[1]; in y: Rational[1]; return : Rational[1]; }
30
+
31
+ function '==' specializes RealFunctions::'==' { in x: Rational[0..1]; in y: Rational[0..1]; return : Boolean[1]; }
32
+
33
+ function gcd{ in x: Rational[1]; in y: Rational[1]; return : Integer[1]; }
34
+
35
+ function floor specializes RealFunctions::floor { in x: Rational[1]; return : Integer[1]; }
36
+ function round specializes RealFunctions::round { in x: Rational[1]; return : Integer[1]; }
37
+
38
+ function ToString specializes RealFunctions::ToString { in x: Rational[1]; return : String[1]; }
39
+ function ToInteger{ in x: Rational[1]; return : Integer[1]; }
40
+ function ToRational{ in x: String[1]; return : Rational[1]; }
41
+
42
+ function sum specializes RealFunctions::sum { in collection: Rational[0..*];
43
+ return : Rational[1] default NumericalFunctions::sum0(collection, rat(0, 1));
44
+ }
45
+
46
+ function product specializes RealFunctions::product { in collection: Rational[0..*];
47
+ return : Rational[1] default NumericalFunctions::product1(collection, rat(1, 1));
48
+ }
49
+ }
@@ -0,0 +1,56 @@
1
+ standard library package RealFunctions {
2
+ doc
3
+ /*
4
+ * This package defines Functions on Real values, including concrete specializations of the
5
+ * general arithmetic and comparison operations.
6
+ */
7
+
8
+ public import ScalarValues::*;
9
+
10
+ function re :> ComplexFunctions::re{ in x: Real[1];
11
+ return : Real[1] = x;
12
+ }
13
+ function im :> ComplexFunctions::im{ in x: Real[1];
14
+ return : Real[1] = 0.0;
15
+ }
16
+
17
+ function abs specializes ComplexFunctions::abs { in x: Real[1]; return : Real[1]; }
18
+ function arg specializes ComplexFunctions::arg { in x: Real[1];
19
+ return : Real[1] = 0.0;
20
+ }
21
+
22
+ function '+' specializes ComplexFunctions::'+' { in x: Real[1]; in y: Real[0..1]; return : Real[1]; }
23
+ function '-' specializes ComplexFunctions::'-' { in x: Real[1]; in y: Real[0..1]; return : Real[1]; }
24
+ function '*' specializes ComplexFunctions::'*' { in x: Real[1]; in y: Real[1]; return : Real[1]; }
25
+ function '/' specializes ComplexFunctions::'/' { in x: Real[1]; in y: Real[1]; return : Real[1]; }
26
+ function '**' specializes ComplexFunctions::'**' { in x: Real[1]; in y: Real[1]; return : Real[1]; }
27
+ function '^' specializes ComplexFunctions::'^' { in x: Real[1]; in y: Real[1]; return : Real[1]; }
28
+
29
+ function '<' specializes NumericalFunctions::'<' { in x: Real[1]; in y: Real[1]; return : Boolean[1]; }
30
+ function '>' specializes NumericalFunctions::'>' { in x: Real[1]; in y: Real[1]; return : Boolean[1]; }
31
+ function '<=' specializes NumericalFunctions::'<=' { in x: Real[1]; in y: Real[1]; return : Boolean[1]; }
32
+ function '>=' specializes NumericalFunctions::'>=' { in x: Real[1]; in y: Real[1]; return : Boolean[1]; }
33
+
34
+ function max specializes NumericalFunctions::max { in x: Real[1]; in y: Real[1]; return : Real[1]; }
35
+ function min specializes NumericalFunctions::min { in x: Real[1]; in y: Real[1]; return : Real[1]; }
36
+
37
+ function '==' specializes ComplexFunctions::'==' { in x: Real[0..1]; in y: Real[0..1]; return : Boolean[1]; }
38
+
39
+ function sqrt{ in x: Real[1]; return : Real[1]; }
40
+
41
+ function floor{ in x: Real[1]; return : Integer[1]; }
42
+ function round{ in x: Real[1]; return : Integer[1]; }
43
+
44
+ function ToString specializes ComplexFunctions::ToString { in x: Real[1]; return : String[1]; }
45
+ function ToInteger{ in x: Real[1]; return : Integer[1]; }
46
+ function ToRational{ in x: Real[1]; return : Rational[1]; }
47
+ function ToReal{ in x: String[1]; return : Real[1]; }
48
+
49
+ function sum specializes ComplexFunctions::sum { in collection: Real[0..*];
50
+ return : Real default NumericalFunctions::sum0(collection, 0.0);
51
+ }
52
+
53
+ function product specializes ComplexFunctions::product { in collection: Real[0..*];
54
+ return : Real default NumericalFunctions::product1(collection, 1.0);
55
+ }
56
+ }
@@ -0,0 +1,33 @@
1
+ standard library package ScalarFunctions {
2
+ doc
3
+ /*
4
+ * This package defines abstract functions that specialize the DataFunctions for use with ScalarValues.
5
+ */
6
+
7
+ public import ScalarValues::*;
8
+
9
+ abstract function '+' specializes DataFunctions::'+' { in x: ScalarValue[1]; in y: ScalarValue[0..1]; return : ScalarValue[1]; }
10
+ abstract function '-' specializes DataFunctions::'-' { in x: ScalarValue[1]; in y: ScalarValue[0..1]; return : ScalarValue[1]; }
11
+ abstract function '*' specializes DataFunctions::'*' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
12
+ abstract function '/' specializes DataFunctions::'/' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
13
+ abstract function '**' specializes DataFunctions::'**' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
14
+ abstract function '^' specializes DataFunctions::'^' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
15
+ abstract function '%' specializes DataFunctions::'%' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
16
+
17
+ abstract function 'not' specializes DataFunctions::'not' { in x: ScalarValue[1]; return : ScalarValue[1]; }
18
+ abstract function 'xor' specializes DataFunctions::'xor' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
19
+
20
+ abstract function '~' specializes DataFunctions::'~' { in x: ScalarValue[1]; return : ScalarValue[1]; }
21
+ abstract function '|' specializes DataFunctions::'|' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
22
+ abstract function '&' specializes DataFunctions::'&' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
23
+
24
+ abstract function '<' specializes DataFunctions::'<' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : Boolean[1]; }
25
+ abstract function '>' specializes DataFunctions::'>' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : Boolean[1]; }
26
+ abstract function '<=' specializes DataFunctions::'<=' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : Boolean[1]; }
27
+ abstract function '>=' specializes DataFunctions::'>=' { in x: ScalarValue[1]; in y: ScalarValue[1]; return : Boolean[1]; }
28
+
29
+ abstract function max specializes DataFunctions::max { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
30
+ abstract function min specializes DataFunctions::min { in x: ScalarValue[1]; in y: ScalarValue[1]; return : ScalarValue[1]; }
31
+
32
+ abstract function '..' specializes DataFunctions::'..' { in lower: ScalarValue[1]; in upper: ScalarValue[1]; return : ScalarValue[0..*]; }
33
+ }