@proposit/proposit-core 3.4.2 → 4.0.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 +12 -6
- package/dist/cli/commands/analysis.d.ts.map +1 -1
- package/dist/cli/commands/analysis.js +7 -9
- package/dist/cli/commands/analysis.js.map +1 -1
- package/dist/cli/commands/graph.d.ts +1 -1
- package/dist/cli/commands/graph.d.ts.map +1 -1
- package/dist/cli/commands/graph.js +21 -15
- package/dist/cli/commands/graph.js.map +1 -1
- package/dist/lib/core/argument-engine.d.ts.map +1 -1
- package/dist/lib/core/argument-engine.js +15 -3
- package/dist/lib/core/argument-engine.js.map +1 -1
- package/dist/lib/core/evaluation/argument-evaluation.d.ts +60 -14
- package/dist/lib/core/evaluation/argument-evaluation.d.ts.map +1 -1
- package/dist/lib/core/evaluation/argument-evaluation.js +398 -235
- package/dist/lib/core/evaluation/argument-evaluation.js.map +1 -1
- package/dist/lib/core/evaluation/belnap.d.ts +22 -0
- package/dist/lib/core/evaluation/belnap.d.ts.map +1 -0
- package/dist/lib/core/evaluation/belnap.js +86 -0
- package/dist/lib/core/evaluation/belnap.js.map +1 -0
- package/dist/lib/core/evaluation/premise-resolver.d.ts +13 -0
- package/dist/lib/core/evaluation/premise-resolver.d.ts.map +1 -0
- package/dist/lib/core/evaluation/premise-resolver.js +35 -0
- package/dist/lib/core/evaluation/premise-resolver.js.map +1 -0
- package/dist/lib/core/evaluation/satisfiability.d.ts +42 -0
- package/dist/lib/core/evaluation/satisfiability.d.ts.map +1 -0
- package/dist/lib/core/evaluation/satisfiability.js +62 -0
- package/dist/lib/core/evaluation/satisfiability.js.map +1 -0
- package/dist/lib/core/evaluation/validation.d.ts +4 -4
- package/dist/lib/core/evaluation/validation.d.ts.map +1 -1
- package/dist/lib/core/evaluation/validation.js +4 -4
- package/dist/lib/core/evaluation/validation.js.map +1 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +30 -7
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts +19 -9
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.d.ts +4 -3
- package/dist/lib/core/premise-engine.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.js +14 -17
- package/dist/lib/core/premise-engine.js.map +1 -1
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/types/evaluation.d.ts +226 -35
- package/dist/lib/types/evaluation.d.ts.map +1 -1
- package/dist/lib/types/evaluation.js +13 -1
- package/dist/lib/types/evaluation.js.map +1 -1
- package/package.json +1 -1
- package/dist/lib/core/evaluation/grading.d.ts +0 -29
- package/dist/lib/core/evaluation/grading.d.ts.map +0 -1
- package/dist/lib/core/evaluation/grading.js +0 -50
- package/dist/lib/core/evaluation/grading.js.map +0 -1
- package/dist/lib/core/evaluation/kleene.d.ts +0 -12
- package/dist/lib/core/evaluation/kleene.d.ts.map +0 -1
- package/dist/lib/core/evaluation/kleene.js +0 -29
- package/dist/lib/core/evaluation/kleene.js.map +0 -1
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
import type { TCoreArgumentRoleState } from "../schemata/index.js";
|
|
2
2
|
export type { TCoreArgumentRoleState };
|
|
3
|
+
/**
|
|
4
|
+
* The fourth truth value: the reader's assignments, run through the steps they
|
|
5
|
+
* granted, force this both true and false.
|
|
6
|
+
*
|
|
7
|
+
* Only evaluation produces it. A reader assigns `TCoreTrivalentValue`, and the
|
|
8
|
+
* assignment types below deliberately exclude this literal so a caller cannot
|
|
9
|
+
* feed it back in.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CONTESTED = "contested";
|
|
12
|
+
/** The type of {@link CONTESTED}. */
|
|
13
|
+
export type TCoreContestedValue = typeof CONTESTED;
|
|
3
14
|
/** Three-valued truth value: true, false, or null (unset/unknown). */
|
|
4
15
|
export type TCoreTrivalentValue = boolean | null;
|
|
16
|
+
/**
|
|
17
|
+
* Four-valued truth value — the three a reader may assign, plus
|
|
18
|
+
* {@link CONTESTED}, which only evaluation can produce.
|
|
19
|
+
*/
|
|
20
|
+
export type TCoreQuadrivalentValue = TCoreTrivalentValue | TCoreContestedValue;
|
|
21
|
+
/** Narrows a four-valued truth value to {@link CONTESTED}. */
|
|
22
|
+
export declare function isContested(value: TCoreQuadrivalentValue | undefined): value is TCoreContestedValue;
|
|
5
23
|
/** Maps variable IDs to three-valued truth values. */
|
|
6
24
|
export type TCoreVariableAssignment = Record<string, TCoreTrivalentValue>;
|
|
7
|
-
/**
|
|
25
|
+
/** Maps variable IDs to the four-valued results constraint closure produced. */
|
|
26
|
+
export type TCoreResolvedVariableValues = Record<string, TCoreQuadrivalentValue>;
|
|
27
|
+
/**
|
|
28
|
+
* Operator decision recorded by a reader.
|
|
29
|
+
*
|
|
30
|
+
* `"accepted"` grants the step: constraint propagation may derive values
|
|
31
|
+
* through it. `"rejected"` withholds the step and **strikes the whole premise
|
|
32
|
+
* the operator lives in** from the evaluated set — it asserts nothing, and in
|
|
33
|
+
* particular never forces the expression or its children to `false`.
|
|
34
|
+
*/
|
|
8
35
|
export type TCoreOperatorAssignment = "accepted" | "rejected";
|
|
9
36
|
/** Full expression assignment: variable truth values and operator acceptance states. */
|
|
10
37
|
export interface TCoreExpressionAssignment {
|
|
@@ -13,6 +40,19 @@ export interface TCoreExpressionAssignment {
|
|
|
13
40
|
/** Operator expression ID → accepted/rejected. Unset operators evaluate normally. */
|
|
14
41
|
operatorAssignments: Record<string, TCoreOperatorAssignment>;
|
|
15
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* An assignment carrying the values constraint closure resolved, which may
|
|
45
|
+
* include {@link CONTESTED}. Evaluation feeds its own closure output back into
|
|
46
|
+
* premise evaluation through this type; a reader supplies
|
|
47
|
+
* {@link TCoreExpressionAssignment}, which is assignable to this one but never
|
|
48
|
+
* the reverse.
|
|
49
|
+
*/
|
|
50
|
+
export interface TCoreResolvedAssignment {
|
|
51
|
+
/** Variable ID → true/false/null/contested. */
|
|
52
|
+
variables: TCoreResolvedVariableValues;
|
|
53
|
+
/** Operator expression ID → accepted/rejected. Unset operators evaluate normally. */
|
|
54
|
+
operatorAssignments: Record<string, TCoreOperatorAssignment>;
|
|
55
|
+
}
|
|
16
56
|
/** Severity level for validation issues. */
|
|
17
57
|
export type TCoreValidationSeverity = "error" | "warning";
|
|
18
58
|
/** Machine-readable codes for all validation issues. */
|
|
@@ -39,39 +79,39 @@ export interface TCoreValidationResult {
|
|
|
39
79
|
}
|
|
40
80
|
export interface TCoreDirectionalVacuity {
|
|
41
81
|
/** Truth value of the antecedent for this directional implication view. */
|
|
42
|
-
antecedentTrue:
|
|
82
|
+
antecedentTrue: TCoreQuadrivalentValue;
|
|
43
83
|
/** Truth value of the consequent for this directional implication view. */
|
|
44
|
-
consequentTrue:
|
|
84
|
+
consequentTrue: TCoreQuadrivalentValue;
|
|
45
85
|
/** Result of evaluating `antecedent -> consequent`. */
|
|
46
|
-
implicationValue:
|
|
86
|
+
implicationValue: TCoreQuadrivalentValue;
|
|
47
87
|
/** `true` iff the implication is true because the antecedent is false; `null` if indeterminate. */
|
|
48
|
-
isVacuouslyTrue:
|
|
88
|
+
isVacuouslyTrue: TCoreQuadrivalentValue;
|
|
49
89
|
/** `true` iff the antecedent was true (the implication "fired"); `null` if indeterminate. */
|
|
50
|
-
fired:
|
|
90
|
+
fired: TCoreQuadrivalentValue;
|
|
51
91
|
}
|
|
52
92
|
export type TCorePremiseInferenceDiagnostic = {
|
|
53
93
|
kind: "implies";
|
|
54
94
|
premiseId: string;
|
|
55
95
|
rootExpressionId: string;
|
|
56
|
-
leftValue:
|
|
57
|
-
rightValue:
|
|
58
|
-
rootValue:
|
|
59
|
-
antecedentTrue:
|
|
60
|
-
consequentTrue:
|
|
61
|
-
isVacuouslyTrue:
|
|
62
|
-
fired:
|
|
63
|
-
firedAndHeld:
|
|
96
|
+
leftValue: TCoreQuadrivalentValue;
|
|
97
|
+
rightValue: TCoreQuadrivalentValue;
|
|
98
|
+
rootValue: TCoreQuadrivalentValue;
|
|
99
|
+
antecedentTrue: TCoreQuadrivalentValue;
|
|
100
|
+
consequentTrue: TCoreQuadrivalentValue;
|
|
101
|
+
isVacuouslyTrue: TCoreQuadrivalentValue;
|
|
102
|
+
fired: TCoreQuadrivalentValue;
|
|
103
|
+
firedAndHeld: TCoreQuadrivalentValue;
|
|
64
104
|
} | {
|
|
65
105
|
kind: "iff";
|
|
66
106
|
premiseId: string;
|
|
67
107
|
rootExpressionId: string;
|
|
68
|
-
leftValue:
|
|
69
|
-
rightValue:
|
|
70
|
-
rootValue:
|
|
108
|
+
leftValue: TCoreQuadrivalentValue;
|
|
109
|
+
rightValue: TCoreQuadrivalentValue;
|
|
110
|
+
rootValue: TCoreQuadrivalentValue;
|
|
71
111
|
leftToRight: TCoreDirectionalVacuity;
|
|
72
112
|
rightToLeft: TCoreDirectionalVacuity;
|
|
73
|
-
bothSidesTrue:
|
|
74
|
-
bothSidesFalse:
|
|
113
|
+
bothSidesTrue: TCoreQuadrivalentValue;
|
|
114
|
+
bothSidesFalse: TCoreQuadrivalentValue;
|
|
75
115
|
};
|
|
76
116
|
export interface TCorePremiseEvaluationResult {
|
|
77
117
|
/** ID of the evaluated premise. */
|
|
@@ -81,11 +121,11 @@ export interface TCorePremiseEvaluationResult {
|
|
|
81
121
|
/** Root expression ID, if the premise has a root. */
|
|
82
122
|
rootExpressionId?: string;
|
|
83
123
|
/** Truth value of the root expression, if the premise was evaluable. */
|
|
84
|
-
rootValue?:
|
|
124
|
+
rootValue?: TCoreQuadrivalentValue;
|
|
85
125
|
/** Per-expression truth values keyed by expression ID. */
|
|
86
|
-
expressionValues: Record<string,
|
|
126
|
+
expressionValues: Record<string, TCoreQuadrivalentValue>;
|
|
87
127
|
/** Referenced variable truth values keyed by variable ID. */
|
|
88
|
-
variableValues: Record<string,
|
|
128
|
+
variableValues: Record<string, TCoreQuadrivalentValue>;
|
|
89
129
|
/** Inference-specific diagnostics for `implies`/`iff` roots. */
|
|
90
130
|
inferenceDiagnostic?: TCorePremiseInferenceDiagnostic;
|
|
91
131
|
}
|
|
@@ -98,14 +138,26 @@ export interface TCoreArgumentEvaluationOptions {
|
|
|
98
138
|
includeDiagnostics?: boolean;
|
|
99
139
|
/** Run argument/premise evaluability validation before evaluating. */
|
|
100
140
|
validateFirst?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Variable IDs pinned `true` in every row of the premise-set
|
|
143
|
+
* satisfiability search — typically axiomatic-bound variables, which the
|
|
144
|
+
* engine forces true. They are also never treated as reader assertions.
|
|
145
|
+
*/
|
|
146
|
+
forcedTrueVariableIds?: ReadonlySet<string>;
|
|
147
|
+
/**
|
|
148
|
+
* Premise-set satisfiability computed by the caller. Supplying it skips
|
|
149
|
+
* the search — `checkArgumentValidity` computes it once and threads it
|
|
150
|
+
* through its truth-table rows, where the surviving set never varies.
|
|
151
|
+
*/
|
|
152
|
+
premiseSetSatisfiable?: TCoreTrivalentValue;
|
|
101
153
|
}
|
|
102
154
|
export interface TCoreArgumentEvaluationResult {
|
|
103
155
|
/** `false` means evaluation could not be completed (typically validation failure). */
|
|
104
156
|
ok: boolean;
|
|
105
157
|
/** Validation output when `ok === false`, or when validation was requested and included. */
|
|
106
158
|
validation?: TCoreValidationResult;
|
|
107
|
-
/** The assignment used for this evaluation. */
|
|
108
|
-
assignment?:
|
|
159
|
+
/** The assignment used for this evaluation, after constraint closure. */
|
|
160
|
+
assignment?: TCoreResolvedAssignment;
|
|
109
161
|
/** All variable IDs referenced across evaluated supporting/conclusion/constraint premises. */
|
|
110
162
|
referencedVariableIds?: string[];
|
|
111
163
|
/** Evaluation result for the designated conclusion premise. */
|
|
@@ -114,23 +166,162 @@ export interface TCoreArgumentEvaluationResult {
|
|
|
114
166
|
supportingPremises?: TCorePremiseEvaluationResult[];
|
|
115
167
|
/** Evaluation results for constraint premises (used to determine admissibility). */
|
|
116
168
|
constraintPremises?: TCorePremiseEvaluationResult[];
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
169
|
+
/**
|
|
170
|
+
* IDs of premises struck from the evaluated set because the reader
|
|
171
|
+
* rejected an operator inside them. Struck premises are still evaluated
|
|
172
|
+
* and still present in `supportingPremises` / `constraintPremises`, so a
|
|
173
|
+
* consumer can render them crossed out — they are simply excluded from the
|
|
174
|
+
* aggregates, from constraint propagation, and from the satisfiability
|
|
175
|
+
* search.
|
|
176
|
+
*
|
|
177
|
+
* The conclusion premise and derivation premises are never struck.
|
|
178
|
+
*/
|
|
179
|
+
struckPremiseIds?: string[];
|
|
180
|
+
/** Number of supporting premises that were not struck. */
|
|
181
|
+
survivingSupportingPremiseCount?: number;
|
|
182
|
+
/** `true` iff every surviving constraint premise evaluates to true. */
|
|
183
|
+
isAdmissibleAssignment?: TCoreQuadrivalentValue;
|
|
184
|
+
/**
|
|
185
|
+
* `true` iff every surviving supporting premise evaluates to true.
|
|
186
|
+
*
|
|
187
|
+
* Vacuously `true` when every supporting premise is struck — read it
|
|
188
|
+
* together with `survivingSupportingPremiseCount`, and never as
|
|
189
|
+
* "the argument worked". Whether the argument reached its conclusion is
|
|
190
|
+
* `conclusionAttribution`, not this field.
|
|
191
|
+
*/
|
|
192
|
+
survivingSupportingPremisesTrue?: TCoreQuadrivalentValue;
|
|
121
193
|
/** The truth value of the conclusion premise root expression. */
|
|
122
|
-
conclusionTrue?:
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
194
|
+
conclusionTrue?: TCoreQuadrivalentValue;
|
|
195
|
+
/**
|
|
196
|
+
* `true` iff constraints are satisfied, every surviving supporting premise
|
|
197
|
+
* is true, and the conclusion is false.
|
|
198
|
+
*
|
|
199
|
+
* A reader-relative gap under one assignment — **not** a countermodel to
|
|
200
|
+
* entailment, which is the stronger claim `checkValidity` answers.
|
|
201
|
+
*
|
|
202
|
+
* It rests on `survivingSupportingPremisesTrue`, which is vacuously `true`
|
|
203
|
+
* when nothing survives, so this field is `null` when the argument had
|
|
204
|
+
* supporting premises and the reader struck every one of them: the case was
|
|
205
|
+
* withheld, not weighed and found wanting. An argument authored with no
|
|
206
|
+
* supporting premises at all is the entailment-from-nothing case and still
|
|
207
|
+
* reports `true` for a false conclusion.
|
|
208
|
+
*/
|
|
209
|
+
premisesHoldConclusionFalse?: TCoreQuadrivalentValue;
|
|
210
|
+
/**
|
|
211
|
+
* Variable IDs whose value came out {@link CONTESTED}, sorted. Always
|
|
212
|
+
* present when `ok`, and **not** gated on `includeDiagnostics`.
|
|
213
|
+
*
|
|
214
|
+
* Read this rather than inferring a conflict from the aggregates above.
|
|
215
|
+
* Propagation carries only the told-true component forward, so a contested
|
|
216
|
+
* variable can yield an uncontested `true` downstream and leave
|
|
217
|
+
* `conclusionTrue`, `isAdmissibleAssignment`,
|
|
218
|
+
* `survivingSupportingPremisesTrue`, `premisesHoldConclusionFalse` and
|
|
219
|
+
* `premiseSetSatisfiable` all reading clean while the reader's inputs
|
|
220
|
+
* still force something both true and false. A non-empty array is the one
|
|
221
|
+
* fact that always records it.
|
|
222
|
+
*
|
|
223
|
+
* Variable-keyed, covering every premise in the argument rather than only
|
|
224
|
+
* `referencedVariableIds`. `variableProvenance[id].contestedBy` names the
|
|
225
|
+
* granted steps behind each entry.
|
|
226
|
+
*/
|
|
227
|
+
contestedVariableIds?: string[];
|
|
228
|
+
/**
|
|
229
|
+
* Where the conclusion's truth came from. `assertedByReader` records that
|
|
230
|
+
* the reader supplied a value for at least one claim the conclusion
|
|
231
|
+
* premise references; `reachedWithoutAssertion` withholds all of them,
|
|
232
|
+
* re-runs constraint propagation from the reduced seed, and reports
|
|
233
|
+
* whether the conclusion premise root still comes back `true`.
|
|
234
|
+
*/
|
|
235
|
+
conclusionAttribution?: TCoreValueAttribution;
|
|
236
|
+
/**
|
|
237
|
+
* Per-claim attribution, one entry per reader-asserted claim-bound
|
|
238
|
+
* variable. `reachedWithoutAssertion` here asks whether the **same value**
|
|
239
|
+
* returns once the reader's own assignment of that variable is withheld —
|
|
240
|
+
* the conclusion asks whether it comes back `true`. Populated only when
|
|
241
|
+
* `includeDiagnostics: true`, and omitted entirely when no operator is
|
|
242
|
+
* accepted (nothing can be derived, so every answer would be `false`).
|
|
243
|
+
*/
|
|
244
|
+
claimAttribution?: Record<string, TCoreValueAttribution>;
|
|
245
|
+
/**
|
|
246
|
+
* `true` iff some total assignment makes every surviving premise true.
|
|
247
|
+
* Asked of the surviving premise set alone, ignoring the reader's own
|
|
248
|
+
* assignment. `null` means "not determined" — the premise set has more
|
|
249
|
+
* free variables than the search ceiling.
|
|
250
|
+
*
|
|
251
|
+
* When `false`, constraint propagation is skipped entirely: nothing is
|
|
252
|
+
* derived, and the conclusion reports only what the reader asserted.
|
|
253
|
+
*/
|
|
254
|
+
premiseSetSatisfiable?: TCoreTrivalentValue;
|
|
127
255
|
/**
|
|
128
256
|
* Evaluator's authoritative propagated variable values across the whole
|
|
129
257
|
* argument. Populated only when `includeDiagnostics: true`. Key set
|
|
130
258
|
* matches `referencedVariableIds`; still-unresolved variables appear
|
|
131
259
|
* with value `null`.
|
|
132
260
|
*/
|
|
133
|
-
propagatedVariableValues?:
|
|
261
|
+
propagatedVariableValues?: TCoreResolvedVariableValues;
|
|
262
|
+
/**
|
|
263
|
+
* Where each propagated value came from, keyed like
|
|
264
|
+
* `propagatedVariableValues`. Populated only when
|
|
265
|
+
* `includeDiagnostics: true`.
|
|
266
|
+
*/
|
|
267
|
+
variableProvenance?: Record<string, TCoreVariableProvenance>;
|
|
268
|
+
}
|
|
269
|
+
/** Whether a value was supplied by the reader, and whether it holds without that. */
|
|
270
|
+
export interface TCoreValueAttribution {
|
|
271
|
+
/** `true` iff the reader supplied `true` or `false`. An explicit unknown is a decision, not an assertion. */
|
|
272
|
+
assertedByReader: boolean;
|
|
273
|
+
/** `true` iff the value still holds once the reader's own assertion is withheld and closure is recomputed. */
|
|
274
|
+
reachedWithoutAssertion: boolean;
|
|
275
|
+
}
|
|
276
|
+
/** Where a propagated variable value came from. */
|
|
277
|
+
export type TCoreValueOrigin = "asserted" | "derived" | "contested" | "unassigned";
|
|
278
|
+
/** The granted operator step that produced a derived value. */
|
|
279
|
+
export interface TCoreDerivationStep {
|
|
280
|
+
/** The accepted operator expression that produced the value. */
|
|
281
|
+
expressionId: string;
|
|
282
|
+
/** The premise that operator lives in. */
|
|
283
|
+
premiseId: string;
|
|
284
|
+
/**
|
|
285
|
+
* Variable IDs whose values the step consumed. One immediate step is
|
|
286
|
+
* recorded per value; walk these transitively to reconstruct a chain.
|
|
287
|
+
*/
|
|
288
|
+
fromVariableIds: string[];
|
|
289
|
+
}
|
|
290
|
+
export interface TCoreVariableProvenance {
|
|
291
|
+
/** The variable's value after propagation. */
|
|
292
|
+
value: TCoreQuadrivalentValue;
|
|
293
|
+
/**
|
|
294
|
+
* `"contested"` whenever the value is {@link CONTESTED}, whatever else
|
|
295
|
+
* contributed; otherwise `"asserted"` for a reader-supplied `true`/`false`,
|
|
296
|
+
* `"derived"` for anything propagation produced, `"unassigned"` for a value
|
|
297
|
+
* still unresolved.
|
|
298
|
+
*/
|
|
299
|
+
origin: TCoreValueOrigin;
|
|
300
|
+
/** The immediate producing step; present iff `origin === "derived"`. */
|
|
301
|
+
derivedBy?: TCoreDerivationStep;
|
|
302
|
+
/**
|
|
303
|
+
* Every granted step that contributed a truth component to a contested
|
|
304
|
+
* value, in a stable order; present iff `origin === "contested"`. The
|
|
305
|
+
* reader's own assertion is not a step and never appears here — compare
|
|
306
|
+
* `assignment.variables[id]` to see whether one of the two components came
|
|
307
|
+
* from the reader. `derivedBy` is absent for a contested value: naming one
|
|
308
|
+
* producing step is a lie once two steps disagree.
|
|
309
|
+
*/
|
|
310
|
+
contestedBy?: TCoreDerivationStep[];
|
|
311
|
+
}
|
|
312
|
+
/** Options for `propagateOperatorConstraints`. */
|
|
313
|
+
export interface TCorePropagationOptions {
|
|
314
|
+
/**
|
|
315
|
+
* Premise IDs excluded from propagation entirely — their expressions are
|
|
316
|
+
* not indexed, so no operator inside them contributes a value.
|
|
317
|
+
*/
|
|
318
|
+
excludedPremiseIds?: ReadonlySet<string>;
|
|
319
|
+
/**
|
|
320
|
+
* Variable IDs dropped from the seed before closure runs. Used by the
|
|
321
|
+
* attribution counterfactual: withhold an assertion, then recompute from
|
|
322
|
+
* the remaining inputs rather than deleting a value after the fact.
|
|
323
|
+
*/
|
|
324
|
+
withheldVariableIds?: ReadonlySet<string>;
|
|
134
325
|
}
|
|
135
326
|
export interface TCoreValidityCheckOptions {
|
|
136
327
|
/** Stop at first counterexample or continue exhaustively. */
|
|
@@ -158,7 +349,7 @@ export interface TCoreValidityCheckOptions {
|
|
|
158
349
|
}
|
|
159
350
|
export interface TCoreCounterexample {
|
|
160
351
|
/** Assignment under which the argument fails to preserve truth. */
|
|
161
|
-
assignment:
|
|
352
|
+
assignment: TCoreResolvedAssignment;
|
|
162
353
|
/** Full argument evaluation result for that assignment. */
|
|
163
354
|
result: TCoreArgumentEvaluationResult;
|
|
164
355
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation.d.ts","sourceRoot":"","sources":["../../../src/lib/types/evaluation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,YAAY,EAAE,sBAAsB,EAAE,CAAA;AAEtC,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,IAAI,CAAA;AAEhD,sDAAsD;AACtD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;AAEzE,
|
|
1
|
+
{"version":3,"file":"evaluation.d.ts","sourceRoot":"","sources":["../../../src/lib/types/evaluation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,M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AIG;IACH,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,mBAAmB;IAChC,mEAAmE;IACnE,UAAU,EAAE,uBAAuB,CAAA;IACnC,2DAA2D;IAC3D,MAAM,EAAE,6BAA6B,CAAA;CACxC;AAED,MAAM,WAAW,wBAAwB;IACrC,oEAAoE;IACpE,EAAE,EAAE,OAAO,CAAA;IACX,6CAA6C;IAC7C,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,2EAA2E;IAC3E,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,wDAAwD;IACxD,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,qEAAqE;IACrE,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACvC,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The fourth truth value: the reader's assignments, run through the steps they
|
|
3
|
+
* granted, force this both true and false.
|
|
4
|
+
*
|
|
5
|
+
* Only evaluation produces it. A reader assigns `TCoreTrivalentValue`, and the
|
|
6
|
+
* assignment types below deliberately exclude this literal so a caller cannot
|
|
7
|
+
* feed it back in.
|
|
8
|
+
*/
|
|
9
|
+
export const CONTESTED = "contested";
|
|
10
|
+
/** Narrows a four-valued truth value to {@link CONTESTED}. */
|
|
11
|
+
export function isContested(value) {
|
|
12
|
+
return value === CONTESTED;
|
|
13
|
+
}
|
|
2
14
|
//# sourceMappingURL=evaluation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation.js","sourceRoot":"","sources":["../../../src/lib/types/evaluation.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"evaluation.js","sourceRoot":"","sources":["../../../src/lib/types/evaluation.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA;AAcpC,8DAA8D;AAC9D,MAAM,UAAU,WAAW,CACvB,KAAyC;IAEzC,OAAO,KAAK,KAAK,SAAS,CAAA;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { TCoreArgumentEvaluationResult } from "../../types/evaluation.js";
|
|
2
|
-
/**
|
|
3
|
-
* Human-readable grade for an argument evaluation result.
|
|
4
|
-
* Summarizes the logical status of the argument under the given assignment.
|
|
5
|
-
*/
|
|
6
|
-
export type TCoreEvaluationGrade = "sound" | "vacuously-true" | "unsound" | "counterexample" | "inadmissible" | "indeterminate";
|
|
7
|
-
export interface TCoreEvaluationGrading {
|
|
8
|
-
/** Machine-readable grade. */
|
|
9
|
-
grade: TCoreEvaluationGrade;
|
|
10
|
-
/** Short human-readable label (e.g. "Sound", "Vacuously True"). */
|
|
11
|
-
label: string;
|
|
12
|
-
/** Display color name for UI rendering. */
|
|
13
|
-
color: "green" | "orange" | "red" | "gray";
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Derives a human-readable grade from an argument evaluation result.
|
|
17
|
-
*
|
|
18
|
-
* Precedence:
|
|
19
|
-
* 1. Evaluation failed (ok=false) → indeterminate
|
|
20
|
-
* 2. Inadmissible assignment → inadmissible
|
|
21
|
-
* 3. Supporting premise false → unsound
|
|
22
|
-
* 4. Counterexample (all supporting true, conclusion false) → counterexample
|
|
23
|
-
* 5. Supporting premises not known true (unknown or absent) → indeterminate
|
|
24
|
-
* 6. Conclusion vacuously true → vacuously-true
|
|
25
|
-
* 7. Conclusion true → sound
|
|
26
|
-
* 8. Otherwise → indeterminate
|
|
27
|
-
*/
|
|
28
|
-
export declare function gradeEvaluation(result: TCoreArgumentEvaluationResult): TCoreEvaluationGrading;
|
|
29
|
-
//# sourceMappingURL=grading.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grading.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/grading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AAE9E;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC1B,OAAO,GACP,gBAAgB,GAChB,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,eAAe,CAAA;AAErB,MAAM,WAAW,sBAAsB;IACnC,8BAA8B;IAC9B,KAAK,EAAE,oBAAoB,CAAA;IAC3B,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAA;CAC7C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC3B,MAAM,EAAE,6BAA6B,GACtC,sBAAsB,CAyCxB"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Derives a human-readable grade from an argument evaluation result.
|
|
3
|
-
*
|
|
4
|
-
* Precedence:
|
|
5
|
-
* 1. Evaluation failed (ok=false) → indeterminate
|
|
6
|
-
* 2. Inadmissible assignment → inadmissible
|
|
7
|
-
* 3. Supporting premise false → unsound
|
|
8
|
-
* 4. Counterexample (all supporting true, conclusion false) → counterexample
|
|
9
|
-
* 5. Supporting premises not known true (unknown or absent) → indeterminate
|
|
10
|
-
* 6. Conclusion vacuously true → vacuously-true
|
|
11
|
-
* 7. Conclusion true → sound
|
|
12
|
-
* 8. Otherwise → indeterminate
|
|
13
|
-
*/
|
|
14
|
-
export function gradeEvaluation(result) {
|
|
15
|
-
if (!result.ok) {
|
|
16
|
-
return { grade: "indeterminate", label: "Indeterminate", color: "gray" };
|
|
17
|
-
}
|
|
18
|
-
if (result.isAdmissibleAssignment === false) {
|
|
19
|
-
return { grade: "inadmissible", label: "Inadmissible", color: "gray" };
|
|
20
|
-
}
|
|
21
|
-
if (result.allSupportingPremisesTrue === false) {
|
|
22
|
-
return { grade: "unsound", label: "Unsound", color: "red" };
|
|
23
|
-
}
|
|
24
|
-
if (result.isCounterexample === true) {
|
|
25
|
-
return {
|
|
26
|
-
grade: "counterexample",
|
|
27
|
-
label: "Counterexample",
|
|
28
|
-
color: "red",
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
// Soundness requires the supporting premises to be true. An unknown or
|
|
32
|
-
// absent value is not true, so it can never reach sound or vacuously-true.
|
|
33
|
-
if (result.allSupportingPremisesTrue !== true) {
|
|
34
|
-
return { grade: "indeterminate", label: "Indeterminate", color: "gray" };
|
|
35
|
-
}
|
|
36
|
-
if (result.conclusionTrue === true) {
|
|
37
|
-
// Check if conclusion is vacuously true
|
|
38
|
-
const diag = result.conclusion?.inferenceDiagnostic;
|
|
39
|
-
if (diag?.kind === "implies" && diag.isVacuouslyTrue === true) {
|
|
40
|
-
return {
|
|
41
|
-
grade: "vacuously-true",
|
|
42
|
-
label: "Vacuously True",
|
|
43
|
-
color: "orange",
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return { grade: "sound", label: "Sound", color: "green" };
|
|
47
|
-
}
|
|
48
|
-
return { grade: "indeterminate", label: "Indeterminate", color: "gray" };
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=grading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grading.js","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/grading.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAC3B,MAAqC;IAErC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACb,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;IAC5E,CAAC;IAED,IAAI,MAAM,CAAC,sBA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1,12 +0,0 @@
|
|
|
1
|
-
import type { TCoreTrivalentValue } from "../../types/evaluation.js";
|
|
2
|
-
/** Kleene three-valued NOT: null propagates. */
|
|
3
|
-
export declare function kleeneNot(a: TCoreTrivalentValue): TCoreTrivalentValue;
|
|
4
|
-
/** Kleene three-valued AND: false dominates, null propagates. */
|
|
5
|
-
export declare function kleeneAnd(a: TCoreTrivalentValue, b: TCoreTrivalentValue): TCoreTrivalentValue;
|
|
6
|
-
/** Kleene three-valued OR: true dominates, null propagates. */
|
|
7
|
-
export declare function kleeneOr(a: TCoreTrivalentValue, b: TCoreTrivalentValue): TCoreTrivalentValue;
|
|
8
|
-
/** Kleene three-valued material implication: NOT a OR b. */
|
|
9
|
-
export declare function kleeneImplies(a: TCoreTrivalentValue, b: TCoreTrivalentValue): TCoreTrivalentValue;
|
|
10
|
-
/** Kleene three-valued biconditional: (a -> b) AND (b -> a). */
|
|
11
|
-
export declare function kleeneIff(a: TCoreTrivalentValue, b: TCoreTrivalentValue): TCoreTrivalentValue;
|
|
12
|
-
//# sourceMappingURL=kleene.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kleene.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/kleene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,gDAAgD;AAChD,wBAAgB,SAAS,CAAC,CAAC,EAAE,mBAAmB,GAAG,mBAAmB,CAErE;AAED,iEAAiE;AACjE,wBAAgB,SAAS,CACrB,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,GACvB,mBAAmB,CAIrB;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CACpB,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,GACvB,mBAAmB,CAIrB;AAED,4DAA4D;AAC5D,wBAAgB,aAAa,CACzB,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,GACvB,mBAAmB,CAErB;AAED,gEAAgE;AAChE,wBAAgB,SAAS,CACrB,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,GACvB,mBAAmB,CAErB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** Kleene three-valued NOT: null propagates. */
|
|
2
|
-
export function kleeneNot(a) {
|
|
3
|
-
return a === null ? null : !a;
|
|
4
|
-
}
|
|
5
|
-
/** Kleene three-valued AND: false dominates, null propagates. */
|
|
6
|
-
export function kleeneAnd(a, b) {
|
|
7
|
-
if (a === false || b === false)
|
|
8
|
-
return false;
|
|
9
|
-
if (a === null || b === null)
|
|
10
|
-
return null;
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
/** Kleene three-valued OR: true dominates, null propagates. */
|
|
14
|
-
export function kleeneOr(a, b) {
|
|
15
|
-
if (a === true || b === true)
|
|
16
|
-
return true;
|
|
17
|
-
if (a === null || b === null)
|
|
18
|
-
return null;
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
/** Kleene three-valued material implication: NOT a OR b. */
|
|
22
|
-
export function kleeneImplies(a, b) {
|
|
23
|
-
return kleeneOr(kleeneNot(a), b);
|
|
24
|
-
}
|
|
25
|
-
/** Kleene three-valued biconditional: (a -> b) AND (b -> a). */
|
|
26
|
-
export function kleeneIff(a, b) {
|
|
27
|
-
return kleeneAnd(kleeneImplies(a, b), kleeneImplies(b, a));
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=kleene.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kleene.js","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/kleene.ts"],"names":[],"mappings":"AAEA,gDAAgD;AAChD,MAAM,UAAU,SAAS,CAAC,CAAsB;IAC5C,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,SAAS,CACrB,CAAsB,EACtB,CAAsB;IAEtB,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IAC5C,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACf,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,QAAQ,CACpB,CAAsB,EACtB,CAAsB;IAEtB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,aAAa,CACzB,CAAsB,EACtB,CAAsB;IAEtB,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACpC,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,SAAS,CACrB,CAAsB,EACtB,CAAsB;IAEtB,OAAO,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC9D,CAAC"}
|