@orkestrel/reason 0.0.13 → 0.0.14
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/src/core/index.cjs +328 -381
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +27 -10
- package/dist/src/core/index.d.ts +27 -10
- package/dist/src/core/index.js +328 -382
- package/dist/src/core/index.js.map +1 -1
- package/package.json +15 -15
|
@@ -368,7 +368,7 @@ export declare interface AggregatorOptions {
|
|
|
368
368
|
* Names how a chaining reasoner walks its rules: `forward` (data-driven fixpoint) or
|
|
369
369
|
* `backward` (goal-driven proving).
|
|
370
370
|
*/
|
|
371
|
-
export declare type
|
|
371
|
+
export declare type ChainStrategy = 'forward' | 'backward';
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
374
|
* Represents a single field predicate: resolves `field` from the subject and compares it
|
|
@@ -2941,7 +2941,7 @@ export declare interface AggregatorOptions {
|
|
|
2941
2941
|
* `proof` is produced only by the backward pass, and only when a conclusion was
|
|
2942
2942
|
* proved.
|
|
2943
2943
|
*/
|
|
2944
|
-
export declare interface
|
|
2944
|
+
export declare interface InferentialChainResult {
|
|
2945
2945
|
readonly derived: readonly Fact[];
|
|
2946
2946
|
readonly proof?: ProofNode;
|
|
2947
2947
|
}
|
|
@@ -2969,7 +2969,7 @@ export declare interface AggregatorOptions {
|
|
|
2969
2969
|
readonly description?: string;
|
|
2970
2970
|
readonly inferences: readonly Inference[];
|
|
2971
2971
|
readonly facts: readonly Fact[];
|
|
2972
|
-
readonly strategy:
|
|
2972
|
+
readonly strategy: ChainStrategy;
|
|
2973
2973
|
readonly depth?: number;
|
|
2974
2974
|
}
|
|
2975
2975
|
|
|
@@ -3181,20 +3181,20 @@ export declare interface AggregatorOptions {
|
|
|
3181
3181
|
export declare function isBounds(value: unknown): value is Bounds;
|
|
3182
3182
|
|
|
3183
3183
|
/**
|
|
3184
|
-
* Determines whether a value is a {@link
|
|
3184
|
+
* Determines whether a value is a {@link ChainStrategy} literal.
|
|
3185
3185
|
*
|
|
3186
3186
|
* @param value - The value to test
|
|
3187
3187
|
* @returns True if `value` is `'forward'` or `'backward'`; false otherwise
|
|
3188
3188
|
*
|
|
3189
3189
|
* @example
|
|
3190
3190
|
* ```ts
|
|
3191
|
-
* import {
|
|
3191
|
+
* import { isChainStrategy } from '@src/core'
|
|
3192
3192
|
*
|
|
3193
|
-
*
|
|
3194
|
-
*
|
|
3193
|
+
* isChainStrategy('forward') // true
|
|
3194
|
+
* isChainStrategy('upward') // false
|
|
3195
3195
|
* ```
|
|
3196
3196
|
*/
|
|
3197
|
-
export declare const
|
|
3197
|
+
export declare const isChainStrategy: Guard<ChainStrategy>;
|
|
3198
3198
|
|
|
3199
3199
|
/**
|
|
3200
3200
|
* Determines whether a value is a {@link Check} — a field / operator / value
|
|
@@ -3708,6 +3708,13 @@ export declare interface AggregatorOptions {
|
|
|
3708
3708
|
/**
|
|
3709
3709
|
* Narrows an unknown caught value to a {@link ReasonError}.
|
|
3710
3710
|
*
|
|
3711
|
+
* @remarks
|
|
3712
|
+
* Accepts errors from another installed copy and subclasses regardless of `name`.
|
|
3713
|
+
* Requires the own self-valued `Symbol.for('@orkestrel/reason.ReasonError')`
|
|
3714
|
+
* brand, a non-base global `Error` prototype, and valid declared members.
|
|
3715
|
+
* Plain objects, unbranded look-alikes, and transparent proxies are rejected.
|
|
3716
|
+
* Hostile reads return false through the contract intrinsics inside `holds`.
|
|
3717
|
+
*
|
|
3711
3718
|
* @param value - The value to test (typically a `catch` binding)
|
|
3712
3719
|
* @returns True if `value` is a {@link ReasonError}; false otherwise
|
|
3713
3720
|
*
|
|
@@ -3960,6 +3967,16 @@ export declare interface AggregatorOptions {
|
|
|
3960
3967
|
*/
|
|
3961
3968
|
export declare function isTransform(value: unknown): value is Transform;
|
|
3962
3969
|
|
|
3970
|
+
/**
|
|
3971
|
+
* Iterates nonnegative indices below a numeric limit without allocating a range.
|
|
3972
|
+
*
|
|
3973
|
+
* @example
|
|
3974
|
+
* ```ts
|
|
3975
|
+
* [...iterateIndices(2.5)] // [0, 1, 2]
|
|
3976
|
+
* ```
|
|
3977
|
+
*/
|
|
3978
|
+
export declare function iterateIndices(limit: number): Generator<number>;
|
|
3979
|
+
|
|
3963
3980
|
/** Names the default `id` for a `LogicalReasoner`. */
|
|
3964
3981
|
export declare const LOGICAL_ID = "logical";
|
|
3965
3982
|
|
|
@@ -3971,7 +3988,7 @@ export declare interface AggregatorOptions {
|
|
|
3971
3988
|
* The shared return shape of the forward-fixpoint and backward-proving passes;
|
|
3972
3989
|
* `LogicalResult.count` is derived from `rules` rather than carried here.
|
|
3973
3990
|
*/
|
|
3974
|
-
export declare interface
|
|
3991
|
+
export declare interface LogicalChainResult {
|
|
3975
3992
|
readonly conclusion: boolean;
|
|
3976
3993
|
readonly rules: readonly RuleResult[];
|
|
3977
3994
|
}
|
|
@@ -3995,7 +4012,7 @@ export declare interface AggregatorOptions {
|
|
|
3995
4012
|
readonly name: string;
|
|
3996
4013
|
readonly description?: string;
|
|
3997
4014
|
readonly rules: readonly Rule[];
|
|
3998
|
-
readonly strategy:
|
|
4015
|
+
readonly strategy: ChainStrategy;
|
|
3999
4016
|
readonly depth?: number;
|
|
4000
4017
|
}
|
|
4001
4018
|
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -368,7 +368,7 @@ export declare interface AggregatorOptions {
|
|
|
368
368
|
* Names how a chaining reasoner walks its rules: `forward` (data-driven fixpoint) or
|
|
369
369
|
* `backward` (goal-driven proving).
|
|
370
370
|
*/
|
|
371
|
-
export declare type
|
|
371
|
+
export declare type ChainStrategy = 'forward' | 'backward';
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
374
|
* Represents a single field predicate: resolves `field` from the subject and compares it
|
|
@@ -2941,7 +2941,7 @@ export declare interface AggregatorOptions {
|
|
|
2941
2941
|
* `proof` is produced only by the backward pass, and only when a conclusion was
|
|
2942
2942
|
* proved.
|
|
2943
2943
|
*/
|
|
2944
|
-
export declare interface
|
|
2944
|
+
export declare interface InferentialChainResult {
|
|
2945
2945
|
readonly derived: readonly Fact[];
|
|
2946
2946
|
readonly proof?: ProofNode;
|
|
2947
2947
|
}
|
|
@@ -2969,7 +2969,7 @@ export declare interface AggregatorOptions {
|
|
|
2969
2969
|
readonly description?: string;
|
|
2970
2970
|
readonly inferences: readonly Inference[];
|
|
2971
2971
|
readonly facts: readonly Fact[];
|
|
2972
|
-
readonly strategy:
|
|
2972
|
+
readonly strategy: ChainStrategy;
|
|
2973
2973
|
readonly depth?: number;
|
|
2974
2974
|
}
|
|
2975
2975
|
|
|
@@ -3181,20 +3181,20 @@ export declare interface AggregatorOptions {
|
|
|
3181
3181
|
export declare function isBounds(value: unknown): value is Bounds;
|
|
3182
3182
|
|
|
3183
3183
|
/**
|
|
3184
|
-
* Determines whether a value is a {@link
|
|
3184
|
+
* Determines whether a value is a {@link ChainStrategy} literal.
|
|
3185
3185
|
*
|
|
3186
3186
|
* @param value - The value to test
|
|
3187
3187
|
* @returns True if `value` is `'forward'` or `'backward'`; false otherwise
|
|
3188
3188
|
*
|
|
3189
3189
|
* @example
|
|
3190
3190
|
* ```ts
|
|
3191
|
-
* import {
|
|
3191
|
+
* import { isChainStrategy } from '@src/core'
|
|
3192
3192
|
*
|
|
3193
|
-
*
|
|
3194
|
-
*
|
|
3193
|
+
* isChainStrategy('forward') // true
|
|
3194
|
+
* isChainStrategy('upward') // false
|
|
3195
3195
|
* ```
|
|
3196
3196
|
*/
|
|
3197
|
-
export declare const
|
|
3197
|
+
export declare const isChainStrategy: Guard<ChainStrategy>;
|
|
3198
3198
|
|
|
3199
3199
|
/**
|
|
3200
3200
|
* Determines whether a value is a {@link Check} — a field / operator / value
|
|
@@ -3708,6 +3708,13 @@ export declare interface AggregatorOptions {
|
|
|
3708
3708
|
/**
|
|
3709
3709
|
* Narrows an unknown caught value to a {@link ReasonError}.
|
|
3710
3710
|
*
|
|
3711
|
+
* @remarks
|
|
3712
|
+
* Accepts errors from another installed copy and subclasses regardless of `name`.
|
|
3713
|
+
* Requires the own self-valued `Symbol.for('@orkestrel/reason.ReasonError')`
|
|
3714
|
+
* brand, a non-base global `Error` prototype, and valid declared members.
|
|
3715
|
+
* Plain objects, unbranded look-alikes, and transparent proxies are rejected.
|
|
3716
|
+
* Hostile reads return false through the contract intrinsics inside `holds`.
|
|
3717
|
+
*
|
|
3711
3718
|
* @param value - The value to test (typically a `catch` binding)
|
|
3712
3719
|
* @returns True if `value` is a {@link ReasonError}; false otherwise
|
|
3713
3720
|
*
|
|
@@ -3960,6 +3967,16 @@ export declare interface AggregatorOptions {
|
|
|
3960
3967
|
*/
|
|
3961
3968
|
export declare function isTransform(value: unknown): value is Transform;
|
|
3962
3969
|
|
|
3970
|
+
/**
|
|
3971
|
+
* Iterates nonnegative indices below a numeric limit without allocating a range.
|
|
3972
|
+
*
|
|
3973
|
+
* @example
|
|
3974
|
+
* ```ts
|
|
3975
|
+
* [...iterateIndices(2.5)] // [0, 1, 2]
|
|
3976
|
+
* ```
|
|
3977
|
+
*/
|
|
3978
|
+
export declare function iterateIndices(limit: number): Generator<number>;
|
|
3979
|
+
|
|
3963
3980
|
/** Names the default `id` for a `LogicalReasoner`. */
|
|
3964
3981
|
export declare const LOGICAL_ID = "logical";
|
|
3965
3982
|
|
|
@@ -3971,7 +3988,7 @@ export declare interface AggregatorOptions {
|
|
|
3971
3988
|
* The shared return shape of the forward-fixpoint and backward-proving passes;
|
|
3972
3989
|
* `LogicalResult.count` is derived from `rules` rather than carried here.
|
|
3973
3990
|
*/
|
|
3974
|
-
export declare interface
|
|
3991
|
+
export declare interface LogicalChainResult {
|
|
3975
3992
|
readonly conclusion: boolean;
|
|
3976
3993
|
readonly rules: readonly RuleResult[];
|
|
3977
3994
|
}
|
|
@@ -3995,7 +4012,7 @@ export declare interface AggregatorOptions {
|
|
|
3995
4012
|
readonly name: string;
|
|
3996
4013
|
readonly description?: string;
|
|
3997
4014
|
readonly rules: readonly Rule[];
|
|
3998
|
-
readonly strategy:
|
|
4015
|
+
readonly strategy: ChainStrategy;
|
|
3999
4016
|
readonly depth?: number;
|
|
4000
4017
|
}
|
|
4001
4018
|
|