trilean 1.12.0 → 1.13.1
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 +19 -0
- package/dist/evaluator-compiled.cjs +311 -0
- package/dist/evaluator-compiled.d.cts +20 -0
- package/dist/evaluator-compiled.d.ts +20 -0
- package/dist/evaluator-compiled.js +310 -0
- package/dist/evaluator-effect.cjs +10 -6
- package/dist/evaluator-effect.d.cts +5 -1
- package/dist/evaluator-effect.d.ts +5 -1
- package/dist/evaluator-effect.js +10 -7
- package/dist/evaluator-factory.cjs +3 -1
- package/dist/evaluator-factory.d.cts +3 -0
- package/dist/evaluator-factory.d.ts +3 -0
- package/dist/evaluator-factory.js +3 -1
- package/dist/evaluator-literals.cjs +43 -0
- package/dist/evaluator-literals.d.cts +10 -0
- package/dist/evaluator-literals.d.ts +10 -0
- package/dist/evaluator-literals.js +42 -0
- package/dist/evaluator.cjs +7 -31
- package/dist/evaluator.js +7 -31
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.d.cts +1 -1
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +1 -1
- package/dist-cli/trilean.mjs +379 -60
- package/package.json +2 -2
- package/schemas/trilean.schema.json +1 -1
package/dist/evaluator.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_complex = require("./complex.cjs");
|
|
3
2
|
const require_evaluation = require("./evaluation.cjs");
|
|
4
3
|
require("./evaluator-budget.cjs");
|
|
5
4
|
const require_evaluator_effect = require("./evaluator-effect.cjs");
|
|
6
5
|
const require_evaluator_collection = require("./evaluator-collection.cjs");
|
|
7
6
|
const require_evaluator_operations = require("./evaluator-operations.cjs");
|
|
7
|
+
const require_evaluator_literals = require("./evaluator-literals.cjs");
|
|
8
8
|
const require_tree = require("./tree.cjs");
|
|
9
9
|
//#region src/evaluator.ts
|
|
10
10
|
/**
|
|
@@ -114,36 +114,12 @@ function* evaluateValueInternal(node, context, resolvers, accumulator, functions
|
|
|
114
114
|
}
|
|
115
115
|
return require_evaluator_operations.invokeRegisteredFunction(functions, node.fn, args);
|
|
116
116
|
}
|
|
117
|
-
case "numberLiteral":
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
case "
|
|
123
|
-
kind: "text",
|
|
124
|
-
value: node.value
|
|
125
|
-
});
|
|
126
|
-
case "booleanLiteral": return require_evaluation.definite({
|
|
127
|
-
kind: "boolean",
|
|
128
|
-
value: node.value
|
|
129
|
-
});
|
|
130
|
-
case "instantLiteral": return require_evaluation.definite({
|
|
131
|
-
kind: "instant",
|
|
132
|
-
value: node.value
|
|
133
|
-
});
|
|
134
|
-
case "durationLiteral": return require_evaluation.definite({
|
|
135
|
-
kind: "duration",
|
|
136
|
-
value: node.value,
|
|
137
|
-
unit: node.unit
|
|
138
|
-
});
|
|
139
|
-
case "complexLiteral":
|
|
140
|
-
if ("re" in node) return require_evaluation.definite({
|
|
141
|
-
kind: "complex",
|
|
142
|
-
re: node.re,
|
|
143
|
-
im: node.im,
|
|
144
|
-
unit: node.unit
|
|
145
|
-
});
|
|
146
|
-
return require_evaluation.definite(require_complex.complexFromPolar(node.magnitude, node.phase, node.unit));
|
|
117
|
+
case "numberLiteral":
|
|
118
|
+
case "textLiteral":
|
|
119
|
+
case "booleanLiteral":
|
|
120
|
+
case "instantLiteral":
|
|
121
|
+
case "durationLiteral":
|
|
122
|
+
case "complexLiteral": return require_evaluation.definite(require_evaluator_literals.literalValue(node));
|
|
147
123
|
case "arithmetic": {
|
|
148
124
|
const [left, right] = yield* require_evaluator_effect.all([evaluateValueInternal(node.left, context, resolvers, accumulator, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth + 1), evaluateValueInternal(node.right, context, resolvers, accumulator, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth + 1)]);
|
|
149
125
|
if (left.status === "indeterminate") return left;
|
package/dist/evaluator.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { complexFromPolar } from "./complex.js";
|
|
2
1
|
import { definite, firstIndeterminate, indeterminate } from "./evaluation.js";
|
|
3
2
|
import "./evaluator-budget.js";
|
|
4
3
|
import { all, wait } from "./evaluator-effect.js";
|
|
5
4
|
import { firstFilterIndeterminate, resolveParticipatingItems } from "./evaluator-collection.js";
|
|
6
5
|
import { absenceEvaluation, applyArithmetic, applyNegate, checkReferenceUnit, combineAnd, combineOr, compareText, compareValues, computeMembershipMatch, invokeRegisteredFunction } from "./evaluator-operations.js";
|
|
6
|
+
import { literalValue } from "./evaluator-literals.js";
|
|
7
7
|
import { ExpressionNodeSchema, PredicateNodeSchema } from "./tree.js";
|
|
8
8
|
//#region src/evaluator.ts
|
|
9
9
|
/**
|
|
@@ -113,36 +113,12 @@ function* evaluateValueInternal(node, context, resolvers, accumulator, functions
|
|
|
113
113
|
}
|
|
114
114
|
return invokeRegisteredFunction(functions, node.fn, args);
|
|
115
115
|
}
|
|
116
|
-
case "numberLiteral":
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
case "
|
|
122
|
-
kind: "text",
|
|
123
|
-
value: node.value
|
|
124
|
-
});
|
|
125
|
-
case "booleanLiteral": return definite({
|
|
126
|
-
kind: "boolean",
|
|
127
|
-
value: node.value
|
|
128
|
-
});
|
|
129
|
-
case "instantLiteral": return definite({
|
|
130
|
-
kind: "instant",
|
|
131
|
-
value: node.value
|
|
132
|
-
});
|
|
133
|
-
case "durationLiteral": return definite({
|
|
134
|
-
kind: "duration",
|
|
135
|
-
value: node.value,
|
|
136
|
-
unit: node.unit
|
|
137
|
-
});
|
|
138
|
-
case "complexLiteral":
|
|
139
|
-
if ("re" in node) return definite({
|
|
140
|
-
kind: "complex",
|
|
141
|
-
re: node.re,
|
|
142
|
-
im: node.im,
|
|
143
|
-
unit: node.unit
|
|
144
|
-
});
|
|
145
|
-
return definite(complexFromPolar(node.magnitude, node.phase, node.unit));
|
|
116
|
+
case "numberLiteral":
|
|
117
|
+
case "textLiteral":
|
|
118
|
+
case "booleanLiteral":
|
|
119
|
+
case "instantLiteral":
|
|
120
|
+
case "durationLiteral":
|
|
121
|
+
case "complexLiteral": return definite(literalValue(node));
|
|
146
122
|
case "arithmetic": {
|
|
147
123
|
const [left, right] = yield* all([evaluateValueInternal(node.left, context, resolvers, accumulator, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth + 1), evaluateValueInternal(node.right, context, resolvers, accumulator, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth + 1)]);
|
|
148
124
|
if (left.status === "indeterminate") return left;
|
package/dist/index.d.cts
CHANGED
|
@@ -12,6 +12,7 @@ import { Evaluation, IndeterminateReason, IndeterminateReasonSchema, definite, f
|
|
|
12
12
|
import { DocumentEvaluation, EvaluateDocumentOptions, TreeKind, evaluateDocument } from "./evaluate-document.cjs";
|
|
13
13
|
import { DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH } from "./evaluator-budget.cjs";
|
|
14
14
|
import { Absence, EvaluationContext, Resolution, Resolvers, SyncResolvers, TreeResolution } from "./resolvers.cjs";
|
|
15
|
+
import { CompiledPredicate } from "./evaluator-compiled.cjs";
|
|
15
16
|
import { EvaluatorOptions, createEvaluator, createSyncEvaluator, evaluatePredicate, evaluateValue } from "./evaluator-factory.cjs";
|
|
16
17
|
import { InputItem, InputsParseResult, createInputResolvers, parseInputs } from "./input-resolvers.cjs";
|
|
17
|
-
export { type Absence, type AccumulatorNode, AccumulatorNodeSchema, type AllOfNode, AllOfNodeSchema, type AndNode, AndNodeSchema, type AnyOfNode, AnyOfNodeSchema, type ArithmeticNode, ArithmeticNodeSchema, type ArithmeticOperator, ArithmeticOperatorSchema, type BooleanLiteralNode, BooleanLiteralNodeSchema, type CallNode, CallNodeSchema, type CompareNode, CompareNodeSchema, type ComparisonOperator, ComparisonOperatorSchema, type ComplexLiteralNode, ComplexLiteralNodeSchema, type ComplexPolarLiteralNode, ComplexPolarLiteralNodeSchema, type ComplexRectangularLiteralNode, ComplexRectangularLiteralNodeSchema, type ComputedValue, ComputedValueSchema, type ConditionalCase, ConditionalCaseSchema, type ConditionalNode, ConditionalNodeSchema, DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH, type DelegateNode, DelegateNodeSchema, type DocumentEvaluation, type DurationLiteralNode, DurationLiteralNodeSchema, type DurationUnit, DurationUnitSchema, type EvaluateDocumentOptions, type Evaluation, type EvaluationContext, type EvaluatorOptions, type EveryNode, EveryNodeSchema, type ExistsNode, ExistsNodeSchema, type ExpressionNode, ExpressionNodeSchema, type FoldCombiner, FoldCombinerSchema, type FoldNode, FoldNodeSchema, type FunctionFailure, type FunctionRegistry, type HitPolicy, HitPolicySchema, type IndeterminateReason, IndeterminateReasonSchema, type InputItem, type InputsParseResult, type InstantLiteralNode, InstantLiteralNodeSchema, type JsonValue, JsonValueSchema, type LookupNode, LookupNodeSchema, type MemberOfNode, MemberOfNodeSchema, type MembershipOperator, MembershipOperatorSchema, type NegateNode, NegateNodeSchema, type NotNode, NotNodeSchema, type NumberLiteralNode, NumberLiteralNodeSchema, type OrNode, OrNodeSchema, type PredicateNode, PredicateNodeSchema, type ReferenceNode, ReferenceNodeSchema, type Resolution, type Resolvers, type SomeNode, SomeNodeSchema, type SyncResolvers, type TextCompareNode, TextCompareNodeSchema, type TextComparisonOperator, TextComparisonOperatorSchema, type TextLiteralNode, TextLiteralNodeSchema, type TreeKind, type TreeReferenceNode, TreeReferenceNodeSchema, type TreeResolution, type Unit, UnitSchema, and, average, builtinFunctions, coalesce, combineUnitsForDivide, combineUnitsForMultiply, complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase, count, createEvaluator, createInputResolvers, createSyncEvaluator, definite, emptyFunctionRegistry, evaluateDocument, evaluatePredicate, evaluateValue, firstIndeterminate, hierarchicalGlobPattern, iff, implies, indeterminate, nand, none, nor, not, or, parseInputs, prefixPattern, presenceOf, sum, unitsEqual, wildcardPattern, xor };
|
|
18
|
+
export { type Absence, type AccumulatorNode, AccumulatorNodeSchema, type AllOfNode, AllOfNodeSchema, type AndNode, AndNodeSchema, type AnyOfNode, AnyOfNodeSchema, type ArithmeticNode, ArithmeticNodeSchema, type ArithmeticOperator, ArithmeticOperatorSchema, type BooleanLiteralNode, BooleanLiteralNodeSchema, type CallNode, CallNodeSchema, type CompareNode, CompareNodeSchema, type ComparisonOperator, ComparisonOperatorSchema, type CompiledPredicate, type ComplexLiteralNode, ComplexLiteralNodeSchema, type ComplexPolarLiteralNode, ComplexPolarLiteralNodeSchema, type ComplexRectangularLiteralNode, ComplexRectangularLiteralNodeSchema, type ComputedValue, ComputedValueSchema, type ConditionalCase, ConditionalCaseSchema, type ConditionalNode, ConditionalNodeSchema, DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH, type DelegateNode, DelegateNodeSchema, type DocumentEvaluation, type DurationLiteralNode, DurationLiteralNodeSchema, type DurationUnit, DurationUnitSchema, type EvaluateDocumentOptions, type Evaluation, type EvaluationContext, type EvaluatorOptions, type EveryNode, EveryNodeSchema, type ExistsNode, ExistsNodeSchema, type ExpressionNode, ExpressionNodeSchema, type FoldCombiner, FoldCombinerSchema, type FoldNode, FoldNodeSchema, type FunctionFailure, type FunctionRegistry, type HitPolicy, HitPolicySchema, type IndeterminateReason, IndeterminateReasonSchema, type InputItem, type InputsParseResult, type InstantLiteralNode, InstantLiteralNodeSchema, type JsonValue, JsonValueSchema, type LookupNode, LookupNodeSchema, type MemberOfNode, MemberOfNodeSchema, type MembershipOperator, MembershipOperatorSchema, type NegateNode, NegateNodeSchema, type NotNode, NotNodeSchema, type NumberLiteralNode, NumberLiteralNodeSchema, type OrNode, OrNodeSchema, type PredicateNode, PredicateNodeSchema, type ReferenceNode, ReferenceNodeSchema, type Resolution, type Resolvers, type SomeNode, SomeNodeSchema, type SyncResolvers, type TextCompareNode, TextCompareNodeSchema, type TextComparisonOperator, TextComparisonOperatorSchema, type TextLiteralNode, TextLiteralNodeSchema, type TreeKind, type TreeReferenceNode, TreeReferenceNodeSchema, type TreeResolution, type Unit, UnitSchema, and, average, builtinFunctions, coalesce, combineUnitsForDivide, combineUnitsForMultiply, complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase, count, createEvaluator, createInputResolvers, createSyncEvaluator, definite, emptyFunctionRegistry, evaluateDocument, evaluatePredicate, evaluateValue, firstIndeterminate, hierarchicalGlobPattern, iff, implies, indeterminate, nand, none, nor, not, or, parseInputs, prefixPattern, presenceOf, sum, unitsEqual, wildcardPattern, xor };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Evaluation, IndeterminateReason, IndeterminateReasonSchema, definite, f
|
|
|
12
12
|
import { DocumentEvaluation, EvaluateDocumentOptions, TreeKind, evaluateDocument } from "./evaluate-document.js";
|
|
13
13
|
import { DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH } from "./evaluator-budget.js";
|
|
14
14
|
import { Absence, EvaluationContext, Resolution, Resolvers, SyncResolvers, TreeResolution } from "./resolvers.js";
|
|
15
|
+
import { CompiledPredicate } from "./evaluator-compiled.js";
|
|
15
16
|
import { EvaluatorOptions, createEvaluator, createSyncEvaluator, evaluatePredicate, evaluateValue } from "./evaluator-factory.js";
|
|
16
17
|
import { InputItem, InputsParseResult, createInputResolvers, parseInputs } from "./input-resolvers.js";
|
|
17
|
-
export { type Absence, type AccumulatorNode, AccumulatorNodeSchema, type AllOfNode, AllOfNodeSchema, type AndNode, AndNodeSchema, type AnyOfNode, AnyOfNodeSchema, type ArithmeticNode, ArithmeticNodeSchema, type ArithmeticOperator, ArithmeticOperatorSchema, type BooleanLiteralNode, BooleanLiteralNodeSchema, type CallNode, CallNodeSchema, type CompareNode, CompareNodeSchema, type ComparisonOperator, ComparisonOperatorSchema, type ComplexLiteralNode, ComplexLiteralNodeSchema, type ComplexPolarLiteralNode, ComplexPolarLiteralNodeSchema, type ComplexRectangularLiteralNode, ComplexRectangularLiteralNodeSchema, type ComputedValue, ComputedValueSchema, type ConditionalCase, ConditionalCaseSchema, type ConditionalNode, ConditionalNodeSchema, DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH, type DelegateNode, DelegateNodeSchema, type DocumentEvaluation, type DurationLiteralNode, DurationLiteralNodeSchema, type DurationUnit, DurationUnitSchema, type EvaluateDocumentOptions, type Evaluation, type EvaluationContext, type EvaluatorOptions, type EveryNode, EveryNodeSchema, type ExistsNode, ExistsNodeSchema, type ExpressionNode, ExpressionNodeSchema, type FoldCombiner, FoldCombinerSchema, type FoldNode, FoldNodeSchema, type FunctionFailure, type FunctionRegistry, type HitPolicy, HitPolicySchema, type IndeterminateReason, IndeterminateReasonSchema, type InputItem, type InputsParseResult, type InstantLiteralNode, InstantLiteralNodeSchema, type JsonValue, JsonValueSchema, type LookupNode, LookupNodeSchema, type MemberOfNode, MemberOfNodeSchema, type MembershipOperator, MembershipOperatorSchema, type NegateNode, NegateNodeSchema, type NotNode, NotNodeSchema, type NumberLiteralNode, NumberLiteralNodeSchema, type OrNode, OrNodeSchema, type PredicateNode, PredicateNodeSchema, type ReferenceNode, ReferenceNodeSchema, type Resolution, type Resolvers, type SomeNode, SomeNodeSchema, type SyncResolvers, type TextCompareNode, TextCompareNodeSchema, type TextComparisonOperator, TextComparisonOperatorSchema, type TextLiteralNode, TextLiteralNodeSchema, type TreeKind, type TreeReferenceNode, TreeReferenceNodeSchema, type TreeResolution, type Unit, UnitSchema, and, average, builtinFunctions, coalesce, combineUnitsForDivide, combineUnitsForMultiply, complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase, count, createEvaluator, createInputResolvers, createSyncEvaluator, definite, emptyFunctionRegistry, evaluateDocument, evaluatePredicate, evaluateValue, firstIndeterminate, hierarchicalGlobPattern, iff, implies, indeterminate, nand, none, nor, not, or, parseInputs, prefixPattern, presenceOf, sum, unitsEqual, wildcardPattern, xor };
|
|
18
|
+
export { type Absence, type AccumulatorNode, AccumulatorNodeSchema, type AllOfNode, AllOfNodeSchema, type AndNode, AndNodeSchema, type AnyOfNode, AnyOfNodeSchema, type ArithmeticNode, ArithmeticNodeSchema, type ArithmeticOperator, ArithmeticOperatorSchema, type BooleanLiteralNode, BooleanLiteralNodeSchema, type CallNode, CallNodeSchema, type CompareNode, CompareNodeSchema, type ComparisonOperator, ComparisonOperatorSchema, type CompiledPredicate, type ComplexLiteralNode, ComplexLiteralNodeSchema, type ComplexPolarLiteralNode, ComplexPolarLiteralNodeSchema, type ComplexRectangularLiteralNode, ComplexRectangularLiteralNodeSchema, type ComputedValue, ComputedValueSchema, type ConditionalCase, ConditionalCaseSchema, type ConditionalNode, ConditionalNodeSchema, DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH, type DelegateNode, DelegateNodeSchema, type DocumentEvaluation, type DurationLiteralNode, DurationLiteralNodeSchema, type DurationUnit, DurationUnitSchema, type EvaluateDocumentOptions, type Evaluation, type EvaluationContext, type EvaluatorOptions, type EveryNode, EveryNodeSchema, type ExistsNode, ExistsNodeSchema, type ExpressionNode, ExpressionNodeSchema, type FoldCombiner, FoldCombinerSchema, type FoldNode, FoldNodeSchema, type FunctionFailure, type FunctionRegistry, type HitPolicy, HitPolicySchema, type IndeterminateReason, IndeterminateReasonSchema, type InputItem, type InputsParseResult, type InstantLiteralNode, InstantLiteralNodeSchema, type JsonValue, JsonValueSchema, type LookupNode, LookupNodeSchema, type MemberOfNode, MemberOfNodeSchema, type MembershipOperator, MembershipOperatorSchema, type NegateNode, NegateNodeSchema, type NotNode, NotNodeSchema, type NumberLiteralNode, NumberLiteralNodeSchema, type OrNode, OrNodeSchema, type PredicateNode, PredicateNodeSchema, type ReferenceNode, ReferenceNodeSchema, type Resolution, type Resolvers, type SomeNode, SomeNodeSchema, type SyncResolvers, type TextCompareNode, TextCompareNodeSchema, type TextComparisonOperator, TextComparisonOperatorSchema, type TextLiteralNode, TextLiteralNodeSchema, type TreeKind, type TreeReferenceNode, TreeReferenceNodeSchema, type TreeResolution, type Unit, UnitSchema, and, average, builtinFunctions, coalesce, combineUnitsForDivide, combineUnitsForMultiply, complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase, count, createEvaluator, createInputResolvers, createSyncEvaluator, definite, emptyFunctionRegistry, evaluateDocument, evaluatePredicate, evaluateValue, firstIndeterminate, hierarchicalGlobPattern, iff, implies, indeterminate, nand, none, nor, not, or, parseInputs, prefixPattern, presenceOf, sum, unitsEqual, wildcardPattern, xor };
|
package/dist/tree.cjs
CHANGED
|
@@ -166,7 +166,7 @@ const DurationLiteralNodeSchema = zod.z.object({
|
|
|
166
166
|
/**
|
|
167
167
|
* The wire-format literal accepts either of the two authoring forms real-world complex data arrives in, discriminated structurally rather than by a `form` tag: rectangular (`re`/`im`), matching the `complex` computed-value kind's own single canonical representation exactly (see the "Complex values" section of README.md), or polar (`magnitude`/`phase`, in radians), for the domains that reason that way natively and would otherwise have to hand-compute the conversion before ever constructing the tree. `strictObject` on both members is what makes the two forms mutually exclusive on the wire -- a plain `object` would silently strip an unrecognised field rather than reject a payload that mixes both.
|
|
168
168
|
*
|
|
169
|
-
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see
|
|
169
|
+
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see `literalValue` in evaluator-literals.ts), so nothing downstream of that -- arithmetic, `compare`, `memberOf`, `negate` -- ever sees a polar value; they keep consuming the one canonical `complex` shape unchanged.
|
|
170
170
|
*/
|
|
171
171
|
const ComplexRectangularLiteralNodeSchema = zod.z.strictObject({
|
|
172
172
|
kind: zod.z.literal("complexLiteral"),
|
package/dist/tree.d.cts
CHANGED
|
@@ -231,7 +231,7 @@ export type DurationLiteralNode = z.infer<typeof DurationLiteralNodeSchema>;
|
|
|
231
231
|
/**
|
|
232
232
|
* The wire-format literal accepts either of the two authoring forms real-world complex data arrives in, discriminated structurally rather than by a `form` tag: rectangular (`re`/`im`), matching the `complex` computed-value kind's own single canonical representation exactly (see the "Complex values" section of README.md), or polar (`magnitude`/`phase`, in radians), for the domains that reason that way natively and would otherwise have to hand-compute the conversion before ever constructing the tree. `strictObject` on both members is what makes the two forms mutually exclusive on the wire -- a plain `object` would silently strip an unrecognised field rather than reject a payload that mixes both.
|
|
233
233
|
*
|
|
234
|
-
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see
|
|
234
|
+
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see `literalValue` in evaluator-literals.ts), so nothing downstream of that -- arithmetic, `compare`, `memberOf`, `negate` -- ever sees a polar value; they keep consuming the one canonical `complex` shape unchanged.
|
|
235
235
|
*/
|
|
236
236
|
export declare const ComplexRectangularLiteralNodeSchema: z.ZodObject<{
|
|
237
237
|
kind: z.ZodLiteral<"complexLiteral">;
|
package/dist/tree.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ export type DurationLiteralNode = z.infer<typeof DurationLiteralNodeSchema>;
|
|
|
231
231
|
/**
|
|
232
232
|
* The wire-format literal accepts either of the two authoring forms real-world complex data arrives in, discriminated structurally rather than by a `form` tag: rectangular (`re`/`im`), matching the `complex` computed-value kind's own single canonical representation exactly (see the "Complex values" section of README.md), or polar (`magnitude`/`phase`, in radians), for the domains that reason that way natively and would otherwise have to hand-compute the conversion before ever constructing the tree. `strictObject` on both members is what makes the two forms mutually exclusive on the wire -- a plain `object` would silently strip an unrecognised field rather than reject a payload that mixes both.
|
|
233
233
|
*
|
|
234
|
-
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see
|
|
234
|
+
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see `literalValue` in evaluator-literals.ts), so nothing downstream of that -- arithmetic, `compare`, `memberOf`, `negate` -- ever sees a polar value; they keep consuming the one canonical `complex` shape unchanged.
|
|
235
235
|
*/
|
|
236
236
|
export declare const ComplexRectangularLiteralNodeSchema: z.ZodObject<{
|
|
237
237
|
kind: z.ZodLiteral<"complexLiteral">;
|
package/dist/tree.js
CHANGED
|
@@ -165,7 +165,7 @@ const DurationLiteralNodeSchema = z.object({
|
|
|
165
165
|
/**
|
|
166
166
|
* The wire-format literal accepts either of the two authoring forms real-world complex data arrives in, discriminated structurally rather than by a `form` tag: rectangular (`re`/`im`), matching the `complex` computed-value kind's own single canonical representation exactly (see the "Complex values" section of README.md), or polar (`magnitude`/`phase`, in radians), for the domains that reason that way natively and would otherwise have to hand-compute the conversion before ever constructing the tree. `strictObject` on both members is what makes the two forms mutually exclusive on the wire -- a plain `object` would silently strip an unrecognised field rather than reject a payload that mixes both.
|
|
167
167
|
*
|
|
168
|
-
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see
|
|
168
|
+
* The evaluator normalises whichever form was authored into the single rectangular `ComputedValue` immediately on evaluation (see `literalValue` in evaluator-literals.ts), so nothing downstream of that -- arithmetic, `compare`, `memberOf`, `negate` -- ever sees a polar value; they keep consuming the one canonical `complex` shape unchanged.
|
|
169
169
|
*/
|
|
170
170
|
const ComplexRectangularLiteralNodeSchema = z.strictObject({
|
|
171
171
|
kind: z.literal("complexLiteral"),
|