@cortex-js/compute-engine 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/package.json +1 -1
  2. package/dist/compute-engine.esm.js +0 -41311
  3. package/dist/compute-engine.min.esm.js +0 -125
  4. package/dist/compute-engine.min.umd.js +0 -127
  5. package/dist/compute-engine.umd.js +0 -41336
  6. package/dist/math-json.esm.js +0 -130
  7. package/dist/math-json.min.esm.js +0 -130
  8. package/dist/math-json.min.umd.js +0 -4
  9. package/dist/math-json.umd.js +0 -155
  10. package/dist/types/common/ansi-codes.d.ts +0 -41
  11. package/dist/types/common/configuration-change.d.ts +0 -28
  12. package/dist/types/common/fuzzy-string-match.d.ts +0 -2
  13. package/dist/types/common/grapheme-splitter.d.ts +0 -15
  14. package/dist/types/common/interruptible.d.ts +0 -20
  15. package/dist/types/common/one-of.d.ts +0 -10
  16. package/dist/types/common/signals.d.ts +0 -96
  17. package/dist/types/common/type/ast-nodes.d.ts +0 -146
  18. package/dist/types/common/type/boxed-type.d.ts +0 -30
  19. package/dist/types/common/type/lexer.d.ts +0 -51
  20. package/dist/types/common/type/parse.d.ts +0 -211
  21. package/dist/types/common/type/parser.d.ts +0 -45
  22. package/dist/types/common/type/primitive.d.ts +0 -10
  23. package/dist/types/common/type/serialize.d.ts +0 -2
  24. package/dist/types/common/type/subtype.d.ts +0 -6
  25. package/dist/types/common/type/type-builder.d.ts +0 -32
  26. package/dist/types/common/type/types.d.ts +0 -300
  27. package/dist/types/common/type/utils.d.ts +0 -36
  28. package/dist/types/common/utils.d.ts +0 -23
  29. package/dist/types/compute-engine/assume.d.ts +0 -26
  30. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +0 -165
  31. package/dist/types/compute-engine/boxed-expression/apply.d.ts +0 -5
  32. package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +0 -16
  33. package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +0 -27
  34. package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +0 -38
  35. package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +0 -11
  36. package/dist/types/compute-engine/boxed-expression/box.d.ts +0 -47
  37. package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +0 -44
  38. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +0 -136
  39. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +0 -103
  40. package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +0 -53
  41. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +0 -107
  42. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +0 -27
  43. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +0 -170
  44. package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +0 -83
  45. package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +0 -46
  46. package/dist/types/compute-engine/boxed-expression/cache.d.ts +0 -7
  47. package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +0 -5
  48. package/dist/types/compute-engine/boxed-expression/canonical.d.ts +0 -2
  49. package/dist/types/compute-engine/boxed-expression/compare.d.ts +0 -13
  50. package/dist/types/compute-engine/boxed-expression/expand.d.ts +0 -20
  51. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +0 -12
  52. package/dist/types/compute-engine/boxed-expression/factor.d.ts +0 -10
  53. package/dist/types/compute-engine/boxed-expression/flatten.d.ts +0 -25
  54. package/dist/types/compute-engine/boxed-expression/hold.d.ts +0 -10
  55. package/dist/types/compute-engine/boxed-expression/match.d.ts +0 -19
  56. package/dist/types/compute-engine/boxed-expression/negate.d.ts +0 -11
  57. package/dist/types/compute-engine/boxed-expression/numerics.d.ts +0 -34
  58. package/dist/types/compute-engine/boxed-expression/order.d.ts +0 -71
  59. package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +0 -105
  60. package/dist/types/compute-engine/boxed-expression/product.d.ts +0 -66
  61. package/dist/types/compute-engine/boxed-expression/rules.d.ts +0 -129
  62. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +0 -3
  63. package/dist/types/compute-engine/boxed-expression/sgn.d.ts +0 -46
  64. package/dist/types/compute-engine/boxed-expression/simplify.d.ts +0 -6
  65. package/dist/types/compute-engine/boxed-expression/solve.d.ts +0 -20
  66. package/dist/types/compute-engine/boxed-expression/terms.d.ts +0 -10
  67. package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +0 -9
  68. package/dist/types/compute-engine/boxed-expression/utils.d.ts +0 -64
  69. package/dist/types/compute-engine/boxed-expression/validate.d.ts +0 -58
  70. package/dist/types/compute-engine/collection-utils.d.ts +0 -35
  71. package/dist/types/compute-engine/compilation/base-compiler.d.ts +0 -31
  72. package/dist/types/compute-engine/compilation/javascript-target.d.ts +0 -68
  73. package/dist/types/compute-engine/compilation/types.d.ts +0 -83
  74. package/dist/types/compute-engine/cost-function.d.ts +0 -13
  75. package/dist/types/compute-engine/function-utils.d.ts +0 -120
  76. package/dist/types/compute-engine/global-types.d.ts +0 -2930
  77. package/dist/types/compute-engine/index.d.ts +0 -660
  78. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +0 -2
  79. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +0 -2
  80. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +0 -2
  81. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +0 -2
  82. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +0 -27
  83. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +0 -2
  84. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +0 -2
  85. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +0 -2
  86. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +0 -2
  87. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +0 -2
  88. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +0 -2
  89. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +0 -3
  90. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +0 -2
  91. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +0 -88
  92. package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +0 -21
  93. package/dist/types/compute-engine/latex-syntax/parse.d.ts +0 -303
  94. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +0 -29
  95. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +0 -10
  96. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +0 -37
  97. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +0 -18
  98. package/dist/types/compute-engine/latex-syntax/types.d.ts +0 -845
  99. package/dist/types/compute-engine/latex-syntax/utils.d.ts +0 -5
  100. package/dist/types/compute-engine/library/arithmetic.d.ts +0 -4
  101. package/dist/types/compute-engine/library/calculus.d.ts +0 -2
  102. package/dist/types/compute-engine/library/collections.d.ts +0 -27
  103. package/dist/types/compute-engine/library/combinatorics.d.ts +0 -2
  104. package/dist/types/compute-engine/library/complex.d.ts +0 -2
  105. package/dist/types/compute-engine/library/control-structures.d.ts +0 -2
  106. package/dist/types/compute-engine/library/core.d.ts +0 -2
  107. package/dist/types/compute-engine/library/invisible-operator.d.ts +0 -4
  108. package/dist/types/compute-engine/library/library.d.ts +0 -17
  109. package/dist/types/compute-engine/library/linear-algebra.d.ts +0 -2
  110. package/dist/types/compute-engine/library/logic.d.ts +0 -6
  111. package/dist/types/compute-engine/library/number-theory.d.ts +0 -2
  112. package/dist/types/compute-engine/library/polynomials.d.ts +0 -2
  113. package/dist/types/compute-engine/library/random-expression.d.ts +0 -2
  114. package/dist/types/compute-engine/library/relational-operator.d.ts +0 -2
  115. package/dist/types/compute-engine/library/sets.d.ts +0 -2
  116. package/dist/types/compute-engine/library/statistics.d.ts +0 -2
  117. package/dist/types/compute-engine/library/trigonometry.d.ts +0 -2
  118. package/dist/types/compute-engine/library/utils.d.ts +0 -77
  119. package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +0 -57
  120. package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +0 -75
  121. package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +0 -56
  122. package/dist/types/compute-engine/numeric-value/types.d.ts +0 -116
  123. package/dist/types/compute-engine/numerics/bigint.d.ts +0 -2
  124. package/dist/types/compute-engine/numerics/expression.d.ts +0 -4
  125. package/dist/types/compute-engine/numerics/interval.d.ts +0 -12
  126. package/dist/types/compute-engine/numerics/monte-carlo.d.ts +0 -4
  127. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +0 -18
  128. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +0 -9
  129. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +0 -3
  130. package/dist/types/compute-engine/numerics/numeric.d.ts +0 -60
  131. package/dist/types/compute-engine/numerics/primes.d.ts +0 -7
  132. package/dist/types/compute-engine/numerics/rationals.d.ts +0 -43
  133. package/dist/types/compute-engine/numerics/richardson.d.ts +0 -80
  134. package/dist/types/compute-engine/numerics/special-functions.d.ts +0 -28
  135. package/dist/types/compute-engine/numerics/statistics.d.ts +0 -24
  136. package/dist/types/compute-engine/numerics/strings.d.ts +0 -2
  137. package/dist/types/compute-engine/numerics/types.d.ts +0 -30
  138. package/dist/types/compute-engine/symbolic/antiderivative.d.ts +0 -3
  139. package/dist/types/compute-engine/symbolic/derivative.d.ts +0 -18
  140. package/dist/types/compute-engine/symbolic/distribute.d.ts +0 -5
  141. package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +0 -27
  142. package/dist/types/compute-engine/tensor/tensor-fields.d.ts +0 -128
  143. package/dist/types/compute-engine/tensor/tensors.d.ts +0 -93
  144. package/dist/types/compute-engine/types.d.ts +0 -8
  145. package/dist/types/compute-engine.d.ts +0 -3
  146. package/dist/types/math-json/symbols.d.ts +0 -11
  147. package/dist/types/math-json/types.d.ts +0 -122
  148. package/dist/types/math-json/utils.d.ts +0 -87
  149. package/dist/types/math-json.d.ts +0 -3
