@cortex-js/compute-engine 0.28.0 → 0.29.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 (148) hide show
  1. package/dist/{compute-engine.js → compute-engine.cjs} +22662 -23286
  2. package/dist/compute-engine.esm.js +22672 -23296
  3. package/dist/compute-engine.min.cjs +129 -0
  4. package/dist/compute-engine.min.esm.js +47 -63
  5. package/dist/{math-json.js → math-json.cjs} +2 -2
  6. package/dist/math-json.esm.js +2 -2
  7. package/dist/{math-json.min.js → math-json.min.cjs} +2 -2
  8. package/dist/math-json.min.esm.js +2 -2
  9. package/dist/types/common/ansi-codes.d.ts +1 -1
  10. package/dist/types/common/fuzzy-string-match.d.ts +1 -1
  11. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  12. package/dist/types/common/interruptible.d.ts +1 -1
  13. package/dist/types/common/json5.d.ts +1 -1
  14. package/dist/types/common/one-of.d.ts +2 -1
  15. package/dist/types/common/signals.d.ts +1 -2
  16. package/dist/types/common/type/boxed-type.d.ts +2 -1
  17. package/dist/types/common/type/parse.d.ts +1 -1
  18. package/dist/types/common/type/primitive.d.ts +1 -1
  19. package/dist/types/common/type/serialize.d.ts +1 -1
  20. package/dist/types/common/type/subtype.d.ts +1 -1
  21. package/dist/types/common/type/types.d.ts +102 -107
  22. package/dist/types/common/type/utils.d.ts +1 -1
  23. package/dist/types/common/utils.d.ts +1 -1
  24. package/dist/types/compute-engine/assume.d.ts +1 -1
  25. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +11 -14
  26. package/dist/types/compute-engine/boxed-expression/apply.d.ts +2 -2
  27. package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +3 -3
  28. package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +27 -0
  29. package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +2 -2
  30. package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
  31. package/dist/types/compute-engine/boxed-expression/box.d.ts +5 -5
  32. package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +12 -13
  33. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +4 -7
  34. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +6 -8
  35. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +2 -2
  36. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +2 -3
  37. package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +2 -2
  38. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +6 -7
  39. package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +5 -8
  40. package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
  41. package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
  42. package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
  43. package/dist/types/compute-engine/boxed-expression/expand.d.ts +3 -3
  44. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  45. package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -3
  46. package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
  47. package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
  48. package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
  49. package/dist/types/compute-engine/boxed-expression/negate.d.ts +2 -2
  50. package/dist/types/compute-engine/boxed-expression/numerics.d.ts +3 -3
  51. package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
  52. package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
  53. package/dist/types/compute-engine/boxed-expression/product.d.ts +5 -5
  54. package/dist/types/compute-engine/boxed-expression/rules.d.ts +2 -2
  55. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +3 -3
  56. package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
  57. package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
  58. package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -2
  59. package/dist/types/compute-engine/boxed-expression/terms.d.ts +2 -2
  60. package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +2 -9
  61. package/dist/types/compute-engine/boxed-expression/utils.d.ts +13 -4
  62. package/dist/types/compute-engine/boxed-expression/validate.d.ts +8 -9
  63. package/dist/types/compute-engine/collection-utils.d.ts +1 -1
  64. package/dist/types/compute-engine/compile.d.ts +2 -4
  65. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  66. package/dist/types/compute-engine/function-utils.d.ts +1 -1
  67. package/dist/types/compute-engine/{boxed-expression/public.d.ts → global-types.d.ts} +835 -807
  68. package/dist/types/compute-engine/{compute-engine.d.ts → index.d.ts} +7 -10
  69. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  70. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  71. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  72. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
  73. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  74. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
  75. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  76. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  77. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
  78. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  79. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
  80. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  81. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  82. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +2 -2
  83. package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +2 -2
  84. package/dist/types/compute-engine/latex-syntax/parse.d.ts +2 -2
  85. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +2 -2
  86. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +2 -2
  87. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +2 -2
  88. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  89. package/dist/types/compute-engine/latex-syntax/{public.d.ts → types.d.ts} +3 -1
  90. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -2
  91. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  92. package/dist/types/compute-engine/library/collections.d.ts +2 -2
  93. package/dist/types/compute-engine/library/complex.d.ts +1 -1
  94. package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
  95. package/dist/types/compute-engine/library/core.d.ts +1 -1
  96. package/dist/types/compute-engine/library/invisible-operator.d.ts +2 -2
  97. package/dist/types/compute-engine/library/library.d.ts +3 -3
  98. package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
  99. package/dist/types/compute-engine/library/logic.d.ts +1 -1
  100. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  101. package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
  102. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  103. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  104. package/dist/types/compute-engine/library/statistics.d.ts +1 -1
  105. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  106. package/dist/types/compute-engine/library/utils.d.ts +1 -1
  107. package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +3 -4
  108. package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +3 -5
  109. package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +3 -4
  110. package/dist/types/compute-engine/numeric-value/{public.d.ts → types.d.ts} +9 -5
  111. package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
  112. package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
  113. package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
  114. package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
  115. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
  116. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  117. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  118. package/dist/types/compute-engine/numerics/numeric.d.ts +2 -7
  119. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  120. package/dist/types/compute-engine/numerics/rationals.d.ts +1 -5
  121. package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
  122. package/dist/types/compute-engine/numerics/special-functions.d.ts +4 -4
  123. package/dist/types/compute-engine/numerics/statistics.d.ts +2 -2
  124. package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
  125. package/dist/types/compute-engine/numerics/types.d.ts +30 -0
  126. package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
  127. package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
  128. package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
  129. package/dist/types/compute-engine/{boxed-expression → tensor}/tensor-fields.d.ts +19 -18
  130. package/dist/types/compute-engine/tensor/tensors.d.ts +9 -12
  131. package/dist/types/compute-engine/types.d.ts +11 -0
  132. package/dist/types/compute-engine.d.ts +3 -6
  133. package/dist/types/math-json/identifiers.d.ts +1 -1
  134. package/dist/types/math-json/types.d.ts +4 -2
  135. package/dist/types/math-json/utils.d.ts +1 -1
  136. package/dist/types/math-json.d.ts +2 -2
  137. package/package.json +7 -7
  138. package/dist/compute-engine.min.js +0 -145
  139. package/dist/types/common/buffer.d.ts +0 -9
  140. package/dist/types/common/styled-text.d.ts +0 -28
  141. package/dist/types/common/syntax-highlighter.d.ts +0 -40
  142. package/dist/types/common/terminal.d.ts +0 -19
  143. package/dist/types/compute-engine/boxed-expression/arithmetic-divide.d.ts +0 -12
  144. package/dist/types/compute-engine/boxed-expression/arithmetic-multiply.d.ts +0 -16
  145. package/dist/types/compute-engine/debug.d.ts +0 -3
  146. package/dist/types/compute-engine/numerics/bignum.d.ts +0 -12
  147. package/dist/types/compute-engine/private.d.ts +0 -29
  148. package/dist/types/compute-engine/public.d.ts +0 -42
