@cortex-js/compute-engine 0.35.6 → 0.50.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/README.md +121 -5
- package/dist/compute-engine.esm.js +50435 -44944
- package/dist/compute-engine.min.esm.js +1072 -69
- package/dist/compute-engine.min.umd.js +1072 -69
- package/dist/compute-engine.umd.js +50540 -45049
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.umd.js +2 -2
- package/dist/math-json.umd.js +2 -2
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/configuration-change.d.ts +1 -1
- package/dist/types/common/fuzzy-string-match.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/interruptible.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/type/ast-nodes.d.ts +1 -1
- package/dist/types/common/type/boxed-type.d.ts +1 -1
- package/dist/types/common/type/lexer.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/parser.d.ts +8 -1
- package/dist/types/common/type/primitive.d.ts +2 -1
- package/dist/types/common/type/reduce.d.ts +1 -1
- package/dist/types/common/type/serialize.d.ts +1 -1
- package/dist/types/common/type/subtype.d.ts +1 -1
- package/dist/types/common/type/type-builder.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +1 -1
- package/dist/types/common/type/utils.d.ts +3 -2
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +4 -22
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +63 -76
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +15 -6
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +72 -6
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +8 -8
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +5 -8
- package/dist/types/compute-engine/boxed-expression/box.d.ts +63 -8
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +13 -12
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +44 -43
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +31 -30
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +18 -18
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +5 -37
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +5 -4
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +34 -33
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +34 -33
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +8 -8
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/constants.d.ts +6 -0
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +4 -5
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +9 -9
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +7 -7
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +4 -13
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/inequality-bounds.d.ts +21 -0
- package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +4 -0
- package/dist/types/compute-engine/boxed-expression/match.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +8 -8
- package/dist/types/compute-engine/boxed-expression/order.d.ts +14 -14
- package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +41 -0
- package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +18 -0
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +12 -35
- package/dist/types/compute-engine/boxed-expression/predicates.d.ts +2 -0
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +51 -51
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +8 -8
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +3 -11
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +7 -7
- package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +31 -0
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +13 -13
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +10 -10
- package/dist/types/compute-engine/collection-utils.d.ts +4 -4
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +3 -3
- package/dist/types/compute-engine/compilation/compile-expression.d.ts +25 -0
- package/dist/types/compute-engine/compilation/glsl-target.d.ts +12 -41
- package/dist/types/compute-engine/compilation/gpu-target.d.ts +50 -0
- package/dist/types/compute-engine/compilation/interval-glsl-target.d.ts +11 -11
- package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +7 -7
- package/dist/types/compute-engine/compilation/interval-wgsl-target.d.ts +54 -0
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +6 -6
- package/dist/types/compute-engine/compilation/python-target.d.ts +61 -0
- package/dist/types/compute-engine/compilation/types.d.ts +27 -22
- package/dist/types/compute-engine/compilation/wgsl-target.d.ts +41 -0
- package/dist/types/compute-engine/cost-function.d.ts +3 -3
- package/dist/types/compute-engine/engine-assumptions.d.ts +6 -0
- package/dist/types/compute-engine/engine-cache.d.ts +6 -0
- package/dist/types/compute-engine/engine-common-symbols.d.ts +6 -0
- package/dist/types/compute-engine/engine-compilation-targets.d.ts +17 -0
- package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +15 -0
- package/dist/types/compute-engine/engine-declarations.d.ts +19 -0
- package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +44 -0
- package/dist/types/compute-engine/engine-extension-contracts.d.ts +9 -0
- package/dist/types/compute-engine/engine-latex-dictionary-state.d.ts +13 -0
- package/dist/types/compute-engine/engine-library-bootstrap.d.ts +6 -0
- package/dist/types/compute-engine/engine-numeric-configuration.d.ts +34 -0
- package/dist/types/compute-engine/engine-parse-entrypoint.d.ts +7 -0
- package/dist/types/compute-engine/engine-runtime-state.d.ts +19 -0
- package/dist/types/compute-engine/engine-scope.d.ts +13 -0
- package/dist/types/compute-engine/engine-sequences.d.ts +14 -0
- package/dist/types/compute-engine/engine-simplification-rules.d.ts +15 -0
- package/dist/types/compute-engine/engine-startup-coordinator.d.ts +28 -0
- package/dist/types/compute-engine/engine-type-resolver.d.ts +12 -0
- package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +13 -0
- package/dist/types/compute-engine/free-functions.d.ts +20 -0
- package/dist/types/compute-engine/function-utils.d.ts +10 -10
- package/dist/types/compute-engine/global-types.d.ts +5 -3301
- package/dist/types/compute-engine/index.d.ts +155 -112
- package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
- package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
- package/dist/types/compute-engine/interval/index.d.ts +1 -1
- package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
- package/dist/types/compute-engine/interval/types.d.ts +1 -1
- package/dist/types/compute-engine/interval/util.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-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.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-relational-operators.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-statistics.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 +4 -80
- package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +83 -0
- package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +28 -0
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +23 -33
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +8 -8
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +15 -15
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/types.d.ts +73 -53
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -2
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +4 -4
- package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +19 -6
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic-analysis.d.ts +19 -32
- package/dist/types/compute-engine/library/logic.d.ts +1 -5
- package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +2 -2
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/type-handlers.d.ts +4 -0
- package/dist/types/compute-engine/library/utils.d.ts +12 -12
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +5 -5
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +5 -5
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +5 -5
- package/dist/types/compute-engine/numeric-value/types.d.ts +2 -3
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/expression.d.ts +3 -3
- package/dist/types/compute-engine/numerics/interval.d.ts +2 -2
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +4 -4
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +120 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +1 -2
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +3 -1
- package/dist/types/compute-engine/oeis.d.ts +3 -3
- package/dist/types/compute-engine/sequence.d.ts +13 -13
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/derivative.d.ts +3 -3
- package/dist/types/compute-engine/symbolic/distribute.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/fu-cost.d.ts +6 -6
- package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +46 -46
- package/dist/types/compute-engine/symbolic/fu.d.ts +4 -4
- package/dist/types/compute-engine/symbolic/logic-utils.d.ts +54 -0
- package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +4 -4
- package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-log.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +5 -0
- package/dist/types/compute-engine/symbolic/simplify-power.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +65 -4
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +2 -2
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +42 -42
- package/dist/types/compute-engine/tensor/tensors.d.ts +4 -4
- package/dist/types/compute-engine/types-definitions.d.ts +900 -0
- package/dist/types/compute-engine/types-engine.d.ts +375 -0
- package/dist/types/compute-engine/types-evaluation.d.ts +67 -0
- package/dist/types/compute-engine/types-expression.d.ts +1655 -0
- package/dist/types/compute-engine/types-kernel-evaluation.d.ts +164 -0
- package/dist/types/compute-engine/types-kernel-serialization.d.ts +147 -0
- package/dist/types/compute-engine/types-serialization.d.ts +23 -0
- package/dist/types/compute-engine/types.d.ts +2 -2
- package/dist/types/compute-engine.d.ts +16 -3
- package/dist/types/math-json/symbols.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +3 -3
- package/dist/types/math-json/utils.d.ts +31 -31
- package/dist/types/math-json.d.ts +2 -2
- package/package.json +8 -1
- package/dist/types/compute-engine/boxed-expression/product.d.ts +0 -66
- package/dist/types/compute-engine/boxed-expression/terms.d.ts +0 -10
- package/dist/types/compute-engine/library/invisible-operator.d.ts +0 -4
- package/dist/types/compute-engine/library/logic-utils.d.ts +0 -54
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
/* 0.50.0 */
|
|
2
|
+
import type { MathJsonExpression, MathJsonSymbol } from '../../math-json/types';
|
|
3
|
+
import type { TypeString } from '../../common/type/types';
|
|
4
|
+
import { BoxedType } from '../../common/type/boxed-type';
|
|
5
5
|
export type SymbolTable = {
|
|
6
6
|
parent: SymbolTable | null;
|
|
7
7
|
ids: {
|
|
@@ -36,7 +36,7 @@ export type DelimiterScale = 'normal' | 'scaled' | 'big' | 'none';
|
|
|
36
36
|
/**
|
|
37
37
|
* @category Latex Parsing and Serialization
|
|
38
38
|
*/
|
|
39
|
-
export type LibraryCategory = '
|
|
39
|
+
export type LibraryCategory = 'arithmetic' | 'calculus' | 'collections' | 'control-structures' | 'combinatorics' | 'core' | 'linear-algebra' | 'logic' | 'number-theory' | 'other' | 'physics' | 'polynomials' | 'relop' | 'statistics' | 'trigonometry';
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* :::info[THEORY OF OPERATIONS]
|
|
@@ -167,35 +167,35 @@ export type ParseHandler = ExpressionParseHandler | SymbolParseHandler | Functio
|
|
|
167
167
|
/**
|
|
168
168
|
* @category Latex Parsing and Serialization
|
|
169
169
|
*/
|
|
170
|
-
export type ExpressionParseHandler = (parser: Parser, until?: Readonly<Terminator>) =>
|
|
170
|
+
export type ExpressionParseHandler = (parser: Parser, until?: Readonly<Terminator>) => MathJsonExpression | null;
|
|
171
171
|
/**
|
|
172
172
|
* @category Latex Parsing and Serialization
|
|
173
173
|
*/
|
|
174
|
-
export type PrefixParseHandler = (parser: Parser, until?: Readonly<Terminator>) =>
|
|
174
|
+
export type PrefixParseHandler = (parser: Parser, until?: Readonly<Terminator>) => MathJsonExpression | null;
|
|
175
175
|
/**
|
|
176
176
|
* @category Latex Parsing and Serialization
|
|
177
177
|
*/
|
|
178
|
-
export type SymbolParseHandler = (parser: Parser, until?: Readonly<Terminator>) =>
|
|
178
|
+
export type SymbolParseHandler = (parser: Parser, until?: Readonly<Terminator>) => MathJsonExpression | null;
|
|
179
179
|
/**
|
|
180
180
|
* @category Latex Parsing and Serialization
|
|
181
181
|
*/
|
|
182
|
-
export type FunctionParseHandler = (parser: Parser, until?: Readonly<Terminator>) =>
|
|
182
|
+
export type FunctionParseHandler = (parser: Parser, until?: Readonly<Terminator>) => MathJsonExpression | null;
|
|
183
183
|
/**
|
|
184
184
|
* @category Latex Parsing and Serialization
|
|
185
185
|
*/
|
|
186
|
-
export type EnvironmentParseHandler = (parser: Parser, until?: Readonly<Terminator>) =>
|
|
186
|
+
export type EnvironmentParseHandler = (parser: Parser, until?: Readonly<Terminator>) => MathJsonExpression | null;
|
|
187
187
|
/**
|
|
188
188
|
* @category Latex Parsing and Serialization
|
|
189
189
|
*/
|
|
190
|
-
export type PostfixParseHandler = (parser: Parser, lhs:
|
|
190
|
+
export type PostfixParseHandler = (parser: Parser, lhs: MathJsonExpression, until?: Readonly<Terminator>) => MathJsonExpression | null;
|
|
191
191
|
/**
|
|
192
192
|
* @category Latex Parsing and Serialization
|
|
193
193
|
*/
|
|
194
|
-
export type InfixParseHandler = (parser: Parser, lhs:
|
|
194
|
+
export type InfixParseHandler = (parser: Parser, lhs: MathJsonExpression, until: Readonly<Terminator>) => MathJsonExpression | null;
|
|
195
195
|
/**
|
|
196
196
|
* @category Latex Parsing and Serialization
|
|
197
197
|
*/
|
|
198
|
-
export type MatchfixParseHandler = (parser: Parser, body:
|
|
198
|
+
export type MatchfixParseHandler = (parser: Parser, body: MathJsonExpression) => MathJsonExpression | null;
|
|
199
199
|
/**
|
|
200
200
|
* @category Latex Parsing and Serialization
|
|
201
201
|
*/
|
|
@@ -250,14 +250,14 @@ export type BaseEntry = {
|
|
|
250
250
|
* @category Latex Parsing and Serialization
|
|
251
251
|
*/
|
|
252
252
|
export type DefaultEntry = BaseEntry & Trigger & {
|
|
253
|
-
parse?:
|
|
253
|
+
parse?: MathJsonExpression | ExpressionParseHandler;
|
|
254
254
|
};
|
|
255
255
|
/**
|
|
256
256
|
* @category Latex Parsing and Serialization
|
|
257
257
|
*/
|
|
258
258
|
export type ExpressionEntry = BaseEntry & Trigger & {
|
|
259
259
|
kind: 'expression';
|
|
260
|
-
parse?:
|
|
260
|
+
parse?: MathJsonExpression | ExpressionParseHandler;
|
|
261
261
|
precedence?: Precedence;
|
|
262
262
|
};
|
|
263
263
|
/**
|
|
@@ -344,7 +344,7 @@ export type SymbolEntry = BaseEntry & Trigger & {
|
|
|
344
344
|
kind: 'symbol';
|
|
345
345
|
/** Used for appropriate wrapping (i.e. when to surround it with parens) */
|
|
346
346
|
precedence?: Precedence;
|
|
347
|
-
parse:
|
|
347
|
+
parse: MathJsonExpression | SymbolParseHandler;
|
|
348
348
|
};
|
|
349
349
|
/**
|
|
350
350
|
* A function is a symbol followed by:
|
|
@@ -358,7 +358,17 @@ export type SymbolEntry = BaseEntry & Trigger & {
|
|
|
358
358
|
*/
|
|
359
359
|
export type FunctionEntry = BaseEntry & Trigger & {
|
|
360
360
|
kind: 'function';
|
|
361
|
-
parse?:
|
|
361
|
+
parse?: MathJsonExpression | FunctionParseHandler;
|
|
362
|
+
/**
|
|
363
|
+
* How arguments are parsed:
|
|
364
|
+
* - `'enclosure'` (default): arguments must be enclosed in parentheses,
|
|
365
|
+
* e.g. `\max(a, b)`.
|
|
366
|
+
* - `'implicit'`: arguments can be provided with or without parentheses,
|
|
367
|
+
* e.g. `\det A` is parsed as `\det(A)`.
|
|
368
|
+
* Bare arguments are parsed at multiplication precedence, so
|
|
369
|
+
* `\det 2A + 1` is parsed as `\det(2A) + 1`.
|
|
370
|
+
*/
|
|
371
|
+
arguments?: 'enclosure' | 'implicit';
|
|
362
372
|
};
|
|
363
373
|
/**
|
|
364
374
|
*
|
|
@@ -522,7 +532,7 @@ export type ParseLatexOptions = NumberFormat & {
|
|
|
522
532
|
* The `symbol` argument is a [valid symbol](/math-json/#symbols).
|
|
523
533
|
*
|
|
524
534
|
*/
|
|
525
|
-
getSymbolType: (symbol: MathJsonSymbol) => BoxedType;
|
|
535
|
+
getSymbolType: (symbol: MathJsonSymbol) => BoxedType | TypeString;
|
|
526
536
|
/**
|
|
527
537
|
* This handler is invoked when the parser needs to determine if a symbol
|
|
528
538
|
* has a custom subscript evaluation handler. If true, subscripts on this
|
|
@@ -541,7 +551,7 @@ export type ParseLatexOptions = NumberFormat & {
|
|
|
541
551
|
* The handler should return an expression or `null` if the token is not
|
|
542
552
|
* recognized.
|
|
543
553
|
*/
|
|
544
|
-
parseUnexpectedToken: (lhs:
|
|
554
|
+
parseUnexpectedToken: (lhs: MathJsonExpression | null, parser: Parser) => MathJsonExpression | null;
|
|
545
555
|
/**
|
|
546
556
|
* If true, the expression will be decorated with the LaTeX
|
|
547
557
|
* fragments corresponding to each elements of the expression.
|
|
@@ -640,7 +650,7 @@ export interface Parser {
|
|
|
640
650
|
*/
|
|
641
651
|
latex(start: number, end?: number): string;
|
|
642
652
|
/** Return an error expression with the specified code and arguments */
|
|
643
|
-
error(code: string | [string, ...
|
|
653
|
+
error(code: string | [string, ...MathJsonExpression[]], fromToken: number): MathJsonExpression;
|
|
644
654
|
/** If there are any space, advance the index until a non-space is encountered */
|
|
645
655
|
skipSpace(): boolean;
|
|
646
656
|
/** Skip over "visual space" which
|
|
@@ -669,7 +679,7 @@ export interface Parser {
|
|
|
669
679
|
* Return `null` if none was found
|
|
670
680
|
* Return `Nothing` if an empty group `{}` was found
|
|
671
681
|
*/
|
|
672
|
-
parseGroup():
|
|
682
|
+
parseGroup(): MathJsonExpression | null;
|
|
673
683
|
/**
|
|
674
684
|
* Some LaTeX commands (but not all) can accept arguments as single
|
|
675
685
|
* tokens (i.e. without braces), for example `^2`, `\sqrt3` or `\frac12`
|
|
@@ -684,15 +694,15 @@ export interface Parser {
|
|
|
684
694
|
*
|
|
685
695
|
* The excluded tokens include `!"#$%&(),/;:?@[]`|~", `\left`, `\bigl`, etc...
|
|
686
696
|
*/
|
|
687
|
-
parseToken():
|
|
697
|
+
parseToken(): MathJsonExpression | null;
|
|
688
698
|
/**
|
|
689
699
|
* Parse an expression enclosed in a LaTeX optional group enclosed in square brackets `[]`.
|
|
690
700
|
*
|
|
691
701
|
* Return `null` if none was found.
|
|
692
702
|
*/
|
|
693
|
-
parseOptionalGroup():
|
|
703
|
+
parseOptionalGroup(): MathJsonExpression | null;
|
|
694
704
|
/** Parse an enclosure (open paren/close paren, etc..) and return the expression inside the enclosure */
|
|
695
|
-
parseEnclosure():
|
|
705
|
+
parseEnclosure(): MathJsonExpression | null;
|
|
696
706
|
/**
|
|
697
707
|
* Some LaTeX commands have arguments that are not interpreted as
|
|
698
708
|
* expressions, but as strings. For example, `\begin{array}{ccc}` (both
|
|
@@ -715,7 +725,7 @@ export interface Parser {
|
|
|
715
725
|
* - a single LaTeX command: `\pi`
|
|
716
726
|
* - a multi-letter symbol: `\operatorname{speed}`
|
|
717
727
|
*/
|
|
718
|
-
parseSymbol(until?: Partial<Terminator>):
|
|
728
|
+
parseSymbol(until?: Partial<Terminator>): MathJsonExpression | null;
|
|
719
729
|
/**
|
|
720
730
|
* Parse an expression in a tabular format, where rows are separated by `\\`
|
|
721
731
|
* and columns by `&`.
|
|
@@ -723,7 +733,7 @@ export interface Parser {
|
|
|
723
733
|
* Return rows of sparse columns: empty rows are indicated with `Nothing`,
|
|
724
734
|
* and empty cells are also indicated with `Nothing`.
|
|
725
735
|
*/
|
|
726
|
-
parseTabular(): null |
|
|
736
|
+
parseTabular(): null | MathJsonExpression[][];
|
|
727
737
|
/**
|
|
728
738
|
* Parse an argument list, for example: `(12, x+1)` or `\left(x\right)`
|
|
729
739
|
*
|
|
@@ -735,14 +745,14 @@ export interface Parser {
|
|
|
735
745
|
* Return an array of expressions, one for each argument, or `null` if no
|
|
736
746
|
* argument was found.
|
|
737
747
|
*/
|
|
738
|
-
parseArguments(kind?: 'implicit' | 'enclosure', until?: Terminator): ReadonlyArray<
|
|
748
|
+
parseArguments(kind?: 'implicit' | 'enclosure', until?: Terminator): ReadonlyArray<MathJsonExpression> | null;
|
|
739
749
|
/**
|
|
740
750
|
* Parse a postfix operator, such as `'` or `!`.
|
|
741
751
|
*
|
|
742
752
|
* Prefix, infix and matchfix operators are handled by `parseExpression()`
|
|
743
753
|
*
|
|
744
754
|
*/
|
|
745
|
-
parsePostfixOperator(lhs:
|
|
755
|
+
parsePostfixOperator(lhs: MathJsonExpression | null, until?: Partial<Terminator>): MathJsonExpression | null;
|
|
746
756
|
/**
|
|
747
757
|
* Parse an expression:
|
|
748
758
|
*
|
|
@@ -769,11 +779,11 @@ export interface Parser {
|
|
|
769
779
|
*
|
|
770
780
|
* `until` is `{ minPrec:0 }` by default.
|
|
771
781
|
*/
|
|
772
|
-
parseExpression(until?: Partial<Terminator>):
|
|
782
|
+
parseExpression(until?: Partial<Terminator>): MathJsonExpression | null;
|
|
773
783
|
/**
|
|
774
784
|
* Parse a number.
|
|
775
785
|
*/
|
|
776
|
-
parseNumber():
|
|
786
|
+
parseNumber(): MathJsonExpression | null;
|
|
777
787
|
/**
|
|
778
788
|
* Boundaries are used to detect the end of an expression.
|
|
779
789
|
*
|
|
@@ -791,7 +801,7 @@ export interface Parser {
|
|
|
791
801
|
removeBoundary(): void;
|
|
792
802
|
get atBoundary(): boolean;
|
|
793
803
|
matchBoundary(): boolean;
|
|
794
|
-
boundaryError(msg: string | [string, ...
|
|
804
|
+
boundaryError(msg: string | [string, ...MathJsonExpression[]]): MathJsonExpression;
|
|
795
805
|
}
|
|
796
806
|
/**
|
|
797
807
|
*
|
|
@@ -855,14 +865,24 @@ export type SerializeLatexOptions = NumberSerializationFormat & {
|
|
|
855
865
|
*
|
|
856
866
|
*/
|
|
857
867
|
missingSymbol: LatexString;
|
|
858
|
-
applyFunctionStyle: (expr:
|
|
859
|
-
groupStyle: (expr:
|
|
860
|
-
rootStyle: (expr:
|
|
861
|
-
fractionStyle: (expr:
|
|
862
|
-
logicStyle: (expr:
|
|
863
|
-
powerStyle: (expr:
|
|
864
|
-
numericSetStyle: (expr:
|
|
868
|
+
applyFunctionStyle: (expr: MathJsonExpression, level: number) => DelimiterScale;
|
|
869
|
+
groupStyle: (expr: MathJsonExpression, level: number) => DelimiterScale;
|
|
870
|
+
rootStyle: (expr: MathJsonExpression, level: number) => 'radical' | 'quotient' | 'solidus';
|
|
871
|
+
fractionStyle: (expr: MathJsonExpression, level: number) => 'quotient' | 'block-quotient' | 'inline-quotient' | 'inline-solidus' | 'nice-solidus' | 'reciprocal' | 'factor';
|
|
872
|
+
logicStyle: (expr: MathJsonExpression, level: number) => 'word' | 'boolean' | 'uppercase-word' | 'punctuation';
|
|
873
|
+
powerStyle: (expr: MathJsonExpression, level: number) => 'root' | 'solidus' | 'quotient';
|
|
874
|
+
numericSetStyle: (expr: MathJsonExpression, level: number) => 'compact' | 'regular' | 'interval' | 'set-builder';
|
|
865
875
|
};
|
|
876
|
+
/** @internal */
|
|
877
|
+
export interface SerializerDictionaryEntry {
|
|
878
|
+
name?: string;
|
|
879
|
+
}
|
|
880
|
+
/** @internal */
|
|
881
|
+
export interface SerializerDictionary {
|
|
882
|
+
ids: ReadonlyMap<string, SerializerDictionaryEntry>;
|
|
883
|
+
lookahead: number;
|
|
884
|
+
defs: readonly SerializerDictionaryEntry[];
|
|
885
|
+
}
|
|
866
886
|
/**
|
|
867
887
|
*
|
|
868
888
|
* An instance of `Serializer` is provided to the `serialize` handlers of custom
|
|
@@ -873,7 +893,7 @@ export type SerializeLatexOptions = NumberSerializationFormat & {
|
|
|
873
893
|
*/
|
|
874
894
|
export interface Serializer {
|
|
875
895
|
readonly options: Required<SerializeLatexOptions>;
|
|
876
|
-
readonly dictionary:
|
|
896
|
+
readonly dictionary: SerializerDictionary;
|
|
877
897
|
/** "depth" of the expression:
|
|
878
898
|
* - 0 for the root
|
|
879
899
|
* - 1 for a subexpression of the root
|
|
@@ -887,9 +907,9 @@ export interface Serializer {
|
|
|
887
907
|
*/
|
|
888
908
|
level: number;
|
|
889
909
|
/** Output a LaTeX string representing the expression */
|
|
890
|
-
serialize: (expr:
|
|
891
|
-
serializeFunction(expr:
|
|
892
|
-
serializeSymbol(expr:
|
|
910
|
+
serialize: (expr: MathJsonExpression | null | undefined) => string;
|
|
911
|
+
serializeFunction(expr: MathJsonExpression, def?: SerializerDictionaryEntry): LatexString;
|
|
912
|
+
serializeSymbol(expr: MathJsonExpression): LatexString;
|
|
893
913
|
/** Output `s` surrounded by delimiters.
|
|
894
914
|
*
|
|
895
915
|
* If `delimiters` is not specified, use `()`
|
|
@@ -899,23 +919,23 @@ export interface Serializer {
|
|
|
899
919
|
/** A string with the arguments of expr fenced appropriately and separated by
|
|
900
920
|
* commas.
|
|
901
921
|
*/
|
|
902
|
-
wrapArguments(expr:
|
|
922
|
+
wrapArguments(expr: MathJsonExpression): LatexString;
|
|
903
923
|
/** Add a group fence around the expression if it is
|
|
904
924
|
* an operator of precedence less than or equal to `prec`.
|
|
905
925
|
*/
|
|
906
|
-
wrap: (expr:
|
|
926
|
+
wrap: (expr: MathJsonExpression | null | undefined, prec?: number) => LatexString;
|
|
907
927
|
/** Add a group fence around the expression if it is
|
|
908
928
|
* short (not a function)
|
|
909
929
|
*/
|
|
910
|
-
wrapShort(expr:
|
|
930
|
+
wrapShort(expr: MathJsonExpression | null | undefined): LatexString;
|
|
911
931
|
/** Styles */
|
|
912
|
-
applyFunctionStyle: (expr:
|
|
913
|
-
groupStyle: (expr:
|
|
914
|
-
rootStyle: (expr:
|
|
915
|
-
fractionStyle: (expr:
|
|
916
|
-
logicStyle: (expr:
|
|
917
|
-
powerStyle: (expr:
|
|
918
|
-
numericSetStyle: (expr:
|
|
932
|
+
applyFunctionStyle: (expr: MathJsonExpression, level: number) => DelimiterScale;
|
|
933
|
+
groupStyle: (expr: MathJsonExpression, level: number) => DelimiterScale;
|
|
934
|
+
rootStyle: (expr: MathJsonExpression, level: number) => 'radical' | 'quotient' | 'solidus';
|
|
935
|
+
fractionStyle: (expr: MathJsonExpression, level: number) => 'quotient' | 'block-quotient' | 'inline-quotient' | 'inline-solidus' | 'nice-solidus' | 'reciprocal' | 'factor';
|
|
936
|
+
logicStyle: (expr: MathJsonExpression, level: number) => 'word' | 'boolean' | 'uppercase-word' | 'punctuation';
|
|
937
|
+
powerStyle: (expr: MathJsonExpression, level: number) => 'root' | 'solidus' | 'quotient';
|
|
938
|
+
numericSetStyle: (expr: MathJsonExpression, level: number) => 'compact' | 'regular' | 'interval' | 'set-builder';
|
|
919
939
|
}
|
|
920
940
|
/** The `serialize` handler of a custom LaTeX dictionary entry can be
|
|
921
941
|
* a function of this type.
|
|
@@ -923,4 +943,4 @@ export interface Serializer {
|
|
|
923
943
|
* @category Latex Parsing and Serialization
|
|
924
944
|
*
|
|
925
945
|
*/
|
|
926
|
-
export type SerializeHandler = (serializer: Serializer, expr:
|
|
946
|
+
export type SerializeHandler = (serializer: Serializer, expr: MathJsonExpression) => string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export type CanonicalArithmeticOperators = 'Add' | 'Negate' | 'Multiply' | 'Divide' | 'Power' | 'Sqrt' | 'Root' | 'Ln';
|
|
3
3
|
export declare const ARITHMETIC_LIBRARY: SymbolDefinitions[];
|
|
4
|
-
export declare function isPrime(expr: BoxedExpression): boolean | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const CALCULUS_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const DEFAULT_LINSPACE_COUNT = 50;
|
|
3
3
|
export declare const COLLECTIONS_LIBRARY: SymbolDefinitions;
|
|
4
4
|
/**
|
|
@@ -8,7 +8,7 @@ export declare const COLLECTIONS_LIBRARY: SymbolDefinitions;
|
|
|
8
8
|
* - arguments rounded to integers
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
export declare function range(expr:
|
|
11
|
+
export declare function range(expr: Expression): [lower: number, upper: number, step: number];
|
|
12
12
|
/** Return the last value in the range
|
|
13
13
|
* - could be less that lower if step is negative
|
|
14
14
|
* - could be less than upper if step is positive, for
|
|
@@ -22,6 +22,6 @@ export declare function rangeLast(r: [lower: number, upper: number, step: number
|
|
|
22
22
|
* is returned. Otherwise, the result of the function is used as the new accumulator.
|
|
23
23
|
* If the iteration completes, the final accumulator is returned.
|
|
24
24
|
*/
|
|
25
|
-
export declare function reduceCollection<T>(collection:
|
|
25
|
+
export declare function reduceCollection<T>(collection: Expression, fn: (acc: T, next: Expression) => T | null, initial: T): Generator<T | undefined>;
|
|
26
26
|
export declare function fromRange(start: number, end: number): number[];
|
|
27
|
-
export declare function sortedIndices(expr:
|
|
27
|
+
export declare function sortedIndices(expr: Expression, fn?: Expression | undefined): number[] | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const COMBINATORICS_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const COMPLEX_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const CONTROL_STRUCTURES_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const CORE_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import type { SymbolDefinitions, ComputeEngine } from '../global-types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/* 0.50.0 */
|
|
2
|
+
import type { SymbolDefinitions, IComputeEngine as ComputeEngine, LibraryDefinition } from '../global-types';
|
|
3
|
+
/**
|
|
4
|
+
* The standard libraries bundled with the Compute Engine.
|
|
5
|
+
*
|
|
6
|
+
* Each entry bundles symbol/operator definitions with their LaTeX dictionary
|
|
7
|
+
* entries and declares dependencies on other libraries.
|
|
8
|
+
*/
|
|
9
|
+
export declare const STANDARD_LIBRARIES: LibraryDefinition[];
|
|
10
|
+
/**
|
|
11
|
+
* Topological sort of libraries using Kahn's algorithm.
|
|
12
|
+
* Throws on cycle or missing dependency.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sortLibraries(libs: LibraryDefinition[]): LibraryDefinition[];
|
|
15
|
+
/**
|
|
16
|
+
* Return the standard libraries, optionally filtered by category name.
|
|
17
|
+
* Libraries are returned in dependency order (topologically sorted).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getStandardLibrary(categories?: LibraryCategory[] | LibraryCategory | 'all'): readonly LibraryDefinition[];
|
|
7
20
|
/**
|
|
8
21
|
* Set the symbol table of the current context (`engine.context`) to `table`
|
|
9
22
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const LINEAR_ALGEBRA_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
/**
|
|
3
3
|
* Quantifier domain helpers and boolean analysis functions.
|
|
4
4
|
* Extracted from logic.ts for better code organization.
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
export type ExtractDomainResult = {
|
|
13
13
|
status: 'success';
|
|
14
14
|
variable: string;
|
|
15
|
-
values:
|
|
15
|
+
values: Expression[];
|
|
16
16
|
} | {
|
|
17
17
|
status: 'non-enumerable';
|
|
18
18
|
variable: string;
|
|
19
|
-
domain:
|
|
19
|
+
domain: Expression;
|
|
20
20
|
reason: string;
|
|
21
21
|
} | {
|
|
22
22
|
status: 'error';
|
|
@@ -31,52 +31,39 @@ export type ExtractDomainResult = {
|
|
|
31
31
|
* - ["Element", "x", ["Set", 1, 2, 3], condition] → filtered values (EL-3)
|
|
32
32
|
* Returns detailed result indicating success, non-enumerable domain, or error.
|
|
33
33
|
*/
|
|
34
|
-
export declare function extractFiniteDomainWithReason(condition:
|
|
35
|
-
/**
|
|
36
|
-
* Extract the finite domain from a quantifier's condition.
|
|
37
|
-
* Supports:
|
|
38
|
-
* - ["Element", "x", ["Set", 1, 2, 3]] → [1, 2, 3]
|
|
39
|
-
* - ["Element", "x", ["Range", 1, 5]] → [1, 2, 3, 4, 5]
|
|
40
|
-
* - ["Element", "x", ["Interval", 1, 5]] → [1, 2, 3, 4, 5] (integers only)
|
|
41
|
-
* Returns null if the domain is not finite or not recognized.
|
|
42
|
-
* @deprecated Use extractFiniteDomainWithReason for better error handling
|
|
43
|
-
*/
|
|
44
|
-
export declare function extractFiniteDomain(condition: BoxedExpression, ce: ComputeEngine): {
|
|
45
|
-
variable: string;
|
|
46
|
-
values: BoxedExpression[];
|
|
47
|
-
} | null;
|
|
34
|
+
export declare function extractFiniteDomainWithReason(condition: Expression, ce: ComputeEngine): ExtractDomainResult;
|
|
48
35
|
/**
|
|
49
36
|
* Check if an expression contains a reference to a specific variable.
|
|
50
37
|
*/
|
|
51
|
-
export declare function bodyContainsVariable(expr:
|
|
38
|
+
export declare function bodyContainsVariable(expr: Expression, variable: string): boolean;
|
|
52
39
|
/**
|
|
53
40
|
* For nested quantifiers like ∀x∈S. ∀y∈T. P(x,y), collect the inner domains.
|
|
54
41
|
* Returns an array of {variable, values} for nested ForAll/Exists with finite domains.
|
|
55
42
|
*/
|
|
56
|
-
export declare function collectNestedDomains(body:
|
|
43
|
+
export declare function collectNestedDomains(body: Expression, ce: ComputeEngine): {
|
|
57
44
|
variable: string;
|
|
58
|
-
values:
|
|
45
|
+
values: Expression[];
|
|
59
46
|
}[];
|
|
60
47
|
/**
|
|
61
48
|
* Get the innermost body of nested quantifiers.
|
|
62
49
|
*/
|
|
63
|
-
export declare function getInnermostBody(body:
|
|
50
|
+
export declare function getInnermostBody(body: Expression): Expression;
|
|
64
51
|
/**
|
|
65
52
|
* Evaluate ForAll over a Cartesian product of domains.
|
|
66
53
|
* Returns True if the predicate holds for all combinations.
|
|
67
54
|
*/
|
|
68
55
|
export declare function evaluateForAllCartesian(domains: {
|
|
69
56
|
variable: string;
|
|
70
|
-
values:
|
|
71
|
-
}[], body:
|
|
57
|
+
values: Expression[];
|
|
58
|
+
}[], body: Expression, ce: ComputeEngine): Expression | undefined;
|
|
72
59
|
/**
|
|
73
60
|
* Evaluate Exists over a Cartesian product of domains.
|
|
74
61
|
* Returns True if the predicate holds for at least one combination.
|
|
75
62
|
*/
|
|
76
63
|
export declare function evaluateExistsCartesian(domains: {
|
|
77
64
|
variable: string;
|
|
78
|
-
values:
|
|
79
|
-
}[], body:
|
|
65
|
+
values: Expression[];
|
|
66
|
+
}[], body: Expression, ce: ComputeEngine): Expression | undefined;
|
|
80
67
|
/**
|
|
81
68
|
* Check if a boolean expression is satisfiable.
|
|
82
69
|
*
|
|
@@ -115,7 +102,7 @@ export declare function evaluateExistsCartesian(domains: {
|
|
|
115
102
|
* @returns `True` if satisfiable, `False` if unsatisfiable, or the
|
|
116
103
|
* unevaluated expression if the variable limit is exceeded
|
|
117
104
|
*/
|
|
118
|
-
export declare function isSatisfiable(expr:
|
|
105
|
+
export declare function isSatisfiable(expr: Expression, ce: ComputeEngine): Expression;
|
|
119
106
|
/**
|
|
120
107
|
* Check if a boolean expression is a tautology.
|
|
121
108
|
*
|
|
@@ -152,7 +139,7 @@ export declare function isSatisfiable(expr: BoxedExpression, ce: ComputeEngine):
|
|
|
152
139
|
* @returns `True` if a tautology, `False` if not, or the unevaluated
|
|
153
140
|
* expression if the variable limit is exceeded
|
|
154
141
|
*/
|
|
155
|
-
export declare function isTautology(expr:
|
|
142
|
+
export declare function isTautology(expr: Expression, ce: ComputeEngine): Expression;
|
|
156
143
|
/**
|
|
157
144
|
* Generate a truth table for a boolean expression.
|
|
158
145
|
*
|
|
@@ -186,7 +173,7 @@ export declare function isTautology(expr: BoxedExpression, ce: ComputeEngine): B
|
|
|
186
173
|
* @returns A `List` of `List`s representing the truth table, or the
|
|
187
174
|
* unevaluated expression if the variable limit is exceeded
|
|
188
175
|
*/
|
|
189
|
-
export declare function generateTruthTable(expr:
|
|
176
|
+
export declare function generateTruthTable(expr: Expression, ce: ComputeEngine): Expression;
|
|
190
177
|
/**
|
|
191
178
|
* Find all prime implicants using the Quine-McCluskey algorithm.
|
|
192
179
|
*
|
|
@@ -215,7 +202,7 @@ export declare function generateTruthTable(expr: BoxedExpression, ce: ComputeEng
|
|
|
215
202
|
* @param ce - The ComputeEngine instance
|
|
216
203
|
* @returns A Set of expressions representing prime implicants
|
|
217
204
|
*/
|
|
218
|
-
export declare function findPrimeImplicants(expr:
|
|
205
|
+
export declare function findPrimeImplicants(expr: Expression, ce: ComputeEngine): Expression[] | null;
|
|
219
206
|
/**
|
|
220
207
|
* Find all prime implicates using the Quine-McCluskey algorithm.
|
|
221
208
|
*
|
|
@@ -227,7 +214,7 @@ export declare function findPrimeImplicants(expr: BoxedExpression, ce: ComputeEn
|
|
|
227
214
|
* @param ce - The ComputeEngine instance
|
|
228
215
|
* @returns A Set of expressions representing prime implicates (clauses)
|
|
229
216
|
*/
|
|
230
|
-
export declare function findPrimeImplicates(expr:
|
|
217
|
+
export declare function findPrimeImplicates(expr: Expression, ce: ComputeEngine): Expression[] | null;
|
|
231
218
|
/**
|
|
232
219
|
* Find a minimal DNF (sum of products) using prime implicants.
|
|
233
220
|
*
|
|
@@ -238,7 +225,7 @@ export declare function findPrimeImplicates(expr: BoxedExpression, ce: ComputeEn
|
|
|
238
225
|
* @param ce - The ComputeEngine instance
|
|
239
226
|
* @returns The minimal DNF, or null if too many variables
|
|
240
227
|
*/
|
|
241
|
-
export declare function minimalDNF(expr:
|
|
228
|
+
export declare function minimalDNF(expr: Expression, ce: ComputeEngine): Expression | null;
|
|
242
229
|
/**
|
|
243
230
|
* Find a minimal CNF (product of sums) using prime implicates.
|
|
244
231
|
*
|
|
@@ -246,4 +233,4 @@ export declare function minimalDNF(expr: BoxedExpression, ce: ComputeEngine): Bo
|
|
|
246
233
|
* @param ce - The ComputeEngine instance
|
|
247
234
|
* @returns The minimal CNF, or null if too many variables
|
|
248
235
|
*/
|
|
249
|
-
export declare function minimalCNF(expr:
|
|
236
|
+
export declare function minimalCNF(expr: Expression, ce: ComputeEngine): Expression | null;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const LOGIC_LIBRARY: SymbolDefinitions;
|
|
3
|
-
export declare function simplifyLogicFunction(x: BoxedExpression): {
|
|
4
|
-
value: BoxedExpression;
|
|
5
|
-
because: string;
|
|
6
|
-
} | undefined;
|
|
7
3
|
export declare const LOGIC_FUNCTION_LIBRARY: SymbolDefinitions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const NUMBER_THEORY_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const POLYNOMIALS_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
export declare function randomExpression(level?: number):
|
|
1
|
+
/* 0.50.0 */
|
|
2
|
+
export declare function randomExpression(level?: number): MathJsonExpression;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const RELOP_LIBRARY: SymbolDefinitions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const SETS_LIBRARY: SymbolDefinitions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const STATISTICS_LIBRARY: SymbolDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.50.0 */
|
|
2
2
|
export declare const TRIGONOMETRY_LIBRARY: SymbolDefinitions[];
|