@proposit/proposit-core 0.12.3 → 1.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 +104 -93
- package/dist/cli/commands/premises.d.ts.map +1 -1
- package/dist/cli/commands/premises.js +28 -24
- package/dist/cli/commands/premises.js.map +1 -1
- package/dist/cli/commands/repair.d.ts.map +1 -1
- package/dist/cli/commands/repair.js +4 -2
- package/dist/cli/commands/repair.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +7 -1
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/engine.d.ts.map +1 -1
- package/dist/cli/engine.js +7 -25
- package/dist/cli/engine.js.map +1 -1
- package/dist/cli/import.d.ts.map +1 -1
- package/dist/cli/import.js +66 -28
- package/dist/cli/import.js.map +1 -1
- package/dist/lib/core/argument-engine.d.ts +275 -10
- package/dist/lib/core/argument-engine.d.ts.map +1 -1
- package/dist/lib/core/argument-engine.js +442 -82
- package/dist/lib/core/argument-engine.js.map +1 -1
- package/dist/lib/core/argument-library.d.ts +5 -1
- package/dist/lib/core/argument-library.d.ts.map +1 -1
- package/dist/lib/core/argument-library.js +7 -3
- package/dist/lib/core/argument-library.js.map +1 -1
- package/dist/lib/core/expression-manager.d.ts +68 -73
- package/dist/lib/core/expression-manager.d.ts.map +1 -1
- package/dist/lib/core/expression-manager.js +242 -762
- package/dist/lib/core/expression-manager.js.map +1 -1
- package/dist/lib/core/fork.d.ts +5 -1
- package/dist/lib/core/fork.d.ts.map +1 -1
- package/dist/lib/core/fork.js +16 -6
- package/dist/lib/core/fork.js.map +1 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +68 -7
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/core/interfaces/library.interfaces.d.ts +8 -3
- package/dist/lib/core/interfaces/library.interfaces.d.ts.map +1 -1
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts +50 -47
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.d.ts +80 -11
- package/dist/lib/core/premise-engine.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.js +232 -80
- package/dist/lib/core/premise-engine.js.map +1 -1
- package/dist/lib/core/proposit-core.d.ts.map +1 -1
- package/dist/lib/core/proposit-core.js +13 -3
- package/dist/lib/core/proposit-core.js.map +1 -1
- package/dist/lib/grammar/an-rules.d.ts +158 -0
- package/dist/lib/grammar/an-rules.d.ts.map +1 -0
- package/dist/lib/grammar/an-rules.js +778 -0
- package/dist/lib/grammar/an-rules.js.map +1 -0
- package/dist/lib/grammar/auto-normalize.d.ts +14 -0
- package/dist/lib/grammar/auto-normalize.d.ts.map +1 -0
- package/dist/lib/grammar/auto-normalize.js +35 -0
- package/dist/lib/grammar/auto-normalize.js.map +1 -0
- package/dist/lib/grammar/bounded-subtree.d.ts +30 -0
- package/dist/lib/grammar/bounded-subtree.d.ts.map +1 -0
- package/dist/lib/grammar/bounded-subtree.js +74 -0
- package/dist/lib/grammar/bounded-subtree.js.map +1 -0
- package/dist/lib/grammar/naked-q.d.ts +20 -0
- package/dist/lib/grammar/naked-q.d.ts.map +1 -0
- package/dist/lib/grammar/naked-q.js +58 -0
- package/dist/lib/grammar/naked-q.js.map +1 -0
- package/dist/lib/grammar/normalize.d.ts +12 -0
- package/dist/lib/grammar/normalize.d.ts.map +1 -0
- package/dist/lib/grammar/normalize.js +45 -0
- package/dist/lib/grammar/normalize.js.map +1 -0
- package/dist/lib/grammar/populate-from.d.ts +25 -0
- package/dist/lib/grammar/populate-from.d.ts.map +1 -0
- package/dist/lib/grammar/populate-from.js +252 -0
- package/dist/lib/grammar/populate-from.js.map +1 -0
- package/dist/lib/grammar/repair.d.ts +65 -0
- package/dist/lib/grammar/repair.d.ts.map +1 -0
- package/dist/lib/grammar/repair.js +251 -0
- package/dist/lib/grammar/repair.js.map +1 -0
- package/dist/lib/grammar/types.d.ts +17 -0
- package/dist/lib/grammar/types.d.ts.map +1 -0
- package/dist/lib/grammar/types.js +82 -0
- package/dist/lib/grammar/types.js.map +1 -0
- package/dist/lib/grammar/validate.d.ts +4 -0
- package/dist/lib/grammar/validate.d.ts.map +1 -0
- package/dist/lib/grammar/validate.js +28 -0
- package/dist/lib/grammar/validate.js.map +1 -0
- package/dist/lib/grammar/validators/context.d.ts +11 -0
- package/dist/lib/grammar/validators/context.d.ts.map +1 -0
- package/dist/lib/grammar/validators/context.js +5 -0
- package/dist/lib/grammar/validators/context.js.map +1 -0
- package/dist/lib/grammar/validators/derivable.d.ts +63 -0
- package/dist/lib/grammar/validators/derivable.d.ts.map +1 -0
- package/dist/lib/grammar/validators/derivable.js +502 -0
- package/dist/lib/grammar/validators/derivable.js.map +1 -0
- package/dist/lib/grammar/validators/evaluable.d.ts +48 -0
- package/dist/lib/grammar/validators/evaluable.d.ts.map +1 -0
- package/dist/lib/grammar/validators/evaluable.js +226 -0
- package/dist/lib/grammar/validators/evaluable.js.map +1 -0
- package/dist/lib/grammar/validators/presentable.d.ts +45 -0
- package/dist/lib/grammar/validators/presentable.d.ts.map +1 -0
- package/dist/lib/grammar/validators/presentable.js +231 -0
- package/dist/lib/grammar/validators/presentable.js.map +1 -0
- package/dist/lib/grammar/validators/structural.d.ts +103 -0
- package/dist/lib/grammar/validators/structural.d.ts.map +1 -0
- package/dist/lib/grammar/validators/structural.js +602 -0
- package/dist/lib/grammar/validators/structural.js.map +1 -0
- package/dist/lib/index.d.ts +4 -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/parsing/argument-parser.d.ts.map +1 -1
- package/dist/lib/parsing/argument-parser.js +52 -10
- package/dist/lib/parsing/argument-parser.js.map +1 -1
- package/dist/lib/types/evaluation.d.ts +1 -1
- package/dist/lib/types/evaluation.d.ts.map +1 -1
- package/dist/lib/types/fork.d.ts +12 -3
- package/dist/lib/types/fork.d.ts.map +1 -1
- package/dist/lib/types/validation.d.ts +0 -6
- package/dist/lib/types/validation.d.ts.map +1 -1
- package/dist/lib/types/validation.js +23 -6
- package/dist/lib/types/validation.js.map +1 -1
- package/package.json +1 -1
- package/dist/lib/core/managed-derivation-premise-engine.d.ts +0 -172
- package/dist/lib/core/managed-derivation-premise-engine.d.ts.map +0 -1
- package/dist/lib/core/managed-derivation-premise-engine.js +0 -550
- package/dist/lib/core/managed-derivation-premise-engine.js.map +0 -1
- package/dist/lib/types/grammar.d.ts +0 -83
- package/dist/lib/types/grammar.d.ts.map +0 -1
- package/dist/lib/types/grammar.js +0 -24
- package/dist/lib/types/grammar.js.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Grammar wire format — TypeBox schemas + derived TypeScript types.
|
|
2
|
+
//
|
|
3
|
+
// proposit-core owns these types. proposit-shared re-exports them from
|
|
4
|
+
// `@proposit/shared/schemas/grammar` for consumer ergonomics; server and
|
|
5
|
+
// mobile may import from either repo. The 422 response envelope that
|
|
6
|
+
// composes ViolationSchema lives in shared (`@proposit/shared/schemas/api/grammar-violations`).
|
|
7
|
+
//
|
|
8
|
+
// The four grammar tiers form a strict subset chain
|
|
9
|
+
// (Structural ⊇ Evaluable ⊇ Derivable ⊇ Presentable). See
|
|
10
|
+
// docs/Proposit_Grammar.md §2 for the model and §3 for the per-rule
|
|
11
|
+
// inventory.
|
|
12
|
+
//
|
|
13
|
+
// Codes 'E-2' and 'D-7' are intentionally absent — those rules were
|
|
14
|
+
// promoted/restated in the spec (E-2 → S-13 per §4.2; D-7 → E-6 per
|
|
15
|
+
// §4.3) and their codes are reserved (not reused) so historical
|
|
16
|
+
// references remain unambiguous. Adding or renaming a rule code is a
|
|
17
|
+
// single-repo coordinated change (TypeScript catches drift between
|
|
18
|
+
// rule-identifier strings and validator implementations at build time).
|
|
19
|
+
import Type, {} from "typebox";
|
|
20
|
+
// -- Tier --
|
|
21
|
+
export const GrammarTierSchema = Type.Union([
|
|
22
|
+
Type.Literal("structural"),
|
|
23
|
+
Type.Literal("evaluable"),
|
|
24
|
+
Type.Literal("derivable"),
|
|
25
|
+
Type.Literal("presentable"),
|
|
26
|
+
]);
|
|
27
|
+
// -- Rule code --
|
|
28
|
+
export const GrammarRuleCodeSchema = Type.Union([
|
|
29
|
+
// Structural (S-1..S-14)
|
|
30
|
+
Type.Literal("S-1"),
|
|
31
|
+
Type.Literal("S-2"),
|
|
32
|
+
Type.Literal("S-3"),
|
|
33
|
+
Type.Literal("S-4"),
|
|
34
|
+
Type.Literal("S-5"),
|
|
35
|
+
Type.Literal("S-6"),
|
|
36
|
+
Type.Literal("S-7"),
|
|
37
|
+
Type.Literal("S-8"),
|
|
38
|
+
Type.Literal("S-9"),
|
|
39
|
+
Type.Literal("S-10"),
|
|
40
|
+
Type.Literal("S-11"),
|
|
41
|
+
Type.Literal("S-12"),
|
|
42
|
+
Type.Literal("S-13"),
|
|
43
|
+
Type.Literal("S-14"),
|
|
44
|
+
// Evaluable (E-1, E-3..E-7 — 'E-2' reserved)
|
|
45
|
+
Type.Literal("E-1"),
|
|
46
|
+
Type.Literal("E-3"),
|
|
47
|
+
Type.Literal("E-4"),
|
|
48
|
+
Type.Literal("E-5"),
|
|
49
|
+
Type.Literal("E-6"),
|
|
50
|
+
Type.Literal("E-7"),
|
|
51
|
+
// Derivable (D-1..D-6 — 'D-7' reserved)
|
|
52
|
+
Type.Literal("D-1"),
|
|
53
|
+
Type.Literal("D-2"),
|
|
54
|
+
Type.Literal("D-3"),
|
|
55
|
+
Type.Literal("D-4"),
|
|
56
|
+
Type.Literal("D-5"),
|
|
57
|
+
Type.Literal("D-6"),
|
|
58
|
+
// Presentable (P-1..P-5)
|
|
59
|
+
Type.Literal("P-1"),
|
|
60
|
+
Type.Literal("P-2"),
|
|
61
|
+
Type.Literal("P-3"),
|
|
62
|
+
Type.Literal("P-4"),
|
|
63
|
+
Type.Literal("P-5"),
|
|
64
|
+
]);
|
|
65
|
+
// -- Violation --
|
|
66
|
+
// `tier` and `code` are constrained unions. `message` is a human-readable
|
|
67
|
+
// string the UI may localize/replace. The locator fields are all optional
|
|
68
|
+
// because some rules apply argument-wide and have no per-entity locator.
|
|
69
|
+
// `additionalProperties: true` reserves an extension slot for rule-specific
|
|
70
|
+
// context fields the validator may attach (e.g., D-3 might attach
|
|
71
|
+
// `mixedCitationCount`/`mixedAxiomCount` for UI rendering — see spec §7.1).
|
|
72
|
+
export const ViolationSchema = Type.Object({
|
|
73
|
+
tier: GrammarTierSchema,
|
|
74
|
+
code: GrammarRuleCodeSchema,
|
|
75
|
+
message: Type.String(),
|
|
76
|
+
argumentId: Type.Optional(Type.String()),
|
|
77
|
+
premiseId: Type.Optional(Type.String()),
|
|
78
|
+
expressionId: Type.Optional(Type.String()),
|
|
79
|
+
variableId: Type.Optional(Type.String()),
|
|
80
|
+
claimId: Type.Optional(Type.String()),
|
|
81
|
+
}, { additionalProperties: true });
|
|
82
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/grammar/types.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,qEAAqE;AACrE,gGAAgG;AAChG,EAAE;AACF,oDAAoD;AACpD,0DAA0D;AAC1D,oEAAoE;AACpE,aAAa;AACb,EAAE;AACF,oEAAoE;AACpE,oEAAoE;AACpE,gEAAgE;AAChE,qEAAqE;AACrE,mEAAmE;AACnE,wEAAwE;AAExE,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAE3C,aAAa;AAEb,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IAC1B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IA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,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,iBAAiB,GACvB,SAAS,UAAU,EAAE,CAQvB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Dispatcher per spec §7.1. Returns the union of violations across all
|
|
2
|
+
// tiers up to and including the requested tier (Structural is the most
|
|
3
|
+
// permissive tier; Presentable the strictest):
|
|
4
|
+
//
|
|
5
|
+
// validate('structural') → Structural violations only.
|
|
6
|
+
// validate('evaluable') → Structural + Evaluable.
|
|
7
|
+
// validate('derivable') → Structural + Evaluable + Derivable.
|
|
8
|
+
// validate('presentable') → Structural + Evaluable + Derivable + Presentable.
|
|
9
|
+
//
|
|
10
|
+
// Never throws on grammar issues; only throws on invalid arguments that
|
|
11
|
+
// prevent dispatch.
|
|
12
|
+
import { validateStructural } from "./validators/structural.js";
|
|
13
|
+
import { validateEvaluable } from "./validators/evaluable.js";
|
|
14
|
+
import { validateDerivable } from "./validators/derivable.js";
|
|
15
|
+
import { validatePresentable } from "./validators/presentable.js";
|
|
16
|
+
export function validate(tier, ctx) {
|
|
17
|
+
const structural = validateStructural(ctx);
|
|
18
|
+
if (tier === "structural")
|
|
19
|
+
return structural;
|
|
20
|
+
const evaluable = [...structural, ...validateEvaluable(ctx)];
|
|
21
|
+
if (tier === "evaluable")
|
|
22
|
+
return evaluable;
|
|
23
|
+
const derivable = [...evaluable, ...validateDerivable(ctx)];
|
|
24
|
+
if (tier === "derivable")
|
|
25
|
+
return derivable;
|
|
26
|
+
return [...derivable, ...validatePresentable(ctx)];
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/lib/grammar/validate.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,uEAAuE;AACvE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAC1D,sDAAsD;AACtD,kEAAkE;AAClE,gFAAgF;AAChF,EAAE;AACF,wEAAwE;AACxE,oBAAoB;AAIpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,UAAU,QAAQ,CACpB,IAAkB,EAClB,GAAsB;IAEtB,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;IAC1C,IAAI,IAAI,KAAK,YAAY;QAAE,OAAO,UAAU,CAAA;IAC5C,MAAM,SAAS,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5D,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,SAAS,CAAA;IAC1C,MAAM,SAAS,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;IAC3D,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,SAAS,CAAA;IAC1C,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TCoreArgument, TCorePremise, TCorePropositionalExpression, TCorePropositionalVariable, TCoreClaim } from "../../schemata/index.js";
|
|
2
|
+
import type { TCoreArgumentRoleState } from "../../types/evaluation.js";
|
|
3
|
+
export type TValidatorContext = {
|
|
4
|
+
argument: TCoreArgument;
|
|
5
|
+
premises: readonly TCorePremise[];
|
|
6
|
+
expressions: readonly TCorePropositionalExpression[];
|
|
7
|
+
variables: readonly TCorePropositionalVariable[];
|
|
8
|
+
claims: readonly TCoreClaim[];
|
|
9
|
+
roleState: TCoreArgumentRoleState;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/lib/grammar/validators/context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,aAAa,EACb,YAAY,EACZ,4BAA4B,EAC5B,0BAA0B,EAC1B,UAAU,EACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAEvE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,aAAa,CAAA;IACvB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;IACjC,WAAW,EAAE,SAAS,4BAA4B,EAAE,CAAA;IACpD,SAAS,EAAE,SAAS,0BAA0B,EAAE,CAAA;IAChD,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;IAC7B,SAAS,EAAE,sBAAsB,CAAA;CACpC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/lib/grammar/validators/context.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wEAAwE;AACxE,6CAA6C"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { TViolation } from "../types.js";
|
|
2
|
+
import type { TValidatorContext } from "./context.js";
|
|
3
|
+
/**
|
|
4
|
+
* D-1 — Derivation premise canonical shape. Every `type='derivation'`
|
|
5
|
+
* premise's tree matches one of two canonical forms:
|
|
6
|
+
*
|
|
7
|
+
* - **Naked-Q**: a single `variable` expression at the root, bound to
|
|
8
|
+
* `derivedClaimId`.
|
|
9
|
+
* - **Populated**: root `IMPLIES` with consequent at position 1 (variable
|
|
10
|
+
* bound to `derivedClaimId`); antecedent at position 0, after peeling
|
|
11
|
+
* formula buffers, is either a single claim-bound variable
|
|
12
|
+
* (citation/axiomatic) — see D-2 — or an `OR` whose children (each
|
|
13
|
+
* peeled of formulas) are all claim-bound variables of the same
|
|
14
|
+
* grounding type. IFF at root fails D-1 (Structurally allowed per
|
|
15
|
+
* S-14; D-1 narrows derivation premise root to IMPLIES).
|
|
16
|
+
*
|
|
17
|
+
* Wrong-root-operator cases (and/or/not/formula at root) are already
|
|
18
|
+
* caught by Structural S-14; D-1 silently skips them.
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateD1(ctx: TValidatorContext): readonly TViolation[];
|
|
21
|
+
/**
|
|
22
|
+
* D-2 — Single-citation derivation form. If a derivation premise has a
|
|
23
|
+
* populated form whose antecedent (peeled of formula buffers) is an `OR`
|
|
24
|
+
* with exactly one child (also peeled of formulas), that's wrong — the
|
|
25
|
+
* canonical single-grounding form is `IMPLIES(claim-var, Q)` without the
|
|
26
|
+
* `OR` wrapper.
|
|
27
|
+
*
|
|
28
|
+
* Note: a 1-child `OR` also fails E-1 (variadic ≥ 2) and P-4
|
|
29
|
+
* (single-child binary). D-2 is the Derivable-tier UI hint specifically
|
|
30
|
+
* naming the "drop the OR wrapper" remediation.
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateD2(ctx: TValidatorContext): readonly TViolation[];
|
|
33
|
+
/**
|
|
34
|
+
* D-3 — No mixing axioms and citations in one derivation. For each
|
|
35
|
+
* derivation premise's populated form, collect all claim-bound variables
|
|
36
|
+
* in the antecedent subtree. If they bind to claims of more than one
|
|
37
|
+
* grounding type (citation vs axiomatic), emit D-3.
|
|
38
|
+
*
|
|
39
|
+
* Formula nodes are traversed transparently by
|
|
40
|
+
* `collectVariableExpressionsInSubtree`'s plain DFS descent — no
|
|
41
|
+
* explicit `peelFormulas` call needed for D-3, since the DFS visits
|
|
42
|
+
* formula descendants like any other node and the variable collector
|
|
43
|
+
* picks up the claim-bound variables regardless of nesting depth.
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateD3(ctx: TValidatorContext): readonly TViolation[];
|
|
46
|
+
/**
|
|
47
|
+
* D-4 — Axiomatic claim placement. Variables bound to `type='axiomatic'`
|
|
48
|
+
* claims appear only in the antecedent of a derivation premise, never in
|
|
49
|
+
* freeform premises and never in a derivation premise's consequent slot.
|
|
50
|
+
*/
|
|
51
|
+
export declare function validateD4(ctx: TValidatorContext): readonly TViolation[];
|
|
52
|
+
/**
|
|
53
|
+
* D-5 — Citation claim placement. Mirror of D-4 for citation claims.
|
|
54
|
+
*/
|
|
55
|
+
export declare function validateD5(ctx: TValidatorContext): readonly TViolation[];
|
|
56
|
+
/**
|
|
57
|
+
* D-6 — Derivation premise role. Every `type='derivation'` premise has
|
|
58
|
+
* `role='supporting'` — concretely, `roleState.conclusionPremiseId !==
|
|
59
|
+
* premise.id`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function validateD6(ctx: TValidatorContext): readonly TViolation[];
|
|
62
|
+
export declare function validateDerivable(ctx: TValidatorContext): readonly TViolation[];
|
|
63
|
+
//# sourceMappingURL=derivable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivable.d.ts","sourceRoot":"","sources":["../../../../src/lib/grammar/validators/derivable.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AA4HrD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,UAAU,EAAE,CAiHxE;AA8CD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,UAAU,EAAE,CA+BxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,UAAU,EAAE,CAuCxE;AAyFD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,UAAU,EAAE,CAExE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,UAAU,EAAE,CAExE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,UAAU,EAAE,CAexE;AAID,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,iBAAiB,GACvB,SAAS,UAAU,EAAE,CASvB"}
|