@@ -1,4 +1,4 @@
1
- /** MathJSON 0.28.0 */
1
+ /** MathJSON 0.29.0 */
2
2
  (function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
3
3
  var MathJson = (() => {
4
4
  var __defProp = Object.defineProperty;
@@ -407,7 +407,7 @@ var MathJson = (() => {
407
407
  }
408
408
 
409
409
  // src/math-json.ts
410
- var version = "0.28.0";
410
+ var version = "{{SDK_VERSION}}";
411
411
  return __toCommonJS(math_json_exports);
412
412
  })();
413
413
  Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
@@ -1,4 +1,4 @@
1
- /** Compute Engine 0.28.0 */
1
+ /** Compute Engine 0.29.0 */
2
2
 
3
3
  // src/common/json5.ts
4
4
  var JSON5 = class {
@@ -373,7 +373,7 @@ function mapArgs(expr, fn) {
373
373
  }
374
374
 
375
375
  // src/math-json.ts
376
- var version = "0.28.0";
376
+ var version = "0.29.0";
377
377
  export {
378
378
  dictionaryFromExpression,
379
379
  isFunctionObject,
@@ -1,6 +1,6 @@
1
- /** MathJSON 0.28.0 */
1
+ /** MathJSON 0.29.0 */
2
2
  (function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
3
3
  var MathJson=(()=>{var a=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var A=(n,t)=>{for(var i in t)a(n,i,{get:t[i],enumerable:!0})},w=(n,t,i,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of C(t))!x.call(n,r)&&r!==i&&a(n,r,{get:()=>t[r],enumerable:!(e=k(t,r))||e.enumerable});return n};var I=n=>w(a({},"__esModule",{value:!0}),n);var S={};A(S,{dictionaryFromExpression:()=>g,isFunctionObject:()=>u,isStringObject:()=>y,isSymbolObject:()=>f,mapArgs:()=>E,operand:()=>b,operator:()=>l,stringValue:()=>c,symbol:()=>m,version:()=>v});var o=class{static parse(t){let i=new h(t),e=i.parseValue();if(i.skipWhitespace(),!i.isAtEnd())throw i.error(`Unexpected token '${i.currentChar()}' after parsing complete value`);return e}},h=class{constructor(t){this.index=0;this.text=t}parseValue(){if(this.skipWhitespace(),this.isAtEnd())throw this.error("Unexpected end of input");let t=this.currentChar();return t==="{"?this.parseObject():t==="["?this.parseArray():t==='"'||t==="'"?this.parseString():t==="-"||t==="+"||t>="0"&&t<="9"||t==="."?this.parseNumber():this.parseIdentifier()}parseObject(){let t={};if(this.expectChar("{"),this.skipWhitespace(),this.currentChar()==="}")return this.index++,t;for(;;){this.skipWhitespace();let i,e=this.currentChar();e==='"'||e==="'"?i=this.parseString():i=this.parseIdentifier(),this.skipWhitespace(),this.expectChar(":"),this.skipWhitespace();let r=this.parseValue();if(t[i]=r,this.skipWhitespace(),this.currentChar()===","){if(this.index++,this.skipWhitespace(),this.currentChar()==="}"){this.index++;break}}else if(this.currentChar()==="}"){this.index++;break}else throw this.error(`Expected ',' or '}' in object but found '${this.currentChar()}'`)}return t}parseArray(){let t=[];if(this.expectChar("["),this.skipWhitespace(),this.currentChar()==="]")return this.index++,t;for(;;)if(this.skipWhitespace(),t.push(this.parseValue()),this.skipWhitespace(),this.currentChar()===","){if(this.index++,this.skipWhitespace(),this.currentChar()==="]"){this.index++;break}}else if(this.currentChar()==="]"){this.index++;break}else throw this.error(`Expected ',' or ']' in array but found '${this.currentChar()}'`);return t}parseString(){let t=this.currentChar();if(t!=='"'&&t!=="'")throw this.error(`String should start with a quote, got '${t}'`);this.index++;let i="";for(;!this.isAtEnd();){let e=this.currentChar();if(e===t)return this.index++,i;if(e==="\\"){if(this.index++,this.isAtEnd())throw this.error("Unterminated escape sequence in string");let r=this.currentChar();switch(r){case"b":i+="\b";break;case"f":i+="\f";break;case"n":i+=`
4
4
  `;break;case"r":i+="\r";break;case"t":i+=" ";break;case"v":i+="\v";break;case"\\":i+="\\";break;case"'":i+="'";break;case'"':i+='"';break;case"0":i+="\0";break;case"u":{this.index++;let s=this.text.substr(this.index,4);if(!/^[0-9a-fA-F]{4}$/.test(s))throw this.error(`Invalid Unicode escape sequence: \\u${s}`);i+=String.fromCharCode(parseInt(s,16)),this.index+=3;break}default:i+=r}this.index++}else i+=e,this.index++}throw this.error("Unterminated string literal")}parseNumber(){let t=this.index;if(this.text.startsWith("-Infinity",this.index))return this.index+=9,-1/0;if(this.text.startsWith("+Infinity",this.index))return this.index+=9,1/0;if(this.text.startsWith("Infinity",this.index))return this.index+=8,1/0;for(;!this.isAtEnd()&&/[0-9+\-_.eE]/.test(this.currentChar());)this.index++;let i=this.text.slice(t,this.index),e=i.replace(/_/g,""),r=Number(e);if(isNaN(r))throw this.error(`Invalid number: ${i}`);return r}parseIdentifier(){let t=this.index,i=this.currentChar();if(!/[a-zA-Z$_]/.test(i))throw this.error(`Unexpected token '${i}'`);for(this.index++;!this.isAtEnd();){let r=this.currentChar();if(!/[a-zA-Z0-9$_]/.test(r))break;this.index++}let e=this.text.slice(t,this.index);return e==="true"?!0:e==="false"?!1:e==="null"?null:e==="Infinity"?1/0:e==="NaN"?NaN:e}skipWhitespace(){for(;!this.isAtEnd();){let t=this.currentChar();if(/\s/.test(t)){this.index++;continue}if(t==="/"){let i=this.peekChar(1);if(i==="/"){for(this.index+=2;!this.isAtEnd()&&this.currentChar()!==`
5
- `;)this.index++;continue}else if(i==="*"){for(this.index+=2;!this.isAtEnd()&&!(this.currentChar()==="*"&&this.peekChar(1)==="/");)this.index++;if(this.isAtEnd())throw this.error("Unterminated multi-line comment");this.index+=2;continue}}break}}expectChar(t){if(this.currentChar()!==t)throw this.error(`Expected '${t}' but found '${this.currentChar()}'`);this.index++}currentChar(){return this.text[this.index]}peekChar(t){return this.text[this.index+t]}isAtEnd(){return this.index>=this.text.length}error(t){return new Error(`${t} at position ${this.index}`)}};function f(n){return n!==null&&typeof n=="object"&&"sym"in n}function y(n){return n!==null&&typeof n=="object"&&"str"in n}function u(n){return n!==null&&typeof n=="object"&&"fn"in n}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"||n.length<2||n.at(0)!=="'"||n.at(-1)!=="'"?null:n.substring(1,n.length-1)}function l(n){return Array.isArray(n)?n[0]:n==null?"":u(n)?n.fn[0]:""}function p(n){return Array.isArray(n)?n.slice(1):n!==void 0&&u(n)?n.fn.slice(1):[]}function b(n,t){return Array.isArray(n)?n[t]??null:n===null||!u(n)?null:n.fn[t]??null}function N(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):u(n)?Math.max(0,n.fn.length-1):0}function m(n){if(typeof n=="string")return/^[+-]?[0-9\.]/.test(n)||n.length>=2&&n[0]==="'"&&n[n.length-1]==="'"?null:n;if(n==null)return null;let t=f(n)?n.sym:n;return typeof t!="string"?null:t}function d(n){let t=l(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,e]=p(n),r=c(i);return r?[r,e??"Nothing"]:null}return null}function g(n){if(n===null)return null;if(typeof n=="object"&&!("sym"in n)&&!("num"in n)&&!("str"in n)&&!("fn"in n))return n;if(typeof n=="string"&&n[0]==="{"&&n[n.length-1]==="}")try{return o.parse(n)}catch{return null}let t=d(n);if(t)return{[t[0]]:t[1]};if(l(n)==="Dictionary"){let i={},e=p(n);for(let r=1;r<N(n);r++){let s=d(e[r]);s&&(i[s[0]]=s[1])}return i}return null}function E(n,t){let i=null;if(Array.isArray(n)&&(i=n),u(n)&&(i=n.fn),i===null)return[];let e=1,r=[];for(;e<i.length;)r.push(t(i[e])),e+=1;return r}var v="0.28.0";return I(S);})();
5
+ `;)this.index++;continue}else if(i==="*"){for(this.index+=2;!this.isAtEnd()&&!(this.currentChar()==="*"&&this.peekChar(1)==="/");)this.index++;if(this.isAtEnd())throw this.error("Unterminated multi-line comment");this.index+=2;continue}}break}}expectChar(t){if(this.currentChar()!==t)throw this.error(`Expected '${t}' but found '${this.currentChar()}'`);this.index++}currentChar(){return this.text[this.index]}peekChar(t){return this.text[this.index+t]}isAtEnd(){return this.index>=this.text.length}error(t){return new Error(`${t} at position ${this.index}`)}};function f(n){return n!==null&&typeof n=="object"&&"sym"in n}function y(n){return n!==null&&typeof n=="object"&&"str"in n}function u(n){return n!==null&&typeof n=="object"&&"fn"in n}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"||n.length<2||n.at(0)!=="'"||n.at(-1)!=="'"?null:n.substring(1,n.length-1)}function l(n){return Array.isArray(n)?n[0]:n==null?"":u(n)?n.fn[0]:""}function p(n){return Array.isArray(n)?n.slice(1):n!==void 0&&u(n)?n.fn.slice(1):[]}function b(n,t){return Array.isArray(n)?n[t]??null:n===null||!u(n)?null:n.fn[t]??null}function N(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):u(n)?Math.max(0,n.fn.length-1):0}function m(n){if(typeof n=="string")return/^[+-]?[0-9\.]/.test(n)||n.length>=2&&n[0]==="'"&&n[n.length-1]==="'"?null:n;if(n==null)return null;let t=f(n)?n.sym:n;return typeof t!="string"?null:t}function d(n){let t=l(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,e]=p(n),r=c(i);return r?[r,e??"Nothing"]:null}return null}function g(n){if(n===null)return null;if(typeof n=="object"&&!("sym"in n)&&!("num"in n)&&!("str"in n)&&!("fn"in n))return n;if(typeof n=="string"&&n[0]==="{"&&n[n.length-1]==="}")try{return o.parse(n)}catch{return null}let t=d(n);if(t)return{[t[0]]:t[1]};if(l(n)==="Dictionary"){let i={},e=p(n);for(let r=1;r<N(n);r++){let s=d(e[r]);s&&(i[s[0]]=s[1])}return i}return null}function E(n,t){let i=null;if(Array.isArray(n)&&(i=n),u(n)&&(i=n.fn),i===null)return[];let e=1,r=[];for(;e<i.length;)r.push(t(i[e])),e+=1;return r}var v="{{SDK_VERSION}}";return I(S);})();
6
6
  Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
@@ -1,4 +1,4 @@
1
- /** Compute Engine 0.28.0 */
1
+ /** Compute Engine 0.29.0 */
2
2
 
3
3
  // src/common/json5.ts
4
4
  var JSON5 = class {
@@ -373,7 +373,7 @@ function mapArgs(expr, fn) {
373
373
  }
374
374
 
375
375
  // src/math-json.ts
376
- var version = "0.28.0";
376
+ var version = "0.29.0";
377
377
  export {
378
378
  dictionaryFromExpression,
379
379
  isFunctionObject,
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  export declare const DEFAULT_COLOR = "\u001B[39m";
3
3
  export declare const DEFAULT_BG = "\u001B[49m";
4
4
  export declare const WHITE_BG = "\u001B[47m";
@@ -1,2 +1,2 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  export declare function fuzzyStringMatch(invalidWord: string, validWords: string[]): string | null;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  /**
3
3
  * Return a string or an array of graphemes.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  cause: unknown;
3
3
  value: T;
4
4
  constructor({ message, value, cause, }?: {
@@ -1,3 +1,3 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  static parse(input: string): any;
3
3
  }
@@ -1,7 +1,8 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  infer Head,
3
3
  ...infer Rem
4
4
  ] ? MergeTypes<Rem, Res & Head> : Res;
5
+ /** @internal */
5
6
  export type OneOf<TypesArray extends any[], Res = never, AllProperties = MergeTypes<TypesArray>> = TypesArray extends [infer Head, ...infer Rem] ? OneOf<Rem, Res | OnlyFirst<Head, AllProperties>, AllProperties> : Res;
6
7
  type OnlyFirst<F, S> = F & {
7
8
  [Key in keyof Omit<S, keyof F>]?: never;
@@ -1,5 +1,4 @@
1
- /* 0.28.0 */
2
- /** @category Error Handling */
1
+ /* 0.29.0 */
3
2
  export type RuntimeSignalCode = 'timeout' | 'out-of-memory' | 'recursion-depth-exceeded' | 'iteration-limit-exceeded';
4
3
  /** @category Error Handling */
5
4
  export type SignalCode = RuntimeSignalCode | ('invalid-name' | 'expected-predicate' | 'expected-symbol' | 'operator-requires-one-operand' | 'postfix-operator-requires-one-operand' | 'prefix-operator-requires-one-operand' | 'unbalanced-symbols' | 'expected-argument' | 'unexpected-command' | 'cyclic-definition' | 'invalid-supersets' | 'expected-supersets' | 'unknown-domain' | 'duplicate-wikidata' | 'invalid-dictionary-entry' | 'syntax-error');
@@ -1,4 +1,5 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
+ /** @category Type */
2
3
  export declare class BoxedType {
3
4
  static unknown: BoxedType;
4
5
  type: Type;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  export declare function parseType(s: undefined): undefined;
3
3
  export declare function parseType(s: string | Type): Type;
4
4
  export declare function parseType(s: string | Type | undefined): Type | undefined;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  /** All the types representing numeric values */
3
3
  export declare const NUMERIC_TYPES: PrimitiveType[];
4
4
  export declare const COLLECTION_TYPES: PrimitiveType[];
@@ -1,2 +1,2 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  export declare function typeToString(type: Type, precedence?: number): string;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  /** Return true if lhs is a subtype of rhs */
3
3
  export declare function isPrimitiveSubtype(lhs: PrimitiveType, rhs: PrimitiveType): boolean;
4
4
  /** Return true if lhs is a subtype of rhs */
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  * A primitive type is a simple type that represents a concrete value.
3
3
  *
4
4
  * - `any`: the top type
@@ -10,14 +10,14 @@
10
10
  *
11
11
  * - `expression`:
12
12
  * - a symbolic expression, such as `["Add", "x", 1]`
13
- * - <value>
13
+ * - `<value>`
14
14
  * - `symbol`: a symbol, such as `x`.
15
15
  * - `function`: a function expression
16
16
  * such as `["Function", ["Add", "x", 1], "x"]`.
17
17
  *
18
18
  * - `value`
19
19
  * - `scalar`
20
- * - <number>
20
+ * - `<number>`
21
21
  * - `boolean`: a boolean value: `True` or `False`.
22
22
  * - `string`: a string of characters.
23
23
  * - `collection`
@@ -130,110 +130,105 @@ export type Type = PrimitiveType | AlgebraicType | NegationType | CollectionType
130
130
  * The type is represented either by a primitive type (e.g. number, complex, collection, etc.), or a compound type (e.g. tuple, function signature, etc.).
131
131
  *
132
132
  * Types are described using the following BNF grammar:
133
-
134
- ```bnf
135
- <type> ::= <union_type> | "(" <type> ")"
136
-
137
- <union_type> ::= <intersection_type> (" | " <intersection_type>)*
138
-
139
- <intersection_type> ::= <primary_type> (" & " <primary_type>)*
140
-
141
- <primary_type> ::= <primitive>
142
- | <tuple_type>
143
- | <signature>
144
- | <list_type>
145
-
146
- <primitive> ::= "any" | "unknown" | <value-type> | <symbolic-type> | <numeric-type>
147
-
148
- <numeric-type> ::= "number" | "complex" | "imaginary" | "real" | "rational" | "integer"
149
-
150
- <value-type> ::= "value" | <numeric-type> | "collection" | "boolean" | "string"
151
-
152
- <symbolic-type> ::= "expression" | "function" | "symbol"
153
-
154
- <tuple_type> ::= "tuple<" (<name> <type> "," <named_tuple_elements>*) ">"
155
- | "tuple<" (<type> "," <unnamed_tuple_elements>*) ">" |
156
- | "tuple<" <tuple_elements> ">"
157
-
158
- <tuple_elements> ::= <unnamed_tuple_elements> | <named_tuple_elements>
159
-
160
- <unnamed_tuple_elements> ::= <type> ("," <type>)*
161
-
162
- <named_tuple_elements> ::= <name> <type> ("," <name> <type>)*
163
-
164
- <signature> ::= <arguments> " -> " <type>
165
-
166
- <arguments> ::= "()"
167
- | <argument>
168
- | "(" <argument-list> ")"
169
-
170
- <argument> ::= <type>
171
- | <name> <type>
172
-
173
- <rest_argument> ::= "..." <type>
174
- | <name> "..." <type>
175
-
176
- <optional_argument> ::= <argument> "?"
177
-
178
- <optional_arguments> ::= <optional_argument> ("," <optional_argument>)*
179
-
180
- <required_arguments> ::= <argument> ("," <argument>)*
181
-
182
- <argument-list> ::= <required_arguments> ("," <rest_argument>)?
183
- | <required_arguments> <optional_arguments>?
184
- | <optional_arguments>?
185
- | <rest_argument>
186
-
187
-
188
- <list_type> ::= "list<" <type> <dimensions>? ">"
189
-
190
- <dimensions> ::= "^" <fixed_size>
191
- | "^(" <multi_dimensional_size> ")"
192
-
193
- <fixed_size> ::= <positive-integer_literal>
194
-
195
- <multi_dimensional_size> ::= <positive-integer_literal> "x" <positive-integer_literal> ("x" <positive-integer_literal>)*
196
-
197
- <map> ::= "map" | "map<" <map_elements> ">"
198
-
199
- <map_elements> ::= <name> <type> ("," <name> <type>)*
200
-
201
- <set> ::= "set<" <type> ">"
202
-
203
- <collection ::= "collection<" <type> ">"
204
-
205
- <name> ::= <identifier> ":"
206
-
207
- <identifier> ::= [a-zA-Z_][a-zA-Z0-9_]*
208
-
209
- <positive-integer_literal> ::= [1-9][0-9]*
210
- ```
211
-
212
-
213
- Examples of types strings:
214
- "number" -- a simple type primitive
215
- "(number, boolean)" -- a tuple type
216
- "(x: number, y:boolean)" -- a named tuple/record type. Either all arguments are named, or none are
217
-
218
- "collection<any>" -- an arbitrary collection type, with no length or element type restrictions
219
- "collection<integer>" -- a collection type where all the elements are integers
220
- "collection<(number, boolean)>" -- a collection of tuples
221
- "collection<(value:number, seen:boolean)>" -- a collection of named tuples
222
- "[boolean]^32" -- a collection type with a fixed size of 32 elements
223
- "[integer]^(2x3)" -- an integer matrix of 2 columns and 3 rows
224
- "[integer]^(2x3x4)" -- a tensor of dimensions 2x3x4
225
-
226
- "number -> number" -- a signature with a single argument
227
- "(x: number, number) -> number" -- a signature with a named argument
228
- "(number, y:number?) -> number" -- a signature with an optional named argument (can have several optional arguments, at the end)
229
- "(number, ...number) -> number" -- a signature with a rest argument (can have only one, and no optional arguments if there is a rest argument).
230
- "() -> number" -- a signature with an empty argument list
231
-
232
- "number | boolean" -- a union type
233
- "(x: number) & (y: number)" -- an intersection type
234
- "number | ((x: number) & (y: number))" -- a union type with an intersection type
235
- "(number -> number) | number" -- a union type with a signature and a primitive type
236
- */
133
+ *
134
+ * ```bnf
135
+ * <type> ::= <union_type> | "(" <type> ")"
136
+ *
137
+ * <union_type> ::= <intersection_type> (" | " <intersection_type>)*
138
+ *
139
+ * <intersection_type> ::= <primary_type> (" & " <primary_type>)*
140
+ *
141
+ * <primary_type> ::= <primitive>
142
+ * | <tuple_type>
143
+ * | <signature>
144
+ * | <list_type>
145
+ *
146
+ * <primitive> ::= "any" | "unknown" | <value-type> | <symbolic-type> | <numeric-type>
147
+ *
148
+ * <numeric-type> ::= "number" | "complex" | "imaginary" | "real" | "rational" | "integer"
149
+ *
150
+ * <value-type> ::= "value" | <numeric-type> | "collection" | "boolean" | "string"
151
+ *
152
+ * <symbolic-type> ::= "expression" | "function" | "symbol"
153
+ *
154
+ * <tuple_type> ::= "tuple<" (<name> <type> "," <named_tuple_elements>*) ">"
155
+ * | "tuple<" (<type> "," <unnamed_tuple_elements>*) ">" |
156
+ * | "tuple<" <tuple_elements> ">"
157
+ *
158
+ * <tuple_elements> ::= <unnamed_tuple_elements> | <named_tuple_elements>
159
+ *
160
+ * <unnamed_tuple_elements> ::= <type> ("," <type>)*
161
+ *
162
+ * <named_tuple_elements> ::= <name> <type> ("," <name> <type>)*
163
+ *
164
+ * <signature> ::= <arguments> " -> " <type>
165
+ *
166
+ * <arguments> ::= "()"
167
+ * | <argument>
168
+ * | "(" <argument-list> ")"
169
+ *
170
+ * <argument> ::= <type>
171
+ * | <name> <type>
172
+ *
173
+ * <rest_argument> ::= "..." <type>
174
+ * | <name> "..." <type>
175
+ *
176
+ * <optional_argument> ::= <argument> "?"
177
+ *
178
+ * <optional_arguments> ::= <optional_argument> ("," <optional_argument>)*
179
+ *
180
+ * <required_arguments> ::= <argument> ("," <argument>)*
181
+ *
182
+ * <argument-list> ::= <required_arguments> ("," <rest_argument>)?
183
+ * | <required_arguments> <optional_arguments>?
184
+ * | <optional_arguments>?
185
+ * | <rest_argument>
186
+ *
187
+ * <list_type> ::= "list<" <type> <dimensions>? ">"
188
+ *
189
+ * <dimensions> ::= "^" <fixed_size>
190
+ * | "^(" <multi_dimensional_size> ")"
191
+ *
192
+ * <fixed_size> ::= <positive-integer_literal>
193
+ *
194
+ * <multi_dimensional_size> ::= <positive-integer_literal> "x" <positive-integer_literal> ("x" <positive-integer_literal>)*
195
+ *
196
+ * <map> ::= "map" | "map<" <map_elements> ">"
197
+ *
198
+ * <map_elements> ::= <name> <type> ("," <name> <type>)*
199
+ *
200
+ * <set> ::= "set<" <type> ">"
201
+ *
202
+ * <collection ::= "collection<" <type> ">"
203
+ *
204
+ * <name> ::= <identifier> ":"
205
+ *
206
+ * <identifier> ::= [a-zA-Z_][a-zA-Z0-9_]*
207
+ *
208
+ * <positive-integer_literal> ::= [1-9][0-9]*
209
+ *```
210
+ *
211
+ * Examples of types strings:
212
+ * - `"number"` -- a simple type primitive
213
+ * - `"(number, boolean)"` -- a tuple type
214
+ * - `"(x: number, y:boolean)"` -- a named tuple/record type. Either all arguments are named, or none are
215
+ * - `"collection<any>"` -- an arbitrary collection type, with no length or element type restrictions
216
+ * - `"collection<integer>"` -- a collection type where all the elements are integers
217
+ * - `"collection<(number, boolean)>"` -- a collection of tuples
218
+ * - `"collection<(value:number, seen:boolean)>"` -- a collection of named tuples
219
+ * - `"[boolean]^32"` -- a collection type with a fixed size of 32 elements
220
+ * - `"[integer]^(2x3)"` -- an integer matrix of 2 columns and 3 rows
221
+ * - `"[integer]^(2x3x4)"` -- a tensor of dimensions 2x3x4
222
+ * - `"number -> number"` -- a signature with a single argument
223
+ * - `"(x: number, number) -> number"` -- a signature with a named argument
224
+ * - `"(number, y:number?) -> number"` -- a signature with an optional named argument (can have several optional arguments, at the end)
225
+ * - `"(number, ...number) -> number"` -- a signature with a rest argument (can have only one, and no optional arguments if there is a rest argument).
226
+ * - `"() -> number"` -- a signature with an empty argument list
227
+ * - `"number | boolean"` -- a union type
228
+ * - `"(x: number) & (y: number)"` -- an intersection type
229
+ * - `"number | ((x: number) & (y: number))"` -- a union type with an intersection type
230
+ * - `"(number -> number) | number"` -- a union type with a signature and a primitive type
231
+ */
237
232
  export type TypeString = string;
238
233
  export type TypeCompatibility = 'covariant' | 'contravariant' | 'bivariant' | 'invariant';
239
234
  export type TypeResolver = (name: string) => Type | undefined;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  /** Convert two or more types into a more specific type that is a subtype of
3
3
  * all the input types. The resulting type is usually more constrained and
4
4
  * only encompasses values that belong to both input types.
@@ -1,2 +1,2 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  export declare function hidePrivateProperties(obj: any): void;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  /**
3
3
  * Add an assumption, in the form of a predicate, for example:
4
4
  *
@@ -1,11 +1,11 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  import { Expression, MathJsonIdentifier } from '../../math-json/types';
3
- import type { BoxedBaseDefinition, BoxedExpression, BoxedFunctionDefinition, BoxedRuleSet, BoxedSubstitution, BoxedSymbolDefinition, CanonicalOptions, EvaluateOptions, IComputeEngine, JsonSerializationOptions, Metadata, PatternMatchOptions, Rule, RuntimeScope, Sign, SimplifyOptions, Substitution } from './public';
4
- import type { LatexString } from '../public';
5
- import type { NumericValue } from '../numeric-value/public';
6
- import type { SmallInteger } from '../numerics/numeric';
7
- import { CompiledType } from '../compile';
8
- import type { SerializeLatexOptions } from '../latex-syntax/public';
3
+ import type { Type, TypeString } from '../../common/type/types';
4
+ import { BoxedType } from '../../common/type/boxed-type';
5
+ import type { BoxedSubstitution, Metadata, RuntimeScope, Substitution, CanonicalOptions, BoxedRuleSet, Rule, BoxedBaseDefinition, BoxedSymbolDefinition, BoxedFunctionDefinition, EvaluateOptions, CompiledType, Sign, BoxedExpression, JsonSerializationOptions, PatternMatchOptions, SimplifyOptions, TensorData, ComputeEngine } from '../global-types';
6
+ import type { NumericValue } from '../numeric-value/types';
7
+ import type { SmallInteger } from '../numerics/types';
8
+ import type { LatexString, SerializeLatexOptions } from '../latex-syntax/types';
9
9
  import { AsciiMathOptions } from './ascii-math';
10
10
  /**
11
11
  * _BoxedExpression
@@ -19,12 +19,12 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
19
19
  abstract get isCanonical(): boolean;
20
20
  abstract set isCanonical(_val: boolean);
21
21
  abstract match(pattern: BoxedExpression, options?: PatternMatchOptions): BoxedSubstitution | null;
22
- readonly engine: IComputeEngine;
22
+ readonly engine: ComputeEngine;
23
23
  /** Verbatim LaTeX, obtained from a source, i.e. from parsing,
24
24
  * not generated synthetically
25
25
  */
26
26
  verbatimLatex?: string;
27
- constructor(ce: IComputeEngine, metadata?: Metadata);
27
+ constructor(ce: ComputeEngine, metadata?: Metadata);
28
28
  isSame(rhs: BoxedExpression): boolean;
29
29
  isEqual(rhs: number | BoxedExpression): boolean | undefined;
30
30
  isLess(_rhs: number | BoxedExpression): boolean | undefined;
@@ -61,7 +61,7 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
61
61
  get latex(): LatexString;
62
62
  set latex(val: LatexString);
63
63
  get symbol(): string | null;
64
- get tensor(): null | AbstractTensor<'expression'>;
64
+ get tensor(): null | TensorData<'expression'>;
65
65
  get string(): string | null;
66
66
  getSubexpressions(operator: MathJsonIdentifier): ReadonlyArray<BoxedExpression>;
67
67
  get subexpressions(): ReadonlyArray<BoxedExpression>;
@@ -151,7 +151,7 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
151
151
  to?: 'javascript';
152
152
  functions?: Record<MathJsonIdentifier, string | ((...any: any[]) => any)>;
153
153
  vars?: Record<MathJsonIdentifier, string>;
154
- imports?: Function[];
154
+ imports?: ((...any: any[]) => any)[];
155
155
  preamble?: string;
156
156
  }): (args: Record<string, any>) => CompiledType;
157
157
  get isCollection(): boolean;
@@ -164,6 +164,3 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
164
164
  indexOf(_expr: BoxedExpression): number;
165
165
  }
166
166
  export declare function getSubexpressions(expr: BoxedExpression, name: MathJsonIdentifier): ReadonlyArray<BoxedExpression>;
167
- import type { Type, TypeString } from '../../common/type/types';
168
- import { AbstractTensor } from '../tensor/tensors';
169
- import { BoxedType } from '../../common/type/boxed-type';
@@ -1,5 +1,5 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  import { Decimal } from 'decimal.js';
3
- import type { BoxedExpression } from '../public';
3
+ import type { BoxedExpression } from '../global-types';
4
4
  export declare function apply(expr: BoxedExpression, fn: (x: number) => number | Complex, bigFn?: (x: Decimal) => Decimal | Complex | number, complexFn?: (x: Complex) => number | Complex): BoxedExpression | undefined;
5
5
  export declare function apply2(expr1: BoxedExpression, expr2: BoxedExpression, fn: (x1: number, x2: number) => number | Complex, bigFn?: (x1: Decimal, x2: Decimal) => Decimal | Complex | number, complexFn?: (x1: Complex, x2: number | Complex) => Complex | number): BoxedExpression | undefined;
@@ -1,6 +1,6 @@
1
- /* 0.28.0 */
2
- import { Type } from '../../common/type/types';
1
+ /* 0.29.0 */
3
2
  import { BoxedType } from '../../common/type/boxed-type';
3
+ import type { BoxedExpression, ComputeEngine } from '../global-types';
4
4
  /**
5
5
  *
6
6
  * The canonical form of `Add`:
@@ -10,7 +10,7 @@ import { BoxedType } from '../../common/type/boxed-type';
10
10
  * - sort the terms
11
11
  *
12
12
  */
13
- export declare function canonicalAdd(ce: IComputeEngine, ops: ReadonlyArray<BoxedExpression>): BoxedExpression;
13
+ export declare function canonicalAdd(ce: ComputeEngine, ops: ReadonlyArray<BoxedExpression>): BoxedExpression;
14
14
  export declare function addType(args: ReadonlyArray<BoxedExpression>): Type | BoxedType;
15
15
  export declare function add(...xs: ReadonlyArray<BoxedExpression>): BoxedExpression;
16
16
  export declare function addN(...xs: ReadonlyArray<BoxedExpression>): BoxedExpression;
@@ -0,0 +1,27 @@
1
+ /* 0.29.0 */
2
+ /**
3
+ * Canonical form of 'Divide' (and 'Rational')
4
+ * - remove denominator of 1
5
+ * - simplify the signs
6
+ * - factor out negate (make the numerator and denominator positive)
7
+ * - if numerator and denominator are integer literals, return a rational number
8
+ * or Rational expression
9
+ * - evaluate number literals
10
+ */
11
+ export declare function canonicalDivide(op1: BoxedExpression, op2: BoxedExpression): BoxedExpression;
12
+ export declare function div(num: BoxedExpression, denom: number | BoxedExpression): BoxedExpression;
13
+ /**
14
+ * The canonical form of `Multiply`:
15
+ * - removes `1` anb `-1`
16
+ * - simplifies the signs:
17
+ * - i.e. `-y \times -x` -> `x \times y`
18
+ * - `2 \times -x` -> `-2 \times x`
19
+ * - arguments are sorted
20
+ * - complex numbers promoted (['Multiply', 2, 'ImaginaryUnit'] -> 2i)
21
+ * - Numeric values are promoted (['Multiply', 2, 'Sqrt', 3] -> 2√3)
22
+ *
23
+ * The input ops may not be canonical, the result is canonical.
24
+ */
25
+ export declare function canonicalMultiply(ce: ComputeEngine, ops: ReadonlyArray<BoxedExpression>): BoxedExpression;
26
+ export declare function mul(...xs: ReadonlyArray<BoxedExpression>): BoxedExpression;
27
+ export declare function mulN(...xs: ReadonlyArray<BoxedExpression>): BoxedExpression;
@@ -1,5 +1,5 @@
1
- /* 0.28.0 */
2
- import type { Rational } from '../numerics/rationals';
1
+ /* 0.29.0 */
2
+ import type { Rational } from '../numerics/types';
3
3
  export declare function asRadical(expr: BoxedExpression): Rational | null;
4
4
  export declare function canonicalPower(a: BoxedExpression, b: BoxedExpression): BoxedExpression;
5
5
  export declare function canonicalRoot(a: BoxedExpression, b: BoxedExpression | number): BoxedExpression;
@@ -1,4 +1,4 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  export type AsciiMathSerializer = (expr: BoxedExpression, precedence?: number) => string;
3
3
  export type AsciiMathOptions = {
4
4
  symbols: Record<string, string>;
@@ -1,8 +1,8 @@
1
- /* 0.28.0 */
1
+ /* 0.29.0 */
2
2
  import { Decimal } from 'decimal.js';
3
- import { IComputeEngine, SemiBoxedExpression, BoxedExpression, Metadata, CanonicalOptions } from './public';
3
+ import type { SemiBoxedExpression, BoxedExpression, CanonicalOptions, ComputeEngine, Metadata } from '../global-types';
4
4
  import { MathJsonIdentifier } from '../../math-json/types';
5
- import { NumericValue } from '../numeric-value/public';
5
+ import { NumericValue } from '../numeric-value/types';
6
6
  /**
7
7
  * Given a name and a set of arguments, return a boxed function expression.
8
8
  *
@@ -10,7 +10,7 @@ import { NumericValue } from '../numeric-value/public';
10
10
  *
11
11
  * Note that `boxFunction()` should only be called from `ce.function()`
12
12
  */
13
- export declare function boxFunction(ce: IComputeEngine, name: MathJsonIdentifier, ops: readonly SemiBoxedExpression[], options?: {
13
+ export declare function boxFunction(ce: ComputeEngine, name: MathJsonIdentifier, ops: readonly SemiBoxedExpression[], options?: {
14
14
  metadata?: Metadata;
15
15
  canonical?: CanonicalOptions;
16
16
  structural?: boolean;
@@ -40,7 +40,7 @@ export declare function boxFunction(ce: IComputeEngine, name: MathJsonIdentifier
40
40
  * Note that this function should only be called from `ce.box()`
41
41
  *
42
42
  */
43
- export declare function box(ce: IComputeEngine, expr: null | undefined | NumericValue | SemiBoxedExpression, options?: {
43
+ export declare function box(ce: ComputeEngine, expr: null | undefined | NumericValue | SemiBoxedExpression, options?: {
44
44
  canonical?: CanonicalOptions;
45
45
  structural?: boolean;
46
46
  }): BoxedExpression;