@mojir/dvala 0.0.1 → 0.0.2

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 (914) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1613 -4
  3. package/dist/bundler.esm.js +2 -0
  4. package/dist/bundler.esm.js.map +1 -0
  5. package/dist/bundler.js +2 -0
  6. package/dist/bundler.js.map +1 -0
  7. package/dist/cli/cli/src/cli.d.ts +2 -0
  8. package/dist/cli/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  9. package/dist/cli/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  10. package/dist/cli/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  11. package/dist/cli/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  12. package/dist/cli/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  13. package/dist/cli/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  14. package/dist/cli/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  15. package/dist/cli/cli/src/cliFormatterRules.d.ts +13 -0
  16. package/dist/cli/cli/src/colorizer.d.ts +939 -0
  17. package/dist/cli/cli/src/createReadlineInterface.d.ts +5 -0
  18. package/dist/cli/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  19. package/dist/cli/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  20. package/dist/cli/cli/src/js-interop/Cli/index.d.ts +2 -0
  21. package/dist/cli/cli.js +38614 -0
  22. package/dist/cli/common/createFormatter.d.ts +6 -0
  23. package/dist/cli/common/utils.d.ts +2 -0
  24. package/dist/cli/reference/api.d.ts +75 -0
  25. package/dist/cli/reference/datatype.d.ts +3 -0
  26. package/dist/cli/reference/effect.d.ts +3 -0
  27. package/dist/cli/reference/examples.d.ts +11 -0
  28. package/dist/cli/reference/index.d.ts +191 -0
  29. package/dist/cli/reference/shorthand.d.ts +3 -0
  30. package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +25 -0
  31. package/dist/cli/src/Dvala/Cache.d.ts +16 -0
  32. package/dist/cli/src/Dvala/Dvala.d.ts +68 -0
  33. package/dist/cli/src/allModules.d.ts +2 -0
  34. package/dist/cli/src/builtin/bindingNode.d.ts +11 -0
  35. package/dist/cli/src/builtin/core/array.d.ts +2 -0
  36. package/dist/cli/src/builtin/core/assertion.d.ts +2 -0
  37. package/dist/cli/src/builtin/core/bitwise.d.ts +2 -0
  38. package/dist/cli/src/builtin/core/collection.d.ts +2 -0
  39. package/dist/cli/src/builtin/core/functional.d.ts +2 -0
  40. package/dist/cli/src/builtin/core/math.d.ts +2 -0
  41. package/dist/cli/src/builtin/core/meta.d.ts +3 -0
  42. package/dist/cli/src/builtin/core/misc.d.ts +2 -0
  43. package/dist/cli/src/builtin/core/object.d.ts +2 -0
  44. package/dist/cli/src/builtin/core/predicates.d.ts +2 -0
  45. package/dist/cli/src/builtin/core/regexp.d.ts +2 -0
  46. package/dist/cli/src/builtin/core/sequence.d.ts +2 -0
  47. package/dist/cli/src/builtin/core/string.d.ts +2 -0
  48. package/dist/cli/src/builtin/core/vector.d.ts +2 -0
  49. package/dist/cli/src/builtin/index.d.ts +13 -0
  50. package/dist/cli/src/builtin/interface.d.ts +113 -0
  51. package/dist/cli/src/builtin/modules/assertion/docs.d.ts +2 -0
  52. package/dist/cli/src/builtin/modules/assertion/index.d.ts +2 -0
  53. package/dist/cli/src/builtin/modules/bitwise/index.d.ts +2 -0
  54. package/dist/cli/src/builtin/modules/collection/index.d.ts +2 -0
  55. package/dist/cli/src/builtin/modules/convert/index.d.ts +2 -0
  56. package/dist/cli/src/builtin/modules/functional/index.d.ts +2 -0
  57. package/dist/cli/src/builtin/modules/grid/docs.d.ts +2 -0
  58. package/dist/cli/src/builtin/modules/grid/fromArray.d.ts +8 -0
  59. package/dist/cli/src/builtin/modules/grid/index.d.ts +2 -0
  60. package/dist/cli/src/builtin/modules/grid/transpose.d.ts +2 -0
  61. package/dist/cli/src/builtin/modules/interface.d.ts +11 -0
  62. package/dist/cli/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  63. package/dist/cli/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  64. package/dist/cli/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  65. package/dist/cli/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  66. package/dist/cli/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  67. package/dist/cli/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  68. package/dist/cli/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  69. package/dist/cli/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  70. package/dist/cli/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  71. package/dist/cli/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  72. package/dist/cli/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  73. package/dist/cli/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  74. package/dist/cli/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  75. package/dist/cli/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  76. package/dist/cli/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  77. package/dist/cli/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  78. package/dist/cli/src/builtin/modules/math/index.d.ts +2 -0
  79. package/dist/cli/src/builtin/modules/matrix/docs.d.ts +2 -0
  80. package/dist/cli/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  81. package/dist/cli/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  82. package/dist/cli/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  83. package/dist/cli/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  84. package/dist/cli/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  85. package/dist/cli/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  86. package/dist/cli/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  87. package/dist/cli/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  88. package/dist/cli/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  89. package/dist/cli/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  90. package/dist/cli/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  91. package/dist/cli/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  92. package/dist/cli/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  93. package/dist/cli/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  94. package/dist/cli/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  95. package/dist/cli/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  96. package/dist/cli/src/builtin/modules/matrix/index.d.ts +4 -0
  97. package/dist/cli/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  98. package/dist/cli/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  99. package/dist/cli/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  100. package/dist/cli/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  101. package/dist/cli/src/builtin/modules/number-theory/docs.d.ts +2 -0
  102. package/dist/cli/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  103. package/dist/cli/src/builtin/modules/number-theory/index.d.ts +4 -0
  104. package/dist/cli/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  105. package/dist/cli/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  106. package/dist/cli/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  107. package/dist/cli/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  108. package/dist/cli/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  109. package/dist/cli/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  110. package/dist/cli/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  111. package/dist/cli/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  112. package/dist/cli/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  113. package/dist/cli/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  114. package/dist/cli/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  115. package/dist/cli/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  116. package/dist/cli/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  117. package/dist/cli/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  118. package/dist/cli/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  119. package/dist/cli/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  120. package/dist/cli/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  121. package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +27 -0
  122. package/dist/cli/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  123. package/dist/cli/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  124. package/dist/cli/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  125. package/dist/cli/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  126. package/dist/cli/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  127. package/dist/cli/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  128. package/dist/cli/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  129. package/dist/cli/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  130. package/dist/cli/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  131. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  132. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  133. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  134. package/dist/cli/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  135. package/dist/cli/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  136. package/dist/cli/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  137. package/dist/cli/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  138. package/dist/cli/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  139. package/dist/cli/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  140. package/dist/cli/src/builtin/modules/random/docs.d.ts +2 -0
  141. package/dist/cli/src/builtin/modules/random/index.d.ts +2 -0
  142. package/dist/cli/src/builtin/modules/sequence/index.d.ts +2 -0
  143. package/dist/cli/src/builtin/modules/string/index.d.ts +2 -0
  144. package/dist/cli/src/builtin/modules/vector/bincount.d.ts +9 -0
  145. package/dist/cli/src/builtin/modules/vector/calcMad.d.ts +1 -0
  146. package/dist/cli/src/builtin/modules/vector/calcMean.d.ts +1 -0
  147. package/dist/cli/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  148. package/dist/cli/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  149. package/dist/cli/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  150. package/dist/cli/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  151. package/dist/cli/src/builtin/modules/vector/docs.d.ts +2 -0
  152. package/dist/cli/src/builtin/modules/vector/entropy.d.ts +8 -0
  153. package/dist/cli/src/builtin/modules/vector/histogram.d.ts +9 -0
  154. package/dist/cli/src/builtin/modules/vector/index.d.ts +2 -0
  155. package/dist/cli/src/builtin/modules/vector/mode.d.ts +6 -0
  156. package/dist/cli/src/builtin/modules/vector/outliers.d.ts +7 -0
  157. package/dist/cli/src/builtin/modules/vector/percentile.d.ts +7 -0
  158. package/dist/cli/src/builtin/modules/vector/quartiles.d.ts +1 -0
  159. package/dist/cli/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  160. package/dist/cli/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  161. package/dist/cli/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  162. package/dist/cli/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  163. package/dist/cli/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  164. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  165. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  166. package/dist/cli/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  167. package/dist/cli/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  168. package/dist/cli/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  169. package/dist/cli/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  170. package/dist/cli/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  171. package/dist/cli/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  172. package/dist/cli/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  173. package/dist/cli/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  174. package/dist/cli/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  175. package/dist/cli/src/builtin/normalExpressions/index.d.ts +8 -0
  176. package/dist/cli/src/builtin/specialExpressionTypes.d.ts +26 -0
  177. package/dist/cli/src/builtin/specialExpressions/and.d.ts +6 -0
  178. package/dist/cli/src/builtin/specialExpressions/array.d.ts +6 -0
  179. package/dist/cli/src/builtin/specialExpressions/block.d.ts +6 -0
  180. package/dist/cli/src/builtin/specialExpressions/cond.d.ts +6 -0
  181. package/dist/cli/src/builtin/specialExpressions/defined.d.ts +5 -0
  182. package/dist/cli/src/builtin/specialExpressions/effect.d.ts +5 -0
  183. package/dist/cli/src/builtin/specialExpressions/functions.d.ts +6 -0
  184. package/dist/cli/src/builtin/specialExpressions/if.d.ts +6 -0
  185. package/dist/cli/src/builtin/specialExpressions/import.d.ts +6 -0
  186. package/dist/cli/src/builtin/specialExpressions/let.d.ts +6 -0
  187. package/dist/cli/src/builtin/specialExpressions/loop.d.ts +6 -0
  188. package/dist/cli/src/builtin/specialExpressions/loops.d.ts +9 -0
  189. package/dist/cli/src/builtin/specialExpressions/match.d.ts +7 -0
  190. package/dist/cli/src/builtin/specialExpressions/object.d.ts +6 -0
  191. package/dist/cli/src/builtin/specialExpressions/or.d.ts +6 -0
  192. package/dist/cli/src/builtin/specialExpressions/parallel.d.ts +6 -0
  193. package/dist/cli/src/builtin/specialExpressions/perform.d.ts +6 -0
  194. package/dist/cli/src/builtin/specialExpressions/qq.d.ts +6 -0
  195. package/dist/cli/src/builtin/specialExpressions/race.d.ts +6 -0
  196. package/dist/cli/src/builtin/specialExpressions/recur.d.ts +5 -0
  197. package/dist/cli/src/builtin/specialExpressions/throw.d.ts +5 -0
  198. package/dist/cli/src/builtin/specialExpressions/try.d.ts +7 -0
  199. package/dist/cli/src/builtin/specialExpressions/unless.d.ts +6 -0
  200. package/dist/cli/src/builtin/utils.d.ts +6 -0
  201. package/dist/cli/src/bundler/index.d.ts +9 -0
  202. package/dist/cli/src/bundler/interface.d.ts +15 -0
  203. package/dist/cli/src/bundler.d.ts +3 -0
  204. package/dist/cli/src/cli.d.ts +2 -0
  205. package/dist/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  206. package/dist/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  207. package/dist/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  208. package/dist/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  209. package/dist/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  210. package/dist/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  211. package/dist/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  212. package/dist/cli/src/cliFormatterRules.d.ts +13 -0
  213. package/dist/cli/src/colorizer.d.ts +939 -0
  214. package/dist/cli/src/constants/constants.d.ts +19 -0
  215. package/dist/cli/src/createReadlineInterface.d.ts +5 -0
  216. package/dist/cli/src/effects.d.ts +106 -0
  217. package/dist/cli/src/errors.d.ts +24 -0
  218. package/dist/cli/src/evaluator/ContextStack.d.ts +65 -0
  219. package/dist/cli/src/evaluator/effectRef.d.ts +27 -0
  220. package/dist/cli/src/evaluator/effectTypes.d.ts +79 -0
  221. package/dist/cli/src/evaluator/frames.d.ts +525 -0
  222. package/dist/cli/src/evaluator/interface.d.ts +14 -0
  223. package/dist/cli/src/evaluator/serialization.d.ts +45 -0
  224. package/dist/cli/src/evaluator/standardEffects.d.ts +35 -0
  225. package/dist/cli/src/evaluator/step.d.ts +159 -0
  226. package/dist/cli/src/evaluator/suspension.d.ts +53 -0
  227. package/dist/cli/src/evaluator/trampoline.d.ts +119 -0
  228. package/dist/cli/src/getUndefinedSymbols/index.d.ts +7 -0
  229. package/dist/cli/src/index.d.ts +18 -0
  230. package/dist/cli/src/initReferenceData.d.ts +1 -0
  231. package/dist/cli/src/interface.d.ts +7 -0
  232. package/dist/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  233. package/dist/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  234. package/dist/cli/src/js-interop/Cli/index.d.ts +2 -0
  235. package/dist/cli/src/parser/ParserContext.d.ts +20 -0
  236. package/dist/cli/src/parser/getPrecedence.d.ts +3 -0
  237. package/dist/cli/src/parser/helpers.d.ts +19 -0
  238. package/dist/cli/src/parser/index.d.ts +5 -0
  239. package/dist/cli/src/parser/subParsers/parseArray.d.ts +3 -0
  240. package/dist/cli/src/parser/subParsers/parseBindingTarget.d.ts +8 -0
  241. package/dist/cli/src/parser/subParsers/parseCond.d.ts +4 -0
  242. package/dist/cli/src/parser/subParsers/parseDo.d.ts +3 -0
  243. package/dist/cli/src/parser/subParsers/parseExpression.d.ts +5 -0
  244. package/dist/cli/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  245. package/dist/cli/src/parser/subParsers/parseFunction.d.ts +4 -0
  246. package/dist/cli/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  247. package/dist/cli/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  248. package/dist/cli/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  249. package/dist/cli/src/parser/subParsers/parseLet.d.ts +4 -0
  250. package/dist/cli/src/parser/subParsers/parseLoop.d.ts +4 -0
  251. package/dist/cli/src/parser/subParsers/parseMatch.d.ts +4 -0
  252. package/dist/cli/src/parser/subParsers/parseNumber.d.ts +3 -0
  253. package/dist/cli/src/parser/subParsers/parseObject.d.ts +3 -0
  254. package/dist/cli/src/parser/subParsers/parseOperand.d.ts +3 -0
  255. package/dist/cli/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  256. package/dist/cli/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  257. package/dist/cli/src/parser/subParsers/parseString.d.ts +4 -0
  258. package/dist/cli/src/parser/subParsers/parseSymbol.d.ts +3 -0
  259. package/dist/cli/src/parser/subParsers/parseTry.d.ts +4 -0
  260. package/dist/cli/src/parser/types.d.ts +129 -0
  261. package/dist/cli/src/symbolPatterns.d.ts +2 -0
  262. package/dist/cli/src/testFramework/index.d.ts +15 -0
  263. package/dist/cli/src/tokenizer/minifyTokenStream.d.ts +4 -0
  264. package/dist/cli/src/tokenizer/operators.d.ts +12 -0
  265. package/dist/cli/src/tokenizer/reservedNames.d.ts +66 -0
  266. package/dist/cli/src/tokenizer/token.d.ts +84 -0
  267. package/dist/cli/src/tokenizer/tokenize.d.ts +8 -0
  268. package/dist/cli/src/tokenizer/tokenizers.d.ts +14 -0
  269. package/dist/cli/src/transformer/index.d.ts +2 -0
  270. package/dist/cli/src/typeGuards/annotatedArrays.d.ts +16 -0
  271. package/dist/cli/src/typeGuards/array.d.ts +9 -0
  272. package/dist/cli/src/typeGuards/astNode.d.ts +19 -0
  273. package/dist/cli/src/typeGuards/dvala.d.ts +26 -0
  274. package/dist/cli/src/typeGuards/dvalaFunction.d.ts +12 -0
  275. package/dist/cli/src/typeGuards/index.d.ts +7 -0
  276. package/dist/cli/src/typeGuards/number.d.ts +66 -0
  277. package/dist/cli/src/typeGuards/string.d.ts +15 -0
  278. package/dist/cli/src/untokenizer/index.d.ts +2 -0
  279. package/dist/cli/src/utils/arity.d.ts +10 -0
  280. package/dist/cli/src/utils/debug/debugTools.d.ts +1 -0
  281. package/dist/cli/src/utils/debug/getCodeMarker.d.ts +2 -0
  282. package/dist/cli/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  283. package/dist/cli/src/utils/docString/generateDocString.d.ts +2 -0
  284. package/dist/cli/src/utils/getAssertionError.d.ts +3 -0
  285. package/dist/cli/src/utils/index.d.ts +14 -0
  286. package/dist/cli/src/utils/maybePromise.d.ts +54 -0
  287. package/dist/cli/src/utils/symbols.d.ts +3 -0
  288. package/dist/common/createFormatter.d.ts +6 -0
  289. package/dist/common/utils.d.ts +2 -0
  290. package/dist/debug.esm.js +2 -0
  291. package/dist/debug.esm.js.map +1 -0
  292. package/dist/debug.js +2 -0
  293. package/dist/debug.js.map +1 -0
  294. package/dist/dvala.iife.js +2 -0
  295. package/dist/dvala.iife.js.map +1 -0
  296. package/dist/full.esm.js +2 -0
  297. package/dist/full.esm.js.map +1 -0
  298. package/dist/full.js +2 -0
  299. package/dist/full.js.map +1 -0
  300. package/dist/index.esm.js +2 -0
  301. package/dist/index.esm.js.map +1 -0
  302. package/dist/index.js +2 -2
  303. package/dist/index.js.map +1 -1
  304. package/dist/modules/assertion.esm.js +2 -0
  305. package/dist/modules/assertion.esm.js.map +1 -0
  306. package/dist/modules/assertion.js +2 -0
  307. package/dist/modules/assertion.js.map +1 -0
  308. package/dist/modules/bitwise.esm.js +2 -0
  309. package/dist/modules/bitwise.esm.js.map +1 -0
  310. package/dist/modules/bitwise.js +2 -0
  311. package/dist/modules/bitwise.js.map +1 -0
  312. package/dist/modules/cli/src/cli.d.ts +2 -0
  313. package/dist/modules/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  314. package/dist/modules/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  315. package/dist/modules/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  316. package/dist/modules/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  317. package/dist/modules/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  318. package/dist/modules/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  319. package/dist/modules/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  320. package/dist/modules/cli/src/cliFormatterRules.d.ts +13 -0
  321. package/dist/modules/cli/src/colorizer.d.ts +939 -0
  322. package/dist/modules/cli/src/createReadlineInterface.d.ts +5 -0
  323. package/dist/modules/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  324. package/dist/modules/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  325. package/dist/modules/cli/src/js-interop/Cli/index.d.ts +2 -0
  326. package/dist/modules/collection.esm.js +2 -0
  327. package/dist/modules/collection.esm.js.map +1 -0
  328. package/dist/modules/collection.js +2 -0
  329. package/dist/modules/collection.js.map +1 -0
  330. package/dist/modules/common/createFormatter.d.ts +6 -0
  331. package/dist/modules/common/utils.d.ts +2 -0
  332. package/dist/modules/convert.esm.js +2 -0
  333. package/dist/modules/convert.esm.js.map +1 -0
  334. package/dist/modules/convert.js +2 -0
  335. package/dist/modules/convert.js.map +1 -0
  336. package/dist/modules/functional.esm.js +2 -0
  337. package/dist/modules/functional.esm.js.map +1 -0
  338. package/dist/modules/functional.js +2 -0
  339. package/dist/modules/functional.js.map +1 -0
  340. package/dist/modules/grid.esm.js +2 -0
  341. package/dist/modules/grid.esm.js.map +1 -0
  342. package/dist/modules/grid.js +2 -0
  343. package/dist/modules/grid.js.map +1 -0
  344. package/dist/modules/linear-algebra.esm.js +2 -0
  345. package/dist/modules/linear-algebra.esm.js.map +1 -0
  346. package/dist/modules/linear-algebra.js +2 -0
  347. package/dist/modules/linear-algebra.js.map +1 -0
  348. package/dist/modules/math.esm.js +2 -0
  349. package/dist/modules/math.esm.js.map +1 -0
  350. package/dist/modules/math.js +2 -0
  351. package/dist/modules/math.js.map +1 -0
  352. package/dist/modules/matrix.esm.js +2 -0
  353. package/dist/modules/matrix.esm.js.map +1 -0
  354. package/dist/modules/matrix.js +2 -0
  355. package/dist/modules/matrix.js.map +1 -0
  356. package/dist/modules/number-theory.esm.js +2 -0
  357. package/dist/modules/number-theory.esm.js.map +1 -0
  358. package/dist/modules/number-theory.js +2 -0
  359. package/dist/modules/number-theory.js.map +1 -0
  360. package/dist/modules/random.esm.js +2 -0
  361. package/dist/modules/random.esm.js.map +1 -0
  362. package/dist/modules/random.js +2 -0
  363. package/dist/modules/random.js.map +1 -0
  364. package/dist/modules/reference/api.d.ts +75 -0
  365. package/dist/modules/reference/datatype.d.ts +3 -0
  366. package/dist/modules/reference/effect.d.ts +3 -0
  367. package/dist/modules/reference/index.d.ts +191 -0
  368. package/dist/modules/reference/shorthand.d.ts +3 -0
  369. package/dist/modules/sequence.esm.js +2 -0
  370. package/dist/modules/sequence.esm.js.map +1 -0
  371. package/dist/modules/sequence.js +2 -0
  372. package/dist/modules/sequence.js.map +1 -0
  373. package/dist/modules/src/AutoCompleter/AutoCompleter.d.ts +25 -0
  374. package/dist/modules/src/Dvala/Cache.d.ts +16 -0
  375. package/dist/modules/src/Dvala/Dvala.d.ts +68 -0
  376. package/dist/modules/src/allModules.d.ts +2 -0
  377. package/dist/modules/src/builtin/bindingNode.d.ts +11 -0
  378. package/dist/modules/src/builtin/core/array.d.ts +2 -0
  379. package/dist/modules/src/builtin/core/assertion.d.ts +2 -0
  380. package/dist/modules/src/builtin/core/bitwise.d.ts +2 -0
  381. package/dist/modules/src/builtin/core/collection.d.ts +2 -0
  382. package/dist/modules/src/builtin/core/functional.d.ts +2 -0
  383. package/dist/modules/src/builtin/core/math.d.ts +2 -0
  384. package/dist/modules/src/builtin/core/meta.d.ts +3 -0
  385. package/dist/modules/src/builtin/core/misc.d.ts +2 -0
  386. package/dist/modules/src/builtin/core/object.d.ts +2 -0
  387. package/dist/modules/src/builtin/core/predicates.d.ts +2 -0
  388. package/dist/modules/src/builtin/core/regexp.d.ts +2 -0
  389. package/dist/modules/src/builtin/core/sequence.d.ts +2 -0
  390. package/dist/modules/src/builtin/core/string.d.ts +2 -0
  391. package/dist/modules/src/builtin/core/vector.d.ts +2 -0
  392. package/dist/modules/src/builtin/index.d.ts +13 -0
  393. package/dist/modules/src/builtin/interface.d.ts +113 -0
  394. package/dist/modules/src/builtin/modules/assertion/docs.d.ts +2 -0
  395. package/dist/modules/src/builtin/modules/assertion/index.d.ts +2 -0
  396. package/dist/modules/src/builtin/modules/bitwise/index.d.ts +2 -0
  397. package/dist/modules/src/builtin/modules/collection/index.d.ts +2 -0
  398. package/dist/modules/src/builtin/modules/convert/index.d.ts +2 -0
  399. package/dist/modules/src/builtin/modules/functional/index.d.ts +2 -0
  400. package/dist/modules/src/builtin/modules/grid/docs.d.ts +2 -0
  401. package/dist/modules/src/builtin/modules/grid/fromArray.d.ts +8 -0
  402. package/dist/modules/src/builtin/modules/grid/index.d.ts +2 -0
  403. package/dist/modules/src/builtin/modules/grid/transpose.d.ts +2 -0
  404. package/dist/modules/src/builtin/modules/interface.d.ts +11 -0
  405. package/dist/modules/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  406. package/dist/modules/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  407. package/dist/modules/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  408. package/dist/modules/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  409. package/dist/modules/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  410. package/dist/modules/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  411. package/dist/modules/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  412. package/dist/modules/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  413. package/dist/modules/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  414. package/dist/modules/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  415. package/dist/modules/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  416. package/dist/modules/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  417. package/dist/modules/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  418. package/dist/modules/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  419. package/dist/modules/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  420. package/dist/modules/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  421. package/dist/modules/src/builtin/modules/math/index.d.ts +2 -0
  422. package/dist/modules/src/builtin/modules/matrix/docs.d.ts +2 -0
  423. package/dist/modules/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  424. package/dist/modules/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  425. package/dist/modules/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  426. package/dist/modules/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  427. package/dist/modules/src/builtin/modules/matrix/helpers/diagonal.d.ts +1 -0
  428. package/dist/modules/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  429. package/dist/modules/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  430. package/dist/modules/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  431. package/dist/modules/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  432. package/dist/modules/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  433. package/dist/modules/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  434. package/dist/modules/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  435. package/dist/modules/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  436. package/dist/modules/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  437. package/dist/modules/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  438. package/dist/modules/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  439. package/dist/modules/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  440. package/dist/modules/src/builtin/modules/matrix/index.d.ts +4 -0
  441. package/dist/modules/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  442. package/dist/modules/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  443. package/dist/modules/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  444. package/dist/modules/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  445. package/dist/modules/src/builtin/modules/number-theory/docs.d.ts +2 -0
  446. package/dist/modules/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  447. package/dist/modules/src/builtin/modules/number-theory/index.d.ts +4 -0
  448. package/dist/modules/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  449. package/dist/modules/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  450. package/dist/modules/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  451. package/dist/modules/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  452. package/dist/modules/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  453. package/dist/modules/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  454. package/dist/modules/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  455. package/dist/modules/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  456. package/dist/modules/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  457. package/dist/modules/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  458. package/dist/modules/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  459. package/dist/modules/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  460. package/dist/modules/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  461. package/dist/modules/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  462. package/dist/modules/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  463. package/dist/modules/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  464. package/dist/modules/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  465. package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +27 -0
  466. package/dist/modules/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  467. package/dist/modules/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  468. package/dist/modules/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  469. package/dist/modules/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  470. package/dist/modules/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  471. package/dist/modules/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  472. package/dist/modules/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  473. package/dist/modules/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  474. package/dist/modules/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  475. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  476. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  477. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  478. package/dist/modules/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  479. package/dist/modules/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  480. package/dist/modules/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  481. package/dist/modules/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  482. package/dist/modules/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  483. package/dist/modules/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  484. package/dist/modules/src/builtin/modules/random/docs.d.ts +2 -0
  485. package/dist/modules/src/builtin/modules/random/index.d.ts +2 -0
  486. package/dist/modules/src/builtin/modules/sequence/index.d.ts +2 -0
  487. package/dist/modules/src/builtin/modules/string/index.d.ts +2 -0
  488. package/dist/modules/src/builtin/modules/vector/bincount.d.ts +9 -0
  489. package/dist/modules/src/builtin/modules/vector/calcMad.d.ts +1 -0
  490. package/dist/modules/src/builtin/modules/vector/calcMean.d.ts +1 -0
  491. package/dist/modules/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  492. package/dist/modules/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  493. package/dist/modules/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  494. package/dist/modules/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  495. package/dist/modules/src/builtin/modules/vector/docs.d.ts +2 -0
  496. package/dist/modules/src/builtin/modules/vector/entropy.d.ts +8 -0
  497. package/dist/modules/src/builtin/modules/vector/histogram.d.ts +9 -0
  498. package/dist/modules/src/builtin/modules/vector/index.d.ts +2 -0
  499. package/dist/modules/src/builtin/modules/vector/mode.d.ts +6 -0
  500. package/dist/modules/src/builtin/modules/vector/outliers.d.ts +7 -0
  501. package/dist/modules/src/builtin/modules/vector/percentile.d.ts +7 -0
  502. package/dist/modules/src/builtin/modules/vector/quartiles.d.ts +1 -0
  503. package/dist/modules/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  504. package/dist/modules/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  505. package/dist/modules/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  506. package/dist/modules/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  507. package/dist/modules/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  508. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  509. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  510. package/dist/modules/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  511. package/dist/modules/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  512. package/dist/modules/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  513. package/dist/modules/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  514. package/dist/modules/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  515. package/dist/modules/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  516. package/dist/modules/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  517. package/dist/modules/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  518. package/dist/modules/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  519. package/dist/modules/src/builtin/normalExpressions/index.d.ts +8 -0
  520. package/dist/modules/src/builtin/specialExpressionTypes.d.ts +26 -0
  521. package/dist/modules/src/builtin/specialExpressions/and.d.ts +6 -0
  522. package/dist/modules/src/builtin/specialExpressions/array.d.ts +6 -0
  523. package/dist/modules/src/builtin/specialExpressions/block.d.ts +6 -0
  524. package/dist/modules/src/builtin/specialExpressions/cond.d.ts +6 -0
  525. package/dist/modules/src/builtin/specialExpressions/defined.d.ts +5 -0
  526. package/dist/modules/src/builtin/specialExpressions/effect.d.ts +5 -0
  527. package/dist/modules/src/builtin/specialExpressions/functions.d.ts +6 -0
  528. package/dist/modules/src/builtin/specialExpressions/if.d.ts +6 -0
  529. package/dist/modules/src/builtin/specialExpressions/import.d.ts +6 -0
  530. package/dist/modules/src/builtin/specialExpressions/let.d.ts +6 -0
  531. package/dist/modules/src/builtin/specialExpressions/loop.d.ts +6 -0
  532. package/dist/modules/src/builtin/specialExpressions/loops.d.ts +9 -0
  533. package/dist/modules/src/builtin/specialExpressions/match.d.ts +7 -0
  534. package/dist/modules/src/builtin/specialExpressions/object.d.ts +6 -0
  535. package/dist/modules/src/builtin/specialExpressions/or.d.ts +6 -0
  536. package/dist/modules/src/builtin/specialExpressions/parallel.d.ts +6 -0
  537. package/dist/modules/src/builtin/specialExpressions/perform.d.ts +6 -0
  538. package/dist/modules/src/builtin/specialExpressions/qq.d.ts +6 -0
  539. package/dist/modules/src/builtin/specialExpressions/race.d.ts +6 -0
  540. package/dist/modules/src/builtin/specialExpressions/recur.d.ts +5 -0
  541. package/dist/modules/src/builtin/specialExpressions/throw.d.ts +5 -0
  542. package/dist/modules/src/builtin/specialExpressions/try.d.ts +7 -0
  543. package/dist/modules/src/builtin/specialExpressions/unless.d.ts +6 -0
  544. package/dist/modules/src/builtin/utils.d.ts +6 -0
  545. package/dist/modules/src/bundler/index.d.ts +9 -0
  546. package/dist/modules/src/bundler/interface.d.ts +15 -0
  547. package/dist/modules/src/bundler.d.ts +3 -0
  548. package/dist/modules/src/constants/constants.d.ts +19 -0
  549. package/dist/modules/src/debug.d.ts +115 -0
  550. package/dist/modules/src/effects.d.ts +106 -0
  551. package/dist/modules/src/errors.d.ts +24 -0
  552. package/dist/modules/src/evaluator/ContextStack.d.ts +65 -0
  553. package/dist/modules/src/evaluator/effectRef.d.ts +27 -0
  554. package/dist/modules/src/evaluator/effectTypes.d.ts +79 -0
  555. package/dist/modules/src/evaluator/frames.d.ts +525 -0
  556. package/dist/modules/src/evaluator/interface.d.ts +14 -0
  557. package/dist/modules/src/evaluator/serialization.d.ts +45 -0
  558. package/dist/modules/src/evaluator/standardEffects.d.ts +35 -0
  559. package/dist/modules/src/evaluator/step.d.ts +159 -0
  560. package/dist/modules/src/evaluator/suspension.d.ts +53 -0
  561. package/dist/modules/src/evaluator/trampoline.d.ts +119 -0
  562. package/dist/modules/src/full.d.ts +17 -0
  563. package/dist/modules/src/getUndefinedSymbols/index.d.ts +7 -0
  564. package/dist/modules/src/index.d.ts +18 -0
  565. package/dist/modules/src/initReferenceData.d.ts +1 -0
  566. package/dist/modules/src/interface.d.ts +7 -0
  567. package/dist/modules/src/modules/assertion.d.ts +2 -0
  568. package/dist/modules/src/modules/bitwise.d.ts +2 -0
  569. package/dist/modules/src/modules/collection.d.ts +2 -0
  570. package/dist/modules/src/modules/convert.d.ts +2 -0
  571. package/dist/modules/src/modules/functional.d.ts +2 -0
  572. package/dist/modules/src/modules/grid.d.ts +2 -0
  573. package/dist/modules/src/modules/linear-algebra.d.ts +2 -0
  574. package/dist/modules/src/modules/math.d.ts +2 -0
  575. package/dist/modules/src/modules/matrix.d.ts +2 -0
  576. package/dist/modules/src/modules/number-theory.d.ts +2 -0
  577. package/dist/modules/src/modules/random.d.ts +2 -0
  578. package/dist/modules/src/modules/sequence.d.ts +2 -0
  579. package/dist/modules/src/modules/string.d.ts +2 -0
  580. package/dist/modules/src/modules/vector.d.ts +2 -0
  581. package/dist/modules/src/parser/ParserContext.d.ts +20 -0
  582. package/dist/modules/src/parser/getPrecedence.d.ts +3 -0
  583. package/dist/modules/src/parser/helpers.d.ts +19 -0
  584. package/dist/modules/src/parser/index.d.ts +5 -0
  585. package/dist/modules/src/parser/subParsers/parseArray.d.ts +3 -0
  586. package/dist/modules/src/parser/subParsers/parseBindingTarget.d.ts +8 -0
  587. package/dist/modules/src/parser/subParsers/parseCond.d.ts +4 -0
  588. package/dist/modules/src/parser/subParsers/parseDo.d.ts +3 -0
  589. package/dist/modules/src/parser/subParsers/parseExpression.d.ts +5 -0
  590. package/dist/modules/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  591. package/dist/modules/src/parser/subParsers/parseFunction.d.ts +4 -0
  592. package/dist/modules/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  593. package/dist/modules/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  594. package/dist/modules/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  595. package/dist/modules/src/parser/subParsers/parseLet.d.ts +4 -0
  596. package/dist/modules/src/parser/subParsers/parseLoop.d.ts +4 -0
  597. package/dist/modules/src/parser/subParsers/parseMatch.d.ts +4 -0
  598. package/dist/modules/src/parser/subParsers/parseNumber.d.ts +3 -0
  599. package/dist/modules/src/parser/subParsers/parseObject.d.ts +3 -0
  600. package/dist/modules/src/parser/subParsers/parseOperand.d.ts +3 -0
  601. package/dist/modules/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  602. package/dist/modules/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  603. package/dist/modules/src/parser/subParsers/parseString.d.ts +4 -0
  604. package/dist/modules/src/parser/subParsers/parseSymbol.d.ts +3 -0
  605. package/dist/modules/src/parser/subParsers/parseTry.d.ts +4 -0
  606. package/dist/modules/src/parser/types.d.ts +129 -0
  607. package/dist/modules/src/symbolPatterns.d.ts +2 -0
  608. package/dist/modules/src/testFramework/index.d.ts +15 -0
  609. package/dist/modules/src/tokenizer/minifyTokenStream.d.ts +4 -0
  610. package/dist/modules/src/tokenizer/operators.d.ts +12 -0
  611. package/dist/modules/src/tokenizer/reservedNames.d.ts +66 -0
  612. package/dist/modules/src/tokenizer/token.d.ts +84 -0
  613. package/dist/modules/src/tokenizer/tokenize.d.ts +8 -0
  614. package/dist/modules/src/tokenizer/tokenizers.d.ts +14 -0
  615. package/dist/modules/src/transformer/index.d.ts +2 -0
  616. package/dist/modules/src/typeGuards/annotatedArrays.d.ts +16 -0
  617. package/dist/modules/src/typeGuards/array.d.ts +9 -0
  618. package/dist/modules/src/typeGuards/astNode.d.ts +19 -0
  619. package/dist/modules/src/typeGuards/dvala.d.ts +26 -0
  620. package/dist/modules/src/typeGuards/dvalaFunction.d.ts +12 -0
  621. package/dist/modules/src/typeGuards/index.d.ts +7 -0
  622. package/dist/modules/src/typeGuards/number.d.ts +66 -0
  623. package/dist/modules/src/typeGuards/string.d.ts +15 -0
  624. package/dist/modules/src/untokenizer/index.d.ts +2 -0
  625. package/dist/modules/src/utils/arity.d.ts +10 -0
  626. package/dist/modules/src/utils/debug/debugTools.d.ts +1 -0
  627. package/dist/modules/src/utils/debug/getCodeMarker.d.ts +2 -0
  628. package/dist/modules/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  629. package/dist/modules/src/utils/docString/generateDocString.d.ts +2 -0
  630. package/dist/modules/src/utils/getAssertionError.d.ts +3 -0
  631. package/dist/modules/src/utils/index.d.ts +14 -0
  632. package/dist/modules/src/utils/maybePromise.d.ts +54 -0
  633. package/dist/modules/src/utils/symbols.d.ts +3 -0
  634. package/dist/modules/string.esm.js +2 -0
  635. package/dist/modules/string.esm.js.map +1 -0
  636. package/dist/modules/string.js +2 -0
  637. package/dist/modules/string.js.map +1 -0
  638. package/dist/modules/vector.esm.js +2 -0
  639. package/dist/modules/vector.esm.js.map +1 -0
  640. package/dist/modules/vector.js +2 -0
  641. package/dist/modules/vector.js.map +1 -0
  642. package/dist/reference/api.d.ts +75 -0
  643. package/dist/reference/datatype.d.ts +3 -0
  644. package/dist/reference/effect.d.ts +3 -0
  645. package/dist/reference/index.d.ts +191 -0
  646. package/dist/reference/shorthand.d.ts +3 -0
  647. package/dist/src/AutoCompleter/AutoCompleter.d.ts +25 -0
  648. package/dist/src/Dvala/Cache.d.ts +16 -0
  649. package/dist/src/Dvala/Dvala.d.ts +68 -0
  650. package/dist/src/allModules.d.ts +2 -0
  651. package/dist/src/builtin/bindingNode.d.ts +11 -0
  652. package/dist/src/builtin/core/array.d.ts +2 -0
  653. package/dist/src/builtin/core/assertion.d.ts +2 -0
  654. package/dist/src/builtin/core/bitwise.d.ts +2 -0
  655. package/dist/src/builtin/core/collection.d.ts +2 -0
  656. package/dist/src/builtin/core/functional.d.ts +2 -0
  657. package/dist/src/builtin/core/math.d.ts +2 -0
  658. package/dist/src/builtin/core/meta.d.ts +3 -0
  659. package/dist/src/builtin/core/misc.d.ts +2 -0
  660. package/dist/src/builtin/core/object.d.ts +2 -0
  661. package/dist/src/builtin/core/predicates.d.ts +2 -0
  662. package/dist/src/builtin/core/regexp.d.ts +2 -0
  663. package/dist/src/builtin/core/sequence.d.ts +2 -0
  664. package/dist/src/builtin/core/string.d.ts +2 -0
  665. package/dist/src/builtin/core/vector.d.ts +2 -0
  666. package/dist/src/builtin/index.d.ts +13 -0
  667. package/dist/src/builtin/interface.d.ts +113 -0
  668. package/dist/src/builtin/modules/assertion/docs.d.ts +2 -0
  669. package/dist/src/builtin/modules/assertion/index.d.ts +2 -0
  670. package/dist/src/builtin/modules/bitwise/index.d.ts +2 -0
  671. package/dist/src/builtin/modules/collection/index.d.ts +2 -0
  672. package/dist/src/builtin/modules/convert/index.d.ts +2 -0
  673. package/dist/src/builtin/modules/functional/index.d.ts +2 -0
  674. package/dist/src/builtin/modules/grid/docs.d.ts +2 -0
  675. package/dist/src/builtin/modules/grid/fromArray.d.ts +8 -0
  676. package/dist/src/builtin/modules/grid/index.d.ts +2 -0
  677. package/dist/src/builtin/modules/grid/transpose.d.ts +2 -0
  678. package/dist/src/builtin/modules/interface.d.ts +11 -0
  679. package/dist/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  680. package/dist/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  681. package/dist/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  682. package/dist/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  683. package/dist/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  684. package/dist/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  685. package/dist/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  686. package/dist/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  687. package/dist/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  688. package/dist/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  689. package/dist/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  690. package/dist/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  691. package/dist/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  692. package/dist/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  693. package/dist/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  694. package/dist/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  695. package/dist/src/builtin/modules/math/index.d.ts +2 -0
  696. package/dist/src/builtin/modules/matrix/docs.d.ts +2 -0
  697. package/dist/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  698. package/dist/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  699. package/dist/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  700. package/dist/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  701. package/dist/src/builtin/modules/matrix/helpers/diagonal.d.ts +1 -0
  702. package/dist/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  703. package/dist/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  704. package/dist/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  705. package/dist/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  706. package/dist/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  707. package/dist/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  708. package/dist/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  709. package/dist/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  710. package/dist/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  711. package/dist/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  712. package/dist/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  713. package/dist/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  714. package/dist/src/builtin/modules/matrix/index.d.ts +4 -0
  715. package/dist/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  716. package/dist/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  717. package/dist/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  718. package/dist/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  719. package/dist/src/builtin/modules/number-theory/docs.d.ts +2 -0
  720. package/dist/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  721. package/dist/src/builtin/modules/number-theory/index.d.ts +4 -0
  722. package/dist/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  723. package/dist/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  724. package/dist/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  725. package/dist/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  726. package/dist/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  727. package/dist/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  728. package/dist/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  729. package/dist/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  730. package/dist/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  731. package/dist/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  732. package/dist/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  733. package/dist/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  734. package/dist/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  735. package/dist/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  736. package/dist/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  737. package/dist/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  738. package/dist/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  739. package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +27 -0
  740. package/dist/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  741. package/dist/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  742. package/dist/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  743. package/dist/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  744. package/dist/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  745. package/dist/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  746. package/dist/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  747. package/dist/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  748. package/dist/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  749. package/dist/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  750. package/dist/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  751. package/dist/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  752. package/dist/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  753. package/dist/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  754. package/dist/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  755. package/dist/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  756. package/dist/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  757. package/dist/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  758. package/dist/src/builtin/modules/random/docs.d.ts +2 -0
  759. package/dist/src/builtin/modules/random/index.d.ts +2 -0
  760. package/dist/src/builtin/modules/sequence/index.d.ts +2 -0
  761. package/dist/src/builtin/modules/string/index.d.ts +2 -0
  762. package/dist/src/builtin/modules/vector/bincount.d.ts +9 -0
  763. package/dist/src/builtin/modules/vector/calcMad.d.ts +1 -0
  764. package/dist/src/builtin/modules/vector/calcMean.d.ts +1 -0
  765. package/dist/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  766. package/dist/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  767. package/dist/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  768. package/dist/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  769. package/dist/src/builtin/modules/vector/docs.d.ts +2 -0
  770. package/dist/src/builtin/modules/vector/entropy.d.ts +8 -0
  771. package/dist/src/builtin/modules/vector/histogram.d.ts +9 -0
  772. package/dist/src/builtin/modules/vector/index.d.ts +2 -0
  773. package/dist/src/builtin/modules/vector/mode.d.ts +6 -0
  774. package/dist/src/builtin/modules/vector/outliers.d.ts +7 -0
  775. package/dist/src/builtin/modules/vector/percentile.d.ts +7 -0
  776. package/dist/src/builtin/modules/vector/quartiles.d.ts +1 -0
  777. package/dist/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  778. package/dist/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  779. package/dist/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  780. package/dist/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  781. package/dist/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  782. package/dist/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  783. package/dist/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  784. package/dist/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  785. package/dist/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  786. package/dist/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  787. package/dist/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  788. package/dist/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  789. package/dist/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  790. package/dist/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  791. package/dist/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  792. package/dist/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  793. package/dist/src/builtin/normalExpressions/index.d.ts +8 -0
  794. package/dist/src/builtin/specialExpressionTypes.d.ts +26 -0
  795. package/dist/src/builtin/specialExpressions/and.d.ts +6 -0
  796. package/dist/src/builtin/specialExpressions/array.d.ts +6 -0
  797. package/dist/src/builtin/specialExpressions/block.d.ts +6 -0
  798. package/dist/src/builtin/specialExpressions/cond.d.ts +6 -0
  799. package/dist/src/builtin/specialExpressions/defined.d.ts +5 -0
  800. package/dist/src/builtin/specialExpressions/effect.d.ts +5 -0
  801. package/dist/src/builtin/specialExpressions/functions.d.ts +6 -0
  802. package/dist/src/builtin/specialExpressions/if.d.ts +6 -0
  803. package/dist/src/builtin/specialExpressions/import.d.ts +6 -0
  804. package/dist/src/builtin/specialExpressions/let.d.ts +6 -0
  805. package/dist/src/builtin/specialExpressions/loop.d.ts +6 -0
  806. package/dist/src/builtin/specialExpressions/loops.d.ts +9 -0
  807. package/dist/src/builtin/specialExpressions/match.d.ts +7 -0
  808. package/dist/src/builtin/specialExpressions/object.d.ts +6 -0
  809. package/dist/src/builtin/specialExpressions/or.d.ts +6 -0
  810. package/dist/src/builtin/specialExpressions/parallel.d.ts +6 -0
  811. package/dist/src/builtin/specialExpressions/perform.d.ts +6 -0
  812. package/dist/src/builtin/specialExpressions/qq.d.ts +6 -0
  813. package/dist/src/builtin/specialExpressions/race.d.ts +6 -0
  814. package/dist/src/builtin/specialExpressions/recur.d.ts +5 -0
  815. package/dist/src/builtin/specialExpressions/throw.d.ts +5 -0
  816. package/dist/src/builtin/specialExpressions/try.d.ts +7 -0
  817. package/dist/src/builtin/specialExpressions/unless.d.ts +6 -0
  818. package/dist/src/builtin/utils.d.ts +6 -0
  819. package/dist/src/bundler/index.d.ts +9 -0
  820. package/dist/src/bundler/interface.d.ts +15 -0
  821. package/dist/src/bundler.d.ts +3 -0
  822. package/dist/src/constants/constants.d.ts +19 -0
  823. package/dist/src/debug.d.ts +115 -0
  824. package/dist/src/effects.d.ts +106 -0
  825. package/dist/src/errors.d.ts +24 -0
  826. package/dist/src/evaluator/ContextStack.d.ts +65 -0
  827. package/dist/src/evaluator/effectRef.d.ts +27 -0
  828. package/dist/src/evaluator/effectTypes.d.ts +79 -0
  829. package/dist/src/evaluator/frames.d.ts +525 -0
  830. package/dist/src/evaluator/interface.d.ts +14 -0
  831. package/dist/src/evaluator/serialization.d.ts +45 -0
  832. package/dist/src/evaluator/standardEffects.d.ts +35 -0
  833. package/dist/src/evaluator/step.d.ts +159 -0
  834. package/dist/src/evaluator/suspension.d.ts +53 -0
  835. package/dist/src/evaluator/trampoline.d.ts +119 -0
  836. package/dist/src/full.d.ts +17 -0
  837. package/dist/src/getUndefinedSymbols/index.d.ts +7 -0
  838. package/dist/src/index.d.ts +18 -0
  839. package/dist/src/initReferenceData.d.ts +1 -0
  840. package/dist/src/interface.d.ts +7 -0
  841. package/dist/src/modules/assertion.d.ts +2 -0
  842. package/dist/src/modules/bitwise.d.ts +2 -0
  843. package/dist/src/modules/collection.d.ts +2 -0
  844. package/dist/src/modules/convert.d.ts +2 -0
  845. package/dist/src/modules/functional.d.ts +2 -0
  846. package/dist/src/modules/grid.d.ts +2 -0
  847. package/dist/src/modules/linear-algebra.d.ts +2 -0
  848. package/dist/src/modules/math.d.ts +2 -0
  849. package/dist/src/modules/matrix.d.ts +2 -0
  850. package/dist/src/modules/number-theory.d.ts +2 -0
  851. package/dist/src/modules/random.d.ts +2 -0
  852. package/dist/src/modules/sequence.d.ts +2 -0
  853. package/dist/src/modules/string.d.ts +2 -0
  854. package/dist/src/modules/vector.d.ts +2 -0
  855. package/dist/src/parser/ParserContext.d.ts +20 -0
  856. package/dist/src/parser/getPrecedence.d.ts +3 -0
  857. package/dist/src/parser/helpers.d.ts +19 -0
  858. package/dist/src/parser/index.d.ts +5 -0
  859. package/dist/src/parser/subParsers/parseArray.d.ts +3 -0
  860. package/dist/src/parser/subParsers/parseBindingTarget.d.ts +8 -0
  861. package/dist/src/parser/subParsers/parseCond.d.ts +4 -0
  862. package/dist/src/parser/subParsers/parseDo.d.ts +3 -0
  863. package/dist/src/parser/subParsers/parseExpression.d.ts +5 -0
  864. package/dist/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  865. package/dist/src/parser/subParsers/parseFunction.d.ts +4 -0
  866. package/dist/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  867. package/dist/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  868. package/dist/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  869. package/dist/src/parser/subParsers/parseLet.d.ts +4 -0
  870. package/dist/src/parser/subParsers/parseLoop.d.ts +4 -0
  871. package/dist/src/parser/subParsers/parseMatch.d.ts +4 -0
  872. package/dist/src/parser/subParsers/parseNumber.d.ts +3 -0
  873. package/dist/src/parser/subParsers/parseObject.d.ts +3 -0
  874. package/dist/src/parser/subParsers/parseOperand.d.ts +3 -0
  875. package/dist/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  876. package/dist/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  877. package/dist/src/parser/subParsers/parseString.d.ts +4 -0
  878. package/dist/src/parser/subParsers/parseSymbol.d.ts +3 -0
  879. package/dist/src/parser/subParsers/parseTry.d.ts +4 -0
  880. package/dist/src/parser/types.d.ts +129 -0
  881. package/dist/src/symbolPatterns.d.ts +2 -0
  882. package/dist/src/testFramework/index.d.ts +15 -0
  883. package/dist/src/tokenizer/minifyTokenStream.d.ts +4 -0
  884. package/dist/src/tokenizer/operators.d.ts +12 -0
  885. package/dist/src/tokenizer/reservedNames.d.ts +66 -0
  886. package/dist/src/tokenizer/token.d.ts +84 -0
  887. package/dist/src/tokenizer/tokenize.d.ts +8 -0
  888. package/dist/src/tokenizer/tokenizers.d.ts +14 -0
  889. package/dist/src/transformer/index.d.ts +2 -0
  890. package/dist/src/typeGuards/annotatedArrays.d.ts +16 -0
  891. package/dist/src/typeGuards/array.d.ts +9 -0
  892. package/dist/src/typeGuards/astNode.d.ts +19 -0
  893. package/dist/src/typeGuards/dvala.d.ts +26 -0
  894. package/dist/src/typeGuards/dvalaFunction.d.ts +12 -0
  895. package/dist/src/typeGuards/index.d.ts +7 -0
  896. package/dist/src/typeGuards/number.d.ts +66 -0
  897. package/dist/src/typeGuards/string.d.ts +15 -0
  898. package/dist/src/untokenizer/index.d.ts +2 -0
  899. package/dist/src/utils/arity.d.ts +10 -0
  900. package/dist/src/utils/debug/debugTools.d.ts +1 -0
  901. package/dist/src/utils/debug/getCodeMarker.d.ts +2 -0
  902. package/dist/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  903. package/dist/src/utils/docString/generateDocString.d.ts +2 -0
  904. package/dist/src/utils/getAssertionError.d.ts +3 -0
  905. package/dist/src/utils/index.d.ts +14 -0
  906. package/dist/src/utils/maybePromise.d.ts +54 -0
  907. package/dist/src/utils/symbols.d.ts +3 -0
  908. package/dist/testFramework.esm.js +2 -0
  909. package/dist/testFramework.esm.js.map +1 -0
  910. package/dist/testFramework.js +2 -0
  911. package/dist/testFramework.js.map +1 -0
  912. package/package.json +144 -16
  913. package/dist/index.d.ts +0 -2
  914. package/dist/index.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/debug/debugTools.ts","../../src/utils/symbols.ts","../../src/typeGuards/number.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/typeGuards/annotatedArrays.ts","../../src/utils/index.ts","../../src/utils/arity.ts","../../src/builtin/modules/matrix/docs.ts","../../src/builtin/modules/matrix/helpers/determinant.ts","../../src/builtin/modules/matrix/helpers/minor.ts","../../src/builtin/modules/matrix/helpers/adjugate.ts","../../src/builtin/modules/matrix/helpers/isSquare.ts","../../src/builtin/modules/matrix/helpers/isIdentity.ts","../../src/builtin/modules/matrix/helpers/matrixMultiply.ts","../../src/builtin/modules/matrix/index.ts","../../src/builtin/modules/matrix/helpers/inverse.ts","../../src/builtin/modules/matrix/helpers/cofactor.ts","../../src/builtin/modules/matrix/helpers/trace.ts","../../src/builtin/modules/matrix/helpers/isSymetric.ts","../../src/builtin/modules/matrix/helpers/isTriangular.ts","../../src/builtin/modules/matrix/helpers/isDiagonal.ts","../../src/builtin/modules/matrix/helpers/isOrthogonal.ts","../../src/builtin/modules/grid/transpose.ts","../../src/builtin/modules/matrix/helpers/band.ts","../../src/builtin/modules/matrix/helpers/isBanded.ts","../../src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.ts","../../src/builtin/modules/matrix/helpers/norm1.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getDvalaErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class DvalaError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getDvalaErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, DvalaError.prototype)\n this.name = 'DvalaError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends DvalaError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends DvalaError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends DvalaError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isDvalaError(error: unknown): error is DvalaError {\n return error instanceof DvalaError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'Builtin',\n 'SpecialBuiltin',\n 'NativeJsFunction',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, DvalaFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isDvalaFunction(func: unknown): func is DvalaFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isDvalaFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\nexport const EFFECT_SYMBOL = '^^ef^^'\n","import { DvalaError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new DvalaError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import { DvalaError } from '../errors'\nimport type { Any } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isNumber } from './number'\n\nconst annotatedArrays = new WeakSet<unknown[]>()\nconst vectors = new WeakSet<unknown[]>()\nconst notVectors = new WeakSet<unknown[]>()\nconst matrices = new WeakSet<unknown[]>()\nconst notMatrices = new WeakSet<unknown[]>()\nconst grids = new WeakSet<unknown[]>()\nconst notGrids = new WeakSet<unknown[]>()\n\nexport function annotate<T>(value: T): T {\n if (!Array.isArray(value)) {\n return value\n }\n if (annotatedArrays.has(value)) {\n return value\n }\n isVector(value)\n if (!isMatrix(value)) {\n isGrid(value)\n }\n\n return value\n}\nexport function isVector(vector: unknown): vector is number[] {\n if (!Array.isArray(vector)) {\n return false\n }\n\n if (vectors.has(vector)) {\n return true\n }\n if (notVectors.has(vector)) {\n return false\n }\n\n if (vector.every(elem => isNumber(elem))) {\n annotatedArrays.add(vector)\n vectors.add(vector)\n return true\n }\n notVectors.add(vector)\n return false\n}\n\nexport function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n if (!isVector(vector)) {\n throw new DvalaError(`Expected a vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is2dVector(vector: unknown): vector is [number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 2\n}\nexport function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number] {\n if (!is2dVector(vector)) {\n throw new DvalaError(`Expected a 2d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is3dVector(vector: unknown): vector is [number, number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 3\n}\nexport function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number] {\n if (!is3dVector(vector)) {\n throw new DvalaError(`Expected a 3d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n assertVector(vector, sourceCodeInfo)\n if (vector.length === 0) {\n throw new DvalaError(`Expected a non empty vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function isGrid(grid: unknown): grid is unknown[][] {\n if (!Array.isArray(grid)) {\n return false\n }\n if (grids.has(grid)) {\n return true\n }\n if (notGrids.has(grid)) {\n return false\n }\n if (grid.length === 0) {\n notGrids.add(grid)\n return false\n }\n if (!Array.isArray(grid[0])) {\n notGrids.add(grid)\n return false\n }\n const nbrOfCols = grid[0].length\n for (const row of grid.slice(1)) {\n if (!Array.isArray(row)) {\n notGrids.add(grid)\n return false\n }\n if (row.length !== nbrOfCols) {\n notGrids.add(grid)\n return false\n }\n }\n annotatedArrays.add(grid)\n grids.add(grid)\n return true\n}\n\nexport function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][] {\n if (!isGrid(grid)) {\n throw new DvalaError(`Expected a grid, but got ${grid}`, sourceCodeInfo)\n }\n}\n\nexport function isMatrix(matrix: unknown): matrix is number[][] {\n if (!Array.isArray(matrix)) {\n return false\n }\n if (matrices.has(matrix)) {\n return true\n }\n if (notMatrices.has(matrix)) {\n return false\n }\n if (matrix.length === 0) {\n notMatrices.add(matrix)\n return false\n }\n if (!Array.isArray(matrix[0]) || matrix[0].length === 0) {\n notMatrices.add(matrix)\n return false\n }\n const nbrOfCols = matrix[0].length\n for (const row of matrix) {\n if (!Array.isArray(row) || row.length !== nbrOfCols || row.some(cell => !isNumber(cell))) {\n notMatrices.add(matrix)\n return false\n }\n }\n annotatedArrays.add(matrix)\n grids.add(matrix)\n matrices.add(matrix)\n return true\n}\n\nexport function assertMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new DvalaError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n}\n\nexport function assertSquareMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new DvalaError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n if (matrix.length !== matrix[0]!.length) {\n throw new DvalaError(`Expected square matrix, but got ${matrix.length} and ${matrix[0]!.length}`, sourceCodeInfo)\n }\n}\n\nexport function isSquareMatrix(matrix: unknown): matrix is number[][] {\n if (!isMatrix(matrix)) {\n return false\n }\n if (matrix.length !== matrix[0]!.length) {\n return false\n }\n return true\n}\n","import type { Any, Coll, Obj } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { asAny, isColl, isObj, isRegularExpression } from '../typeGuards/dvala'\nimport { isNumber } from '../typeGuards/number'\nimport { asString, assertStringOrNumber } from '../typeGuards/string'\nimport { isUnknownRecord } from '../typeGuards'\nimport { DvalaError } from '../errors'\n\nexport function collHasKey(coll: unknown, key: string | number): boolean {\n if (!isColl(coll))\n return false\n\n if (typeof coll === 'string' || Array.isArray(coll)) {\n if (!isNumber(key, { integer: true }))\n return false\n\n return key >= 0 && key < coll.length\n }\n return !!Object.getOwnPropertyDescriptor(coll, key)\n}\n\nexport function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number {\n assertStringOrNumber(a, sourceCodeInfo)\n assertStringOrNumber(b, sourceCodeInfo)\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a < b ? -1 : a > b ? 1 : 0\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.sign((a) - (b))\n }\n throw new DvalaError(`Cannot compare values of different types: ${typeof a} and ${typeof b}`, sourceCodeInfo)\n}\n\nexport function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean {\n if (a === b)\n return true\n\n if (typeof a === 'number' && typeof b === 'number')\n return approxEqual(a, b)\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false\n\n for (let i = 0; i < a.length; i += 1) {\n if (!deepEqual(asAny(a[i], sourceCodeInfo), asAny(b[i], sourceCodeInfo), sourceCodeInfo))\n return false\n }\n return true\n }\n if (isRegularExpression(a) && isRegularExpression(b))\n return a.s === b.s && a.f === b.f\n\n if (isUnknownRecord(a) && isUnknownRecord(b)) {\n const aKeys = Object.keys(a)\n const bKeys = Object.keys(b)\n if (aKeys.length !== bKeys.length)\n return false\n\n for (let i = 0; i < aKeys.length; i += 1) {\n const key = asString(aKeys[i], sourceCodeInfo)\n if (!deepEqual(a[key], b[key], sourceCodeInfo))\n return false\n }\n return true\n }\n return false\n}\n\nexport function toNonNegativeInteger(num: number): number {\n return Math.max(0, Math.ceil(num))\n}\n\nexport function toAny(value: unknown): Any {\n return (value ?? null) as Any\n}\n\nfunction clone<T>(value: T): T {\n if (isObj(value)) {\n return Object.entries(value).reduce((result: Obj, entry) => {\n const [key, val] = entry\n result[key] = clone(val)\n return result\n }, {}) as T\n }\n if (Array.isArray(value))\n // eslint-disable-next-line ts/no-unsafe-return\n return value.map(item => clone(item)) as unknown as T\n\n return value\n}\n\nexport function cloneColl<T extends Coll>(value: T): T {\n return clone(value)\n}\n\nexport function joinSets<T>(...results: Set<T>[]): Set<T> {\n const result = new Set<T>()\n for (const symbols of results)\n symbols.forEach(symbol => result.add(symbol))\n\n return result\n}\n\nexport function addToSet<T>(target: Set<T>, source: Set<T>): void {\n source.forEach(symbol => target.add(symbol))\n}\n\nexport const EPSILON = 1e-10\n\nexport function approxEqual(a: number, b: number, epsilon: number = EPSILON): boolean {\n if (a === b) {\n return true\n }\n\n const diff = Math.abs(a - b)\n\n if (a === 0 || b === 0 || diff < epsilon) {\n // Use absolute error for values near zero\n return diff < epsilon\n }\n const absA = Math.abs(a)\n const absB = Math.abs(b)\n\n // Use relative error for larger values\n return diff / (absA + absB) < epsilon\n}\n\nexport function approxZero(value: number): boolean {\n return Math.abs(value) < EPSILON\n}\n\nexport function smartTrim(str: string, minIndent = 0): string {\n const lines = str.split('\\n')\n while (lines[0]?.match(/^\\s*$/)) {\n lines.shift() // Remove leading empty lines\n }\n while (lines[lines.length - 1]?.match(/^\\s*$/)) {\n lines.pop() // Remove trailing empty lines\n }\n const indent = lines.reduce((acc, line) => {\n if (line.match(/^\\s*$/))\n return acc // Skip empty lines\n const lineIndent = line.match(/^\\s*/)![0].length\n return Math.min(acc, lineIndent)\n }, Infinity)\n return lines.map(line => ' '.repeat(minIndent) + line.slice(indent)).join('\\n').trimEnd()\n}\n","import type { Arity } from '../builtin/interface'\nimport { DvalaError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/dvala'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new DvalaError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new DvalaError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import type { FunctionDocs } from '../../interface'\n\nexport const moduleDocs: Record<string, FunctionDocs> = {\n 'mul': {\n category: 'matrix',\n description: 'Multiplies two `matrices` using standard `matrix` multiplication based on **dot products** of rows and columns.',\n returns: {\n type: 'matrix',\n },\n args: {\n a: {\n type: 'matrix',\n },\n b: {\n type: 'matrix',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { mul } = import(matrix);\\nmul([[1, 2], [3, 4]], [[5, 6], [7, 8]])',\n 'let { mul } = import(matrix);\\nmul([[1, 2, 3], [4, 5, 6]], [[7, 8], [9, 10], [11, 12]])',\n ],\n seeAlso: ['matrix.det', 'matrix.inv'],\n },\n 'det': {\n category: 'matrix',\n description: 'Calculates the **determinant** of a square matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the determinant of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { det } = import(matrix);\\ndet([[1, 2], [3, 4]])',\n 'let { det } = import(matrix);\\ndet([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.inv', 'matrix.cofactor', 'matrix.adj', 'matrix.trace', 'matrix.rank', 'matrix.invertible?', 'matrix.mul', 'matrix.minor'],\n },\n 'inv': {\n category: 'matrix',\n description: 'Calculates the **inverse** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the inverse of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { inv } = import(matrix);\\ninv([[1, 2], [3, 4]])',\n 'let { inv } = import(matrix);\\ninv([[1, 2, 3], [4, 5, 7], [7, 8, 10]])',\n ],\n seeAlso: ['matrix.det', 'matrix.adj', 'matrix.invertible?', 'linear-algebra.solve', 'matrix.mul', 'matrix.orthogonal-matrix?'],\n },\n 'adj': {\n category: 'matrix',\n description: 'Calculates the **adjugate** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the adjugate of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { adj } = import(matrix);\\nadj([[1, 2], [3, 4]])',\n 'let { adj } = import(matrix);\\nadj([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { adj } = import(matrix);\\nadj([[1, 2, 3], [7, 8, 9], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.cofactor', 'matrix.det', 'matrix.inv'],\n },\n 'cofactor': {\n category: 'matrix',\n description: 'Calculates the **cofactor** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the cofactor of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { cofactor } = import(matrix);\\ncofactor([[1, 2], [3, 4]])',\n 'let { cofactor } = import(matrix);\\ncofactor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { cofactor } = import(matrix);\\ncofactor([[1, 2, 3], [7, 8, 9], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.adj', 'matrix.minor', 'matrix.det'],\n },\n 'minor': {\n category: 'matrix',\n description: 'Calculates the **minor** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the minor of.',\n },\n row: {\n type: 'integer',\n description: 'The row index of the element to calculate the minor for.',\n },\n col: {\n type: 'integer',\n description: 'The column index of the element to calculate the minor for.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n 'row',\n 'col',\n ],\n },\n ],\n examples: [\n 'let { minor } = import(matrix);\\nminor([[1, 2], [3, 4]], 0, 1)',\n 'let { minor } = import(matrix);\\nminor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1, 1)',\n ],\n seeAlso: ['matrix.cofactor', 'matrix.det'],\n },\n 'trace': {\n category: 'matrix',\n description: 'Calculates the **trace** of a square matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the trace of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { trace } = import(matrix);\\ntrace([[1, 2], [3, 4]])',\n 'let { trace } = import(matrix);\\ntrace([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.det', 'matrix.diagonal?'],\n },\n 'symmetric?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **symmetric**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for symmetry.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { symmetric? } = import(matrix);\\nsymmetric?([[1, 2], [2, 1]])',\n 'let { symmetric? } = import(matrix);\\nsymmetric?([[1, 2, 3], [2, 1, 4], [3, 4, 1]])',\n ],\n seeAlso: ['matrix.orthogonal-matrix?', 'matrix.diagonal?', 'matrix.square?', 'matrix.hilbert'],\n },\n 'triangular?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **triangular**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for triangularity.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { triangular? } = import(matrix);\\ntriangular?([[2, 0], [0, 1]])',\n 'let { triangular? } = import(matrix);\\ntriangular?([[1, 2, 3], [0, 4, 5], [0, 0, 6]])',\n ],\n seeAlso: ['matrix.upper-triangular?', 'matrix.lower-triangular?', 'matrix.diagonal?', 'matrix.banded?'],\n },\n 'upper-triangular?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **upper triangular**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for upper triangularity.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { upper-triangular? } = import(matrix);\\nupper-triangular?([[1, 2], [0, 3]])',\n 'let { upper-triangular? } = import(matrix);\\nupper-triangular?([[1, 2, 3], [0, 4, 5], [0, 0, 6]])',\n ],\n seeAlso: ['matrix.lower-triangular?', 'matrix.triangular?', 'matrix.diagonal?'],\n },\n 'lower-triangular?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **lower triangular**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for lower triangularity.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { lower-triangular? } = import(matrix);\\nlower-triangular?([[1, 0], [2, 3]])',\n 'let { lower-triangular? } = import(matrix);\\nlower-triangular?([[1, 0, 0], [2, 3, 0], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.upper-triangular?', 'matrix.triangular?', 'matrix.diagonal?'],\n },\n 'diagonal?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **diagonal**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for diagonal property.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { diagonal? } = import(matrix);\\ndiagonal?([[1, 0], [0, 2]])',\n 'let { diagonal? } = import(matrix);\\ndiagonal?([[1, 0, 0], [0, 2, 0], [0, 0, 3]])',\n 'let { diagonal? } = import(matrix);\\ndiagonal?([[1, 0, 0], [2, 2, 2], [0, 0, 3]])',\n ],\n seeAlso: ['matrix.identity?', 'matrix.symmetric?', 'matrix.triangular?', 'matrix.trace', 'matrix.upper-triangular?', 'matrix.lower-triangular?', 'matrix.band', 'matrix.banded?'],\n },\n 'square?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **square**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for square property.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { square? } = import(matrix);\\nsquare?([[1, 2], [3, 4]])',\n 'let { square? } = import(matrix);\\nsquare?([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { square? } = import(matrix);\\nsquare?([[1, 2, 3], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.symmetric?', 'matrix.identity?', 'matrix.invertible?'],\n },\n 'orthogonal-matrix?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **orthogonal**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for **orthogonality**.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { orthogonal-matrix? } = import(matrix);\\northogonal-matrix?([[1, 0], [0, 1]])',\n 'let { orthogonal-matrix? } = import(matrix);\\northogonal-matrix?([[1, 0], [0, -1]])',\n 'let { orthogonal-matrix? } = import(matrix);\\northogonal-matrix?([[1, 2], [3, 4]])',\n ],\n seeAlso: ['matrix.symmetric?', 'matrix.inv', 'matrix.identity?', 'linear-algebra.orthogonal?'],\n },\n 'identity?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is an **identity matrix**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for identity property.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { identity? } = import(matrix);\\nidentity?([[1, 0], [0, 1]])',\n 'let { identity? } = import(matrix);\\nidentity?([[1, 0, 0], [0, 1, 0], [0, 0, 1]])',\n 'let { identity? } = import(matrix);\\nidentity?([[1, 0, 0], [0, 1, 0], [0, 0, 0]])',\n ],\n seeAlso: ['matrix.diagonal?', 'matrix.square?', 'matrix.orthogonal-matrix?'],\n },\n 'invertible?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **invertible**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for invertibility.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { invertible? } = import(matrix);\\ninvertible?([[1, 2], [3, 4]])',\n 'let { invertible? } = import(matrix);\\ninvertible?([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { invertible? } = import(matrix);\\ninvertible?([[1, 2], [2, 4]])',\n ],\n seeAlso: ['matrix.det', 'matrix.inv', 'matrix.rank', 'matrix.square?'],\n },\n 'hilbert': {\n category: 'matrix',\n description: 'Generates a **Hilbert matrix** of size `n`.',\n returns: {\n type: 'matrix',\n },\n args: {\n n: {\n type: 'integer',\n description: 'The size of the Hilbert matrix.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'n',\n ],\n },\n ],\n examples: [\n 'let { hilbert } = import(matrix);\\nhilbert(3)',\n 'let { hilbert } = import(matrix);\\nhilbert(4)',\n ],\n seeAlso: ['matrix.vandermonde', 'matrix.symmetric?'],\n },\n 'vandermonde': {\n category: 'matrix',\n description: 'Generates a **Vandermonde matrix** from a vector.',\n returns: {\n type: 'matrix',\n },\n args: {\n v: {\n type: 'vector',\n description: 'The vector to generate the Vandermonde matrix from.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'v',\n ],\n },\n ],\n examples: [\n 'let { vandermonde } = import(matrix);\\nvandermonde([1, 2, 3])',\n 'let { vandermonde } = import(matrix);\\nvandermonde([1, 0, 1])',\n ],\n seeAlso: ['matrix.hilbert', 'matrix.band'],\n },\n 'band': {\n category: 'matrix',\n description: 'Generates a **banded matrix** of size `n` with lower band index `lband` and upper band index `uband`.',\n returns: {\n type: 'matrix',\n },\n args: {\n n: {\n type: 'integer',\n description: 'The size of the banded matrix.',\n },\n lband: {\n type: 'integer',\n description: 'The lower band index.',\n },\n uband: {\n type: 'integer',\n description: 'The upper band index.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'n',\n 'lband',\n 'uband',\n ],\n },\n ],\n examples: [\n 'let { band } = import(matrix);\\nband(3, 1, 1)',\n 'let { band } = import(matrix);\\nband(4, 1, 2)',\n ],\n seeAlso: ['matrix.banded?', 'matrix.diagonal?', 'matrix.vandermonde'],\n },\n 'banded?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **banded** with lower band index `lband` and upper band index `uband`.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for **banded** property.',\n },\n lband: {\n type: 'integer',\n description: 'The lower band index.',\n },\n uband: {\n type: 'integer',\n description: 'The upper band index.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n 'lband',\n 'uband',\n ],\n },\n ],\n examples: [\n 'let { banded? } = import(matrix);\\nbanded?([\\n [1, 1, 1, 0],\\n [1, 1, 1, 1],\\n [1, 1, 1, 1],\\n [0, 1, 1, 1],\\n], 2, 2)',\n 'let { banded? } = import(matrix);\\nbanded?([\\n [1, 1, 1, 0],\\n [1, 1, 1, 1],\\n [1, 1, 1, 1],\\n [0, 1, 1, 1],\\n], 1, 1)',\n ],\n seeAlso: ['matrix.band', 'matrix.triangular?', 'matrix.diagonal?'],\n },\n 'rank': {\n category: 'matrix',\n description: 'Calculates the **rank** of a matrix using **Gaussian elimination**.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the rank of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { rank } = import(matrix);\\nrank([[1, 0, 0], [0, 1, 0], [0, 0, 1]])',\n 'let { rank } = import(matrix);\\nrank([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { rank } = import(matrix);\\nrank([[2, 4, 6], [3, 6, 9], [4, 8, 12]])',\n ],\n seeAlso: ['matrix.det', 'matrix.invertible?', 'linear-algebra.rref'],\n },\n 'frobenius-norm': {\n category: 'matrix',\n description: 'Calculates the **Frobenius norm** of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the Frobenius norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { frobenius-norm } = import(matrix);\\nfrobenius-norm([[1, 2], [3, 4]])',\n 'let { frobenius-norm } = import(matrix);\\nfrobenius-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.one-norm', 'matrix.inf-norm', 'matrix.max-norm'],\n },\n 'one-norm': {\n category: 'matrix',\n description: 'Calculates the **one-norm** (column norm) of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the one-norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { one-norm } = import(matrix);\\none-norm([[1, 2], [3, 4]])',\n 'let { one-norm } = import(matrix);\\none-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.frobenius-norm', 'matrix.inf-norm', 'matrix.max-norm'],\n },\n 'inf-norm': {\n category: 'matrix',\n description: 'Calculates the **infinity norm** of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the infinity norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { inf-norm } = import(matrix);\\ninf-norm([[1, 2], [3, 4]])',\n 'let { inf-norm } = import(matrix);\\ninf-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.frobenius-norm', 'matrix.one-norm', 'matrix.max-norm'],\n },\n 'max-norm': {\n category: 'matrix',\n description: 'Calculates the **max norm** of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the max norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { max-norm } = import(matrix);\\nmax-norm([[1, 2], [3, 4]])',\n 'let { max-norm } = import(matrix);\\nmax-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.frobenius-norm', 'matrix.one-norm', 'matrix.inf-norm'],\n },\n}\n","import { approxZero } from '../../../../utils'\n\n/**\n * Calculates the determinant of a matrix using Gaussian Elimination\n * @param matrix A square matrix represented as a 2D array\n * @returns The determinant of the matrix\n */\nexport function determinant(matrix: number[][]): number {\n // First, make a deep copy of the matrix to avoid modifying the original\n const n = matrix.length\n const A: number[][] = []\n\n for (let i = 0; i < n; i++) {\n A[i] = [...matrix[i]!]\n }\n\n // Handle special cases for small matrices\n if (n === 1) {\n return A[0]![0]!\n }\n\n if (n === 2) {\n return A[0]![0]! * A[1]![1]! - A[0]![1]! * A[1]![0]!\n }\n\n // For larger matrices, use Gaussian elimination\n let sign = 1 // Track sign changes from row swaps\n\n // Perform Gaussian elimination to get an upper triangular matrix\n for (let i = 0; i < n - 1; i += 1) {\n // Find pivot (maximum element in current column)\n let maxRow = i\n\n for (let j = i + 1; j < n; j += 1) {\n if (Math.abs(A[j]![i]!) > Math.abs(A[maxRow]![i]!)) {\n maxRow = j\n }\n }\n\n // If the pivot is zero, the determinant is zero\n if (approxZero(A[maxRow]![i]!)) {\n return 0\n }\n\n // Swap rows if necessary\n if (maxRow !== i) {\n [A[i], A[maxRow]] = [A[maxRow]!, A[i]!] // ES6 array destructuring for swap\n sign = -sign // Each row swap changes the sign\n }\n\n // Eliminate entries below the pivot\n for (let j = i + 1; j < n; j += 1) {\n const factor = A[j]![i]! / A[i]![i]!\n\n // Subtract (factor * pivot row) from current row\n for (let k = i; k < n; k++) {\n A[j]![k]! -= factor * A[i]![k]!\n }\n }\n }\n\n // Calculate determinant as the product of diagonal elements\n let det = sign\n for (let i = 0; i < n; i++) {\n det *= A[i]![i]!\n }\n\n return det\n}\n","export function minor(matrix: number[][], row: number, col: number): number[][] {\n const n = matrix.length\n const result: number[][] = []\n\n for (let i = 0; i < n; i++) {\n if (i !== row) {\n const minorRow: number[] = []\n for (let j = 0; j < n; j++) {\n if (j !== col) {\n minorRow.push(matrix[i]![j]!)\n }\n }\n result.push(minorRow)\n }\n }\n\n return result\n}\n","import { determinant } from './determinant'\nimport { minor } from './minor'\n\nexport function adjugate(matrix: number[][]): number[][] {\n const n = matrix.length\n const adj: number[][] = []\n for (let i = 0; i < n; i++) {\n adj[i] = []\n for (let j = 0; j < n; j++) {\n const min = minor(matrix, j, i)\n const sign = (-1) ** (i + j)\n const cofactor = sign * determinant(min)\n adj[i]![j] = cofactor\n }\n }\n return adj\n}\n","export function isSquare(matrix: number[][]): boolean {\n return matrix.length === matrix[0]!.length\n}\n","import { approxEqual, approxZero } from '../../../../utils'\nimport { isSquare } from './isSquare'\n\nexport function isIdentity(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const n = matrix.length\n\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < n; j++) {\n if (i === j) {\n if (!approxEqual(matrix[i]![j]!, 1)) {\n return false\n }\n }\n else {\n if (!approxZero(matrix[i]![j]!)) {\n return false\n }\n }\n }\n }\n\n return true\n}\n","/**\n * Performs cache-optimized matrix multiplication.\n * @param A The first input matrix (m x n)\n * @param B The second input matrix (n x p)\n * @returns The result matrix C (m x p) where C = A × B\n */\nexport function matrixMultiply(A: number[][], B: number[][]): number[][] {\n // Check if matrices can be multiplied\n if (A.length === 0 || B.length === 0 || A[0]!.length !== B.length) {\n throw new Error('Matrix dimensions do not match for multiplication')\n }\n\n const m = A.length // Number of rows in A\n const n = A[0]!.length // Number of columns in A / Number of rows in B\n const p = B[0]!.length // Number of columns in B\n\n // Initialize result matrix C with zeros\n const C: number[][] = (Array(m).fill(0) as number[]).map(() => Array(p).fill(0) as number[])\n\n // Perform multiplication with cache-optimized loop order (i-k-j)\n for (let i = 0; i < m; i++) {\n for (let k = 0; k < n; k++) {\n const aik = A[i]![k]! // Cache this value to avoid repeated lookups\n for (let j = 0; j < p; j++) {\n C[i]![j]! += aik * B[k]![j]!\n }\n }\n }\n\n return C\n}\n","import { DvalaError } from '../../../errors'\nimport { assertMatrix, assertSquareMatrix, assertVector, isSquareMatrix } from '../../../typeGuards/annotatedArrays'\nimport { assertNumber } from '../../../typeGuards/number'\nimport { approxZero } from '../../../utils'\nimport { toFixedArity } from '../../../utils/arity'\nimport type { BuiltinNormalExpressions } from '../../../builtin/interface'\nimport type { DvalaModule } from '../interface'\nimport { gaussJordanElimination } from '../linear-algebra/helpers/gaussJordanElimination'\nimport { moduleDocs } from './docs'\nimport { adjugate } from './helpers/adjugate'\nimport { band } from './helpers/band'\nimport { cofactor } from './helpers/cofactor'\nimport { determinant } from './helpers/determinant'\nimport { inverse } from './helpers/inverse'\nimport { isBanded } from './helpers/isBanded'\nimport { isDiagonal } from './helpers/isDiagonal'\nimport { isIdentity } from './helpers/isIdentity'\nimport { isOrthogonal } from './helpers/isOrthogonal'\nimport { isSquare } from './helpers/isSquare'\nimport { isSymetric } from './helpers/isSymetric'\nimport { isTriangular, isTriangularLower, isTriangularUpper } from './helpers/isTriangular'\nimport { matrixMultiply } from './helpers/matrixMultiply'\nimport { minor } from './helpers/minor'\nimport { norm1 } from './helpers/norm1'\nimport { trace } from './helpers/trace'\n\nexport const matrixNormalExpression: BuiltinNormalExpressions = {\n 'mul': {\n evaluate: ([matrix1, matrix2], sourceCodeInfo): number[][] => {\n assertMatrix(matrix1, sourceCodeInfo)\n assertMatrix(matrix2, sourceCodeInfo)\n try {\n return matrixMultiply(matrix1, matrix2)\n }\n catch (error) {\n throw new DvalaError(`The number of columns in the first matrix must be equal to the number of rows in the second matrix, but got ${matrix1[0]!.length} and ${matrix2.length}`, sourceCodeInfo)\n }\n },\n arity: toFixedArity(2),\n },\n 'det': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return determinant(matrix)\n },\n arity: toFixedArity(1),\n },\n 'inv': {\n evaluate: ([matrix], sourceCodeInfo): number[][] => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n const result = inverse(matrix)\n if (result === null) {\n throw new DvalaError('The matrix must be invertible', sourceCodeInfo)\n }\n return result\n },\n arity: toFixedArity(1),\n },\n 'adj': {\n evaluate: ([matrix], sourceCodeInfo): number[][] => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return adjugate(matrix)\n },\n arity: toFixedArity(1),\n },\n 'cofactor': {\n evaluate: ([matrix], sourceCodeInfo): number[][] => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return cofactor(matrix)\n },\n arity: toFixedArity(1),\n },\n 'minor': {\n evaluate: ([matrix, row, col], sourceCodeInfo): number[][] => {\n assertMatrix(matrix, sourceCodeInfo)\n assertNumber(row, sourceCodeInfo, { integer: true, nonNegative: true, lte: matrix.length })\n assertNumber(col, sourceCodeInfo, { integer: true, nonNegative: true, lte: matrix[0]!.length })\n\n return minor(matrix, row, col)\n },\n arity: toFixedArity(3),\n },\n 'trace': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return trace(matrix)\n },\n arity: toFixedArity(1),\n },\n 'symmetric?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isSymetric(matrix)\n },\n arity: toFixedArity(1),\n },\n 'triangular?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isTriangular(matrix)\n },\n arity: toFixedArity(1),\n },\n 'upper-triangular?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isTriangularUpper(matrix)\n },\n arity: toFixedArity(1),\n },\n 'lower-triangular?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isTriangularLower(matrix)\n },\n arity: toFixedArity(1),\n },\n 'diagonal?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isDiagonal(matrix)\n },\n arity: toFixedArity(1),\n },\n 'square?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isSquare(matrix)\n },\n arity: toFixedArity(1),\n },\n 'orthogonal-matrix?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isOrthogonal(matrix)\n },\n arity: toFixedArity(1),\n },\n 'identity?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isIdentity(matrix)\n },\n arity: toFixedArity(1),\n },\n 'invertible?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n if (!isSquareMatrix(matrix)) {\n return false\n }\n return !approxZero(determinant(matrix))\n },\n arity: toFixedArity(1),\n },\n 'hilbert': {\n evaluate: ([size], sourceCodeInfo): number[][] => {\n assertNumber(size, sourceCodeInfo, { integer: true, positive: true })\n const result: number[][] = []\n for (let i = 0; i < size; i += 1) {\n const row: number[] = []\n for (let j = 0; j < size; j += 1) {\n row.push(1 / (i + j + 1))\n }\n result.push(row)\n }\n return result\n },\n arity: toFixedArity(1),\n },\n 'vandermonde': {\n evaluate: ([vector], sourceCodeInfo): number[][] => {\n assertVector(vector, sourceCodeInfo)\n const result: number[][] = []\n for (let i = 0; i < vector.length; i += 1) {\n const row: number[] = []\n for (let j = 0; j < vector.length; j += 1) {\n row.push((vector[i]!) ** j)\n }\n result.push(row)\n }\n return result\n },\n arity: toFixedArity(1),\n },\n 'band': {\n evaluate: ([n, lband, uband], sourceCodeInfo): number[][] => {\n assertNumber(n, sourceCodeInfo, { integer: true, positive: true })\n assertNumber(lband, sourceCodeInfo, { integer: true, nonNegative: true, lt: n })\n assertNumber(uband, sourceCodeInfo, { integer: true, nonNegative: true, lte: n })\n return band(n, lband, uband)\n },\n arity: toFixedArity(3),\n },\n 'banded?': {\n evaluate: ([matrix, lband, uband], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n const maxBand = Math.max(matrix.length, matrix[0]!.length)\n assertNumber(lband, sourceCodeInfo, { integer: true, nonNegative: true, lt: maxBand })\n assertNumber(uband, sourceCodeInfo, { integer: true, nonNegative: true, lt: maxBand })\n return isBanded(matrix, lband, uband)\n },\n arity: toFixedArity(3),\n },\n 'rank': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n const [, result] = gaussJordanElimination(matrix)\n return result\n },\n arity: toFixedArity(1),\n },\n // Frobenius norm\n 'frobenius-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return Math.sqrt(matrix.reduce((sum, row) => sum + row.reduce((rowSum, cell) => rowSum + cell * cell, 0), 0))\n },\n arity: toFixedArity(1),\n },\n // one-norm (column norm)\n 'one-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return norm1(matrix)\n },\n arity: toFixedArity(1),\n },\n // Infinity norm\n 'inf-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return matrix.reduce((max, row) => Math.max(max, row.reduce((sum, cell) => sum + Math.abs(cell), 0)), 0)\n },\n arity: toFixedArity(1),\n },\n // Max norm\n 'max-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return matrix.reduce((maxVal, row) => {\n const rowMax = row.reduce((max, val) => Math.max(max, Math.abs(val)), 0)\n return Math.max(maxVal, rowMax)\n }, 0)\n },\n arity: toFixedArity(1),\n },\n}\n\nfor (const [key, docs] of Object.entries(moduleDocs)) {\n if (matrixNormalExpression[key])\n matrixNormalExpression[key].docs = docs\n}\n\nexport const matrixModule: DvalaModule = {\n name: 'matrix',\n functions: matrixNormalExpression,\n}\n","/**\n * Calculate the inverse of a matrix using the adjugate method\n * @param matrix The input matrix\n * @returns The inverse matrix or null if the matrix is not invertible\n */\n\nimport { approxZero } from '../../../../utils'\nimport { adjugate } from './adjugate'\nimport { determinant } from './determinant'\n\nexport function inverse(matrix: number[][]): number[][] | null {\n const n = matrix.length\n\n // Special case for 1x1 matrix - handle it directly\n if (n === 1) {\n const element = matrix[0]![0]!\n if (approxZero(element)) {\n return null // Not invertible\n }\n return [[1 / element]]\n }\n\n // Calculate determinant\n const det = determinant(matrix)\n\n // Check if matrix is invertible\n if (approxZero(det)) {\n return null // Matrix is not invertible\n }\n\n // Get the adjugate matrix\n const adj = adjugate(matrix)\n\n // Calculate the inverse: inverse = adjugate / determinant\n const inverseMatrix: number[][] = []\n for (let i = 0; i < n; i++) {\n inverseMatrix[i] = []\n for (let j = 0; j < n; j++) {\n inverseMatrix[i]![j] = adj[i]![j]! / det\n }\n }\n\n return inverseMatrix\n}\n","import { determinant } from './determinant'\nimport { minor } from './minor'\n\nexport function cofactor(matrix: number[][]): number[][] {\n const n = matrix.length\n const cofactors: number[][] = []\n\n // Create a new matrix to store cofactors\n for (let i = 0; i < n; i++) {\n cofactors[i] = []\n for (let j = 0; j < n; j++) {\n // Get the minor by removing row i and column j\n const min = minor(matrix, i, j)\n const sign = (-1) ** (i + j)\n cofactors[i]![j] = sign * determinant(min)\n }\n }\n\n return cofactors\n}\n","/**\n * Calculates the trace of a square matrix.\n * The trace is defined as the sum of the elements on the main diagonal.\n *\n * @param matrix - A 2D array representing a square matrix.\n * @returns The trace of the matrix.\n */\nexport function trace(matrix: number[][]): number {\n return matrix.reduce((sum, row, i) => sum + row[i]!, 0)\n}\n","import { isSquare } from './isSquare'\n\n/**\n * Checks if a given matrix is symmetric.\n * A matrix is symmetric if it is square and its transpose is equal to itself.\n *\n * @param matrix - A 2D array representing the matrix.\n * @returns `true` if the matrix is symmetric, otherwise `false`.\n */\nexport function isSymetric(matrix: number[][]): boolean {\n const rows = matrix.length\n\n // Check if the matrix is square\n if (!isSquare(matrix)) {\n return false\n }\n\n // Check symmetry\n for (let i = 0; i < rows; i += 1) {\n for (let j = 0; j < i; j += 1) {\n if (matrix[i]![j]! !== matrix[j]![i]!) {\n return false\n }\n }\n }\n\n return true\n}\n","import { isSquare } from './isSquare'\n\n/**\n * Determines whether a given matrix is triangular.\n *\n * A triangular matrix is a square matrix where all elements\n * below or above the main diagonal are zero. This function\n * checks if the matrix is square and symmetric.\n *\n * @param matrix - A two-dimensional array of numbers representing the matrix.\n * @returns `true` if the matrix is triangular, otherwise `false`.\n */\nexport function isTriangular(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n\n const rows = matrix.length\n\n let isUpperTriangular = true\n let isLowerTriangular = true\n\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < rows; j++) {\n if (i > j && matrix[i]![j] !== 0) {\n isUpperTriangular = false\n if (!isLowerTriangular) {\n return false\n }\n }\n if (i < j && matrix[i]![j] !== 0) {\n isLowerTriangular = false\n }\n }\n }\n\n return isUpperTriangular || isLowerTriangular\n}\n\nexport function isTriangularUpper(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const rows = matrix.length\n\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < i; j++) {\n if (matrix[i]![j] !== 0) {\n return false\n }\n }\n }\n\n return true\n}\n\nexport function isTriangularLower(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const rows = matrix.length\n\n // Check if the matrix is square\n if (!matrix.every(row => row.length === rows)) {\n return false\n }\n\n for (let i = 0; i < rows; i++) {\n for (let j = i + 1; j < rows; j++) {\n if (matrix[i]![j] !== 0) {\n return false\n }\n }\n }\n\n return true\n}\n","import { isSquare } from './isSquare'\n\n/**\n * Checks if a given matrix is diagonal.\n *\n * A matrix is considered diagonal if it is square (i.e., the number of rows equals the number of columns)\n * and all elements outside the main diagonal are zero.\n *\n * @param matrix - A two-dimensional array of numbers representing the matrix to check.\n * @returns `true` if the matrix is diagonal, otherwise `false`.\n */\nexport function isDiagonal(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const rows = matrix.length\n\n for (let i = 0; i < rows; i += 1) {\n for (let j = 0; j < rows; j += 1) {\n if (i !== j && matrix[i]![j] !== 0) {\n return false\n }\n }\n }\n\n return true\n}\n","import { transpose } from '../../../modules/grid/transpose'\nimport { matrixMultiply } from './matrixMultiply'\nimport { isIdentity } from './isIdentity'\nimport { isSquare } from './isSquare'\n\nexport function isOrthogonal(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n\n // Calculate matrix transpose\n const transposed = transpose(matrix)\n\n // Check if matrix * transpose = Identity\n const product = matrixMultiply(matrix, transposed)\n\n // Check if the product is an identity matrix\n return isIdentity(product)\n}\n","import type { Any } from '../../../interface'\n\nexport function transpose<T extends Any>(grid: T[][]): T[][] {\n const result: T[][] = []\n\n for (let i = 0; i < grid[0]!.length; i += 1) {\n const row: T[] = []\n for (let j = 0; j < grid.length; j += 1) {\n row.push(grid[j]![i]!)\n }\n result.push(row)\n }\n return result\n}\n","/**\n * Creates a band matrix with specified lower and upper bandwidths\n *\n * @param n Size of the square matrix\n * @param lband Lower bandwidth (number of non-zero diagonals below main diagonal)\n * @param uband Upper bandwidth (number of non-zero diagonals above main diagonal)\n * @returns A 2D array representing the band matrix with 1s in the band and 0s elsewhere\n */\nexport function band(n: number, lband: number, uband: number): number[][] {\n // Create an n×n matrix filled with zeros\n const matrix: number[][] = Array.from({ length: n }, () => Array.from({ length: n }, () => 0))\n\n // Fill the band with 1s\n for (let i = 0; i < n; i++) {\n for (let j = Math.max(0, i - lband); j <= Math.min(n - 1, i + uband); j++) {\n matrix[i]![j] = 1\n }\n }\n\n return matrix\n}\n","/**\n * Checks if a matrix is banded with the given lower and upper bandwidth.\n * A matrix is banded if all non-zero elements are within 'lower' diagonals\n * below the main diagonal and 'upper' diagonals above the main diagonal.\n *\n * @param matrix - The matrix to check, represented as a 2D array of numbers\n * @param lower - Number of non-zero diagonals below the main diagonal\n * @param upper - Number of non-zero diagonals above the main diagonal\n * @returns true if the matrix is banded with the given parameters, false otherwise\n */\nexport function isBanded(matrix: number[][], lower: number, upper: number): boolean {\n const rows = matrix.length\n const cols = matrix[0]!.length\n\n // Check each element in the matrix\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n // If we find a non-zero element outside the band, return false\n if (matrix[i]![j] !== 0 && (i - j > lower || j - i > upper)) {\n return false\n }\n }\n }\n\n // All elements outside the band are zero\n return true\n}\n","import { approxZero } from '../../../../utils'\n\n/**\n * Performs Gauss-Jordan elimination on a matrix, transforming it to reduced row echelon form\n *\n * @param matrix - The input matrix\n * @returns A tuple containing the reduced row echelon form matrix and the rank\n */\nexport function gaussJordanElimination(matrix: number[][]): [number[][], number] {\n // Create a copy of the matrix to avoid modifying the original\n const m = matrix.map(row => [...row])\n const rows = m.length\n const cols = m[0]!.length\n\n let rank = 0\n let rowsProcessed = 0\n\n // Row reduction to reduced row echelon form\n for (let col = 0; col < cols; col++) {\n // Find the pivot\n let pivotRow = -1\n\n for (let row = rowsProcessed; row < rows; row++) {\n if (!approxZero(m[row]![col]!)) {\n pivotRow = row\n break\n }\n }\n\n if (pivotRow === -1)\n continue // No pivot in this column\n\n // Increase rank\n rank += 1\n\n // Swap rows\n if (pivotRow !== rowsProcessed) {\n [m[pivotRow], m[rowsProcessed]] = [m[rowsProcessed]!, m[pivotRow]!]\n }\n\n // Get the pivot value\n const pivotValue = m[rowsProcessed]![col]!\n\n // Normalize the pivot row (always, for RREF)\n for (let j = col; j < cols; j++) {\n m[rowsProcessed]![j]! /= pivotValue\n }\n\n // Eliminate above and below (full Gauss-Jordan)\n for (let row = 0; row < rows; row++) {\n if (row !== rowsProcessed && !approxZero(m[row]![col]!)) {\n const factor = m[row]![col]!\n for (let j = col; j < cols; j++) {\n m[row]![j]! -= factor * m[rowsProcessed]![j]!\n }\n }\n }\n\n rowsProcessed++\n if (rowsProcessed === rows)\n break\n }\n\n return [m, rank]\n}\n","// Assuming a matrix is represented as a 2D array\nexport function norm1(matrix: number[][]): number {\n const numRows = matrix.length\n const numCols = matrix[0]!.length\n\n let maxColSum = 0\n\n // Iterate through each column\n for (let j = 0; j < numCols; j += 1) {\n let colSum = 0\n\n // Sum the absolute values of all elements in this column\n for (let i = 0; i < numRows; i += 1) {\n colSum += Math.abs(matrix[i]![j]!)\n }\n\n // Update the maximum column sum if necessary\n maxColSum = Math.max(maxColSum, colSum)\n }\n\n return maxColSum\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","DvalaError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getDvalaErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","isDvalaFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","anyValue","getSourceCodeInfo","annotatedArrays","WeakSet","vectors","notVectors","matrices","notMatrices","grids","assertVector","vector","every","elem","add","isVector","isMatrix","matrix","nbrOfCols","row","some","cell","assertMatrix","assertSquareMatrix","approxEqual","a","b","epsilon","diff","abs","approxZero","toFixedArity","arity","min","moduleDocs","mul","category","description","returns","args","variants","argumentNames","examples","seeAlso","det","m","inv","adj","cofactor","minor","col","trace","hilbert","n","vandermonde","v","band","lband","uband","rank","determinant","A","i","maxRow","j","factor","k","result","minorRow","push","adjugate","isSquare","isIdentity","matrixMultiply","B","p","C","fill","map","aik","matrixNormalExpression","evaluate","matrix1","matrix2","error","element","inverseMatrix","inverse","cofactors","reduce","sum","rows","isSymetric","isUpperTriangular","isLowerTriangular","isTriangular","isTriangularUpper","isTriangularLower","isDiagonal","grid","transpose","isOrthogonal","isSquareMatrix","size","from","maxBand","lower","upper","cols","isBanded","rowsProcessed","pivotRow","pivotValue","gaussJordanElimination","sqrt","rowSum","numRows","numCols","maxColSum","colSum","norm1","maxVal","rowMax","val","docs","entries","matrixModule","functions"],"mappings":"aAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAmBC,MACdX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA8BD,EAAiBf,GAC7C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIjB,EAAeE,SACbH,EAAcC,IAExC,CAoBUoB,CAAqBL,EAASf,IACpCqB,KAAKT,aAAeG,EACpBM,KAAKrB,eAAiBA,EACtBsB,OAAOC,eAAeF,KAAMX,EAAWc,WACvCH,KAAKI,KAAO,YACb,CAEM,aAAA1B,GACL,OAAOsB,KAAKrB,gBAAkBD,EAAcsB,KAAKrB,eAClD,EC5CI,MAAM0B,EAAY,CACvBC,OAAQ,EACRC,OAAQ,EACRC,iBAAkB,EAClBC,kBAAmB,EACnBC,kBAAmB,EACnBC,oBAAqB,EACrBC,qBAAsB,EACtBC,eAAgB,EAChBC,QAAS,EACTC,OAAQ,IAGJC,EAAe,IAAIC,IAAIhB,OAAOiB,OAAOb,IAa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,KAAS1L,OAAO2L,QAAQ3F,GACnC8C,EAAuB/G,KACzB+G,EAAuB/G,GAAK2J,KAAOA,GAG1B,MAAAE,EAA4B,CACvCzL,KAAM,SACN0L,UAAW/C"}
@@ -0,0 +1,2 @@
1
+ function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,r=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(r,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(r,n){const o=r instanceof Error?r.message:`${r}`;super(function(t,r){if(!r)return t;const n=`${r.position.line}:${r.position.column}`;return`${t}${r.filePath?`\n${r.filePath}:${n}`:`\nLocation ${n}`}\n${r.code}\n${e(r)}`}(o,n)),this.shortMessage=o,this.sourceCodeInfo=n,Object.setPrototypeOf(this,t.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const r={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},n=new Set(Object.values(r));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","Builtin","SpecialBuiltin","NativeJsFunction","Module"]);const i="^^fn^^",a="^^re^^",s="^^ef^^";function m(e){return null!==e&&"object"==typeof e&&(i in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&o.has(t)));var t}function u(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&n.has(t));var t}function h(e){return m(e)?`<function ${e.name||"λ"}>`:u(e)?`${t=e[0],Object.keys(r).find(e=>r[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function c(e,t){return e?.sourceCodeInfo??t}function l(e,t={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(t.integer&&!Number.isInteger(e))&&(!(t.finite&&!Number.isFinite(e))&&((!t.zero||0===e)&&((!t.nonZero||0!==e)&&(!(t.positive&&e<=0)&&(!(t.negative&&e>=0)&&(!(t.nonPositive&&e>0)&&(!(t.nonNegative&&e<0)&&(!("number"==typeof t.gt&&e<=t.gt)&&(!("number"==typeof t.gte&&e<t.gte)&&(!("number"==typeof t.lt&&e>=t.lt)&&!("number"==typeof t.lte&&e>t.lte)))))))))))))}function p(e,r,n={}){if(!l(e,n))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),r=e.integer?"integer":"number",n=e.finite?"finite":"",o=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,n,r,o].filter(e=>!!e).join(" ")}(n)}, got ${h(e)}.`,c(e,r))}const y=new WeakSet,b=new WeakSet,g=new WeakSet;function f(e,r){if(!function(e){return!(!Array.isArray(e)||!b.has(e)&&(g.has(e)||(e.every(e=>l(e))?(y.add(e),b.add(e),0):(g.add(e),1))))}(e))throw new t(`Expected a vector, but got ${e}`,r)}function d(e,r,n){return new t(`Expected ${e}, got ${h(r)}.`,c(r,n))}function q(e,t){if(!Array.isArray(e))throw d("array",e,t)}function v(e){return null!==e&&"object"==typeof e&&!!e[i]}function k(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||v(e)||(t=e,null!==t&&"object"==typeof t&&t[a])||function(e){return null!==e&&"object"==typeof e&&!!e[s]}(e));var t}function w(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||k(e)}function x(e,t){if(!function(e){return"number"==typeof e||!!w(e)||!!v(e)}(e))throw d("FunctionLike",e,t)}function A(e){return{min:e,max:e}}const N={"abundant-seq":{category:"number-theory",description:"Generates the abundant numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { abundant-seq } = import(number-theory);\nabundant-seq(1)","let { abundant-seq } = import(number-theory);\nabundant-seq(5)"],seeAlso:["number-theory.abundant-nth","number-theory.abundant-take-while","number-theory.abundant?","number-theory.deficient-seq","number-theory.perfect-seq"]},"abundant-take-while":{category:"number-theory",description:"Generates the abundant numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { abundant-take-while } = import(number-theory);\nabundant-take-while(-> $ < 100)"],seeAlso:["number-theory.abundant-seq","number-theory.abundant-nth","number-theory.abundant?"]},"abundant-nth":{category:"number-theory",description:"Generates the nth term of the abundant numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the number in the sequence."}},variants:[{argumentNames:["n"]}],examples:["let { abundant-nth } = import(number-theory);\nabundant-nth(1)","let { abundant-nth } = import(number-theory);\nabundant-nth(5)"],seeAlso:["number-theory.abundant-seq","number-theory.abundant-take-while","number-theory.abundant?"]},"abundant?":{category:"number-theory",description:"Checks if a number is abundant.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { abundant? } = import(number-theory);\nabundant?(12)","let { abundant? } = import(number-theory);\nabundant?(15)"],seeAlso:["number-theory.abundant-seq","number-theory.abundant-nth","number-theory.deficient?","number-theory.perfect?","number-theory.sigma","number-theory.divisors","number-theory.abundant-take-while"]},"arithmetic-seq":{category:"number-theory",description:"Generates the arithmetic sequence for a given $start, $step, and $length.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["start","step","length"]}],examples:["let { arithmetic-seq } = import(number-theory);\narithmetic-seq(3, 2, 2)","let { arithmetic-seq } = import(number-theory);\narithmetic-seq(2, 3, 2)","let { arithmetic-seq } = import(number-theory);\narithmetic-seq(1, 2, 2)","let { arithmetic-seq } = import(number-theory);\narithmetic-seq(1, 1.5, 12)"],seeAlso:["number-theory.arithmetic-nth","number-theory.arithmetic-take-while","number-theory.arithmetic?","number-theory.geometric-seq"]},"arithmetic-take-while":{category:"number-theory",description:"Generates the arithmetic sequence while a condition is met.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},takeWhile:{type:"function",description:"A function that takes a number and an index and returns a boolean."}},variants:[{argumentNames:["start","step","takeWhile"]}],examples:["let { arithmetic-take-while } = import(number-theory);\narithmetic-take-while(1, 0.25, -> $ < 3)"],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-nth","number-theory.arithmetic?"]},"arithmetic-nth":{category:"number-theory",description:"Generates the nth term of the arithmetic sequence.",returns:{type:"integer"},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["start","step","n"]}],examples:["let { arithmetic-nth } = import(number-theory);\narithmetic-nth(3, 2, 2)","let { arithmetic-nth } = import(number-theory);\narithmetic-nth(2, 3, 2)","let { arithmetic-nth } = import(number-theory);\narithmetic-nth(1, 2, 2)","let { arithmetic-nth } = import(number-theory);\narithmetic-nth(1, 1.5, 12)"],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-take-while","number-theory.arithmetic?"]},"arithmetic?":{category:"number-theory",description:"Checks if a number is part of the arithmetic sequence.",returns:{type:"boolean"},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["start","step","n"]}],examples:["let { arithmetic? } = import(number-theory);\narithmetic?(3, 2, 2)","let { arithmetic? } = import(number-theory);\narithmetic?(2, 3, 2)","let { arithmetic? } = import(number-theory);\narithmetic?(1, 2, 2)","let { arithmetic? } = import(number-theory);\narithmetic?(1, 1.5, 12)"],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-nth","number-theory.geometric?","number-theory.arithmetic-take-while"]},"bell-seq":{category:"number-theory",description:"Generates the Bell sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 22 (the maximum length of the pre-calculated bell numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { bell-seq } = import(number-theory);\nbell-seq(5)","let { bell-seq } = import(number-theory);\nbell-seq(10)","let { bell-seq } = import(number-theory);\nbell-seq()"],seeAlso:["number-theory.bell-nth","number-theory.bell-take-while","number-theory.bell?","number-theory.catalan-seq","number-theory.stirling-second","number-theory.stirling-first"]},"bell-take-while":{category:"number-theory",description:"Generates the Bell sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { bell-take-while } = import(number-theory);\nbell-take-while(-> $ < 1000)"],seeAlso:["number-theory.bell-seq","number-theory.bell-nth","number-theory.bell?"]},"bell-nth":{category:"number-theory",description:"Generates the nth term of the Bell sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { bell-nth } = import(number-theory);\nbell-nth(5)","let { bell-nth } = import(number-theory);\nbell-nth(10)"],seeAlso:["number-theory.bell-seq","number-theory.bell-take-while","number-theory.bell?"]},"bell?":{category:"number-theory",description:"Checks if a number is in the Bell sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { bell? } = import(number-theory);\nbell?(1)","let { bell? } = import(number-theory);\nbell?(27644437)","let { bell? } = import(number-theory);\nbell?(27644436)"],seeAlso:["number-theory.bell-seq","number-theory.bell-nth","number-theory.catalan?","number-theory.bell-take-while"]},"bernoulli-seq":{category:"number-theory",description:"Generates the Bernoulli sequence up to a specified length.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { bernoulli-seq } = import(number-theory);\nbernoulli-seq(5)","let { bernoulli-seq } = import(number-theory);\nbernoulli-seq(10)"],seeAlso:["number-theory.bernoulli-nth","number-theory.bernoulli-take-while"]},"bernoulli-take-while":{category:"number-theory",description:"Generates the Bernoulli sequence while a condition is met.",returns:{type:"number",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { bernoulli-take-while } = import(number-theory);\nbernoulli-take-while(-> abs($) < 100)"],seeAlso:["number-theory.bernoulli-seq","number-theory.bernoulli-nth"]},"bernoulli-nth":{category:"number-theory",description:"Generates the nth term of the Bernoulli sequence.",returns:{type:"number"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { bernoulli-nth } = import(number-theory);\nbernoulli-nth(5)","let { bernoulli-nth } = import(number-theory);\nbernoulli-nth(10)","let { bernoulli-nth } = import(number-theory);\nbernoulli-nth(23)"],seeAlso:["number-theory.bernoulli-seq","number-theory.bernoulli-take-while"]},"catalan-seq":{category:"number-theory",description:"Generates the Catalan sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 30 (the maximum length of the pre-calculated catalan numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { catalan-seq } = import(number-theory);\ncatalan-seq(5)","let { catalan-seq } = import(number-theory);\ncatalan-seq(10)","let { catalan-seq } = import(number-theory);\ncatalan-seq()"],seeAlso:["number-theory.catalan-nth","number-theory.catalan-take-while","number-theory.catalan?","number-theory.bell-seq"]},"catalan-take-while":{category:"number-theory",description:"Generates the Catalan sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { catalan-take-while } = import(number-theory);\ncatalan-take-while(-> $ < 1000)"],seeAlso:["number-theory.catalan-seq","number-theory.catalan-nth","number-theory.catalan?"]},"catalan-nth":{category:"number-theory",description:"Generates the nth term of the Catalan sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { catalan-nth } = import(number-theory);\ncatalan-nth(5)","let { catalan-nth } = import(number-theory);\ncatalan-nth(10)"],seeAlso:["number-theory.catalan-seq","number-theory.catalan-take-while","number-theory.catalan?"]},"catalan?":{category:"number-theory",description:"Determines if a number is in the Catalan sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { catalan? } = import(number-theory);\ncatalan?(5)","let { catalan? } = import(number-theory);\ncatalan?(10)"],seeAlso:["number-theory.catalan-seq","number-theory.catalan-nth","number-theory.bell?","number-theory.catalan-take-while"]},"collatz-seq":{category:"number-theory",description:"Generates the collatz sequence starting from a given integer.",returns:{type:"integer",array:!0},args:{start:{type:"integer",description:"The starting integer for the collatz sequence."}},variants:[{argumentNames:["start"]}],examples:["let { collatz-seq } = import(number-theory);\ncollatz-seq(3)","let { collatz-seq } = import(number-theory);\ncollatz-seq(11)"],seeAlso:["number-theory.juggler-seq"]},"composite-seq":{category:"number-theory",description:"Generates the composite sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { composite-seq } = import(number-theory);\ncomposite-seq(1)","let { composite-seq } = import(number-theory);\ncomposite-seq(2)","let { composite-seq } = import(number-theory);\ncomposite-seq(10)"],seeAlso:["number-theory.composite-nth","number-theory.composite-take-while","number-theory.composite?","number-theory.prime-seq"]},"composite-take-while":{category:"number-theory",description:"Generates the composite sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { composite-take-while } = import(number-theory);\ncomposite-take-while(-> $ < 50)"],seeAlso:["number-theory.composite-seq","number-theory.composite-nth","number-theory.composite?"]},"composite-nth":{category:"number-theory",description:"Generates the nth term of the composite sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the composite number to retrieve."}},variants:[{argumentNames:["n"]}],examples:["let { composite-nth } = import(number-theory);\ncomposite-nth(1)","let { composite-nth } = import(number-theory);\ncomposite-nth(2)","let { composite-nth } = import(number-theory);\ncomposite-nth(10)"],seeAlso:["number-theory.composite-seq","number-theory.composite-take-while","number-theory.composite?"]},"composite?":{category:"number-theory",description:"Determines if a number is composite.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { composite? } = import(number-theory);\ncomposite?(4)","let { composite? } = import(number-theory);\ncomposite?(5)","let { composite? } = import(number-theory);\ncomposite?(11)"],seeAlso:["number-theory.composite-seq","number-theory.composite-nth","number-theory.prime?","number-theory.prime-factors","number-theory.composite-take-while"]},"deficient-seq":{category:"number-theory",description:"Generates the deficient numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { deficient-seq } = import(number-theory);\ndeficient-seq(1)","let { deficient-seq } = import(number-theory);\ndeficient-seq(5)"],seeAlso:["number-theory.deficient-nth","number-theory.deficient-take-while","number-theory.deficient?","number-theory.abundant-seq","number-theory.perfect-seq"]},"deficient-take-while":{category:"number-theory",description:"Generates the deficient numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { deficient-take-while } = import(number-theory);\ndeficient-take-while(-> $ < 100)"],seeAlso:["number-theory.deficient-seq","number-theory.deficient-nth","number-theory.deficient?"]},"deficient-nth":{category:"number-theory",description:"Generates the nth term of the deficient numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the number in the sequence."}},variants:[{argumentNames:["n"]}],examples:["let { deficient-nth } = import(number-theory);\ndeficient-nth(5)","let { deficient-nth } = import(number-theory);\ndeficient-nth(12)"],seeAlso:["number-theory.deficient-seq","number-theory.deficient-take-while","number-theory.deficient?"]},"deficient?":{category:"number-theory",description:"Checks if a number is deficient.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { deficient? } = import(number-theory);\ndeficient?(12)","let { deficient? } = import(number-theory);\ndeficient?(15)"],seeAlso:["number-theory.deficient-seq","number-theory.deficient-nth","number-theory.abundant?","number-theory.perfect?","number-theory.sigma","number-theory.divisors","number-theory.deficient-take-while"]},"factorial-seq":{category:"number-theory",description:"Generates the factorial sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 19 (the maximum length of the pre-calculated factorial numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { factorial-seq } = import(number-theory);\nfactorial-seq(1)","let { factorial-seq } = import(number-theory);\nfactorial-seq(2)","let { factorial-seq } = import(number-theory);\nfactorial-seq(3)","let { factorial-seq } = import(number-theory);\nfactorial-seq(4)","let { factorial-seq } = import(number-theory);\nfactorial-seq(5)","let { factorial-seq } = import(number-theory);\nfactorial-seq(10)"],seeAlso:["number-theory.factorial-nth","number-theory.factorial-take-while","number-theory.factorial?","number-theory.factorial"]},"factorial-take-while":{category:"number-theory",description:"Generates the factorial sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { factorial-take-while } = import(number-theory);\nfactorial-take-while(-> $ < 1000)"],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial?"]},"factorial-nth":{category:"number-theory",description:"Generates the nth term of the factorial sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { factorial-nth } = import(number-theory);\nfactorial-nth(1)","let { factorial-nth } = import(number-theory);\nfactorial-nth(2)","let { factorial-nth } = import(number-theory);\nfactorial-nth(3)","let { factorial-nth } = import(number-theory);\nfactorial-nth(4)","let { factorial-nth } = import(number-theory);\nfactorial-nth(5)","let { factorial-nth } = import(number-theory);\nfactorial-nth(10)"],seeAlso:["number-theory.factorial-seq","number-theory.factorial-take-while","number-theory.factorial?","number-theory.factorial"]},"factorial?":{category:"number-theory",description:"Checks if a number is in the factorial sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { factorial? } = import(number-theory);\nfactorial?(1)","let { factorial? } = import(number-theory);\nfactorial?(2)","let { factorial? } = import(number-theory);\nfactorial?(3)","let { factorial? } = import(number-theory);\nfactorial?(4)","let { factorial? } = import(number-theory);\nfactorial?(5)","let { factorial? } = import(number-theory);\nfactorial?(6)","let { factorial? } = import(number-theory);\nfactorial?(7)","let { factorial? } = import(number-theory);\nfactorial?(8)","let { factorial? } = import(number-theory);\nfactorial?(9)","let { factorial? } = import(number-theory);\nfactorial?(3628800)"],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial","number-theory.factorial-take-while"]},"fibonacci-seq":{category:"number-theory",description:"Generates the fibonacci sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 79 (the maximum length of the pre-calculated Fibonacci numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { fibonacci-seq } = import(number-theory);\nfibonacci-seq(1)","let { fibonacci-seq } = import(number-theory);\nfibonacci-seq(2)","let { fibonacci-seq } = import(number-theory);\nfibonacci-seq()"],seeAlso:["number-theory.fibonacci-nth","number-theory.fibonacci-take-while","number-theory.fibonacci?","number-theory.lucas-seq","number-theory.tribonacci-seq","number-theory.pell-seq","number-theory.padovan-seq"]},"fibonacci-take-while":{category:"number-theory",description:"Generates the fibonacci sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { fibonacci-take-while } = import(number-theory);\nfibonacci-take-while(-> $ < 100)"],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-nth","number-theory.fibonacci?"]},"fibonacci-nth":{category:"number-theory",description:"Generates the nth term of the fibonacci sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { fibonacci-nth } = import(number-theory);\nfibonacci-nth(5)","let { fibonacci-nth } = import(number-theory);\nfibonacci-nth(50)"],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-take-while","number-theory.fibonacci?"]},"fibonacci?":{category:"number-theory",description:"Determines if a number is in the fibonacci sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { fibonacci? } = import(number-theory);\nfibonacci?(0)","let { fibonacci? } = import(number-theory);\nfibonacci?(1)","let { fibonacci? } = import(number-theory);\nfibonacci?(2)","let { fibonacci? } = import(number-theory);\nfibonacci?(3)","let { fibonacci? } = import(number-theory);\nfibonacci?(4)","let { fibonacci? } = import(number-theory);\nfibonacci?(5)","let { fibonacci? } = import(number-theory);\nfibonacci?(6)","let { fibonacci? } = import(number-theory);\nfibonacci?(7)","let { fibonacci? } = import(number-theory);\nfibonacci?(8)","let { fibonacci? } = import(number-theory);\nfibonacci?(9)"],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-nth","number-theory.lucas?","number-theory.fibonacci-take-while","number-theory.tribonacci?","number-theory.padovan?","number-theory.pell?"]},"geometric-seq":{category:"number-theory",description:"Generates the geometric sequence for a given $start, $ratio, and $length.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["start","ratio","length"]}],examples:["let { geometric-seq } = import(number-theory);\ngeometric-seq(3, 2, 2)","let { geometric-seq } = import(number-theory);\ngeometric-seq(2, 3, 2)","let { geometric-seq } = import(number-theory);\ngeometric-seq(1, 2, 2)","let { geometric-seq } = import(number-theory);\ngeometric-seq(1, 1.5, 12)"],seeAlso:["number-theory.geometric-nth","number-theory.geometric-take-while","number-theory.geometric?","number-theory.arithmetic-seq"]},"geometric-take-while":{category:"number-theory",description:"Generates the geometric sequence while a condition is met.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},takeWhile:{type:"function",description:"A function that takes a number and an index and returns a boolean."}},variants:[{argumentNames:["start","ratio","takeWhile"]}],examples:["let { geometric-take-while } = import(number-theory);\ngeometric-take-while(1, 1.5, -> $ < 10)"],seeAlso:["number-theory.geometric-seq","number-theory.geometric-nth","number-theory.geometric?"]},"geometric-nth":{category:"number-theory",description:"Generates the nth term of the geometric sequence.",returns:{type:"integer"},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["start","ratio","n"]}],examples:["let { geometric-nth } = import(number-theory);\ngeometric-nth(3, 2, 2)","let { geometric-nth } = import(number-theory);\ngeometric-nth(2, 3, 2)","let { geometric-nth } = import(number-theory);\ngeometric-nth(1, 2, 2)","let { geometric-nth } = import(number-theory);\ngeometric-nth(1, 1.5, 4)"],seeAlso:["number-theory.geometric-seq","number-theory.geometric-take-while","number-theory.geometric?"]},"geometric?":{category:"number-theory",description:"Checks if a number is in the geometric sequence.",returns:{type:"boolean"},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},n:{type:"number",description:"The number to check."}},variants:[{argumentNames:["start","ratio","n"]}],examples:["let { geometric? } = import(number-theory);\ngeometric?(1, 2, 1)","let { geometric? } = import(number-theory);\ngeometric?(2, 3, 2)","let { geometric? } = import(number-theory);\ngeometric?(3, 2, 2)","let { geometric? } = import(number-theory);\ngeometric?(1, 1.5, 2.25)","let { geometric? } = import(number-theory);\ngeometric?(1, 1.5, -4)"],seeAlso:["number-theory.geometric-seq","number-theory.geometric-nth","number-theory.arithmetic?","number-theory.geometric-take-while"]},"golomb-seq":{category:"number-theory",description:"Generates the Golomb sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { golomb-seq } = import(number-theory);\ngolomb-seq(5)","let { golomb-seq } = import(number-theory);\ngolomb-seq(20)"],seeAlso:["number-theory.golomb-nth","number-theory.golomb-take-while","number-theory.golomb?","number-theory.recaman-seq"]},"golomb-take-while":{category:"number-theory",description:"Generates the Golomb sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { golomb-take-while } = import(number-theory);\ngolomb-take-while(-> $ <= 10)"],seeAlso:["number-theory.golomb-seq","number-theory.golomb-nth","number-theory.golomb?"]},"golomb-nth":{category:"number-theory",description:"Generates the nth term of the Golomb sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { golomb-nth } = import(number-theory);\ngolomb-nth(5)","let { golomb-nth } = import(number-theory);\ngolomb-nth(1000)"],seeAlso:["number-theory.golomb-seq","number-theory.golomb-take-while","number-theory.golomb?"]},"golomb?":{category:"number-theory",description:"Checks if a number is in the Golomb sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { golomb? } = import(number-theory);\ngolomb?(1)","let { golomb? } = import(number-theory);\ngolomb?(2)","let { golomb? } = import(number-theory);\ngolomb?(3345)","let { golomb? } = import(number-theory);\ngolomb?(67867864)"],seeAlso:["number-theory.golomb-seq","number-theory.golomb-nth","number-theory.golomb-take-while"]},"happy-seq":{category:"number-theory",description:"Generates the happy sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 20 (the maximum length of the pre-calculated happy numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { happy-seq } = import(number-theory);\nhappy-seq(1)","let { happy-seq } = import(number-theory);\nhappy-seq(2)","let { happy-seq } = import(number-theory);\nhappy-seq(20)"],seeAlso:["number-theory.happy-nth","number-theory.happy-take-while","number-theory.happy?","number-theory.lucky-seq"]},"happy-take-while":{category:"number-theory",description:"Generates the happy sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { happy-take-while } = import(number-theory);\nhappy-take-while(-> $ < 100)"],seeAlso:["number-theory.happy-seq","number-theory.happy-nth","number-theory.happy?"]},"happy-nth":{category:"number-theory",description:"Generates the nth term of the happy sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the happy number to return."}},variants:[{argumentNames:["n"]}],examples:["let { happy-nth } = import(number-theory);\nhappy-nth(1)","let { happy-nth } = import(number-theory);\nhappy-nth(2)","let { happy-nth } = import(number-theory);\nhappy-nth(20)"],seeAlso:["number-theory.happy-seq","number-theory.happy-take-while","number-theory.happy?"]},"happy?":{category:"number-theory",description:"Determines if a number is a happy number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { happy? } = import(number-theory);\nhappy?(1)","let { happy? } = import(number-theory);\nhappy?(2)","let { happy? } = import(number-theory);\nhappy?(100)"],seeAlso:["number-theory.happy-seq","number-theory.happy-nth","number-theory.happy-take-while"]},"juggler-seq":{category:"number-theory",description:"Generates the Juggler sequence starting from a given integer.",returns:{type:"integer",array:!0},args:{start:{type:"integer",description:"The starting integer for the Juggler sequence."}},variants:[{argumentNames:["start"]}],examples:["let { juggler-seq } = import(number-theory);\njuggler-seq(3)","let { juggler-seq } = import(number-theory);\njuggler-seq(5)"],seeAlso:["number-theory.collatz-seq"]},"look-and-say-seq":{category:"number-theory",description:"Generates the Look-and-Say sequence up to a specified length.",returns:{type:"string",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { look-and-say-seq } = import(number-theory);\nlook-and-say-seq(5)"],seeAlso:["number-theory.look-and-say-nth","number-theory.look-and-say-take-while","number-theory.look-and-say?"]},"look-and-say-take-while":{category:"number-theory",description:"Generates the Look-and-Say sequence while a condition is met.",returns:{type:"string",array:!0},args:{takeWhile:{type:"function",description:"A function that takes a string and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { look-and-say-take-while } = import(number-theory);\nlook-and-say-take-while((term, index) -> count(term) < 10)","let { look-and-say-take-while } = import(number-theory);\nlook-and-say-take-while(-> $2 <= 10)"],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-nth","number-theory.look-and-say?"]},"look-and-say-nth":{category:"number-theory",description:"Generates the nth term of the Look-and-Say sequence.",returns:{type:"string"},args:{n:{type:"integer",description:"The index of the term in the sequence."}},variants:[{argumentNames:["n"]}],examples:["let { look-and-say-nth } = import(number-theory);\nlook-and-say-nth(5)"],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-take-while","number-theory.look-and-say?"]},"look-and-say?":{category:"number-theory",description:"Checks if a string is a valid Look-and-Say term.",returns:{type:"boolean"},args:{term:{type:"string",description:"The term to check."}},variants:[{argumentNames:["term"]}],examples:['let { look-and-say? } = import(number-theory);\nlook-and-say?("111221")','let { look-and-say? } = import(number-theory);\nlook-and-say?("123")'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-nth","number-theory.look-and-say-take-while"]},"lucas-seq":{category:"number-theory",description:"Generates the lucas sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 77 (the maximum length of the pre-calculated Lucas numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { lucas-seq } = import(number-theory);\nlucas-seq(1)","let { lucas-seq } = import(number-theory);\nlucas-seq(2)","let { lucas-seq } = import(number-theory);\nlucas-seq()"],seeAlso:["number-theory.lucas-nth","number-theory.lucas-take-while","number-theory.lucas?","number-theory.fibonacci-seq"]},"lucas-take-while":{category:"number-theory",description:"Generates the lucas sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { lucas-take-while } = import(number-theory);\nlucas-take-while(-> $ < 100)"],seeAlso:["number-theory.lucas-seq","number-theory.lucas-nth","number-theory.lucas?"]},"lucas-nth":{category:"number-theory",description:"Generates the nth term of the lucas sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { lucas-nth } = import(number-theory);\nlucas-nth(1)","let { lucas-nth } = import(number-theory);\nlucas-nth(2)","let { lucas-nth } = import(number-theory);\nlucas-nth(10)"],seeAlso:["number-theory.lucas-seq","number-theory.lucas-take-while","number-theory.lucas?"]},"lucas?":{category:"number-theory",description:"Determines if a number is in the lucas sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { lucas? } = import(number-theory);\nlucas?(1)","let { lucas? } = import(number-theory);\nlucas?(2)","let { lucas? } = import(number-theory);\nlucas?(10)"],seeAlso:["number-theory.lucas-seq","number-theory.lucas-nth","number-theory.fibonacci?","number-theory.lucas-take-while"]},"lucky-seq":{category:"number-theory",description:"Generates the lucky sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { lucky-seq } = import(number-theory);\nlucky-seq(1)","let { lucky-seq } = import(number-theory);\nlucky-seq(2)","let { lucky-seq } = import(number-theory);\nlucky-seq(20)"],seeAlso:["number-theory.lucky-nth","number-theory.lucky-take-while","number-theory.lucky?","number-theory.happy-seq","number-theory.prime-seq"]},"lucky-take-while":{category:"number-theory",description:"Generates the lucky sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { lucky-take-while } = import(number-theory);\nlucky-take-while(-> $ < 100)"],seeAlso:["number-theory.lucky-seq","number-theory.lucky-nth","number-theory.lucky?"]},"lucky-nth":{category:"number-theory",description:"Generates the nth term of the lucky sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The position in the sequence."}},variants:[{argumentNames:["n"]}],examples:["let { lucky-nth } = import(number-theory);\nlucky-nth(1)","let { lucky-nth } = import(number-theory);\nlucky-nth(2)","let { lucky-nth } = import(number-theory);\nlucky-nth(20)"],seeAlso:["number-theory.lucky-seq","number-theory.lucky-take-while","number-theory.lucky?"]},"lucky?":{category:"number-theory",description:"Checks if a number is a lucky number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { lucky? } = import(number-theory);\nlucky?(4)","let { lucky? } = import(number-theory);\nlucky?(7)","let { lucky? } = import(number-theory);\nlucky?(33)"],seeAlso:["number-theory.lucky-seq","number-theory.lucky-nth","number-theory.prime?","number-theory.lucky-take-while"]},"mersenne-seq":{category:"number-theory",description:"Generates the Mersenne sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 9 (the maximum length of the pre-calculated mersenne numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { mersenne-seq } = import(number-theory);\nmersenne-seq(1)","let { mersenne-seq } = import(number-theory);\nmersenne-seq(5)","let { mersenne-seq } = import(number-theory);\nmersenne-seq()"],seeAlso:["number-theory.mersenne-nth","number-theory.mersenne-take-while","number-theory.mersenne?","number-theory.prime-seq"]},"mersenne-take-while":{category:"number-theory",description:"Generates the Mersenne sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { mersenne-take-while } = import(number-theory);\nmersenne-take-while(-> $ < 1000)"],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-nth","number-theory.mersenne?"]},"mersenne-nth":{category:"number-theory",description:"Generates the nth term of the Mersenne sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { mersenne-nth } = import(number-theory);\nmersenne-nth(1)","let { mersenne-nth } = import(number-theory);\nmersenne-nth(5)"],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-take-while","number-theory.mersenne?"]},"mersenne?":{category:"number-theory",description:"Checks if a number is in the Mersenne sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { mersenne? } = import(number-theory);\nmersenne?(3)","let { mersenne? } = import(number-theory);\nmersenne?(4)","let { mersenne? } = import(number-theory);\nmersenne?(7)"],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-nth","number-theory.prime?","number-theory.mersenne-take-while"]},"padovan-seq":{category:"number-theory",description:"Generates the Padovan sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { padovan-seq } = import(number-theory);\npadovan-seq(5)","let { padovan-seq } = import(number-theory);\npadovan-seq(10)","let { padovan-seq } = import(number-theory);\npadovan-seq(20)"],seeAlso:["number-theory.padovan-nth","number-theory.padovan-take-while","number-theory.padovan?","number-theory.fibonacci-seq"]},"padovan-take-while":{category:"number-theory",description:"Generates the Padovan sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { padovan-take-while } = import(number-theory);\npadovan-take-while(-> $ < 1000)"],seeAlso:["number-theory.padovan-seq","number-theory.padovan-nth","number-theory.padovan?"]},"padovan-nth":{category:"number-theory",description:"Generates the nth term of the Padovan sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { padovan-nth } = import(number-theory);\npadovan-nth(5)","let { padovan-nth } = import(number-theory);\npadovan-nth(10)","let { padovan-nth } = import(number-theory);\npadovan-nth(20)"],seeAlso:["number-theory.padovan-seq","number-theory.padovan-take-while","number-theory.padovan?"]},"padovan?":{category:"number-theory",description:"Checks if a number is in the Padovan sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { padovan? } = import(number-theory);\npadovan?(1)","let { padovan? } = import(number-theory);\npadovan?(265)","let { padovan? } = import(number-theory);\npadovan?(6)"],seeAlso:["number-theory.padovan-seq","number-theory.padovan-nth","number-theory.fibonacci?","number-theory.padovan-take-while"]},"partition-seq":{category:"number-theory",description:"Generates the partition numbers up to a specified length. If no length is provided, it defaults to 299 (the maximum length of the pre-calculated partition numbers).",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { partition-seq } = import(number-theory);\npartition-seq(1)","let { partition-seq } = import(number-theory);\npartition-seq(10)","let { partition-seq } = import(number-theory);\npartition-seq()"],seeAlso:["number-theory.partition-nth","number-theory.partition-take-while","number-theory.partition?","number-theory.partitions","number-theory.count-partitions"]},"partition-take-while":{category:"number-theory",description:"Generates the partition numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { partition-take-while } = import(number-theory);\npartition-take-while(-> $ < 1000)"],seeAlso:["number-theory.partition-seq","number-theory.partition-nth","number-theory.partition?"]},"partition-nth":{category:"number-theory",description:"Generates the nth term of the partition numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the partition number to generate."}},variants:[{argumentNames:["n"]}],examples:["let { partition-nth } = import(number-theory);\npartition-nth(1)","let { partition-nth } = import(number-theory);\npartition-nth(5)"],seeAlso:["number-theory.partition-seq","number-theory.partition-take-while","number-theory.partition?"]},"partition?":{category:"number-theory",description:"Checks if a number is in the partition numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { partition? } = import(number-theory);\npartition?(0)","let { partition? } = import(number-theory);\npartition?(1)","let { partition? } = import(number-theory);\npartition?(2)","let { partition? } = import(number-theory);\npartition?(3)","let { partition? } = import(number-theory);\npartition?(4)","let { partition? } = import(number-theory);\npartition?(5)"],seeAlso:["number-theory.partition-seq","number-theory.partition-nth","number-theory.partitions","number-theory.partition-take-while"]},"pell-seq":{category:"number-theory",description:"Generates the Pell sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 42 (the maximum length of the pre-calculated Pell numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { pell-seq } = import(number-theory);\npell-seq(5)","let { pell-seq } = import(number-theory);\npell-seq(10)","let { pell-seq } = import(number-theory);\npell-seq()"],seeAlso:["number-theory.pell-nth","number-theory.pell-take-while","number-theory.pell?","number-theory.fibonacci-seq"]},"pell-take-while":{category:"number-theory",description:"Generates the Pell sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { pell-take-while } = import(number-theory);\npell-take-while(-> $ < 1000)"],seeAlso:["number-theory.pell-seq","number-theory.pell-nth","number-theory.pell?"]},"pell-nth":{category:"number-theory",description:"Generates the nth term of the Pell sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { pell-nth } = import(number-theory);\npell-nth(5)","let { pell-nth } = import(number-theory);\npell-nth(10)","let { pell-nth } = import(number-theory);\npell-nth(20)"],seeAlso:["number-theory.pell-seq","number-theory.pell-take-while","number-theory.pell?"]},"pell?":{category:"number-theory",description:"Checks if a number is a Pell number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { pell? } = import(number-theory);\npell?(1)","let { pell? } = import(number-theory);\npell?(470832)","let { pell? } = import(number-theory);\npell?(10)"],seeAlso:["number-theory.pell-seq","number-theory.pell-nth","number-theory.fibonacci?","number-theory.pell-take-while"]},"perfect-seq":{category:"number-theory",description:"Generates the perfect numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If no length is provided, it defaults to 7 (the maximum length of the pre-calculated perfect numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { perfect-seq } = import(number-theory);\nperfect-seq(1)","let { perfect-seq } = import(number-theory);\nperfect-seq(5)","let { perfect-seq } = import(number-theory);\nperfect-seq()"],seeAlso:["number-theory.perfect-nth","number-theory.perfect-take-while","number-theory.perfect?","number-theory.abundant-seq","number-theory.deficient-seq","number-theory.amicable?"]},"perfect-take-while":{category:"number-theory",description:"Generates the perfect numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { perfect-take-while } = import(number-theory);\nperfect-take-while(-> $ < 1000)"],seeAlso:["number-theory.perfect-seq","number-theory.perfect-nth","number-theory.perfect?"]},"perfect-nth":{category:"number-theory",description:"Generates the nth term of the perfect numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the perfect number to generate."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-nth } = import(number-theory);\nperfect-nth(1)","let { perfect-nth } = import(number-theory);\nperfect-nth(5)"],seeAlso:["number-theory.perfect-seq","number-theory.perfect-take-while","number-theory.perfect?"]},"perfect?":{category:"number-theory",description:"Checks if a number is in the perfect numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { perfect? } = import(number-theory);\nperfect?(0)","let { perfect? } = import(number-theory);\nperfect?(1)","let { perfect? } = import(number-theory);\nperfect?(2)","let { perfect? } = import(number-theory);\nperfect?(3)","let { perfect? } = import(number-theory);\nperfect?(4)","let { perfect? } = import(number-theory);\nperfect?(5)","let { perfect? } = import(number-theory);\nperfect?(6)","let { perfect? } = import(number-theory);\nperfect?(7)","let { perfect? } = import(number-theory);\nperfect?(8)","let { perfect? } = import(number-theory);\nperfect?(9)"],seeAlso:["number-theory.perfect-seq","number-theory.perfect-nth","number-theory.abundant?","number-theory.deficient?","number-theory.sigma","number-theory.perfect-take-while","number-theory.amicable?","number-theory.proper-divisors"]},"perfect-square-seq":{category:"number-theory",description:"Generates the perfect square numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { perfect-square-seq } = import(number-theory);\nperfect-square-seq(5)","let { perfect-square-seq } = import(number-theory);\nperfect-square-seq(20)"],seeAlso:["number-theory.perfect-square-nth","number-theory.perfect-square-take-while","number-theory.perfect-square?","number-theory.perfect-cube-seq","number-theory.perfect-power-seq","number-theory.polygonal-seq"]},"perfect-square-take-while":{category:"number-theory",description:"Generates the perfect square numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { perfect-square-take-while } = import(number-theory);\nperfect-square-take-while(-> $ <= 100)"],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-nth","number-theory.perfect-square?"]},"perfect-square-nth":{category:"number-theory",description:"Generates the nth term of the perfect square numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-square-nth } = import(number-theory);\nperfect-square-nth(1)","let { perfect-square-nth } = import(number-theory);\nperfect-square-nth(5)"],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-take-while","number-theory.perfect-square?"]},"perfect-square?":{category:"number-theory",description:"Checks if a number is a perfect square.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-square? } = import(number-theory);\nperfect-square?(16)","let { perfect-square? } = import(number-theory);\nperfect-square?(20)"],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-nth","number-theory.perfect-cube?","number-theory.perfect-power?","number-theory.perfect-square-take-while","number-theory.perfect-power","number-theory.polygonal?"]},"perfect-cube-seq":{category:"number-theory",description:"Generates the perfect cube numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { perfect-cube-seq } = import(number-theory);\nperfect-cube-seq(5)","let { perfect-cube-seq } = import(number-theory);\nperfect-cube-seq(20)"],seeAlso:["number-theory.perfect-cube-nth","number-theory.perfect-cube-take-while","number-theory.perfect-cube?","number-theory.perfect-square-seq","number-theory.perfect-power-seq"]},"perfect-cube-take-while":{category:"number-theory",description:"Generates the perfect cube numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { perfect-cube-take-while } = import(number-theory);\nperfect-cube-take-while(-> $ <= 100)"],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-nth","number-theory.perfect-cube?"]},"perfect-cube-nth":{category:"number-theory",description:"Generates the nth term of the perfect cube numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-cube-nth } = import(number-theory);\nperfect-cube-nth(1)","let { perfect-cube-nth } = import(number-theory);\nperfect-cube-nth(5)"],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-take-while","number-theory.perfect-cube?"]},"perfect-cube?":{category:"number-theory",description:"Checks if a number is in the perfect cube numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-cube? } = import(number-theory);\nperfect-cube?(7)","let { perfect-cube? } = import(number-theory);\nperfect-cube?(8)","let { perfect-cube? } = import(number-theory);\nperfect-cube?(9)"],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-nth","number-theory.perfect-square?","number-theory.perfect-power?","number-theory.perfect-cube-take-while","number-theory.perfect-power"]},"perfect-power-seq":{category:"number-theory",description:"Generates the perfect power numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { perfect-power-seq } = import(number-theory);\nperfect-power-seq(5)","let { perfect-power-seq } = import(number-theory);\nperfect-power-seq(20)"],seeAlso:["number-theory.perfect-power-nth","number-theory.perfect-power-take-while","number-theory.perfect-power?","number-theory.perfect-power","number-theory.perfect-square-seq","number-theory.perfect-cube-seq"]},"perfect-power-take-while":{category:"number-theory",description:"Generates the perfect power numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { perfect-power-take-while } = import(number-theory);\nperfect-power-take-while(-> $ <= 100)"],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-nth","number-theory.perfect-power?"]},"perfect-power-nth":{category:"number-theory",description:"Generates the nth term of the perfect power numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-power-nth } = import(number-theory);\nperfect-power-nth(3)","let { perfect-power-nth } = import(number-theory);\nperfect-power-nth(15)"],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-take-while","number-theory.perfect-power?"]},"perfect-power?":{category:"number-theory",description:"Checks if a number is in the perfect power numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-power? } = import(number-theory);\nperfect-power?(7)","let { perfect-power? } = import(number-theory);\nperfect-power?(8)","let { perfect-power? } = import(number-theory);\nperfect-power?(9)","let { perfect-power? } = import(number-theory);\nperfect-power?(10)"],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-nth","number-theory.perfect-power","number-theory.perfect-square?","number-theory.perfect-cube?","number-theory.perfect-power-take-while"]},"polygonal-seq":{category:"number-theory",description:"Generates the polygonal sequence for a given number of sides and length.",returns:{type:"integer",array:!0},args:{sides:{type:"integer",description:"The number of sides of the polygon."},length:{type:"integer",description:"The length of the sequence to generate."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","length"]}],examples:["let { polygonal-seq } = import(number-theory);\npolygonal-seq(3, 2)","let { polygonal-seq } = import(number-theory);\npolygonal-seq(4, 2)","let { polygonal-seq } = import(number-theory);\npolygonal-seq(5, 3)","let { polygonal-seq } = import(number-theory);\npolygonal-seq(6, 5)","let { polygonal-seq } = import(number-theory);\npolygonal-seq(100, 10)"],seeAlso:["number-theory.polygonal-nth","number-theory.polygonal-take-while","number-theory.polygonal?","number-theory.perfect-square-seq"]},"polygonal-take-while":{category:"number-theory",description:"Generates the polygonal sequence while a condition is met.",returns:{type:"integer",array:!0},args:{sides:{type:"integer",description:"The number of sides of the polygon."},takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."},a:{type:"integer"},b:{type:"function"}},variants:[{argumentNames:["sides","takeWhile"]}],examples:["let { polygonal-take-while } = import(number-theory);\npolygonal-take-while(15, -> $ < 1000)"],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-nth","number-theory.polygonal?"]},"polygonal-nth":{category:"number-theory",description:"Generates the nth term of the polygonal sequence.",returns:{type:"integer"},args:{sides:{type:"integer",description:"The number of sides of the polygon."},n:{type:"integer",description:"The index of the term to generate."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","n"]}],examples:["let { polygonal-nth } = import(number-theory);\npolygonal-nth(3, 9)","let { polygonal-nth } = import(number-theory);\npolygonal-nth(4, 5)","let { polygonal-nth } = import(number-theory);\npolygonal-nth(5, 5)"],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-take-while","number-theory.polygonal?"]},"polygonal?":{category:"number-theory",description:"Checks if a number is in the polygonal sequence.",returns:{type:"boolean"},args:{sides:{type:"integer",description:"The number of sides of the polygon."},n:{type:"integer",description:"The number to check."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","n"]}],examples:["let { polygonal? } = import(number-theory);\npolygonal?(3, 10)","let { polygonal? } = import(number-theory);\npolygonal?(3, 9)","let { polygonal? } = import(number-theory);\npolygonal?(4, 10000)","let { polygonal? } = import(number-theory);\npolygonal?(4, 1000)","let { polygonal? } = import(number-theory);\npolygonal?(6, 45)"],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-nth","number-theory.perfect-square?","number-theory.polygonal-take-while"]},"prime-seq":{category:"number-theory",description:"Generates the prime sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { prime-seq } = import(number-theory);\nprime-seq(1)","let { prime-seq } = import(number-theory);\nprime-seq(2)","let { prime-seq } = import(number-theory);\nprime-seq(10)"],seeAlso:["number-theory.prime-nth","number-theory.prime-take-while","number-theory.prime?","number-theory.composite-seq","number-theory.mersenne-seq","number-theory.lucky-seq"]},"prime-take-while":{category:"number-theory",description:"Generates the prime sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { prime-take-while } = import(number-theory);\nprime-take-while(-> $ < 50)"],seeAlso:["number-theory.prime-seq","number-theory.prime-nth","number-theory.prime?"]},"prime-nth":{category:"number-theory",description:"Generates the nth term of the prime sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { prime-nth } = import(number-theory);\nprime-nth(1)","let { prime-nth } = import(number-theory);\nprime-nth(2)","let { prime-nth } = import(number-theory);\nprime-nth(10)"],seeAlso:["number-theory.prime-seq","number-theory.prime-take-while","number-theory.prime?"]},"prime?":{category:"number-theory",description:"Determines if a number is prime.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { prime? } = import(number-theory);\nprime?(1)","let { prime? } = import(number-theory);\nprime?(2)","let { prime? } = import(number-theory);\nprime?(3)","let { prime? } = import(number-theory);\nprime?(4)","let { prime? } = import(number-theory);\nprime?(997)","let { prime? } = import(number-theory);\nprime?(1001)"],seeAlso:["number-theory.prime-seq","number-theory.prime-nth","number-theory.composite?","number-theory.prime-factors","number-theory.mersenne?","number-theory.prime-take-while","number-theory.lucky?"]},"recaman-seq":{category:"number-theory",description:"Generates the Recaman sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { recaman-seq } = import(number-theory);\nrecaman-seq(5)","let { recaman-seq } = import(number-theory);\nrecaman-seq(10)","let { recaman-seq } = import(number-theory);\nrecaman-seq(20)"],seeAlso:["number-theory.recaman-nth","number-theory.recaman-take-while","number-theory.recaman?","number-theory.golomb-seq"]},"recaman-take-while":{category:"number-theory",description:"Generates the Recaman sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { recaman-take-while } = import(number-theory);\nrecaman-take-while(-> $ < 10)"],seeAlso:["number-theory.recaman-seq","number-theory.recaman-nth","number-theory.recaman?"]},"recaman-nth":{category:"number-theory",description:"Generates the nth term of the Recaman sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { recaman-nth } = import(number-theory);\nrecaman-nth(5)","let { recaman-nth } = import(number-theory);\nrecaman-nth(10)","let { recaman-nth } = import(number-theory);\nrecaman-nth(20)"],seeAlso:["number-theory.recaman-seq","number-theory.recaman-take-while","number-theory.recaman?"]},"recaman?":{category:"number-theory",description:"Checks if a number is in the Recaman sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { recaman? } = import(number-theory);\nrecaman?(5)","let { recaman? } = import(number-theory);\nrecaman?(10)","let { recaman? } = import(number-theory);\nrecaman?(20)"],seeAlso:["number-theory.recaman-seq","number-theory.recaman-nth","number-theory.recaman-take-while"]},"sylvester-seq":{category:"number-theory",description:"Generates the Sylvester sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 6 (the maximum length of the pre-calculated Sylvester numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:["let { sylvester-seq } = import(number-theory);\nsylvester-seq(5)","let { sylvester-seq } = import(number-theory);\nsylvester-seq()","let { sylvester-seq } = import(number-theory);\nsylvester-seq()"],seeAlso:["number-theory.sylvester-nth","number-theory.sylvester-take-while","number-theory.sylvester?"]},"sylvester-take-while":{category:"number-theory",description:"Generates the Sylvester sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { sylvester-take-while } = import(number-theory);\nsylvester-take-while(-> $ < 100000)"],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-nth","number-theory.sylvester?"]},"sylvester-nth":{category:"number-theory",description:"Generates the nth term of the Sylvester sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { sylvester-nth } = import(number-theory);\nsylvester-nth(1)","let { sylvester-nth } = import(number-theory);\nsylvester-nth(5)"],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-take-while","number-theory.sylvester?"]},"sylvester?":{category:"number-theory",description:"Checks if a number is in the Sylvester sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { sylvester? } = import(number-theory);\nsylvester?(2)","let { sylvester? } = import(number-theory);\nsylvester?(3)","let { sylvester? } = import(number-theory);\nsylvester?(6)"],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-nth","number-theory.sylvester-take-while"]},"thue-morse-seq":{category:"number-theory",description:"Generates the Thue-Morse sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { thue-morse-seq } = import(number-theory);\nthue-morse-seq(5)","let { thue-morse-seq } = import(number-theory);\nthue-morse-seq(10)","let { thue-morse-seq } = import(number-theory);\nthue-morse-seq(20)"],seeAlso:["number-theory.thue-morse-nth","number-theory.thue-morse-take-while","number-theory.thue-morse?"]},"thue-morse-take-while":{category:"number-theory",description:"Generates the Thue-Morse sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { thue-morse-take-while } = import(number-theory);\nthue-morse-take-while(-> $2 < 10)"],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-nth","number-theory.thue-morse?"]},"thue-morse-nth":{category:"number-theory",description:"Generates the nth term of the Thue-Morse sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term in the sequence."}},variants:[{argumentNames:["n"]}],examples:["let { thue-morse-nth } = import(number-theory);\nthue-morse-nth(5)","let { thue-morse-nth } = import(number-theory);\nthue-morse-nth(10)","let { thue-morse-nth } = import(number-theory);\nthue-morse-nth(20)"],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-take-while","number-theory.thue-morse?"]},"thue-morse?":{category:"number-theory",description:"Checks if a number is part of the Thue-Morse sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { thue-morse? } = import(number-theory);\nthue-morse?(1)","let { thue-morse? } = import(number-theory);\nthue-morse?(2)"],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-nth","number-theory.thue-morse-take-while"]},"tribonacci-seq":{category:"number-theory",description:"Generates the tribonacci sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:["let { tribonacci-seq } = import(number-theory);\ntribonacci-seq(1)","let { tribonacci-seq } = import(number-theory);\ntribonacci-seq(2)","let { tribonacci-seq } = import(number-theory);\ntribonacci-seq(10)"],seeAlso:["number-theory.tribonacci-nth","number-theory.tribonacci-take-while","number-theory.tribonacci?","number-theory.fibonacci-seq"]},"tribonacci-take-while":{category:"number-theory",description:"Generates the tribonacci sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:["let { tribonacci-take-while } = import(number-theory);\ntribonacci-take-while(-> $ < 100)"],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-nth","number-theory.tribonacci?"]},"tribonacci-nth":{category:"number-theory",description:"Generates the nth term of the tribonacci sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:["let { tribonacci-nth } = import(number-theory);\ntribonacci-nth(1)","let { tribonacci-nth } = import(number-theory);\ntribonacci-nth(2)","let { tribonacci-nth } = import(number-theory);\ntribonacci-nth(10)"],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-take-while","number-theory.tribonacci?"]},"tribonacci?":{category:"number-theory",description:"Determines if a number is in the tribonacci sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { tribonacci? } = import(number-theory);\ntribonacci?(0)","let { tribonacci? } = import(number-theory);\ntribonacci?(1)","let { tribonacci? } = import(number-theory);\ntribonacci?(2)","let { tribonacci? } = import(number-theory);\ntribonacci?(3)","let { tribonacci? } = import(number-theory);\ntribonacci?(4)","let { tribonacci? } = import(number-theory);\ntribonacci?(5)","let { tribonacci? } = import(number-theory);\ntribonacci?(6)","let { tribonacci? } = import(number-theory);\ntribonacci?(7)","let { tribonacci? } = import(number-theory);\ntribonacci?(8)","let { tribonacci? } = import(number-theory);\ntribonacci?(9)","let { tribonacci? } = import(number-theory);\ntribonacci?(10)"],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-nth","number-theory.fibonacci?","number-theory.tribonacci-take-while"]},"count-combinations":{category:"number-theory",description:"Calculates the number of combinations of n items taken k at a time.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { count-combinations } = import(number-theory);\ncount-combinations(5, 3)","let { count-combinations } = import(number-theory);\ncount-combinations(10, 2)"],seeAlso:["number-theory.combinations","number-theory.count-permutations","number-theory.factorial","number-theory.multinomial","number-theory.stirling-second","number-theory.count-partitions","number-theory.count-power-set"]},combinations:{category:"number-theory",description:"Generates all possible combinations of a specified size from a collection.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate combinations from."},n:{type:"integer",description:"The size of each combination."},a:{type:"array"},b:{type:"integer"}},variants:[{argumentNames:["set","n"]}],examples:["let { combinations } = import(number-theory);\ncombinations([1, 2, 3], 2)",'let { combinations } = import(number-theory);\ncombinations(["a", "b", "c"], 2)',"let { combinations } = import(number-theory);\ncombinations([1, 2, 3], 0)","let { combinations } = import(number-theory);\ncombinations([1, 2, 3], 1)","let { combinations } = import(number-theory);\ncombinations([1, 2, 3], 3)"],seeAlso:["number-theory.count-combinations","number-theory.permutations","number-theory.power-set","number-theory.cartesian-product","number-theory.partitions"]},"count-derangements":{category:"number-theory",description:"Calculates the number of derangements (permutations where no element appears in its original position) of n items.",returns:{type:"integer"},args:{n:{type:"integer",description:"The total number of items."}},variants:[{argumentNames:["n"]}],examples:["let { count-derangements } = import(number-theory);\ncount-derangements(4)","let { count-derangements } = import(number-theory);\ncount-derangements(5)"],seeAlso:["number-theory.derangements","number-theory.count-permutations","number-theory.factorial"]},derangements:{category:"number-theory",description:"Generates all derangements (permutations where no element appears in its original position) of a set.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate derangements from."}},variants:[{argumentNames:["set"]}],examples:["let { derangements } = import(number-theory);\nderangements([1, 2, 3, 4])",'let { derangements } = import(number-theory);\nderangements(["a", "b", "c"])'],seeAlso:["number-theory.count-derangements","number-theory.permutations"]},divisors:{category:"number-theory",description:"Returns the divisors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find divisors for."}},variants:[{argumentNames:["n"]}],examples:["let { divisors } = import(number-theory);\ndivisors(12)","let { divisors } = import(number-theory);\ndivisors(100)","let { divisors } = import(number-theory);\ndivisors(37)"],seeAlso:["number-theory.count-divisors","number-theory.proper-divisors","number-theory.sigma","number-theory.prime-factors","number-theory.divisible-by?","number-theory.lcm","number-theory.abundant?","number-theory.deficient?","number-theory.count-proper-divisors"]},"count-divisors":{category:"number-theory",description:"Returns the number of divisors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count divisors for."}},variants:[{argumentNames:["n"]}],examples:["let { count-divisors } = import(number-theory);\ncount-divisors(12)","let { count-divisors } = import(number-theory);\ncount-divisors(100)","let { count-divisors } = import(number-theory);\ncount-divisors(37)"],seeAlso:["number-theory.divisors","number-theory.count-proper-divisors","number-theory.sigma"]},"proper-divisors":{category:"number-theory",description:"Returns the proper divisors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find proper divisors for."}},variants:[{argumentNames:["n"]}],examples:["let { proper-divisors } = import(number-theory);\nproper-divisors(12)","let { proper-divisors } = import(number-theory);\nproper-divisors(100)","let { proper-divisors } = import(number-theory);\nproper-divisors(37)"],seeAlso:["number-theory.count-proper-divisors","number-theory.divisors","number-theory.amicable?","number-theory.perfect?"]},"count-proper-divisors":{category:"number-theory",description:"Returns the number of proper divisors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count proper divisors for."}},variants:[{argumentNames:["n"]}],examples:["let { count-proper-divisors } = import(number-theory);\ncount-proper-divisors(12)","let { count-proper-divisors } = import(number-theory);\ncount-proper-divisors(100)","let { count-proper-divisors } = import(number-theory);\ncount-proper-divisors(37)"],seeAlso:["number-theory.proper-divisors","number-theory.count-divisors","number-theory.divisors"]},factorial:{category:"number-theory",description:"Calculates the factorial of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the factorial for."}},variants:[{argumentNames:["n"]}],examples:["let { factorial } = import(number-theory);\nfactorial(5)","let { factorial } = import(number-theory);\nfactorial(0)","let { factorial } = import(number-theory);\nfactorial(10)","let { factorial } = import(number-theory);\nfactorial(20)"],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial?","number-theory.count-combinations","number-theory.count-permutations","number-theory.multinomial","number-theory.count-derangements"]},partitions:{category:"number-theory",description:"Generates all partitions of a number.",returns:{type:"array",array:!0},args:{n:{type:"integer",description:"The number to partition."}},variants:[{argumentNames:["n"]}],examples:["let { partitions } = import(number-theory);\npartitions(4)","let { partitions } = import(number-theory);\npartitions(8)"],seeAlso:["number-theory.count-partitions","number-theory.partition-seq","number-theory.combinations","number-theory.partition?"]},"count-partitions":{category:"number-theory",description:"Returns the number of partitions of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count partitions for."}},variants:[{argumentNames:["n"]}],examples:["let { count-partitions } = import(number-theory);\ncount-partitions(4)","let { count-partitions } = import(number-theory);\ncount-partitions(8)","let { count-partitions } = import(number-theory);\ncount-partitions(15)"],seeAlso:["number-theory.partitions","number-theory.partition-seq","number-theory.count-combinations"]},permutations:{category:"number-theory",description:"Generates all permutations of a collection.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate permutations from."}},variants:[{argumentNames:["set"]}],examples:["let { permutations } = import(number-theory);\npermutations([1, 2, 3])",'let { permutations } = import(number-theory);\npermutations(["a", "b", "c"])',"let { permutations } = import(number-theory);\npermutations([1, 2, 3, 4])","let { permutations } = import(number-theory);\npermutations([1, 2])","let { permutations } = import(number-theory);\npermutations([1])","let { permutations } = import(number-theory);\npermutations([])"],seeAlso:["number-theory.count-permutations","number-theory.combinations","number-theory.derangements","number-theory.cartesian-product"]},"count-permutations":{category:"number-theory",description:"Returns the number of permutations of n items taken k at a time.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { count-permutations } = import(number-theory);\ncount-permutations(5, 3)","let { count-permutations } = import(number-theory);\ncount-permutations(10, 2)","let { count-permutations } = import(number-theory);\ncount-permutations(10, 10)","let { count-permutations } = import(number-theory);\ncount-permutations(10, 0)","let { count-permutations } = import(number-theory);\ncount-permutations(10, 1)"],seeAlso:["number-theory.permutations","number-theory.count-combinations","number-theory.factorial","number-theory.multinomial","number-theory.stirling-first","number-theory.count-derangements"]},"power-set":{category:"number-theory",description:"Generates the power set of a collection.",returns:{type:"array",array:!0},args:{set:{type:"any",array:!0,description:"The input collection to generate the power set from."}},variants:[{argumentNames:["set"]}],examples:['let { power-set } = import(number-theory);\npower-set(["a", "b", "c"])',"let { power-set } = import(number-theory);\npower-set([1, 2])","let { power-set } = import(number-theory);\npower-set([1])","let { power-set } = import(number-theory);\npower-set([])"],seeAlso:["number-theory.count-power-set","number-theory.combinations","number-theory.cartesian-product"]},"count-power-set":{category:"number-theory",description:"Returns the number of subsets of a set.",returns:{type:"integer"},args:{n:{type:"integer",description:"The size of the set."}},variants:[{argumentNames:["n"]}],examples:["let { count-power-set } = import(number-theory);\ncount-power-set(3)","let { count-power-set } = import(number-theory);\ncount-power-set(5)","let { count-power-set } = import(number-theory);\ncount-power-set(10)"],seeAlso:["number-theory.power-set","number-theory.count-combinations"]},"prime-factors":{category:"number-theory",description:"Returns the prime factors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to factor."}},variants:[{argumentNames:["n"]}],examples:["let { prime-factors } = import(number-theory);\nprime-factors(12)","let { prime-factors } = import(number-theory);\nprime-factors(100)","let { prime-factors } = import(number-theory);\nprime-factors(37)"],seeAlso:["number-theory.count-prime-factors","number-theory.distinct-prime-factors","number-theory.prime?","number-theory.divisors","number-theory.euler-totient","number-theory.mobius","number-theory.composite?","number-theory.count-distinct-prime-factors"]},"count-prime-factors":{category:"number-theory",description:"Returns the number of prime factors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count prime factors for."}},variants:[{argumentNames:["n"]}],examples:["let { count-prime-factors } = import(number-theory);\ncount-prime-factors(12)","let { count-prime-factors } = import(number-theory);\ncount-prime-factors(100)","let { count-prime-factors } = import(number-theory);\ncount-prime-factors(37)"],seeAlso:["number-theory.prime-factors","number-theory.distinct-prime-factors","number-theory.count-distinct-prime-factors"]},"distinct-prime-factors":{category:"number-theory",description:"Returns the distinct prime factors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find distinct prime factors for."}},variants:[{argumentNames:["n"]}],examples:["let { distinct-prime-factors } = import(number-theory);\ndistinct-prime-factors(12)","let { distinct-prime-factors } = import(number-theory);\ndistinct-prime-factors(100)","let { distinct-prime-factors } = import(number-theory);\ndistinct-prime-factors(37)"],seeAlso:["number-theory.prime-factors","number-theory.count-distinct-prime-factors","number-theory.count-prime-factors"]},"count-distinct-prime-factors":{category:"number-theory",description:"Returns the number of distinct prime factors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count distinct prime factors for."}},variants:[{argumentNames:["n"]}],examples:["let { count-distinct-prime-factors } = import(number-theory);\ncount-distinct-prime-factors(12)","let { count-distinct-prime-factors } = import(number-theory);\ncount-distinct-prime-factors(100)","let { count-distinct-prime-factors } = import(number-theory);\ncount-distinct-prime-factors(37)"],seeAlso:["number-theory.distinct-prime-factors","number-theory.prime-factors","number-theory.count-prime-factors"]},"coprime?":{category:"number-theory",description:"Checks if two numbers are coprime (i.e., their GCD is 1).",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { coprime? } = import(number-theory);\ncoprime?(12, 8)","let { coprime? } = import(number-theory);\ncoprime?(12, 5)","let { coprime? } = import(number-theory);\ncoprime?(37, 1)","let { coprime? } = import(number-theory);\ncoprime?(0, 0)","let { coprime? } = import(number-theory);\ncoprime?(0, 5)","let { coprime? } = import(number-theory);\ncoprime?(5, 0)","let { coprime? } = import(number-theory);\ncoprime?(1, 0)","let { coprime? } = import(number-theory);\ncoprime?(0, 1)","let { coprime? } = import(number-theory);\ncoprime?(1, 1)","let { coprime? } = import(number-theory);\ncoprime?(2, 3)"],seeAlso:["number-theory.gcd","number-theory.euler-totient","number-theory.divisible-by?","number-theory.lcm","number-theory.carmichael-lambda"]},"divisible-by?":{category:"number-theory",description:"Checks if a number is divisible by another number.",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { divisible-by? } = import(number-theory);\ndivisible-by?(12, 4)","let { divisible-by? } = import(number-theory);\ndivisible-by?(12, 5)","let { divisible-by? } = import(number-theory);\ndivisible-by?(37, 1)","let { divisible-by? } = import(number-theory);\ndivisible-by?(0, 0)","let { divisible-by? } = import(number-theory);\ndivisible-by?(0, 5)","let { divisible-by? } = import(number-theory);\ndivisible-by?(5, 0)"],seeAlso:["number-theory.divisors","number-theory.gcd","number-theory.coprime?"]},gcd:{category:"number-theory",description:"Calculates the greatest common divisor (GCD) of two numbers.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { gcd } = import(number-theory);\ngcd(100, 25)","let { gcd } = import(number-theory);\ngcd(37, 1)","let { gcd } = import(number-theory);\ngcd(0, 0)","let { gcd } = import(number-theory);\ngcd(0, 5)","let { gcd } = import(number-theory);\ngcd(5, 0)"],seeAlso:["number-theory.lcm","number-theory.extended-gcd","number-theory.coprime?","number-theory.divisible-by?"]},lcm:{category:"number-theory",description:"Calculates the least common multiple (LCM) of two numbers.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { lcm } = import(number-theory);\nlcm(100, 25)","let { lcm } = import(number-theory);\nlcm(37, 1)","let { lcm } = import(number-theory);\nlcm(0, 5)","let { lcm } = import(number-theory);\nlcm(5, 0)"],seeAlso:["number-theory.gcd","number-theory.divisors","number-theory.coprime?"]},multinomial:{category:"number-theory",description:"Calculates the multinomial coefficient from of a list of numbers representing the sizes of each group.",returns:{type:"integer"},args:{args:{type:"integer",rest:!0,description:"The numbers representing the sizes of each group."}},variants:[{argumentNames:["args"]}],examples:["let { multinomial } = import(number-theory);\nmultinomial(5, 2, 3)","let { multinomial } = import(number-theory);\nmultinomial(10, 2, 3, 5)"],seeAlso:["number-theory.count-combinations","number-theory.factorial","number-theory.count-permutations"],hideOperatorForm:!0},"amicable?":{category:"number-theory",description:"Checks if two numbers are amicable (i.e., the sum of the proper divisors of each number equals the other number).",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { amicable? } = import(number-theory);\namicable?(220, 284)","let { amicable? } = import(number-theory);\namicable?(1184, 1210)","let { amicable? } = import(number-theory);\namicable?(2620, 2924)","let { amicable? } = import(number-theory);\namicable?(5020, 5564)","let { amicable? } = import(number-theory);\namicable?(6232, 6368)"],seeAlso:["number-theory.proper-divisors","number-theory.perfect?","number-theory.sigma","number-theory.perfect-seq"]},"euler-totient":{category:"number-theory",description:"Calculates the Euler's totient function (φ(n)) of a number, which counts the integers up to n that are coprime to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the totient for."}},variants:[{argumentNames:["n"]}],examples:["let { euler-totient } = import(number-theory);\neuler-totient(1)","let { euler-totient } = import(number-theory);\neuler-totient(2)","let { euler-totient } = import(number-theory);\neuler-totient(10)","let { euler-totient } = import(number-theory);\neuler-totient(20)"],seeAlso:["number-theory.coprime?","number-theory.carmichael-lambda","number-theory.mobius","number-theory.prime-factors","number-theory.mertens"]},mobius:{category:"number-theory",description:"Calculates the Möbius function (μ(n)) of a number, which is used in number theory.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Möbius function for."}},variants:[{argumentNames:["n"]}],examples:["let { mobius } = import(number-theory);\nmobius(1)","let { mobius } = import(number-theory);\nmobius(2)","let { mobius } = import(number-theory);\nmobius(3)","let { mobius } = import(number-theory);\nmobius(4)","let { mobius } = import(number-theory);\nmobius(6)","let { mobius } = import(number-theory);\nmobius(12)","let { mobius } = import(number-theory);\nmobius(30)"],seeAlso:["number-theory.mertens","number-theory.euler-totient","number-theory.prime-factors"]},mertens:{category:"number-theory",description:"Calculates the Mertens function (M(n)) of a number, which is the sum of the Möbius function up to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Mertens function for."}},variants:[{argumentNames:["n"]}],examples:["let { mobius } = import(number-theory);\nmobius(1)","let { mobius } = import(number-theory);\nmobius(2)","let { mobius } = import(number-theory);\nmobius(3)","let { mobius } = import(number-theory);\nmobius(4)","let { mobius } = import(number-theory);\nmobius(6)","let { mobius } = import(number-theory);\nmobius(12)","let { mobius } = import(number-theory);\nmobius(30)"],seeAlso:["number-theory.mobius","number-theory.euler-totient"]},sigma:{category:"number-theory",description:"Calculates the sum of divisors function (σ(n)) of a number, which is the sum of all positive divisors of n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the sum of divisors for."}},variants:[{argumentNames:["n"]}],examples:["let { sigma } = import(number-theory);\nsigma(1)","let { sigma } = import(number-theory);\nsigma(2)","let { sigma } = import(number-theory);\nsigma(3)","let { sigma } = import(number-theory);\nsigma(4)","let { sigma } = import(number-theory);\nsigma(6)","let { sigma } = import(number-theory);\nsigma(12)","let { sigma } = import(number-theory);\nsigma(30)"],seeAlso:["number-theory.divisors","number-theory.perfect?","number-theory.abundant?","number-theory.deficient?","number-theory.amicable?","number-theory.count-divisors"]},"carmichael-lambda":{category:"number-theory",description:"Calculates the Carmichael function (λ(n)) of a number, which is the smallest positive integer m such that a^m ≡ 1 (mod n) for all integers a coprime to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Carmichael function for."}},variants:[{argumentNames:["n"]}],examples:["let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(1)","let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(2)","let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(3)","let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(4)","let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(6)","let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(12)","let { carmichael-lambda } = import(number-theory);\ncarmichael-lambda(30)"],seeAlso:["number-theory.euler-totient","number-theory.mod-exp","number-theory.coprime?"]},"cartesian-product":{category:"number-theory",description:"Calculates the Cartesian product of two or more sets.",returns:{type:"array",array:!0},args:{sets:{type:"array",array:!0,description:"The input collections to calculate the Cartesian product from."},a:{type:"array"},b:{type:"array"}},variants:[{argumentNames:["sets"]}],examples:['let { cartesian-product } = import(number-theory);\ncartesian-product([1, 2], ["a", "b"])','let { cartesian-product } = import(number-theory);\ncartesian-product([1, 2], ["a", "b"], [true, false])','let { cartesian-product } = import(number-theory);\ncartesian-product([1, 2, 3], ["x", "y", "z"])'],seeAlso:["number-theory.combinations","number-theory.power-set","number-theory.permutations"]},"perfect-power":{category:"number-theory",description:"Returns a tuple of the base and exponent if the number is a perfect power, otherwise returns null.",returns:{type:"array",array:!0},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:["let { perfect-power } = import(number-theory);\nperfect-power(1)","let { perfect-power } = import(number-theory);\nperfect-power(2)","let { perfect-power } = import(number-theory);\nperfect-power(4)","let { perfect-power } = import(number-theory);\nperfect-power(8)","let { perfect-power } = import(number-theory);\nperfect-power(9)","let { perfect-power } = import(number-theory);\nperfect-power(16)","let { perfect-power } = import(number-theory);\nperfect-power(19)"],seeAlso:["number-theory.perfect-power?","number-theory.perfect-power-seq","number-theory.perfect-square?","number-theory.perfect-cube?"]},"mod-exp":{category:"number-theory",description:"Calculates the modular exponentiation of a base raised to an exponent modulo a modulus.",returns:{type:"integer"},args:{base:{type:"integer"},exponent:{type:"integer"},modulus:{type:"integer"}},variants:[{argumentNames:["base","exponent","modulus"]}],examples:["let { mod-exp } = import(number-theory);\nmod-exp(2, 3, 5)","let { mod-exp } = import(number-theory);\nmod-exp(3, 4, 7)","let { mod-exp } = import(number-theory);\nmod-exp(5, 6, 11)","let { mod-exp } = import(number-theory);\nmod-exp(7, 8, 13)"],seeAlso:["number-theory.mod-inv","number-theory.carmichael-lambda","number-theory.chinese-remainder"]},"mod-inv":{category:"number-theory",description:"Calculates the modular multiplicative inverse of a number modulo another number.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","m"]}],examples:["let { mod-inv } = import(number-theory);\nmod-inv(3, 11)","let { mod-inv } = import(number-theory);\nmod-inv(10, 17)","let { mod-inv } = import(number-theory);\nmod-inv(5, 13)","let { mod-inv } = import(number-theory);\nmod-inv(7, 19)"],seeAlso:["number-theory.mod-exp","number-theory.extended-gcd","number-theory.chinese-remainder"]},"extended-gcd":{category:"number-theory",description:"Calculates the extended greatest common divisor (GCD) of two numbers, returning the GCD and the coefficients of Bézout's identity.",returns:{type:"integer",array:!0},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:["let { extended-gcd } = import(number-theory);\nextended-gcd(30, 12)","let { extended-gcd } = import(number-theory);\nextended-gcd(56, 98)","let { extended-gcd } = import(number-theory);\nextended-gcd(101, 10)","let { extended-gcd } = import(number-theory);\nextended-gcd(17, 13)"],seeAlso:["number-theory.gcd","number-theory.mod-inv","number-theory.chinese-remainder"]},"chinese-remainder":{category:"number-theory",description:"Solves a system of simultaneous congruences using the Chinese Remainder Theorem.",returns:{type:"integer"},args:{remainders:{type:"integer",array:!0,description:"The remainders of the congruences."},moduli:{type:"integer",array:!0,description:"The moduli of the congruences."},a:{type:"array"},b:{type:"array"}},variants:[{argumentNames:["remainders","moduli"]}],examples:["let { chinese-remainder } = import(number-theory);\nchinese-remainder([2, 3], [3, 5])","let { chinese-remainder } = import(number-theory);\nchinese-remainder([1, 2], [3, 4])","let { chinese-remainder } = import(number-theory);\nchinese-remainder([0, 1], [2, 3])","let { chinese-remainder } = import(number-theory);\nchinese-remainder([1, 2, 3], [4, 5, 7])"],seeAlso:["number-theory.mod-exp","number-theory.mod-inv","number-theory.extended-gcd"]},"stirling-first":{category:"number-theory",description:"Calculates the Stirling numbers of the first kind, which count the number of permutations of n elements with k cycles.",returns:{type:"integer"},args:{a:{type:"integer",description:"The number of elements."},b:{type:"integer",description:"The number of cycles."}},variants:[{argumentNames:["a","b"]}],examples:["let { stirling-first } = import(number-theory);\nstirling-first(5, 2)","let { stirling-first } = import(number-theory);\nstirling-first(4, 3)","let { stirling-first } = import(number-theory);\nstirling-first(6, 1)","let { stirling-first } = import(number-theory);\nstirling-first(7, 4)","let { stirling-first } = import(number-theory);\nstirling-first(8, 5)"],seeAlso:["number-theory.stirling-second","number-theory.bell-seq","number-theory.count-permutations"]},"stirling-second":{category:"number-theory",description:"Calculates the Stirling numbers of the second kind, which count the number of ways to partition n elements into k non-empty subsets.",returns:{type:"integer"},args:{a:{type:"integer",description:"The number of elements."},b:{type:"integer",description:"The number of subsets."}},variants:[{argumentNames:["a","b"]}],examples:["let { stirling-second } = import(number-theory);\nstirling-second(5, 2)","let { stirling-second } = import(number-theory);\nstirling-second(4, 3)","let { stirling-second } = import(number-theory);\nstirling-second(6, 1)","let { stirling-second } = import(number-theory);\nstirling-second(7, 4)","let { stirling-second } = import(number-theory);\nstirling-second(8, 5)"],seeAlso:["number-theory.stirling-first","number-theory.bell-seq","number-theory.count-combinations"]}};function T(e,t){if(0===t||t===e)return 1;let r=1;for(let n=0;n<t;n++)r*=(e-n)/(n+1);return r}function G(e,t){if(1===t)return e.map(e=>[e]);const r=[];for(let n=0;n<=e.length-t;n++){const o=e[n],i=G(e.slice(n+1),t-1);for(const e of i)r.push([o,...e])}return r}const $={combinations:{evaluate:([e,t],r)=>(q(e,r),p(t,r,{integer:!0,nonNegative:!0,lte:e.length}),0===t?[[]]:G(e,t)),arity:A(2)},"count-combinations":{evaluate:([e,t],r)=>(p(e,r,{integer:!0,nonNegative:!0}),p(t,r,{integer:!0,nonNegative:!0,lte:e}),T(e,t)),arity:A(2)}};const C={derangements:{evaluate:([e],t)=>(q(e,t),function(e){const t=e.length,r=[],n=Array.from({length:t},()=>!1),o=Array.from({length:t});return function i(a){if(a!==t)for(let r=0;r<t;r++)n[r]||r===a||(n[r]=!0,o[a]=e[r],i(a+1),n[r]=!1);else r.push([...o])}(0),r}(e)),arity:A(1)},"count-derangements":{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),function(e){if(1===e)return 0;let t=1,r=0,n=0;for(let o=2;o<=e;o++)n=(o-1)*(t+r),t=r,r=n;return n}(e)),arity:A(1)}};function W(e){const t=[];for(let r=1;r<=Math.sqrt(e);r++)e%r===0&&(t.push(r),r!==e/r&&t.push(e/r));return t}function M(e){return W(e).sort((e,t)=>e-t)}function S(e){return M(e).slice(0,-1)}const E={divisors:{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),M(e)),arity:A(1)},"count-divisors":{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),W(e).length),arity:A(1)},"proper-divisors":{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),S(e)),arity:A(1)},"count-proper-divisors":{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),W(e).length-1),arity:A(1)}},R=[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3];function I(e){if(e<0)throw new Error("Factorial is not defined for negative numbers");if(0===e||1===e)return 1;if(e<=18)return R[e];let t=R[18];for(let r=19;r<=e;r++)t*=r;return t}const j={factorial:{evaluate:([e],t)=>(p(e,t,{integer:!0,nonNegative:!0,lte:170}),I(e)),arity:A(1)}},z=[1,2,3,5,7,11,15,22,30,42,56,77,101,135,176,231,297,385,490,627,792,1002,1255,1575,1958,2436,3010,3718,4565,5604,6842,8349,10143,12310,14883,17977,21637,26015,31185,37338,44583,53174,63261,75175,89134,105558,124754,147273,173525,204226,239943,281589,329931,386155,451276,526823,614154,715220,831820,966467,1121505,1300156,1505499,1741630,2012558,2323520,2679689,3087735,3554345,4087968,4697205,5392783,6185689,7089500,8118264,9289091,10619863,12132164,13848650,15796476,18004327,20506255,23338469,26543660,30167357,34262962,38887673,44108109,49995925,56634173,64112359,72533807,82010177,92669720,104651419,118114304,133230930,150198136,169229875,190569292,214481126,241265379,271248950,304801365,342325709,384276336,431149389,483502844,541946240,607163746,679903203,761002156,851376628,952050665,1064144451,1188908248,1327710076,1482074143,1653668665,1844349560,2056148051,2291320912,2552338241,2841940500,3163127352,3519222692,3913864295,4351078600,4835271870,5371315400,5964539504,6620830889,7346629512,8149040695,9035836076,10015581680,11097645016,12292341831,13610949895,15065878135,16670689208,18440293320,20390982757,22540654445,24908858009,27517052599,30388671978,33549419497,37027355200,40853235313,45060624582,49686288421,54770336324,60356673280,66493182097,73232243759,80630964769,88751778802,97662728555,107438159466,118159068427,129913904637,142798995930,156919475295,172389800255,189334822579,207890420102,228204732751,250438925115,274768617130,301384802048,330495499613,362326859895,397125074750,435157697830,476715857290,522115831195,571701605655,625846753120,684957390936,749474411781,819876908323,896684817527,980462880430,0xf98dace281,1171432692373,1280011042268,1398341745571,1527273599625,1667727404093,1820701100652,1987276856363,2168627105469,2366022741845,2580840212973,2814570987591,3068829878530,3345365983698,3646072432125,3972999029388,4328363658647,4714566886083,5134205287973,5590088317495,6085253859260,6622987708040,7206841706490,7840656226137,8528581302375,9275102575355,0x92c1cc50847,0x9f8afdf968b,0xad6918d4f36,0xbc72dde1287,0xccc0de0d1d7,0xde6da02b061,0xf195c5ba10a,18028182516671,19573856161145,21248279009367,23061871173849,25025873760111,27152408925615,29454549941750,31946390696157,34643126322519,37561133582570,40718063627362,44132934884255,47826239745920,51820051838712,56138148670947,60806135438329,65851585970275,71304185514919,77195892663512,83561103925871,90436839668817,97862933703585,0x604ca1b434ad,0x682ca0bc6d4e,0x70ad06a4328b,0x79da3e8e4df8,0x83c1a359c63d,0x8e7190d8114a,0x99f976fff202,0xa669edb53a4a,0xb3d4caca1bc8,0xc24d38b78151,0xd1e7cfd30909,0xe2bab064772f,0xf4dd9f8523e3,290726957916112,313891991306665,338854264248680,365749566870782,394723676655357,425933084409356,459545750448675,495741934760846,534715062908609,576672674947168,621837416509615,670448123060170,722760953690372,779050629562167,839611730366814,904760108316360,974834369944625,0x3bb262854d36d,0x404dafd2efa2e,0x4541ae2536f6d,0x4a94ddd83ba57,0x504e363fd1eca,0x56752ddfc97e7,0x5d11c356f6b53,0x642c86bff69f5,0x6bcea3db036a0,0x7401ecbfdbd63,0x7cd0e571c49d4,0x8646d010a1b6f,0x906fba0855202,0x9b5889f52508f,0xa70f0ea631153,0xb3a20ef033ec5,0xc1215ac210755,0xcf9ddd28cfa8d,0xdf29afbd9f60e,0xefd82f26a7157,4534253126900886,4872038056472084,5234371069753672,5622992691950605,6039763882095515,6486674127079088,6965850144195831,7479565078510584,8030248384943040,8620496275465025];const D={partitions:{evaluate:([e],t)=>(p(e,t,{integer:!0,nonNegative:!0}),function(e){if(e<=0)return[[]];if(1===e)return[[1]];const t=[];return function e(r,n,o){if(0!==r)for(let t=Math.min(n,r);t>=1;t--)o.push(t),e(r-t,t,o),o.pop();else t.push([...o])}(e,e,[]),t}(e)),arity:A(1)},"count-partitions":{evaluate:([e],r)=>{if(p(e,r,{integer:!0,nonNegative:!0}),0===e)return 1;if(e>z.length)throw new t(`n is too large. The maximum value is ${z.length-1}.`,r);return z[e-1]},arity:A(1)}};function P(e){if(0===e.length)return[[]];const t=[];for(let r=0;r<e.length;r++){const n=e[r],o=P([...e.slice(0,r),...e.slice(r+1)]);for(const e of o)t.push([n,...e])}return t}const F={permutations:{evaluate:([e],t)=>(q(e,t),P(e)),arity:A(1)},"count-permutations":{evaluate:([e,t],r)=>(p(e,r,{integer:!0,nonNegative:!0}),p(t,r,{integer:!0,nonNegative:!0,lte:e}),I(e)/I(e-t)),arity:A(2)}};const B={"power-set":{evaluate:([e],t)=>(q(e,t),function(e){const t=[[]];for(const r of e){const e=t.map(e=>[...e,r]);t.push(...e)}return t}(e)),arity:A(1)},"count-power-set":{evaluate:([e],t)=>(p(e,t,{integer:!0,nonNegative:!0}),e>=53?1/0:2**e),arity:A(1)}};function L(e){if(1===e)return[];const t=[];let r=2;for(;e>1;)e%r===0?(t.push(r),e/=r):r++;return t}const O={"prime-factors":{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),L(e)),arity:A(1)},"distinct-prime-factors":{evaluate:([e],t)=>{p(e,t,{finite:!0,integer:!0,positive:!0});const r=L(e),n=new Set(r);return Array.from(n)},arity:A(1)},"count-prime-factors":{evaluate:([e],t)=>(p(e,t,{finite:!0,integer:!0,positive:!0}),L(e).length),arity:A(1)},"count-distinct-prime-factors":{evaluate:([e],t)=>{p(e,t,{finite:!0,integer:!0,positive:!0});const r=L(e);return new Set(r).size},arity:A(1)}};function _(e,t){return e instanceof Promise?e.then(t):t(e)}function J(e){return S(e).reduce((e,t)=>e+t,0)>e}const X={"abundant-seq":e=>{const t=[];let r=2;for(;t.length<e;)J(r)&&t.push(r),r+=1;return t},"abundant?":e=>J(e),"abundant-take-while":e=>{const t=[];return function r(n){return J(n)?_(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(2)}};function U(e,t,r=1e-10){if(e===t)return!0;const n=Math.abs(e-t);if(0===e||0===t||n<r)return n<r;return n/(Math.abs(e)+Math.abs(t))<r}const Z={"arithmetic-seq":{evaluate:([e,t,r],n)=>(p(e,n,{finite:!0}),p(t,n,{finite:!0}),p(r,n,{integer:!0,positive:!0}),Array.from({length:r},(r,n)=>e+n*t)),arity:A(3)},"arithmetic-take-while":{evaluate:([e,t,r],n,o,{executeFunction:i})=>{p(e,n,{finite:!0}),p(t,n,{finite:!0}),x(r,n);const a=e,s=t,m=r,u=[];return function e(t){const r=a+t*s;return _(i(m,[r,t],o,n),n=>n?(u.push(r),e(t+1)):u)}(0)},arity:A(3)},"arithmetic-nth":{evaluate:([e,t,r],n)=>(p(e,n,{finite:!0}),p(t,n,{finite:!0}),p(r,n,{integer:!0,positive:!0}),e+(r-1)*t),arity:A(3)},"arithmetic?":{evaluate:([e,t,r],n)=>(p(r,n),p(e,n,{finite:!0}),p(t,n,{finite:!0}),function(e,t,r){if(0===t)return U(r,e);const n=(r-e)/t;if(n<0)return!1;const o=Math.round(n),i=e+t*o;return U(n,o)&&U(i,r)}(e,t,r)),arity:A(3)}};function H(e){const t=[1];for(let r=1;r<e;r+=1){let e=0;for(let n=0;n<r;n+=1)e+=T(r+1,n)*t[n];t[r]=r>1&&r%2==1?0:-e/(r+1)}return t}const K={"bernoulli-seq":{evaluate:([e],t)=>(p(e,t,{integer:!0,positive:!0}),H(e)),arity:A(1)},"bernoulli-nth":{evaluate:([e],t)=>{p(e,t,{integer:!0,positive:!0});return H(e)[e-1]},arity:A(1)},"bernoulli-take-while":{evaluate:([e],t,r,{executeFunction:n})=>{x(e,t);const o=e;return function(e){const t=[1];return function r(n){let o=0;for(let e=0;e<n;e++)o+=T(n+1,e)*t[e];const i=n>1&&n%2==1?0:-o/(n+1);return _(e(i,n),e=>e?(t.push(i),r(n+1)):t)}(1)}((e,t)=>_(n(o,[e,t],r),e=>!!e))},arity:A(1)}};function Q(e){if(e<=1)return!1;if(e<=3)return!0;if(e%2==0||e%3==0)return!1;for(let t=5;t*t<=e;t+=6)if(e%t===0||e%(t+2)===0)return!1;return!0}const V={"prime-seq":e=>{const t=[];let r=2;for(;t.length<e;)Q(r)&&t.push(r),r+=1;return t},"prime?":e=>Q(e),"prime-take-while":e=>{const t=[];return function r(n){return Q(n)?_(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(2)}};function Y(e){return!(e<=1)&&!Q(e)}const ee={"composite-seq":e=>{const t=[];let r=2;for(;t.length<e;)Y(r)&&t.push(r),r+=1;return t},"composite?":e=>Y(e),"composite-take-while":e=>{const t=[];return function r(n){return Y(n)?_(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(4)}};function te(e){return S(e).reduce((e,t)=>e+t,0)<e}const re={"deficient-seq":e=>{const t=[];let r=1;for(;t.length<e;)te(r)&&t.push(r),r+=1;return t},"deficient?":e=>te(e),"deficient-take-while":e=>{const t=[];return function r(n){return te(n)?_(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(1)}};const ne={"geometric-seq":{evaluate:([e,t,r],n)=>(p(e,n,{finite:!0}),p(t,n,{finite:!0}),p(r,n,{integer:!0,positive:!0}),Array.from({length:r},(r,n)=>e*t**n)),arity:A(3)},"geometric-take-while":{evaluate:([e,t,r],n,o,{executeFunction:i})=>{p(e,n,{finite:!0}),p(t,n,{finite:!0}),x(r,n);const a=e,s=t,m=r,u=[];return function e(t){const r=a*s**t;return _(i(m,[r,t],o,n),n=>n?(u.push(r),e(t+1)):u)}(0)},arity:A(3)},"geometric-nth":{evaluate:([e,t,r],n)=>(p(e,n,{finite:!0}),p(t,n,{finite:!0}),p(r,n,{integer:!0,positive:!0}),e*t**(r-1)),arity:A(3)},"geometric?":{evaluate:([e,t,r],n)=>(p(r,n),p(e,n,{finite:!0}),p(t,n,{finite:!0}),function(e,t,r){if(U(e,0))return U(r,0);if(U(t,1))return U(r,e);if(U(t,0))return U(r,0)||U(r,e);if(U(r,e))return!0;if(U(t,-1))return U(r,e)||U(r,-e);if(t<0){const n=Math.log(Math.abs(r/e))/Math.log(Math.abs(t)),o=Math.round(n);if(!U(o,n)||o<0)return!1;const i=o%2==0?Math.sign(e):Math.sign(e)*Math.sign(t);return Math.sign(r)===i}if(t>1&&r<e||t<1&&r>e)return!1;const n=Math.log(r/e)/Math.log(t),o=Math.round(n);return!(!U(o,n)||o<0)&&U(e*t**o,r)}(e,t,r)),arity:A(3)}};const oe={"golomb-seq":e=>function(e){const t=[0,1];for(let r=2;r<=e;r+=1)t.push(1+t[r-t[t[r-1]]]);return t.slice(1)}(e),"golomb?":()=>!0,"golomb-take-while":e=>function(e){const t=[0,1];return _(e(1,0),r=>r?function r(n){const o=1+t[n-t[t[n-1]]];return _(e(o,n-1),e=>e?(t.push(o),r(n+1)):t.slice(1))}(2):[])}(e)};function ie(e){if(e<=0)return!1;const t=new Set;for(;1!==e&&!t.has(e);)t.add(e),e=ae(e);return 1===e}function ae(e){let t=0;for(;e>0;){const r=e%10;t+=r*r,e=Math.floor(e/10)}return t}const se={"happy-seq":e=>{const t=[];for(let r=1;t.length<e;r++){let e=r;const n=new Set;for(;1!==e&&!n.has(e);)n.add(e),e=String(e).split("").reduce((e,t)=>e+Number(t)**2,0);1===e&&t.push(r)}return t},"happy?":e=>ie(e),"happy-take-while":e=>{const t=[];return function r(n){return ie(n)?_(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(1)}},me={"juggler-seq":e=>{let t=e;const r=[t];for(;t>1;)t=t%2==0?Math.floor(Math.sqrt(t)):Math.floor(t**1.5),r.push(t);return r},noNth:!0};function ue(e){let t="",r=1;for(let n=0;n<e.length;n++)n+1<e.length&&e[n]===e[n+1]?r++:(t+=r.toString()+e[n],r=1);return t}const he={string:!0,"look-and-say-seq":e=>{const t=["1"];for(let r=1;r<e;r+=1){const e=t[r-1].replace(/(\d)\1*/g,e=>`${e.length}${e[0]}`);t[r]=e}return t},"look-and-say-take-while":e=>{const t=[];return _(e("1",0),r=>{if(!r)return t;return t.push("1"),function r(n){const o=t[n-1].replace(/(\d)\1*/g,e=>`${e.length}${e[0]}`);return _(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(1)})},"look-and-say?":e=>function(e){let t="1";if(t===e)return!0;for(;;){if(t=ue(t),t===e)return!0;if(t.length>e.length)return!1}}(e)};function ce(e){const t=[];for(let e=1;e<=2e3;e++)t.push(e);let r=[1];for(let e=1;e<t.length;e++)t[e]%2!=0&&r.push(t[e]);const n=[1];let o=1;return _(e(1,0),t=>{if(!t)return[];let i=1;return function t(){const a=r[i];return _(e(a,o),e=>{if(!e)return n;n.push(a),o++;const s=a,m=[];for(let e=0;e<r.length;e++)(e+1)%s!==0&&m.push(r[e]);if(r=m,i++,i>=r.length-5){let e=r[r.length-1]+2;for(;r.length<i+1e3;)r.push(e),e+=2}return t()})}()})}const le={"lucky-seq":e=>function(e){const t=[];let r=1;const n=e*(e<100?20:30);for(;t.length<n;)t.push(r),r+=2;let o=1;for(;o<t.length&&o<e;){const e=t[o];let r=0;for(let n=0;n<t.length;n++)(n+1)%e!==0&&(t[r++]=t[n]);t.length=r,o<t.length&&o++}return t.slice(0,e)}(e),"lucky?":e=>ce(t=>t<=e).includes(e),"lucky-take-while":e=>ce(e)};const pe={"padovan-seq":e=>{const t=[1,1,1];for(let r=3;r<e;r+=1)t[r]=t[r-2]+t[r-3];return t.slice(0,e)},"padovan?":e=>function(e){if(!Number.isInteger(e)||e<=0)return!1;if(1===e)return!0;const t=[1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513,3329,4410,5842,7739,10252,13581,17991,23833,31572,41824,55405,73396,97229];if(t.includes(e))return!0;if(e>t[t.length-1]&&e<=Number.MAX_SAFE_INTEGER){let r,n=t[t.length-3],o=t[t.length-2],i=t[t.length-1];for(;i<e;){if(r=n+o,n=o,o=i,i=r,i===e)return!0;if(!Number.isSafeInteger(i))return!1}}return!1}(e),"padovan-take-while":e=>{const t=[];return _(e(1,0),r=>r?(t.push(1),_(e(1,1),r=>r?(t.push(1),_(e(1,2),r=>{if(!r)return t;t.push(1);let n=1,o=1,i=1;return function r(a){const s=n+o;return n=o,o=i,i=s,_(e(i,a),e=>e?(t.push(i),r(a+1)):t)}(4)})):t)):t)}},ye={"perfect-cube-seq":e=>{const t=[];for(let r=1;r<=e;r++)t.push(r**3);return t},"perfect-cube?":e=>e>0&&Number.isInteger(Math.cbrt(e)),"perfect-cube-take-while":e=>{const t=[];return function r(n){const o=n**3;return _(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(1)}};function be(e){if(e<2)return 1===e?[1,2]:null;const t=Math.floor(Math.log2(e))+1;for(let r=2;r<=t;r++){const t=e**(1/r),n=Math.round(t);if(U(n**r,e))return[n,r]}return null}const ge={"perfect-power-seq":e=>{const t=[];for(let r=1;t.length<e;r++)be(r)&&t.push(r);return t},"perfect-power?":e=>null!==be(e),"perfect-power-take-while":e=>{const t=[];return function r(n){return be(n)?_(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(1)}},fe={"perfect-square-seq":e=>{const t=[];for(let r=1;r<=e;r++)t.push(r**2);return t},"perfect-square?":e=>e>0&&Number.isInteger(Math.sqrt(e)),"perfect-square-take-while":e=>{const t=[];return function r(n){const o=n**2;return _(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(1)}},de={"polygonal-seq":{evaluate:([e,t],r)=>{p(e,r,{integer:!0,gte:3}),p(t,r,{integer:!0,positive:!0});const n=[];for(let r=1;r<=t;r+=1)n[r-1]=(r*r*(e-2)-r*(e-4))/2;return n},arity:A(2)},"polygonal-take-while":{evaluate:([e,t],r,n,{executeFunction:o})=>{p(e,r,{integer:!0,gte:3}),x(t,r);const i=e,a=t,s=[];return function e(t){const m=(t*t*(i-2)-t*(i-4))/2;return _(o(a,[m,t],n,r),r=>r?(s.push(m),e(t+1)):s)}(1)},arity:A(2)},"polygonal-nth":{evaluate:([e,t],r)=>(p(e,r,{integer:!0,gte:3}),p(t,r,{integer:!0,positive:!0}),(t*t*(e-2)-t*(e-4))/2),arity:A(2)},"polygonal?":{evaluate:([e,t],r)=>{if(p(t,r,{integer:!0}),p(e,r,{integer:!0,gte:3}),t<=0)return!1;const n=e-2,o=e-4,i=8*n*t+o*o,a=Math.sqrt(i);if(!Number.isInteger(a))return!1;const s=a+o;if(s%(2*n)!=0)return!1;const m=s/(2*n);return Number.isInteger(m)&&m>0},arity:A(2)}};const qe={"recaman-seq":e=>function(e){if(1===e)return[0];const t=[0],r=new Set([0]);for(let n=1;n<e;n++){let e=t[n-1]-n;(e<=0||r.has(e))&&(e=t[n-1]+n),t.push(e),r.add(e)}return t}(e),"recaman-take-while":e=>{const t=[],r=new Set([0]);return _(e(0,0),n=>{if(!n)return t;return t.push(0),function n(o){let i=t[o-1]-o;return(i<=0||r.has(i))&&(i=t[o-1]+o),_(e(i,o),e=>e?(t.push(i),r.add(i),n(o+1)):t)}(1)})},"recaman?":()=>!0},ve={"thue-morse-seq":e=>{const t=[];for(let r=0;r<e;r+=1)t[r]=ke(r)%2;return t},"thue-morse-take-while":e=>{const t=[];return function r(n){const o=ke(n)%2;return _(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(0)},"thue-morse?":e=>1===e||0===e};function ke(e){let t=0;for(;e;)t+=1&e,e>>=1;return t}const we={};function xe(e){for(const[t,r]of Object.entries(e)){if(we[t])throw new Error(`Duplicate normal expression key found: ${t}`);we[t]=r}}function Ae(e,t){return{[`${e}-seq`]:Te(e=>t.slice(0,e),t.length),[`${e}-take-while`]:Ge(e=>function r(n){return n>=t.length?t.slice(0,n):_(e(t[n],n),e=>e?r(n+1):t.slice(0,n))}(0),t.length),[`${e}-nth`]:$e(()=>t,t.length),[`${e}?`]:Ce(e=>t.includes(e))}}function Ne(e){for(const[t,r]of Object.entries(e)){if(we[t])throw new Error(`Duplicate normal expression key found: ${t}`);t.endsWith("seq")?(we[t]=Te(r,e.maxLength),e.noNth||(we[t.replace(/seq$/,"nth")]=$e(r,e.maxLength))):t.endsWith("take-while")?we[t]=Ge(r,e.maxLength):t.endsWith("?")&&(e.string?we[t]=We(r):we[t]=Ce(r))}}function Te(e,r){return{evaluate:(n,o)=>{const i=n[0]??r;p(i,o,{integer:!0,positive:!0,lte:r});const a=e(i,o);if("number"==typeof a[0]&&a.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",o);return a},arity:"number"==typeof r?{max:1}:A(1)}}function Ge(e,r){return{evaluate:(r,n,o,{executeFunction:i})=>{const a=r[0];x(a,n);const s=e((e,t)=>_(i(a,[e,t],o),e=>!!e),n);return _(s,e=>{if("number"==typeof e[0]&&e.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",n);return e})},arity:"number"==typeof r?{max:1}:A(1)}}function $e(e,r){return{evaluate:(n,o)=>{const i=n[0];p(i,o,{integer:!0,positive:!0,lte:r});const a=e(i,o);if("number"==typeof a[0]&&a.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",o);return a[i-1]},arity:A(1)}}function Ce(e){return{evaluate:(t,r)=>{const n=t[0];return p(n,r),e(n,r)},arity:A(1)}}function We(e){return{evaluate:(t,r)=>{const n=t[0];return function(e,t,r={}){if(!function(e,t={}){return!("string"!=typeof e||t.nonEmpty&&0===e.length||t.char&&1!==e.length)}(e,r))throw d(r.nonEmpty?"non empty string":r.char?"character":"string",e,t)}(n,r),e(n,r)},arity:A(1)}}function Me(e,t){for(;0!==t;){const r=t;t=e%t,e=r}return Math.abs(e)}function Se(e,t){return Math.floor(e*t/Me(e,t))}function Ee(e){if(1===e)return 1;const t=L(e);return new Set(t).size!==t.length?0:t.length%2==0?1:-1}function Re(e,t){if(0===t)return[e,1,0];const[r,n,o]=Re(t,e%t);return[r,o,n-Math.floor(e/t)*o]}function Ie(e,t){const[r,n]=Re(e,t);if(1!==r)throw new Error(`Modular inverse does not exist (gcd(${e}, ${t}) = ${r})`);return(n%t+t)%t}Ne(X),Ne({"collatz-seq":e=>{let t=e;const r=[t];for(;1!==t;)t%2==0?t/=2:t=3*t+1,r.push(t);return r},noNth:!0}),Ne(ee),Ne(re),Ne(oe),Ne(se),Ne(me),Ne(he),Ne(le),Ne(pe),Ne(fe),Ne(ye),Ne(ge),Ne(V),Ne(qe),Ne(ve),xe(Ae("tribonacci",[0,1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136,5768,10609,19513,35890,66012,121415,223317,410744,755476,1389537,2555757,4700770,8646064,15902591,29249425,53798080,98950096,181997601,334745777,615693474,1132436852,2082876103,3831006429,7046319384,12960201916,23837527729,43844049029,80641778674,148323355432,272809183135,501774317241,922906855808,1697490356184,3122171529233,5742568741225,0x99b36012952,19426970897100,35731770264967,65720971788709,0x6df08059d9f8,0xca35cf00a924,408933139743937,752145307699165,0x4ea34736b35c2,0x90a3317d5c260,4680045560037375,8607945812375585])),xe(Ae("catalan",[1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440,9694845,35357670,129644790,477638700,1767263190,6564120420,24466267020,91482563640,343059613650,1289904147324,4861946401452,18367353072152,69533550916004,0xefe09af96cd8,0x38f88b34d6a68,0xd8db5c347b610])),xe(Ae("factorial",R)),xe(Ae("fibonacci",[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,2971215073,4807526976,7778742049,12586269025,20365011074,32951280099,53316291173,86267571272,139583862445,225851433717,365435296162,591286729879,956722026041,1548008755920,2504730781961,4052739537881,6557470319842,0x9a661ca20bb,0xf9d297a859d,27777890035288,44945570212853,72723460248141,0x6b04f4c2fe42,0xad2934c6d08f,308061521170129,498454011879264,806515533049393,0x4a2dce62b0d91,0x780626e057bc2,0xc233f54308953,5527939700884757,8944394323791464])),xe(Ae("lucas",[2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749957122,17393796001,28143753123,45537549124,73681302247,119218851371,192900153618,312119004989,505019158607,817138163596,1322157322203,2139295485799,3461452808002,5600748293801,9062201101803,0xd55fbe3dc94,23725150497407,38388099893011,62113250390418,0x5b67cb4878a5,0x93e5a9822a37,0xef4d74caa2dc,425730551631123,688846502588399,0x3f5b3b1643d02,0x66834447bacf1,0xa5de7f5dfe9f3,4721424167835364,7639424778862807])),xe(Ae("mersenne",[3,7,31,127,2047,8191,131071,524287,2147483647])),xe(Ae("partition",z)),xe(Ae("pell",[1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,1136689,2744210,6625109,15994428,38613965,93222358,225058681,543339720,1311738121,3166815962,7645370045,18457556052,44560482149,107578520350,259717522849,627013566048,1513744654945,3654502875938,8822750406821,21300003689580,51422757785981,0x70e8e1937766,299713796309065,723573111879672,0x634c28af7f039,0xefb9b143d586a])),xe(Ae("perfect",[6,28,496,8128,33550336,8589869056,137438691328])),xe(Ae("sylvester",[2,6,42,1806,3263442,0x9afa8dc8416])),xe(Ae("bell",[1,2,5,15,52,203,877,4140,21147,115975,678570,4213597,27644437,190899322,1382958545,10480142147,82864869804,682076806159,5832742205057,51724158235372,474869816156751,4506715738447323])),xe(Z),xe(K),xe(ne),xe(de);const je={"coprime?":{evaluate:([e,t],r)=>(p(e,r,{integer:!0}),p(t,r,{integer:!0}),1===Me(e,t)),arity:A(2)},"divisible-by?":{evaluate:([e,t],r)=>(p(e,r,{integer:!0}),p(t,r,{integer:!0}),0!==t&&e%t===0),arity:A(2)},gcd:{evaluate:([e,t],r)=>(p(e,r),p(t,r),Me(e,t)),arity:A(2)},lcm:{evaluate:([e,t],r)=>(p(e,r),p(t,r),Se(e,t)),arity:A(2)},multinomial:{evaluate:([...e],t)=>{f(e,t);return I(e.reduce((e,r)=>(p(r,t,{integer:!0,nonNegative:!0}),e+r),0))/e.reduce((e,t)=>e*I(t),1)},arity:{min:1}},"amicable?":{evaluate:([e,t],r)=>{p(e,r,{integer:!0,positive:!0}),p(t,r,{integer:!0,positive:!0});const n=S(e).reduce((e,t)=>e+t,0),o=S(t).reduce((e,t)=>e+t,0);return n===t&&o===e&&e!==t},arity:A(2)},"euler-totient":{evaluate:([e],t)=>{p(e,t,{integer:!0,positive:!0});let r=e;for(let t=2;t*t<=e;t+=1)if(e%t===0){for(;e%t===0;)e/=t;r-=r/t}return e>1&&(r-=r/e),r},arity:A(1)},mobius:{evaluate:([e],t)=>{if(p(e,t,{integer:!0,positive:!0}),1===e)return 1;const r=L(e);return new Set(r).size!==r.length?0:r.length%2==0?1:-1},arity:A(1)},mertens:{evaluate:([e],t)=>{if(p(e,t,{integer:!0,positive:!0}),1===e)return 1;let r=0;for(let t=1;t<=e;t++){r+=Ee(t)}return r},arity:A(1)},sigma:{evaluate:([e],t)=>(p(e,t,{integer:!0,positive:!0}),M(e).reduce((e,t)=>e+t,0)),arity:A(1)},"carmichael-lambda":{evaluate:([e],t)=>{if(p(e,t,{integer:!0,positive:!0}),1===e)return 1;const r=L(e),n=new Map;for(const e of r)n.set(e,(n.get(e)||0)+1);const o=[];for(const[e,t]of n.entries())2===e?1===t?o.push(1):2===t?o.push(2):o.push(2**(t-2)):o.push((e-1)*e**(t-1));return o.reduce((e,t)=>Se(e,t),1)},arity:A(1)},"cartesian-product":{evaluate:(e,t)=>{e.forEach(e=>{q(e,t)});return e.reduce((e,t)=>{const r=[];return e.forEach(e=>{t.forEach(t=>{r.push([...e,t])})}),r},[[]])},arity:{min:1}},"perfect-power":{evaluate:([e],t)=>{p(e,t,{integer:!0,positive:!0});return be(e)||null},arity:A(1)},"mod-exp":{evaluate:([e,t,r],n)=>(p(e,n,{finite:!0}),p(t,n,{integer:!0,positive:!0}),p(r,n,{integer:!0,positive:!0}),function(e,t,r){if(1===r)return 0;let n=1;for(e%=r;t>0;)t%2==1&&(n=n*e%r),t>>=1,e=e*e%r;return n}(e,t,r)),arity:A(3)},"mod-inv":{evaluate:([e,r],n)=>{p(e,n,{integer:!0,positive:!0}),p(r,n,{integer:!0,positive:!0});try{return Ie(e,r)}catch(e){throw new t(e,n)}},arity:A(2)},"extended-gcd":{evaluate:([e,t],r)=>(p(e,r,{integer:!0}),p(t,r,{integer:!0}),Re(e,t)),arity:A(2)},"chinese-remainder":{evaluate:([e,r],n)=>{if(f(e,n),f(r,n),e.length!==r.length)throw new t("Remainders and moduli must have the same length.",n);try{return function(e,t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++){const n=Re(t[e],t[r])[0];if(1!==n)throw new Error(`Moduli must be pairwise coprime, but gcd(${t[e]}, ${t[r]}) = ${n}`)}const r=t.reduce((e,t)=>e*t,1);let n=0;for(let o=0;o<e.length;o++){const i=e[o],a=t[o],s=r/a;n=(n+i*s*Ie(s,a))%r}return n}(e,r)}catch(e){throw new t(e.message,n)}},arity:A(2)},"stirling-first":{evaluate:([e,t],r)=>{p(e,r,{integer:!0,positive:!0}),p(t,r,{integer:!0,positive:!0,lte:e});const n=Array.from({length:e+1},()=>Array(t+1).fill(0));n[0][0]=1;for(let r=1;r<=e;r++)for(let e=1;e<=Math.min(r,t);e++)n[r][e]=n[r-1][e-1]+(r-1)*n[r-1][e];return n[e][t]},arity:A(2)},"stirling-second":{evaluate:([e,t],r)=>{if(p(e,r,{integer:!0,positive:!0}),p(t,r,{integer:!0,positive:!0,lte:e}),1===t)return 1;if(t===e)return 1;const n=Array.from({length:e+1},()=>Array(t+1).fill(0));n[0][0]=1;for(let r=1;r<=e;r++)for(let e=1;e<=Math.min(r,t);e++)n[r][e]=e*n[r-1][e]+n[r-1][e-1];return n[e][t]},arity:A(2)}};function ze(e){for(const[t,r]of Object.entries(e)){if(je[t])throw new Error(`Duplicate normal expression key found: ${t}`);je[t]=r}}!function(e){for(const[t,r]of Object.entries(e)){if(je[t])throw new Error(`Duplicate normal expression key found: ${t}`);je[t]=r}}(we),ze(j),ze(E),ze($),ze(F),ze(D),ze(O),ze(C),ze(B);for(const[e,t]of Object.entries(N))je[e]&&(je[e].docs=t);const De={name:"number-theory",functions:je};export{De as numberTheoryModule};
2
+ //# sourceMappingURL=number-theory.esm.js.map