@cortex-js/compute-engine 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compute-engine.esm.js +15779 -12531
- package/dist/compute-engine.min.esm.js +2 -2
- package/dist/compute-engine.min.js +2 -2
- package/dist/math-json.esm.js +62 -43
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.js +2 -2
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +22 -10
- package/dist/types/compute-engine/boxed-expression/box.d.ts +2 -14
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +36 -19
- package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +14 -13
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +5 -5
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +9 -6
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +24 -10
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +23 -6
- package/dist/types/compute-engine/compute-engine.d.ts +74 -50
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/domain-utils.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -3
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-inequalities.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +8 -7
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +3 -3
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +87 -62
- package/dist/types/compute-engine/latex-syntax/public.d.ts +65 -46
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +6 -4
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-add.d.ts +11 -0
- package/dist/types/compute-engine/library/arithmetic-divide.d.ts +15 -0
- package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +19 -0
- package/dist/types/compute-engine/{dictionary → library}/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +2 -0
- package/dist/types/compute-engine/library/calculus.d.ts +2 -0
- package/dist/types/compute-engine/library/collections.d.ts +2 -0
- package/dist/types/compute-engine/library/core.d.ts +2 -0
- package/dist/types/compute-engine/library/domains.d.ts +15 -0
- package/dist/types/compute-engine/library/library.d.ts +17 -0
- package/dist/types/compute-engine/library/logic.d.ts +2 -0
- package/dist/types/compute-engine/library/polynomials.d.ts +2 -0
- package/dist/types/compute-engine/library/relational-operator.d.ts +2 -0
- package/dist/types/compute-engine/library/sets.d.ts +2 -0
- package/dist/types/compute-engine/library/trigonometry.d.ts +2 -0
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-decimal.d.ts +5 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +4 -2
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/public.d.ts +237 -187
- package/dist/types/compute-engine/rules.d.ts +1 -1
- package/dist/types/compute-engine/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/expand.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/negate.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/sum.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +2 -2
- package/dist/types/math-json/math-json-format.d.ts +27 -23
- package/dist/types/math-json/utils.d.ts +22 -16
- package/dist/types/math-json.d.ts +3 -3
- package/package.json +20 -20
- package/dist/types/compute-engine/dictionary/arithmetic-add.d.ts +0 -11
- package/dist/types/compute-engine/dictionary/arithmetic-divide.d.ts +0 -9
- package/dist/types/compute-engine/dictionary/arithmetic-multiply.d.ts +0 -17
- package/dist/types/compute-engine/dictionary/arithmetic.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/collections.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/core.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/dictionary.d.ts +0 -26
- package/dist/types/compute-engine/dictionary/logic.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/polynomials.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/relational-operator.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/sets.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/trigonometry.d.ts +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.7.0 */
|
|
2
2
|
export declare class Sum {
|
|
3
3
|
private engine;
|
|
4
4
|
private _literal;
|
|
@@ -11,7 +11,7 @@ export declare class Sum {
|
|
|
11
11
|
/**
|
|
12
12
|
* Add a new term to the sum.
|
|
13
13
|
* A term is a rational coefficient and an expression.
|
|
14
|
-
*
|
|
14
|
+
* Optionally, the term is multiplied by the constant `c` before being added.
|
|
15
15
|
*
|
|
16
16
|
* If the sum already has this term, the coefficient is added
|
|
17
17
|
* to the previous one. Otherwise, a new entry is added.
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
/** A human readable string to annotate
|
|
1
|
+
/* 0.7.0 */
|
|
2
|
+
/** A human readable string to annotate this expression, since JSON does not
|
|
3
3
|
* allow comments in its encoding */
|
|
4
4
|
comment?: string;
|
|
5
5
|
/** A Markdown-encoded string providing documentation about this expression.
|
|
6
6
|
*/
|
|
7
7
|
documentation?: string;
|
|
8
|
-
/** A
|
|
9
|
-
* other problem when parsing or evaluating an expression.
|
|
10
|
-
*/
|
|
11
|
-
error?: string;
|
|
12
|
-
/** A visual representation in LaTeX of the expression.
|
|
8
|
+
/** A visual representation of this expression as a LaTeX string.
|
|
13
9
|
*
|
|
14
10
|
* This can be useful to preserve non-semantic details, for example
|
|
15
|
-
* parentheses in an expression or styling attributes
|
|
11
|
+
* parentheses in an expression or styling attributes.
|
|
16
12
|
*/
|
|
17
13
|
latex?: string;
|
|
18
14
|
/**
|
|
19
|
-
* A short string
|
|
15
|
+
* A short string referencing an entry in a wikibase.
|
|
16
|
+
*
|
|
17
|
+
* For example:
|
|
20
18
|
*
|
|
21
|
-
* For example
|
|
22
19
|
* `"Q167"` is the [wikidata entry](https://www.wikidata.org/wiki/Q167)
|
|
23
20
|
* for the `Pi` constant.
|
|
24
21
|
*/
|
|
@@ -43,36 +40,43 @@
|
|
|
43
40
|
* The default value is "http://www.openmath.org/cd".
|
|
44
41
|
*/
|
|
45
42
|
openmathCd?: string;
|
|
46
|
-
/** A
|
|
43
|
+
/** A URL to the source code from which this expression was generated.
|
|
47
44
|
*/
|
|
48
45
|
sourceUrl?: string;
|
|
49
|
-
/** The source from which this expression was generated.
|
|
46
|
+
/** The source code from which this expression was generated.
|
|
50
47
|
*
|
|
51
|
-
* It could be a LaTeX expression, or some other source language
|
|
48
|
+
* It could be a LaTeX expression, or some other source language.
|
|
52
49
|
*/
|
|
53
50
|
sourceContent?: string;
|
|
54
51
|
/**
|
|
55
52
|
* A character offset in `sourceContent` or `sourceUrl` from which this
|
|
56
|
-
* expression was generated
|
|
53
|
+
* expression was generated.
|
|
57
54
|
*/
|
|
58
55
|
sourceOffsets?: [start: number, end: number];
|
|
59
56
|
};
|
|
60
57
|
/**
|
|
61
58
|
* A MathJSON numeric quantity.
|
|
62
59
|
*
|
|
63
|
-
* The string is made of:
|
|
60
|
+
* The `num` string is made of:
|
|
64
61
|
* - an optional `-` minus sign
|
|
65
62
|
* - a string of decimal digits
|
|
66
|
-
* - an optional fraction part (a `.` decimal
|
|
63
|
+
* - an optional fraction part (a `.` decimal marker followed by decimal digits)
|
|
64
|
+
* - an optional repeating decimal pattern: a string of digits enclosed in
|
|
65
|
+
* parentheses
|
|
67
66
|
* - an optional exponent part (a `e` or `E` exponent marker followed by an
|
|
68
|
-
* optional `-` minus sign, followed by a string of digits)
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
67
|
+
* optional `-` minus sign, followed by a string of digits)
|
|
68
|
+
*
|
|
69
|
+
* It can also consist of the value `NaN`, `-Infinity` and `+Infinity` to
|
|
70
|
+
* represent these respective values.
|
|
71
|
+
*
|
|
72
|
+
* A MathJSON number may contain more digits or an exponent with a greater
|
|
73
|
+
* range than can be represented in an IEEE 64-bit floating-point.
|
|
74
74
|
*
|
|
75
|
-
* For example:
|
|
75
|
+
* For example:
|
|
76
|
+
* - `-12.34`
|
|
77
|
+
* - `0.234e-56`
|
|
78
|
+
* - `1.(3)`
|
|
79
|
+
* - `123456789123456789.123(4567)e999`
|
|
76
80
|
*/
|
|
77
81
|
export declare type MathJsonNumber = {
|
|
78
82
|
num: 'NaN' | '-Infinity' | '+Infinity' | string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.7.0 */
|
|
2
2
|
/**
|
|
3
3
|
* These constants are the 'primitive' functions and constants that are used
|
|
4
4
|
* for some basic manipulations such as parsing, and transforming to canonical
|
|
@@ -32,12 +32,13 @@ export declare function isDictionaryObject(expr: Expression): expr is MathJsonNu
|
|
|
32
32
|
* (i.e. not a function and not a dictionary)
|
|
33
33
|
*/
|
|
34
34
|
export declare function isAtomic(expr: Expression | null): boolean;
|
|
35
|
+
export declare function isValidSymbolName(s: string): boolean;
|
|
35
36
|
/** If expr is a string literal, return it.
|
|
36
37
|
*
|
|
37
38
|
* A string literal is a JSON string that begins and ends with
|
|
38
39
|
* **U+0027 APOSTROPHE** : **`'`** or an object literal with a `str` key.
|
|
39
40
|
*/
|
|
40
|
-
export declare function stringValue(expr: Expression | null): string | null;
|
|
41
|
+
export declare function stringValue(expr: Expression | null | undefined): string | null;
|
|
41
42
|
/**
|
|
42
43
|
* The head of a function can be a string or an expression.
|
|
43
44
|
*
|
|
@@ -47,34 +48,38 @@ export declare function stringValue(expr: Expression | null): string | null;
|
|
|
47
48
|
* * `["Negate", 5]` -> `"Negate"`
|
|
48
49
|
* * `[["Prime", "f"], "x"]` -> `["Prime", "f"]`
|
|
49
50
|
*/
|
|
50
|
-
export declare function head(expr: Expression | null): Expression | null;
|
|
51
|
+
export declare function head(expr: Expression | null | undefined): Expression | null;
|
|
51
52
|
/** Return the head of an expression, only if it's a string */
|
|
52
53
|
export declare function headName(expr: Expression | null): string;
|
|
53
|
-
export declare function op(expr: Expression | null, n: number): Expression | null;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
export declare function op(expr: Expression | null | undefined, n: number): Expression | null;
|
|
55
|
+
/**
|
|
56
|
+
* Return all the elements but the first one, i.e. the arguments of a
|
|
57
|
+
* function.
|
|
58
|
+
*/
|
|
59
|
+
export declare function ops(expr: Expression | null | undefined): Expression[] | null;
|
|
60
|
+
export declare function op1(expr: Expression | null | undefined): Expression | null;
|
|
61
|
+
export declare function op2(expr: Expression | null | undefined): Expression | null;
|
|
62
|
+
export declare function nops(expr: Expression | null | undefined): number;
|
|
63
|
+
export declare function symbol(expr: Expression | null | undefined): string | null;
|
|
57
64
|
export declare function dictionary(expr: Expression | null): null | Record<string, Expression>;
|
|
58
|
-
export declare function machineValue(expr: Expression | null): number | null;
|
|
65
|
+
export declare function machineValue(expr: Expression | null | undefined): number | null;
|
|
59
66
|
/**
|
|
60
67
|
* Return a rational (numer over denom) representation of the expression,
|
|
61
68
|
* if possible, `[null, null]` otherwise.
|
|
62
69
|
*
|
|
63
70
|
* The expression can be:
|
|
64
|
-
* - Some symbols: "
|
|
71
|
+
* - Some symbols: "Infinity", "Half"...
|
|
65
72
|
* - ["Power", d, -1]
|
|
66
73
|
* - ["Power", n, 1]
|
|
67
74
|
* - ["Divide", n, d]
|
|
68
75
|
*
|
|
69
76
|
* The denominator is always > 0.
|
|
70
77
|
*/
|
|
71
|
-
export declare function rationalValue(expr: Expression): [number, number] | [null, null];
|
|
72
|
-
/**
|
|
73
|
-
* Return all the elements but the first one, i.e. the arguments of a
|
|
74
|
-
* function.
|
|
75
|
-
*/
|
|
76
|
-
export declare function tail(expr: Expression | null): Expression[];
|
|
78
|
+
export declare function rationalValue(expr: Expression | undefined | null): [number, number] | [null, null];
|
|
77
79
|
export declare function applyRecursively(expr: Expression, fn: (x: Expression) => Expression): Expression;
|
|
80
|
+
export declare function subs(expr: Expression, s: {
|
|
81
|
+
[symbol: string]: Expression;
|
|
82
|
+
}): Expression;
|
|
78
83
|
/**
|
|
79
84
|
* Apply a function to the arguments of a function and return an array of T
|
|
80
85
|
*/
|
|
@@ -93,4 +98,5 @@ export declare function asValidJSONNumber(num: string): string | number;
|
|
|
93
98
|
*/
|
|
94
99
|
export declare function applyAssociativeOperator(op: string, lhs: Expression, rhs: Expression, associativity?: 'right' | 'left' | 'non' | 'both'): Expression;
|
|
95
100
|
export declare function getSequence(expr: Expression | null): Expression[] | null;
|
|
96
|
-
export declare function
|
|
101
|
+
export declare function isEmptySequence(expr: Expression | null): boolean;
|
|
102
|
+
export declare function missingIfEmpty(expr: Expression | null): Expression;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
export { isAtomic, isSymbolObject, isStringObject, isFunctionObject, isDictionaryObject, stringValue as getStringValue, head, headName, symbol,
|
|
1
|
+
/* 0.7.0 */
|
|
2
|
+
export { isAtomic, isSymbolObject, isStringObject, isFunctionObject, isDictionaryObject, stringValue as getStringValue, head, headName, symbol, applyRecursively, mapArgs, op, nops, dictionary as getDictionary, asValidJSONNumber, } from './math-json/utils';
|
|
3
3
|
export type { LatexToken, ParseHandler, SerializeHandler, LatexDictionaryEntry, LatexDictionary, ParseLatexOptions, SerializeLatexOptions, NumberFormattingOptions, } from './compute-engine/latex-syntax/public';
|
|
4
|
-
export declare const version = "0.
|
|
4
|
+
export declare const version = "0.7.0";
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.7.0",
|
|
3
3
|
"scripts": {
|
|
4
4
|
"build": "bash ./scripts/build.sh",
|
|
5
5
|
"clean": "bash ./scripts/clean.sh",
|
|
@@ -47,41 +47,41 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@cortex-js/prettier-config": "^1.1.1",
|
|
50
|
-
"@jest/console": "^
|
|
51
|
-
"@rollup/plugin-commonjs": "^
|
|
52
|
-
"@rollup/plugin-node-resolve": "^
|
|
53
|
-
"@types/jest": "^
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
56
|
-
"@typescript-eslint/parser": "^5.
|
|
57
|
-
"@typescript-eslint/typescript-estree": "^5.
|
|
50
|
+
"@jest/console": "^29.0.3",
|
|
51
|
+
"@rollup/plugin-commonjs": "^22.0.2",
|
|
52
|
+
"@rollup/plugin-node-resolve": "^14.0.1",
|
|
53
|
+
"@types/jest": "^29.0.0",
|
|
54
|
+
"@types/node": "^18.7.16",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^5.36.2",
|
|
56
|
+
"@typescript-eslint/parser": "^5.36.2",
|
|
57
|
+
"@typescript-eslint/typescript-estree": "^5.36.2",
|
|
58
58
|
"chalk": "^5.0.1",
|
|
59
59
|
"check-node-version": "^4.2.1",
|
|
60
60
|
"child_process": "^1.0.2",
|
|
61
61
|
"chokidar": "^3.5.3",
|
|
62
|
-
"eslint": "^8.
|
|
62
|
+
"eslint": "^8.23.0",
|
|
63
63
|
"eslint-config-prettier": "^8.5.0",
|
|
64
64
|
"eslint-plugin-import": "^2.26.0",
|
|
65
65
|
"eslint-plugin-no-unsanitized": "^4.0.1",
|
|
66
|
-
"eslint-plugin-prettier": "^4.
|
|
66
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
67
67
|
"estrella": "^1.4.1",
|
|
68
|
-
"jest": "^
|
|
68
|
+
"jest": "^29.0.3",
|
|
69
69
|
"jest-silent-reporter": "^0.5.0",
|
|
70
70
|
"open": "^8.4.0",
|
|
71
|
-
"prettier": "^2.
|
|
72
|
-
"rollup": "^2.
|
|
71
|
+
"prettier": "^2.7.1",
|
|
72
|
+
"rollup": "^2.79.0",
|
|
73
73
|
"rollup-plugin-copy": "^3.4.0",
|
|
74
74
|
"rollup-plugin-eslint": "^7.0.0",
|
|
75
75
|
"rollup-plugin-terser": "^7.0.2",
|
|
76
76
|
"rollup-plugin-typescript2": "latest",
|
|
77
|
-
"serve-http": "^1.0.
|
|
78
|
-
"ts-jest": "^
|
|
79
|
-
"typescript": "^4.
|
|
80
|
-
"update-notifier": "^
|
|
77
|
+
"serve-http": "^1.0.7",
|
|
78
|
+
"ts-jest": "^29.0.0",
|
|
79
|
+
"typescript": "^4.8.3",
|
|
80
|
+
"update-notifier": "^6.0.2"
|
|
81
81
|
},
|
|
82
82
|
"prettier": "@cortex-js/prettier-config",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"complex.js": "^2.1.
|
|
85
|
-
"decimal.js": "^10.
|
|
84
|
+
"complex.js": "^2.1.1",
|
|
85
|
+
"decimal.js": "^10.4.0"
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* 0.6.0 */
|
|
2
|
-
/** The canonical form of `Add`:
|
|
3
|
-
* - removes `0`
|
|
4
|
-
* - adds up small integers and rational numbers
|
|
5
|
-
* - capture complex numbers (a + ib or ai +b)
|
|
6
|
-
* - groups repeated terms (a + a -> 2a)
|
|
7
|
-
* */
|
|
8
|
-
export declare function canonicalAdd(ce: IComputeEngine, ops: BoxedExpression[]): BoxedExpression;
|
|
9
|
-
export declare function domainAdd(_ce: IComputeEngine, args: BoxedExpression[]): Domain | string | null;
|
|
10
|
-
export declare function numEvalAdd(ce: IComputeEngine, args: BoxedExpression[]): BoxedExpression;
|
|
11
|
-
export declare function processAdd(ce: IComputeEngine, args: BoxedExpression[], _mode: 'simplify' | 'evaluate'): BoxedExpression | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/* 0.6.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 Divide, transform into Multiply/Power
|
|
8
|
-
*/
|
|
9
|
-
export declare function canonicalDivide(ce: IComputeEngine, op1: BoxedExpression, op2: BoxedExpression): BoxedExpression;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* 0.6.0 */
|
|
2
|
-
/** The canonical form of `Multiply`:
|
|
3
|
-
* - remove `1`
|
|
4
|
-
* - combine literal small integers and rationals
|
|
5
|
-
* - any arg is literal 0 -> return 0
|
|
6
|
-
* - simplify signs
|
|
7
|
-
* - combine terms with same base
|
|
8
|
-
* `a a^3` -> `a^4`
|
|
9
|
-
* - simplify the signs:
|
|
10
|
-
* - i.e. `-2 \times -3` -> `2 \times 3`
|
|
11
|
-
* - `2 \times -x` -> `-2 \times x`
|
|
12
|
-
*
|
|
13
|
-
* The ops must be canonical, the result is canonical.
|
|
14
|
-
*/
|
|
15
|
-
export declare function canonicalMultiply(ce: IComputeEngine, ops: BoxedExpression[]): BoxedExpression;
|
|
16
|
-
export declare function processMultiply(ce: IComputeEngine, ops: BoxedExpression[], _mode: 'simplify' | 'evaluate'): BoxedExpression | undefined;
|
|
17
|
-
export declare function numEvalMultiply(ce: IComputeEngine, ops: BoxedExpression[]): BoxedExpression | undefined;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* 0.6.0 */
|
|
2
|
-
import { IComputeEngine, Dictionary } from '../public';
|
|
3
|
-
export declare function getDefaultDictionaries(categories?: DictionaryCategory[] | 'all'): Readonly<Dictionary>[];
|
|
4
|
-
export declare const DICTIONARIES: {
|
|
5
|
-
[category in DictionaryCategory]?: Readonly<Dictionary> | Readonly<Dictionary>[];
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Set the dictionary of the current context (`engine.context`) to `dicts`
|
|
9
|
-
*
|
|
10
|
-
* `dicts` can be an array of dictionaries, in order to deal with circular
|
|
11
|
-
* dependencies: it is possible to partition a dictionary into multiple
|
|
12
|
-
* sub-dictionary, to control the order in which they are processe and
|
|
13
|
-
* avoid having expressions in the definition of an entry reference a symbol
|
|
14
|
-
* or function name that has not yet been added to the dictionary.
|
|
15
|
-
*
|
|
16
|
-
* Specifically:
|
|
17
|
-
* - Expressions (for values, evaluate, domain, isElementOf, etc..) are boxed
|
|
18
|
-
* - The domain of entries is inferred and validated:
|
|
19
|
-
* - check that domains are in canonical form
|
|
20
|
-
* - check that domains are consistent with declarations
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
export declare function setCurrentContextDictionary(engine: IComputeEngine, dicts: Dictionary | Dictionary[] | undefined): void;
|
|
24
|
-
/**
|
|
25
|
-
* For debugging: a textual representation of the inheritance chain of sets.
|
|
26
|
-
*/
|