@cortex-js/compute-engine 0.9.0 → 0.10.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 (83) hide show
  1. package/dist/compute-engine.esm.js +370 -220
  2. package/dist/compute-engine.min.esm.js +2 -2
  3. package/dist/compute-engine.min.js +2 -2
  4. package/dist/math-json.esm.js +2 -2
  5. package/dist/math-json.min.esm.js +2 -2
  6. package/dist/math-json.min.js +2 -2
  7. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  8. package/dist/types/common/signals.d.ts +1 -1
  9. package/dist/types/common/utils.d.ts +1 -1
  10. package/dist/types/compute-engine/assume.d.ts +1 -1
  11. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -2
  12. package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
  13. package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
  14. package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +1 -1
  15. package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
  16. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -2
  17. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -2
  18. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
  19. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -2
  20. package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +2 -3
  21. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -2
  22. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  23. package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
  24. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
  25. package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
  26. package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
  27. package/dist/types/compute-engine/compute-engine.d.ts +3 -2
  28. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  29. package/dist/types/compute-engine/domain-utils.d.ts +1 -1
  30. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  31. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  32. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  33. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  34. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-inequalities.d.ts +1 -1
  35. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  36. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  37. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  38. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  39. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  40. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
  41. package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +1 -1
  42. package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
  43. package/dist/types/compute-engine/latex-syntax/public.d.ts +1 -1
  44. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
  45. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
  46. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
  47. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  48. package/dist/types/compute-engine/library/arithmetic-add.d.ts +1 -1
  49. package/dist/types/compute-engine/library/arithmetic-divide.d.ts +1 -1
  50. package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +1 -1
  51. package/dist/types/compute-engine/library/arithmetic-power.d.ts +1 -1
  52. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
  53. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  54. package/dist/types/compute-engine/library/collections.d.ts +1 -1
  55. package/dist/types/compute-engine/library/core.d.ts +1 -1
  56. package/dist/types/compute-engine/library/domains.d.ts +1 -1
  57. package/dist/types/compute-engine/library/library.d.ts +1 -1
  58. package/dist/types/compute-engine/library/logic.d.ts +1 -1
  59. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  60. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  61. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  62. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  63. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  64. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  65. package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
  66. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  67. package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
  68. package/dist/types/compute-engine/public.d.ts +12 -14
  69. package/dist/types/compute-engine/rules.d.ts +1 -1
  70. package/dist/types/compute-engine/simplify-rules.d.ts +1 -1
  71. package/dist/types/compute-engine/solve.d.ts +1 -1
  72. package/dist/types/compute-engine/symbolic/expand.d.ts +1 -1
  73. package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
  74. package/dist/types/compute-engine/symbolic/negate.d.ts +1 -1
  75. package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
  76. package/dist/types/compute-engine/symbolic/product.d.ts +1 -1
  77. package/dist/types/compute-engine/symbolic/sum.d.ts +1 -1
  78. package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
  79. package/dist/types/compute-engine.d.ts +2 -2
  80. package/dist/types/math-json/math-json-format.d.ts +1 -1
  81. package/dist/types/math-json/utils.d.ts +1 -1
  82. package/dist/types/math-json.d.ts +2 -2
  83. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /** MathJSON 0.9.0 */
1
+ /** MathJSON 0.10.0 */
2
2
  function isSymbolObject(expr) {
3
3
  return expr !== null && typeof expr === 'object' && 'sym' in expr;
4
4
  }
@@ -182,6 +182,6 @@ function mapArgs(expr, fn) {
182
182
  }
183
183
 
184
184
  // This is the root of the `math-json` package (i.e. `math-json.js` and
185
- const version = '0.9.0';
185
+ const version = '0.10.0';
186
186
 
187
187
  export { applyRecursively, dictionary as getDictionary, stringValue as getStringValue, head, headName, isDictionaryObject, isFunctionObject, isStringObject, isSymbolObject, mapArgs, nops, op, symbol, version };