@@ -1,120 +0,0 @@
1
- /* 0.31.0 */
2
- import type { BoxedDefinition, BoxedExpression, ComputeEngine, Scope } from './global-types';
3
- /***
4
- * ### THEORY OF OPERATIONS
5
- *
6
- * The body of a `["Function"]` expression is a `["Block"]` expression,
7
- * which is scoped. The function arguments are declared in that scope as well.
8
- *
9
- * Some expressions with anonymous parameters (e.g. `["Add", "_", 1]`)
10
- * are rewritten to a `["Function"]` expression with anonymous parameters
11
- * (e.g. `["Function", ["Block", ["Add", "_", 1]], "_"]`).
12
- *
13
- *
14
- * #### DURING BOXING (in makeLambda())
15
- *
16
- * During the boxing/canonicalization phase of a function
17
- * (`["Function"]` expression or operator of expression):
18
- *
19
- * 1/ If not a `["Function"]` expression, the expression is rewritten
20
- * to a `["Function"]` expression with anonymous parameters
21
- * 2/ A new scope is created
22
- * 3/ The function parameters are declared in the scope
23
- * 4/ The function body is boxed in the context of the scope and the scope
24
- * is associated with the function
25
- *
26
- *
27
- * #### DURING EVALUATION (executing the result of makeLambda())
28
- *
29
- * 1/ The arguments are evaluated in the current scope
30
- * 2/ The context is swapped to the function scope
31
- * 3/ The function parameters are set to the value of the arguments
32
- * 4/ The function body is evaluated in the context of the function scope
33
- * 5/ The context is swapped back to the current scope
34
- * 6/ The result of the function body is returned
35
- *
36
- */
37
- /**
38
- * From an expression, return a predicate function, which can be used to filter.
39
- */
40
- export declare function predicate(_expr: BoxedExpression): (...args: BoxedExpression[]) => boolean;
41
- /**
42
- * From an expression, create an ordering function, which can be used to sort.
43
- */
44
- export declare function order(_expr: BoxedExpression): (a: BoxedExpression, b: BoxedExpression) => -1 | 0 | 1;
45
- /**
46
- * Given an expression, rewrite it to a symbol or canonical Function form.
47
- *
48
- * - symbol (no change):
49
- * "Sin"
50
- * -> "Sin"
51
- *
52
- * - built-in function:
53
- * ["BuiltinFunction", "Sin"]
54
- * -> "Sin"
55
- *
56
- * - parenthesized expression:
57
- * ["Delimiter", ["Add", "_", 1], "'()'"]
58
- * -> ["Function", ["Block", ["Add", "_", 1]], "_"]
59
- *
60
- * - explicit parameters (adding a block to serve as a scope for the arguments):
61
- * ["Function", ["Add", "x", 1], "x"]
62
- * -> ["Function", ["Block", ["Add", "x", 1]], "x"]
63
- *
64
- *
65
- * - single anonymous parameters:
66
- * ["Add", "_", 1]
67
- * -> ["Function", ["Block", ["Add", "_", 1]], "_"]
68
- *
69
- * - multiple anonymous parameters:
70
- * ["Add", "_1", "_2"]
71
- * -> ["Function", ["Block", ["Add", "_1", "_2"]], "_1", "_2"]
72
- *
73
- *
74
- */
75
- export declare function canonicalFunctionLiteral(expr: BoxedExpression | undefined): BoxedExpression | undefined;
76
- /** Assuming that ops has the following form:
77
- * - body
78
- * - ...params
79
- * return a canonical function literal (["Function", body, ...params]) where
80
- * body is potentially wrapped in a Block expression and the arguments are
81
- * declared in the scope of the body.
82
- */
83
- export declare function canonicalFunctionLiteralArguments(ce: ComputeEngine, ops: ReadonlyArray<BoxedExpression>): BoxedExpression | undefined;
84
- /**
85
- * Apply arguments to an expression which is either:
86
- * - a `["Function"]` expression
87
- * - the symbol for a function, e.g. `Sin`.
88
- */
89
- export declare function apply(fn: BoxedExpression, args: ReadonlyArray<BoxedExpression>): BoxedExpression;
90
- /**
91
- * Return a lambda function, assuming a scoped environment has been
92
- * created and there is a single numeric argument
93
- */
94
- export declare function makeLambdaN1(expr: BoxedExpression): ((arg: number) => number) | undefined;
95
- /**
96
- * Given an expression such as:
97
- * - ["Function", ["Add", 1, "x"], "x"]
98
- * - ["Function", ["Divide", "_", 2]]
99
- * - ["Multiply, "_", 3]
100
- * - ["Add, "_1", "_2"]
101
- * - "Sin"
102
- *
103
- * return a JS function that can be called with arguments.
104
- */
105
- export declare function applicable(fn: BoxedExpression): (xs: ReadonlyArray<BoxedExpression>) => BoxedExpression | undefined;
106
- /**
107
- * Use `applicableN1()` when the function is known to be a function with a
108
- * single real argument that returns a real value.
109
- *
110
- * Unlike `apply()`, `applicableN1()` returns a function that can be called
111
- * with an argument.
112
- *
113
- */
114
- export declare function applicableN1(fn: BoxedExpression): (x: number) => number;
115
- /**
116
- * Given a string like "f(x,y)" return, ["f", ["x", "y"]]
117
- */
118
- export declare function parseFunctionSignature(s: string): [id: string, args: string[] | undefined];
119
- /** Lookup a definition matching a symbol in a lexical scope chain */
120
- export declare function lookup(id: MathJsonSymbol, scope: Scope): undefined | BoxedDefinition;