@@ -1,2 +1,2 @@
1
- /** MathJSON 0.9.0 */
2
- function n(n){return null!==n&&"object"==typeof n&&"sym"in n}function t(n){return null!==n&&"object"==typeof n&&"str"in n}function r(n){return null!==n&&"object"==typeof n&&"fn"in n}function u(n){return null!==n&&"object"==typeof n&&"dict"in n}function l(n){return null==n?null:"object"==typeof n&&"str"in n?n.str:"string"!=typeof n||n.length<2||"'"!==n[0]||"'"!==n[n.length-1]?null:n.substring(1,n.length-1)}function e(n){return null==n?null:Array.isArray(n)?n[0]:r(n)?n.fn[0]:null}function i(n){const t=e(n);return"string"==typeof t?t:""}function o(n){return null==n?null:Array.isArray(n)?n.slice(1):r(n)?n.fn.slice(1):null}function f(n,t){return null==n?null:Array.isArray(n)?n[t]??null:r(n)?n.fn[t]??null:null}function c(n){return f(n,2)}function s(n){return null==n?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function y(t){if(null==t)return null;if("string"==typeof t){if(/^[+\-\.0-9]/.test(t))return null;if(t.length>=2&&"'"===t[0]&&"'"===t[t.length-1])return null}const r=n(t)?t.sym:t;return"string"!=typeof r?null:r}function a(n){const t=e(n);if("KeyValuePair"===t||"Tuple"===t||"Pair"===t){const t=l(function(n){return f(n,1)}(n));return t?[t,c(n)??"Nothing"]:null}return null}function g(n){if(null===n)return null;if("object"==typeof n&&"dict"in n)return n.dict;const t=a(n);if(t)return{[t[0]]:t[1]};if("Dictionary"===e(n)){const t={};for(let r=1;r<s(n);r++){const u=a(f(n,r));u&&(t[u[0]]=u[1])}return t}return null}function p(n,t){const r=e(n);if(null!==r)return[t(r),...(o(n)??[]).map(t)];const u=g(n);if(null!==u){const n=Object.keys(u),r={};for(const l of n)r[l]=t(u[l]);return{dict:r}}return t(n)}function h(n,t){let u=null;if(Array.isArray(n)&&(u=n),r(n)&&(u=n.fn),null===u)return[];let l=1;const e=[];for(;l<u.length;)e.push(t(u[l])),l+=1;return e}const A="0.9.0";export{p as applyRecursively,g as getDictionary,l as getStringValue,e as head,i as headName,u as isDictionaryObject,r as isFunctionObject,t as isStringObject,n as isSymbolObject,h as mapArgs,s as nops,f as op,y as symbol,A as version};
1
+ /** MathJSON 0.10.0 */
2
+ function n(n){return null!==n&&"object"==typeof n&&"sym"in n}function t(n){return null!==n&&"object"==typeof n&&"str"in n}function r(n){return null!==n&&"object"==typeof n&&"fn"in n}function u(n){return null!==n&&"object"==typeof n&&"dict"in n}function l(n){return null==n?null:"object"==typeof n&&"str"in n?n.str:"string"!=typeof n||n.length<2||"'"!==n[0]||"'"!==n[n.length-1]?null:n.substring(1,n.length-1)}function e(n){return null==n?null:Array.isArray(n)?n[0]:r(n)?n.fn[0]:null}function i(n){const t=e(n);return"string"==typeof t?t:""}function o(n){return null==n?null:Array.isArray(n)?n.slice(1):r(n)?n.fn.slice(1):null}function f(n,t){return null==n?null:Array.isArray(n)?n[t]??null:r(n)?n.fn[t]??null:null}function c(n){return f(n,2)}function s(n){return null==n?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function y(t){if(null==t)return null;if("string"==typeof t){if(/^[+\-\.0-9]/.test(t))return null;if(t.length>=2&&"'"===t[0]&&"'"===t[t.length-1])return null}const r=n(t)?t.sym:t;return"string"!=typeof r?null:r}function a(n){const t=e(n);if("KeyValuePair"===t||"Tuple"===t||"Pair"===t){const t=l(function(n){return f(n,1)}(n));return t?[t,c(n)??"Nothing"]:null}return null}function g(n){if(null===n)return null;if("object"==typeof n&&"dict"in n)return n.dict;const t=a(n);if(t)return{[t[0]]:t[1]};if("Dictionary"===e(n)){const t={};for(let r=1;r<s(n);r++){const u=a(f(n,r));u&&(t[u[0]]=u[1])}return t}return null}function p(n,t){const r=e(n);if(null!==r)return[t(r),...(o(n)??[]).map(t)];const u=g(n);if(null!==u){const n=Object.keys(u),r={};for(const l of n)r[l]=t(u[l]);return{dict:r}}return t(n)}function h(n,t){let u=null;if(Array.isArray(n)&&(u=n),r(n)&&(u=n.fn),null===u)return[];let l=1;const e=[];for(;l<u.length;)e.push(t(u[l])),l+=1;return e}const A="0.10.0";export{p as applyRecursively,g as getDictionary,l as getStringValue,e as head,i as headName,u as isDictionaryObject,r as isFunctionObject,t as isStringObject,n as isSymbolObject,h as mapArgs,s as nops,f as op,y as symbol,A as version};
@@ -1,2 +1,2 @@
1
- /** MathJSON 0.9.0 */
2
- var global,factory;global=this,factory=function(n){function t(n){return null!==n&&"object"==typeof n&&"sym"in n}function r(n){return null!==n&&"object"==typeof n&&"fn"in n}function l(n){return null==n?null:"object"==typeof n&&"str"in n?n.str:"string"!=typeof n||n.length<2||"'"!==n[0]||"'"!==n[n.length-1]?null:n.substring(1,n.length-1)}function e(n){return null==n?null:Array.isArray(n)?n[0]:r(n)?n.fn[0]:null}function u(n){return null==n?null:Array.isArray(n)?n.slice(1):r(n)?n.fn.slice(1):null}function o(n,t){var l,e;return null==n?null:Array.isArray(n)?null!==(l=n[t])&&void 0!==l?l:null:r(n)&&null!==(e=n.fn[t])&&void 0!==e?e:null}function i(n){return o(n,2)}function f(n){return null==n?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function c(n){var t;const r=e(n);if("KeyValuePair"===r||"Tuple"===r||"Pair"===r){const r=l(function(n){return o(n,1)}(n));return r?[r,null!==(t=i(n))&&void 0!==t?t:"Nothing"]:null}return null}function s(n){if(null===n)return null;if("object"==typeof n&&"dict"in n)return n.dict;const t=c(n);if(t)return{[t[0]]:t[1]};if("Dictionary"===e(n)){const t={};for(let r=1;r<f(n);r++){const l=c(o(n,r));l&&(t[l[0]]=l[1])}return t}return null}n.applyRecursively=function(n,t){var r;const l=e(n);if(null!==l)return[t(l),...(null!==(r=u(n))&&void 0!==r?r:[]).map(t)];const o=s(n);if(null!==o){const n=Object.keys(o),r={};for(const l of n)r[l]=t(o[l]);return{dict:r}}return t(n)},n.getDictionary=s,n.getStringValue=l,n.head=e,n.headName=function(n){const t=e(n);return"string"==typeof t?t:""},n.isDictionaryObject=function(n){return null!==n&&"object"==typeof n&&"dict"in n},n.isFunctionObject=r,n.isStringObject=function(n){return null!==n&&"object"==typeof n&&"str"in n},n.isSymbolObject=t,n.mapArgs=function(n,t){let l=null;if(Array.isArray(n)&&(l=n),r(n)&&(l=n.fn),null===l)return[];let e=1;const u=[];for(;e<l.length;)u.push(t(l[e])),e+=1;return u},n.nops=f,n.op=o,n.symbol=function(n){if(null==n)return null;if("string"==typeof n){if(/^[+\-\.0-9]/.test(n))return null;if(n.length>=2&&"'"===n[0]&&"'"===n[n.length-1])return null}const r=t(n)?n.sym:n;return"string"!=typeof r?null:r},n.version="0.9.0",Object.defineProperty(n,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).MathJson={});
1
+ /** MathJSON 0.10.0 */
2
+ var global,factory;global=this,factory=function(n){function t(n){return null!==n&&"object"==typeof n&&"sym"in n}function r(n){return null!==n&&"object"==typeof n&&"fn"in n}function l(n){return null==n?null:"object"==typeof n&&"str"in n?n.str:"string"!=typeof n||n.length<2||"'"!==n[0]||"'"!==n[n.length-1]?null:n.substring(1,n.length-1)}function e(n){return null==n?null:Array.isArray(n)?n[0]:r(n)?n.fn[0]:null}function u(n){return null==n?null:Array.isArray(n)?n.slice(1):r(n)?n.fn.slice(1):null}function o(n,t){var l,e;return null==n?null:Array.isArray(n)?null!==(l=n[t])&&void 0!==l?l:null:r(n)&&null!==(e=n.fn[t])&&void 0!==e?e:null}function i(n){return o(n,2)}function f(n){return null==n?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function c(n){var t;const r=e(n);if("KeyValuePair"===r||"Tuple"===r||"Pair"===r){const r=l(function(n){return o(n,1)}(n));return r?[r,null!==(t=i(n))&&void 0!==t?t:"Nothing"]:null}return null}function s(n){if(null===n)return null;if("object"==typeof n&&"dict"in n)return n.dict;const t=c(n);if(t)return{[t[0]]:t[1]};if("Dictionary"===e(n)){const t={};for(let r=1;r<f(n);r++){const l=c(o(n,r));l&&(t[l[0]]=l[1])}return t}return null}n.applyRecursively=function(n,t){var r;const l=e(n);if(null!==l)return[t(l),...(null!==(r=u(n))&&void 0!==r?r:[]).map(t)];const o=s(n);if(null!==o){const n=Object.keys(o),r={};for(const l of n)r[l]=t(o[l]);return{dict:r}}return t(n)},n.getDictionary=s,n.getStringValue=l,n.head=e,n.headName=function(n){const t=e(n);return"string"==typeof t?t:""},n.isDictionaryObject=function(n){return null!==n&&"object"==typeof n&&"dict"in n},n.isFunctionObject=r,n.isStringObject=function(n){return null!==n&&"object"==typeof n&&"str"in n},n.isSymbolObject=t,n.mapArgs=function(n,t){let l=null;if(Array.isArray(n)&&(l=n),r(n)&&(l=n.fn),null===l)return[];let e=1;const u=[];for(;e<l.length;)u.push(t(l[e])),e+=1;return u},n.nops=f,n.op=o,n.symbol=function(n){if(null==n)return null;if("string"==typeof n){if(/^[+\-\.0-9]/.test(n))return null;if(n.length>=2&&"'"===n[0]&&"'"===n[n.length-1])return null}const r=t(n)?n.sym:n;return"string"!=typeof r?null:r},n.version="0.10.0",Object.defineProperty(n,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).MathJson={});
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * Return a string or an array of graphemes.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare 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');
3
3
  export declare type SignalMessage = SignalCode | [SignalCode, ...any[]];
4
4
  export declare type SignalOrigin = {
@@ -1 +1 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * Add an assumption, in the form of a predicate, for example:
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Complex } from 'complex.js';
3
3
  import { Expression } from '../../math-json/math-json-format';
4
4
  import { BoxedExpression, BoxedFunctionDefinition, BoxedRuleSet, BoxedSymbolDefinition, BoxedDomain, EvaluateOptions, IComputeEngine, LatexString, Metadata, NOptions, PatternMatchOptions, SemiBoxedExpression, SimplifyOptions, Substitution, RuntimeScope, DomainCompatibility, DomainLiteral, BoxedBaseDefinition, Rational, BoxedSubstitution } from '../public';
@@ -86,7 +86,6 @@ export declare abstract class AbstractBoxedExpression implements BoxedExpression
86
86
  isCompatible(_dom: BoxedDomain | DomainLiteral, _kind?: DomainCompatibility): boolean;
87
87
  get description(): string[] | undefined;
88
88
  get url(): string | undefined;
89
- get isLiteral(): boolean;
90
89
  get wikidata(): string | undefined;
91
90
  set wikidata(val: string | undefined);
92
91
  get complexity(): number | undefined;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Decimal } from 'decimal.js';
3
3
  import { IComputeEngine, SemiBoxedExpression, BoxedExpression, Metadata, Rational } from '../public';
4
4
  import { MathJsonNumber } from '../../math-json/math-json-format';
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { BoxedExpression, IComputeEngine, EvaluateOptions, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, ReplaceOptions, Substitution, Metadata, PatternMatchOptions, BoxedDomain, BoxedSubstitution } from '../public';
3
3
  import { AbstractBoxedExpression } from './abstract-boxed-expression';
4
4
  /**
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { BoxedDomain, BoxedExpression, BoxedSubstitution, DomainCompatibility, DomainConstructor, DomainExpression, DomainLiteral, IComputeEngine, Metadata, PatternMatchOptions } from '../public';
3
3
  import { AbstractBoxedExpression } from './abstract-boxed-expression';
4
4
  /**
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function makeFunctionDefinition(engine: IComputeEngine, def: FunctionDefinition): BoxedFunctionDefinition;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Expression } from '../../math-json/math-json-format';
3
3
  import { BoxedExpression, BoxedFunctionDefinition, IComputeEngine, EvaluateOptions, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, Substitution, ReplaceOptions, Metadata, PatternMatchOptions, BoxedDomain, RuntimeScope, BoxedSubstitution } from '../public';
4
4
  /**
@@ -27,7 +27,6 @@ export declare class BoxedFunction extends AbstractBoxedExpression {
27
27
  get hash(): number;
28
28
  get isCanonical(): boolean;
29
29
  set isCanonical(val: boolean);
30
- get isLiteral(): boolean;
31
30
  get isPure(): boolean;
32
31
  get json(): Expression;
33
32
  get scope(): RuntimeScope | null;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Complex } from 'complex.js';
3
3
  import { Expression } from '../../math-json/math-json-format';
4
4
  import { BoxedExpression, BoxedDomain, IComputeEngine, Metadata, NOptions, PatternMatchOptions, Rational, SimplifyOptions, BoxedSubstitution } from '../public';
@@ -30,7 +30,6 @@ export declare class BoxedNumber extends AbstractBoxedExpression {
30
30
  get hash(): number;
31
31
  get head(): string;
32
32
  get isPure(): boolean;
33
- get isLiteral(): boolean;
34
33
  get isExact(): boolean;
35
34
  get isCanonical(): boolean;
36
35
  set isCanonical(val: boolean);
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { AbstractBoxedExpression } from './abstract-boxed-expression';
3
3
  import { BoxedExpression, BoxedSubstitution, BoxedDomain, IComputeEngine, LatexString, Metadata, Pattern, PatternMatchOptions, SemiBoxedExpression, Substitution } from '../public';
4
4
  export declare class BoxedPattern extends AbstractBoxedExpression implements Pattern {
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { AbstractBoxedExpression } from './abstract-boxed-expression';
3
3
  import { BoxedExpression, BoxedDomain, IComputeEngine, Metadata, PatternMatchOptions, BoxedSubstitution } from '../public';
4
4
  /**
@@ -11,7 +11,6 @@ export declare class BoxedString extends AbstractBoxedExpression {
11
11
  get json(): Expression;
12
12
  get head(): string;
13
13
  get isPure(): boolean;
14
- get isLiteral(): boolean;
15
14
  get isCanonical(): boolean;
16
15
  set isCanonical(_va: boolean);
17
16
  get domain(): BoxedDomain;
@@ -1,11 +1,10 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function domainToFlags(dom: BoxedDomain | undefined | null): Partial<SymbolFlags>;
3
3
  export declare class BoxedSymbolDefinitionImpl implements BoxedSymbolDefinition {
4
4
  readonly name: string;
5
5
  private _def;
6
6
  private _value;
7
7
  private _domain;
8
- private _inferedDomain;
9
8
  private _engine;
10
9
  readonly scope: RuntimeScope | undefined;
11
10
  wikidata?: string;
@@ -45,7 +44,7 @@ export declare class BoxedSymbolDefinitionImpl implements BoxedSymbolDefinition
45
44
  unbind(): void;
46
45
  bind(): void;
47
46
  get value(): BoxedExpression | undefined;
48
- set value(val: BoxedExpression | number | undefined);
47
+ set value(val: SemiBoxedExpression | number | undefined);
49
48
  get domain(): BoxedDomain | undefined;
50
49
  set domain(domain: BoxedDomain | DomainExpression | undefined);
51
50
  updateFlags(flags: Partial<SymbolFlags>): void;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { AbstractBoxedExpression } from './abstract-boxed-expression';
3
3
  import { BoxedExpression, BoxedRuleSet, BoxedSymbolDefinition, IComputeEngine, EvaluateOptions, NOptions, ReplaceOptions, SimplifyOptions, Substitution, Metadata, PatternMatchOptions, BoxedDomain, RuntimeScope, BoxedFunctionDefinition, BoxedBaseDefinition, DomainExpression, BoxedSubstitution } from '../public';
4
4
  /**
@@ -41,7 +41,6 @@ export declare class BoxedSymbol extends AbstractBoxedExpression {
41
41
  get head(): string;
42
42
  get symbol(): string;
43
43
  get isNothing(): boolean;
44
- get isLiteral(): boolean;
45
44
  get baseDefinition(): BoxedBaseDefinition | undefined;
46
45
  get symbolDefinition(): BoxedSymbolDefinition | undefined;
47
46
  get functionDefinition(): BoxedFunctionDefinition | undefined;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare class ExpressionMap<U> implements ExpressionMapInterface<U> {
3
3
  readonly _items: Map<BoxedExpression, U>;
4
4
  constructor(source?: ExpressionMapInterface<U> | readonly (readonly [BoxedExpression, U])[]);
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare type Order = 'lex' | 'dexlex' | 'grevlex' | 'elim';
3
3
  export declare const DEFAULT_COMPLEXITY = 100000;
4
4
  /**
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import Decimal from 'decimal.js';
3
3
  import { Expression } from '../../math-json/math-json-format';
4
4
  import { BoxedExpression, IComputeEngine, Metadata, Rational } from '../public';
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Expression } from '../../math-json/math-json-format';
3
3
  import { BoxedExpression, IComputeEngine } from '../public';
4
4
  export declare function isLatexString(s: unknown): s is string;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function validateArgumentCount(ce: IComputeEngine, ops: BoxedExpression[], count: number): BoxedExpression[];
3
3
  /**
4
4
  * Validation of arguments is normally done by checking the signature of the
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Complex } from 'complex.js';
3
3
  import { Expression, MathJsonNumber } from '../math-json/math-json-format';
4
4
  import { SignalMessage, WarningSignal } from '../common/signals';
@@ -108,6 +108,7 @@ export declare class ComputeEngine implements IComputeEngine {
108
108
  *
109
109
  */
110
110
  context: RuntimeScope | null;
111
+ strict: boolean;
111
112
  /** Absolute time beyond which evaluation should not proceed.
112
113
  * @internal
113
114
  */
@@ -262,7 +263,7 @@ export declare class ComputeEngine implements IComputeEngine {
262
263
  */
263
264
  popScope(): void;
264
265
  set(identifiers: {
265
- [identifier: string]: SemiBoxedExpression;
266
+ [identifier: string]: SemiBoxedExpression | null;
266
267
  }): void;
267
268
  let(identifiers: {
268
269
  [identifier: string]: SymbolDefinition | FunctionDefinition;
@@ -1,3 +1,3 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function costFunction(expr: BoxedExpression): number;
3
3
  export declare const DEFAULT_COST_FUNCTION: typeof costFunction;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Decimal } from 'decimal.js';
3
3
  import { BoxedExpression } from './public';
4
4
  /** Quickly determine the numeric domain of a number or constant
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_ALGEBRA: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_ARITHMETIC: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_CALCULUS: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_CORE: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_INEQUALITIES: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_LOGIC: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_OTHERS: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_SETS: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_SYMBOLS: LatexDictionary;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DEFINITIONS_TRIGONOMETRY: LatexDictionary;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { WarningSignal } from '../../../common/signals';
3
3
  export declare type CommonEntry = {
4
4
  name?: string;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Serializer } from './serializer';
3
3
  import { Expression } from '../../math-json/math-json-format';
4
4
  import { WarningSignalHandler } from '../../common/signals';
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { IndexedLatexDictionary, InfixEntry, PostfixEntry, PrefixEntry, SymbolEntry } from './dictionary/definitions';
3
3
  import { IComputeEngine } from '../public';
4
4
  import { Expression } from '../../math-json/math-json-format';
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { Expression } from '../../math-json/math-json-format';
3
3
  import type { IComputeEngine } from '../public';
4
4
  /**
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { NumberFormattingOptions } from './public';
3
3
  export declare function serializeNumber(expr: Expression | null, options: NumberFormattingOptions): string;
4
4
  export declare function serializeEngineeringNotationNumber(value: number, options: NumberFormattingOptions): string;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function getApplyFunctionStyle(_expr: Expression, _level: number): 'paren' | 'leftright' | 'big' | 'none';
3
3
  export declare function getGroupStyle(_expr: Expression, _level: number): 'paren' | 'leftright' | 'big' | 'none';
4
4
  export declare function getRootStyle(_expr: Expression | null, level: number): 'radical' | 'quotient' | 'solidus';
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { WarningSignalHandler } from '../../common/signals';
3
3
  import { NumberFormattingOptions, LatexString, SerializeLatexOptions, FunctionEntry } from './public';
4
4
  import { IndexedLatexDictionary, SymbolEntry } from './dictionary/definitions';
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  * ## Reference
3
3
  * TeX source code:
4
4
  * {@link http://tug.org/texlive/devsrc/Build/source/texk/web2c/tex.web | Tex.web}
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /** The canonical form of `Add`:
3
3
  * - removes `0`
4
4
  * - capture complex numbers (a + ib or ai +b)
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * Canonical form of 'Divide' (and 'Rational')
4
4
  * - remove denominator of 1
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /** The canonical form of `Multiply`:
3
3
  * - remove `1`
4
4
  * - combine literal integers and rationals
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  *
4
4
  * Return `null` if there is no canonicalization necessary and the result is
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const ARITHMETIC_LIBRARY: SymbolTable[];
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const CALCULUS_LIBRARY: SymbolTable[];
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const COLLECTIONS_LIBRARY: SymbolTable;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const CORE_LIBRARY: SymbolTable[];
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const DOMAIN_CONSTRUCTORS: string[];
3
3
  export declare const DOMAIN_ALIAS: {
4
4
  NumericFunction: (string | string[])[];
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { IComputeEngine, SymbolTable } from '../public';
3
3
  export declare function getStandardLibrary(categories: LibraryCategory[] | LibraryCategory | 'all'): Readonly<SymbolTable>[];
4
4
  export declare const LIBRARIES: {
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const LOGIC_LIBRARY: SymbolTable;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const POLYNOMIALS_LIBRARY: SymbolTable[];
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const RELOP_LIBRARY: SymbolTable;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const SETS_LIBRARY: SymbolTable;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const TRIGONOMETRY_LIBRARY: SymbolTable[];
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import { IComputeEngine } from '../public';
3
3
  export declare function gcd(a: Decimal, b: Decimal): Decimal;
4
4
  export declare function lcm(a: Decimal, b: Decimal): Decimal;
@@ -1,3 +1,3 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function gamma(c: Complex): Complex;
3
3
  export declare function lngamma(c: Complex): Complex;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import Decimal from 'decimal.js';
3
3
  import { BoxedExpression } from '../public';
4
4
  export declare const MACHINE_PRECISION_BITS = 53;
@@ -1,2 +1,2 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare function isPrime(n: number): boolean | undefined;
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  import Decimal from 'decimal.js';
3
3
  export declare function isRational(x: any | null): x is Rational;
4
4
  export declare function isMachineRational(x: any | null): x is [number, number];
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  * The most important classes are {@link ComputeEngine} and
3
3
  * {@link BoxedExpression}.
4
4
  *
@@ -431,16 +431,6 @@ export interface BoxedExpression {
431
431
  *
432
432
  */
433
433
  readonly isValid: boolean;
434
- /**
435
- * If `true`, this expression represents a value that was not calculated
436
- * and that does not reference another expression.
437
- *
438
- * This means the expression is either a number, a string or a dictionary.
439
- * Functions and symbols are not literals.
440
- *
441
- * **Note** applicable to canonical and non-canonical expressions.
442
- */
443
- readonly isLiteral: boolean;
444
434
  /**
445
435
  * An exact value is not further transformed when evaluated. To get an
446
436
  * approximate evaluation of an exact value, use `.N()`.
@@ -1494,7 +1484,7 @@ export declare type SymbolDefinition = BaseDefinition & Partial<SymbolFlags> & P
1494
1484
  };
1495
1485
  export interface BoxedSymbolDefinition extends BoxedBaseDefinition, Partial<SymbolFlags>, SymbolDefinitionFlags {
1496
1486
  get value(): BoxedExpression | undefined;
1497
- set value(val: BoxedExpression | undefined);
1487
+ set value(val: SemiBoxedExpression | number | undefined);
1498
1488
  domain: BoxedDomain | undefined;
1499
1489
  at?: (index: string | number) => undefined | BoxedExpression;
1500
1490
  }
@@ -1570,6 +1560,14 @@ export interface IComputeEngine {
1570
1560
  set precision(p: number | 'machine');
1571
1561
  get precision(): number;
1572
1562
  costFunction: (expr: BoxedExpression) => number;
1563
+ /** In strict mode (the default) the Compute Engine performs
1564
+ * validation of domains and signature and may report errors.
1565
+ *
1566
+ * When strict mode is off, results may be incorrect or generate JavaScript
1567
+ * errors if the input is not valid.
1568
+ *
1569
+ */
1570
+ strict: boolean;
1573
1571
  /**
1574
1572
  * Associate a new definition to a symbol in the current context.
1575
1573
  *
@@ -1723,9 +1721,9 @@ export interface IComputeEngine {
1723
1721
  scope?: Partial<Scope>;
1724
1722
  }): void;
1725
1723
  popScope(): void;
1726
- /** Assign a value to an identifier in the current scope */
1724
+ /** Assign a value to an identifier in the current scope. Use `null` to reset the identifier to no value */
1727
1725
  set(identifiers: {
1728
- [identifier: string]: SemiBoxedExpression;
1726
+ [identifier: string]: SemiBoxedExpression | null;
1729
1727
  }): void;
1730
1728
  /** Declare identifiers (specify their domain without necessarily assigning them a value in the current scope*/
1731
1729
  let(identifiers: {
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * Go through all the rules in the rule set, and for all the rules that match
4
4
  * return the rhs of the rule applied to `expr`.
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * A set of simplification rules.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  export declare const UNIVARIATE_ROOTS: Rule[];
3
3
  /**
4
4
  * Expression is a function of a single variable (`x`) or an Equality
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * Return the expansion of ['Multiply', lhs, rhs]
4
4
  * - lhs = 'a + b', rhs = '2'
@@ -1,4 +1,4 @@
1
- /* 0.9.0 */
1
+ /* 0.10.0 */
2
2
  /**
3
3
  * Flatten the arguments.
4
4
  * If `expr` was canonical, the result it canonical.