@polintpro/proposit-core 0.1.7 → 0.1.9

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.
Files changed (43) hide show
  1. package/README.md +132 -17
  2. package/dist/cli/commands/expressions.d.ts.map +1 -1
  3. package/dist/cli/commands/expressions.js +35 -5
  4. package/dist/cli/commands/expressions.js.map +1 -1
  5. package/dist/cli/import.d.ts.map +1 -1
  6. package/dist/cli/import.js +2 -1
  7. package/dist/cli/import.js.map +1 -1
  8. package/dist/cli/schemata.d.ts +3 -3
  9. package/dist/cli/storage/arguments.js +2 -2
  10. package/dist/cli/storage/arguments.js.map +1 -1
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib/core/ExpressionManager.d.ts +15 -0
  16. package/dist/lib/core/ExpressionManager.d.ts.map +1 -1
  17. package/dist/lib/core/ExpressionManager.js +67 -44
  18. package/dist/lib/core/ExpressionManager.js.map +1 -1
  19. package/dist/lib/core/PremiseManager.d.ts +21 -0
  20. package/dist/lib/core/PremiseManager.d.ts.map +1 -1
  21. package/dist/lib/core/PremiseManager.js +60 -0
  22. package/dist/lib/core/PremiseManager.js.map +1 -1
  23. package/dist/lib/core/relationships.d.ts +15 -0
  24. package/dist/lib/core/relationships.d.ts.map +1 -0
  25. package/dist/lib/core/relationships.js +319 -0
  26. package/dist/lib/core/relationships.js.map +1 -0
  27. package/dist/lib/index.d.ts +4 -0
  28. package/dist/lib/index.d.ts.map +1 -1
  29. package/dist/lib/index.js +3 -0
  30. package/dist/lib/index.js.map +1 -1
  31. package/dist/lib/schemata/propositional.d.ts +9 -9
  32. package/dist/lib/schemata/propositional.d.ts.map +1 -1
  33. package/dist/lib/schemata/propositional.js +2 -2
  34. package/dist/lib/schemata/propositional.js.map +1 -1
  35. package/dist/lib/types/relationships.d.ts +36 -0
  36. package/dist/lib/types/relationships.d.ts.map +1 -0
  37. package/dist/lib/types/relationships.js +2 -0
  38. package/dist/lib/types/relationships.js.map +1 -0
  39. package/dist/lib/utils/position.d.ts +5 -0
  40. package/dist/lib/utils/position.d.ts.map +1 -0
  41. package/dist/lib/utils/position.js +7 -0
  42. package/dist/lib/utils/position.js.map +1 -0
  43. package/package.json +1 -1
@@ -0,0 +1,319 @@
1
+ // ── Variable profiling ──────────────────────────────────────────────────
2
+ function collectVariableAppearances(premise, expressionId, side) {
3
+ const appearances = [];
4
+ const stack = [
5
+ { id: expressionId, negationDepth: 0 },
6
+ ];
7
+ while (stack.length > 0) {
8
+ const { id, negationDepth } = stack.pop();
9
+ const expr = premise.getExpression(id);
10
+ if (!expr)
11
+ continue;
12
+ if (expr.type === "variable") {
13
+ appearances.push({
14
+ variableId: expr.variableId,
15
+ side,
16
+ polarity: negationDepth % 2 === 0 ? "positive" : "negative",
17
+ });
18
+ }
19
+ else {
20
+ const nextDepth = expr.type === "operator" && expr.operator === "not"
21
+ ? negationDepth + 1
22
+ : negationDepth;
23
+ for (const child of premise.getChildExpressions(id)) {
24
+ stack.push({ id: child.id, negationDepth: nextDepth });
25
+ }
26
+ }
27
+ }
28
+ return appearances;
29
+ }
30
+ /**
31
+ * Builds a profile of a premise's variable appearances, recording each
32
+ * variable's side (antecedent/consequent) and polarity (positive/negative).
33
+ */
34
+ export function buildPremiseProfile(premise) {
35
+ const premiseId = premise.getId();
36
+ if (!premise.isInference()) {
37
+ return { premiseId, isInference: false, appearances: [] };
38
+ }
39
+ const root = premise.getRootExpression();
40
+ const children = premise.getChildExpressions(root.id);
41
+ const leftChild = children.find((c) => c.position === 0);
42
+ const rightChild = children.find((c) => c.position === 1);
43
+ const appearances = [];
44
+ if (leftChild) {
45
+ appearances.push(...collectVariableAppearances(premise, leftChild.id, "antecedent"));
46
+ }
47
+ if (rightChild) {
48
+ appearances.push(...collectVariableAppearances(premise, rightChild.id, "consequent"));
49
+ }
50
+ return { premiseId, isInference: true, appearances };
51
+ }
52
+ // ── Graph construction ──────────────────────────────────────────────────
53
+ function buildVariableFlowGraph(profiles) {
54
+ const graph = new Map();
55
+ for (const [sourceId, sourceProfile] of profiles) {
56
+ if (!sourceProfile.isInference)
57
+ continue;
58
+ const edges = [];
59
+ const conseqVars = sourceProfile.appearances.filter((a) => a.side === "consequent");
60
+ for (const [targetId, targetProfile] of profiles) {
61
+ if (targetId === sourceId || !targetProfile.isInference)
62
+ continue;
63
+ const anteVars = targetProfile.appearances.filter((a) => a.side === "antecedent");
64
+ const variables = [];
65
+ for (const cv of conseqVars) {
66
+ for (const av of anteVars) {
67
+ if (cv.variableId === av.variableId) {
68
+ variables.push({
69
+ variableId: cv.variableId,
70
+ polarityMatch: cv.polarity === av.polarity,
71
+ });
72
+ }
73
+ }
74
+ }
75
+ if (variables.length > 0) {
76
+ edges.push({ targetPremiseId: targetId, variables });
77
+ }
78
+ }
79
+ graph.set(sourceId, edges);
80
+ }
81
+ return graph;
82
+ }
83
+ function bfsToTarget(graph, sourceId, targetId) {
84
+ const visited = new Set();
85
+ visited.add(sourceId);
86
+ const queue = [];
87
+ // Seed with direct edges from source
88
+ const sourceEdges = graph.get(sourceId) ?? [];
89
+ for (const edge of sourceEdges) {
90
+ const allMatch = edge.variables.every((v) => v.polarityMatch);
91
+ if (edge.targetPremiseId === targetId) {
92
+ return {
93
+ reachable: true,
94
+ polarityMatch: allMatch,
95
+ variableDetails: edge.variables.map((v) => ({
96
+ variableId: v.variableId,
97
+ relationship: v.polarityMatch
98
+ ? "supporting"
99
+ : "contradicting",
100
+ })),
101
+ transitive: false,
102
+ };
103
+ }
104
+ if (!visited.has(edge.targetPremiseId)) {
105
+ visited.add(edge.targetPremiseId);
106
+ queue.push({
107
+ premiseId: edge.targetPremiseId,
108
+ polarityMatch: allMatch,
109
+ entryVariables: edge.variables,
110
+ });
111
+ }
112
+ }
113
+ while (queue.length > 0) {
114
+ const { premiseId, polarityMatch, entryVariables } = queue.shift();
115
+ const edges = graph.get(premiseId) ?? [];
116
+ for (const edge of edges) {
117
+ if (edge.targetPremiseId === targetId) {
118
+ const stepMatch = edge.variables.every((v) => v.polarityMatch);
119
+ // XOR logic: both match or both mismatch = overall match
120
+ const finalMatch = (polarityMatch && stepMatch) ||
121
+ (!polarityMatch && !stepMatch);
122
+ return {
123
+ reachable: true,
124
+ polarityMatch: finalMatch,
125
+ variableDetails: entryVariables.map((v) => ({
126
+ variableId: v.variableId,
127
+ relationship: finalMatch
128
+ ? "supporting"
129
+ : "contradicting",
130
+ })),
131
+ transitive: true,
132
+ };
133
+ }
134
+ if (!visited.has(edge.targetPremiseId)) {
135
+ visited.add(edge.targetPremiseId);
136
+ const stepMatch = edge.variables.every((v) => v.polarityMatch);
137
+ const nextMatch = (polarityMatch && stepMatch) ||
138
+ (!polarityMatch && !stepMatch);
139
+ queue.push({
140
+ premiseId: edge.targetPremiseId,
141
+ polarityMatch: nextMatch,
142
+ entryVariables,
143
+ });
144
+ }
145
+ }
146
+ }
147
+ return {
148
+ reachable: false,
149
+ polarityMatch: true,
150
+ variableDetails: [],
151
+ transitive: false,
152
+ };
153
+ }
154
+ // ── Restricting check ───────────────────────────────────────────────────
155
+ function hasVariableOnBothSides(profile, focusedProfile) {
156
+ const antecedentVarIds = new Set(profile.appearances
157
+ .filter((a) => a.side === "antecedent")
158
+ .map((a) => a.variableId));
159
+ const consequentVarIds = new Set(profile.appearances
160
+ .filter((a) => a.side === "consequent")
161
+ .map((a) => a.variableId));
162
+ const bothSideVarIds = new Set([...antecedentVarIds].filter((id) => consequentVarIds.has(id)));
163
+ const focusedVarIds = new Set(focusedProfile.appearances.map((a) => a.variableId));
164
+ const restricting = [];
165
+ for (const varId of bothSideVarIds) {
166
+ if (focusedVarIds.has(varId)) {
167
+ restricting.push({
168
+ variableId: varId,
169
+ relationship: "restricting",
170
+ });
171
+ }
172
+ }
173
+ return restricting;
174
+ }
175
+ // ── Constraint premise classification ───────────────────────────────────
176
+ function classifyConstraintPremise(premise, focusedProfile, connectedVarIds) {
177
+ const premiseVarIds = new Set(premise.getVariables().map((v) => v.id));
178
+ const focusedVarIds = new Set(focusedProfile.appearances.map((a) => a.variableId));
179
+ const directOverlap = [...premiseVarIds].some((id) => focusedVarIds.has(id));
180
+ const transitiveOverlap = [...premiseVarIds].some((id) => connectedVarIds.has(id));
181
+ if (directOverlap || transitiveOverlap) {
182
+ return {
183
+ premiseId: premise.getId(),
184
+ relationship: "restricting",
185
+ variableDetails: [],
186
+ transitive: !directOverlap && transitiveOverlap,
187
+ };
188
+ }
189
+ return {
190
+ premiseId: premise.getId(),
191
+ relationship: "unrelated",
192
+ variableDetails: [],
193
+ transitive: false,
194
+ };
195
+ }
196
+ // ── Precedence ──────────────────────────────────────────────────────────
197
+ const PRECEDENCE = {
198
+ contradicting: 3,
199
+ restricting: 2,
200
+ supporting: 1,
201
+ };
202
+ function applyPrecedence(details) {
203
+ let highest = "supporting";
204
+ for (const d of details) {
205
+ if (PRECEDENCE[d.relationship] > PRECEDENCE[highest]) {
206
+ highest = d.relationship;
207
+ }
208
+ }
209
+ return highest;
210
+ }
211
+ // ── Main function ───────────────────────────────────────────────────────
212
+ /**
213
+ * Analyzes how every other premise in the argument relates to the focused
214
+ * premise, classifying each as supporting, contradicting, restricting,
215
+ * downstream, or unrelated.
216
+ */
217
+ export function analyzePremiseRelationships(engine, focusedPremiseId) {
218
+ const focusedPremise = engine.getPremise(focusedPremiseId);
219
+ if (!focusedPremise) {
220
+ throw new Error(`Premise "${focusedPremiseId}" does not exist in the argument.`);
221
+ }
222
+ const allPremises = engine.listPremises();
223
+ const otherPremises = allPremises.filter((pm) => pm.getId() !== focusedPremiseId);
224
+ if (otherPremises.length === 0) {
225
+ return { focusedPremiseId, premises: [] };
226
+ }
227
+ // Build profiles for all premises
228
+ const profiles = new Map();
229
+ for (const pm of allPremises) {
230
+ profiles.set(pm.getId(), buildPremiseProfile(pm));
231
+ }
232
+ const focusedProfile = profiles.get(focusedPremiseId);
233
+ // Build variable flow graph (inference premises only)
234
+ const graph = buildVariableFlowGraph(profiles);
235
+ // Collect all variable IDs connected to the focused premise
236
+ // (for constraint classification)
237
+ const connectedVarIds = new Set();
238
+ for (const pm of allPremises) {
239
+ const pmId = pm.getId();
240
+ if (pmId === focusedPremiseId)
241
+ continue;
242
+ const profile = profiles.get(pmId);
243
+ if (!profile.isInference)
244
+ continue;
245
+ const toFocused = bfsToTarget(graph, pmId, focusedPremiseId);
246
+ const fromFocused = bfsToTarget(graph, focusedPremiseId, pmId);
247
+ if (toFocused.reachable || fromFocused.reachable) {
248
+ for (const v of pm.getVariables()) {
249
+ connectedVarIds.add(v.id);
250
+ }
251
+ }
252
+ }
253
+ for (const a of focusedProfile.appearances) {
254
+ connectedVarIds.add(a.variableId);
255
+ }
256
+ // Classify each premise
257
+ const results = [];
258
+ for (const pm of otherPremises) {
259
+ const pmId = pm.getId();
260
+ const profile = profiles.get(pmId);
261
+ // Constraint premises get special handling
262
+ if (!profile.isInference) {
263
+ results.push(classifyConstraintPremise(pm, focusedProfile, connectedVarIds));
264
+ continue;
265
+ }
266
+ // If focused premise is a constraint, all sharing premises are
267
+ // restricting
268
+ if (!focusedProfile.isInference) {
269
+ const focusedVarIds = new Set(focusedPremise.getVariables().map((v) => v.id));
270
+ const pmVarIds = new Set(pm.getVariables().map((v) => v.id));
271
+ const shares = [...pmVarIds].some((id) => focusedVarIds.has(id));
272
+ results.push({
273
+ premiseId: pmId,
274
+ relationship: shares ? "restricting" : "unrelated",
275
+ variableDetails: [],
276
+ transitive: false,
277
+ });
278
+ continue;
279
+ }
280
+ // Check restricting (variable on both sides of source, appearing
281
+ // in focused)
282
+ const restrictingDetails = hasVariableOnBothSides(profile, focusedProfile);
283
+ // Check forward path (source → focused)
284
+ const toFocused = bfsToTarget(graph, pmId, focusedPremiseId);
285
+ // Check reverse path (focused → source) for downstream
286
+ const fromFocused = bfsToTarget(graph, focusedPremiseId, pmId);
287
+ if (restrictingDetails.length > 0 || toFocused.reachable) {
288
+ const allDetails = [
289
+ ...restrictingDetails,
290
+ ...toFocused.variableDetails,
291
+ ];
292
+ const relationship = applyPrecedence(allDetails);
293
+ results.push({
294
+ premiseId: pmId,
295
+ relationship,
296
+ variableDetails: allDetails,
297
+ transitive: toFocused.transitive,
298
+ });
299
+ }
300
+ else if (fromFocused.reachable) {
301
+ results.push({
302
+ premiseId: pmId,
303
+ relationship: "downstream",
304
+ variableDetails: [],
305
+ transitive: fromFocused.transitive,
306
+ });
307
+ }
308
+ else {
309
+ results.push({
310
+ premiseId: pmId,
311
+ relationship: "unrelated",
312
+ variableDetails: [],
313
+ transitive: false,
314
+ });
315
+ }
316
+ }
317
+ return { focusedPremiseId, premises: results };
318
+ }
319
+ //# sourceMappingURL=relationships.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../../src/lib/core/relationships.ts"],"names":[],"mappings":"AAWA,2EAA2E;AAE3E,SAAS,0BAA0B,CAC/B,OAAuB,EACvB,YAAoB,EACpB,IAAsB;IAEtB,MAAM,WAAW,GAA8B,EAAE,CAAA;IACjD,MAAM,KAAK,GAA4C;QACnD,EAAE,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,EAAE;KACzC,CAAA;IAED,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,GAAG,EAAG,CAAA;QAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;QACtC,IAAI,CAAC,IAAI;YAAE,SAAQ;QAEnB,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC3B,WAAW,CAAC,IAAI,CAAC;gBACb,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,IAAI;gBACJ,QAAQ,EAAE,aAAa,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;aAC9D,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core/PremiseManager.js";
7
7
  export * from "./types/evaluation.js";
8
8
  export * from "./types/diff.js";
9
9
  export { diffArguments, defaultCompareArgument, defaultCompareVariable, defaultComparePremise, defaultCompareExpression, } from "./core/diff.js";
10
+ export * from "./types/relationships.js";
11
+ export { analyzePremiseRelationships, buildPremiseProfile, } from "./core/relationships.js";
10
12
  export { parseFormula } from "./core/parser/formula.js";
11
13
  export type { FormulaAST } from "./core/parser/formula.js";
14
+ export type { TExpressionWithoutPosition } from "./core/ExpressionManager.js";
15
+ export { POSITION_MIN, POSITION_MAX, POSITION_INITIAL, midpoint, } from "./utils/position.js";
12
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,cAAc,0BAA0B,CAAA;AACxC,OAAO,EACH,2BAA2B,EAC3B,mBAAmB,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,QAAQ,GACX,MAAM,qBAAqB,CAAA"}
package/dist/lib/index.js CHANGED
@@ -7,5 +7,8 @@ export { PremiseManager } from "./core/PremiseManager.js";
7
7
  export * from "./types/evaluation.js";
8
8
  export * from "./types/diff.js";
9
9
  export { diffArguments, defaultCompareArgument, defaultCompareVariable, defaultComparePremise, defaultCompareExpression, } from "./core/diff.js";
10
+ export * from "./types/relationships.js";
11
+ export { analyzePremiseRelationships, buildPremiseProfile, } from "./core/relationships.js";
10
12
  export { parseFormula } from "./core/parser/formula.js";
13
+ export { POSITION_MIN, POSITION_MAX, POSITION_INITIAL, midpoint, } from "./utils/position.js";
11
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,cAAc,0BAA0B,CAAA;AACxC,OAAO,EACH,2BAA2B,EAC3B,mBAAmB,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGvD,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,QAAQ,GACX,MAAM,qBAAqB,CAAA"}
@@ -6,7 +6,7 @@ export declare const CorePropositionalVariableExpressionSchema: Type.TObject<{
6
6
  argumentId: Type.TString;
7
7
  argumentVersion: Type.TNumber;
8
8
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
9
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
9
+ position: Type.TNumber;
10
10
  type: Type.TLiteral<"variable">;
11
11
  variableId: Type.TString;
12
12
  }>;
@@ -18,7 +18,7 @@ export declare const CoreOperatorExpressionSchema: Type.TObject<{
18
18
  argumentId: Type.TString;
19
19
  argumentVersion: Type.TNumber;
20
20
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
21
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
21
+ position: Type.TNumber;
22
22
  type: Type.TLiteral<"operator">;
23
23
  operator: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
24
24
  }>;
@@ -28,7 +28,7 @@ export declare const CoreFormulaExpressionSchema: Type.TObject<{
28
28
  argumentId: Type.TString;
29
29
  argumentVersion: Type.TNumber;
30
30
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
31
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
31
+ position: Type.TNumber;
32
32
  type: Type.TLiteral<"formula">;
33
33
  }>;
34
34
  export type TCoreFormulaExpression = Static<typeof CoreFormulaExpressionSchema>;
@@ -37,7 +37,7 @@ export declare const CorePropositionalExpressionSchema: Type.TUnion<[Type.TObjec
37
37
  argumentId: Type.TString;
38
38
  argumentVersion: Type.TNumber;
39
39
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
40
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
40
+ position: Type.TNumber;
41
41
  type: Type.TLiteral<"variable">;
42
42
  variableId: Type.TString;
43
43
  }>, Type.TObject<{
@@ -45,7 +45,7 @@ export declare const CorePropositionalExpressionSchema: Type.TUnion<[Type.TObjec
45
45
  argumentId: Type.TString;
46
46
  argumentVersion: Type.TNumber;
47
47
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
48
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
48
+ position: Type.TNumber;
49
49
  type: Type.TLiteral<"operator">;
50
50
  operator: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
51
51
  }>, Type.TObject<{
@@ -53,7 +53,7 @@ export declare const CorePropositionalExpressionSchema: Type.TUnion<[Type.TObjec
53
53
  argumentId: Type.TString;
54
54
  argumentVersion: Type.TNumber;
55
55
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
56
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
56
+ position: Type.TNumber;
57
57
  type: Type.TLiteral<"formula">;
58
58
  }>]>;
59
59
  export type TCorePropositionalExpressionCombined = Static<typeof CorePropositionalExpressionSchema>;
@@ -76,7 +76,7 @@ export declare const CorePremiseSchema: Type.TObject<{
76
76
  argumentId: Type.TString;
77
77
  argumentVersion: Type.TNumber;
78
78
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
79
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
79
+ position: Type.TNumber;
80
80
  type: Type.TLiteral<"variable">;
81
81
  variableId: Type.TString;
82
82
  }>, Type.TObject<{
@@ -84,7 +84,7 @@ export declare const CorePremiseSchema: Type.TObject<{
84
84
  argumentId: Type.TString;
85
85
  argumentVersion: Type.TNumber;
86
86
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
87
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
87
+ position: Type.TNumber;
88
88
  type: Type.TLiteral<"operator">;
89
89
  operator: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
90
90
  }>, Type.TObject<{
@@ -92,7 +92,7 @@ export declare const CorePremiseSchema: Type.TObject<{
92
92
  argumentId: Type.TString;
93
93
  argumentVersion: Type.TNumber;
94
94
  parentId: Type.TUnion<[Type.TString, Type.TNull]>;
95
- position: Type.TUnion<[Type.TInteger, Type.TNull]>;
95
+ position: Type.TNumber;
96
96
  type: Type.TLiteral<"formula">;
97
97
  }>]>>;
98
98
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"propositional.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/propositional.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAO3C,eAAO,MAAM,gCAAgC,+FAI3C,CAAA;AACF,MAAM,MAAM,iCAAiC,GAAG,MAAM,CAClD,OAAO,gCAAgC,CAC1C,CAAA;AAoBD,eAAO,MAAM,yCAAyC;;;;;;;;EAMrD,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG,MAAM,CACrD,OAAO,yCAAyC,CACnD,CAAA;AAED,eAAO,MAAM,uBAAuB,gIAMlC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,eAAO,MAAM,4BAA4B;;;;;;;;EAMxC,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,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CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CACxC,OAAO,4BAA4B,CACtC,CAAA;AAED,eAAO,MAAM,2BAA2B;;;;;;;EAKvC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;IAI5C,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,MAAM,CACrD,OAAO,iCAAiC,CAC3C,CAAA;AAED,MAAM,MAAM,4BAA4B,CACpC,CAAC,SAAS,iCAAiC,GACvC,iCAAiC,IACrC,OAAO,CAAC,oCAAoC,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AAE9D,eAAO,MAAM,+BAA+B;;;;;EAe3C,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC3C,OAAO,+BAA+B,CACzC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsB7B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
@@ -15,10 +15,10 @@ const BasePropositionalExpressionSchema = Type.Object({
15
15
  parentId: Nullable(UUID, {
16
16
  description: "The ID of the parent operator expression, or null if this is a top-level expression.",
17
17
  }),
18
- position: Nullable(Type.Integer({
18
+ position: Type.Number({
19
19
  minimum: 0,
20
20
  description: "The ordering of this expression among its siblings under the same parent. Must be unique within (parentId, argumentId, argumentVersion).",
21
- })),
21
+ }),
22
22
  });
23
23
  export const CorePropositionalVariableExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
24
24
  type: VariableType,
@@ -1 +1 @@
1
- {"version":3,"file":"propositional.js","sourceRoot":"","sources":["../../../src/lib/schemata/propositional.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IA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AAE,IAAI;IAC1B,WAAW,EACP,kEAAkE;CACzE,CACJ,CAAA"}
@@ -0,0 +1,36 @@
1
+ /** Polarity of a variable within an expression subtree. */
2
+ export type TCoreVariablePolarity = "positive" | "negative";
3
+ /** Which side of an inference premise a variable appears on. */
4
+ export type TCorePremiseSide = "antecedent" | "consequent";
5
+ /** A single variable appearance within a premise, recording its side and polarity. */
6
+ export interface TCoreVariableAppearance {
7
+ variableId: string;
8
+ side: TCorePremiseSide;
9
+ polarity: TCoreVariablePolarity;
10
+ }
11
+ /** Profile of a premise's variable appearances, split by antecedent/consequent. */
12
+ export interface TCorePremiseProfile {
13
+ premiseId: string;
14
+ isInference: boolean;
15
+ appearances: TCoreVariableAppearance[];
16
+ }
17
+ /** The five relationship categories a premise can have relative to a focused premise. */
18
+ export type TCorePremiseRelationshipType = "supporting" | "contradicting" | "restricting" | "downstream" | "unrelated";
19
+ /** Per-variable relationship detail explaining why a variable contributes to the classification. */
20
+ export interface TCoreVariableRelationship {
21
+ variableId: string;
22
+ relationship: "supporting" | "contradicting" | "restricting";
23
+ }
24
+ /** Classification result for a single premise relative to the focused premise. */
25
+ export interface TCorePremiseRelationResult {
26
+ premiseId: string;
27
+ relationship: TCorePremiseRelationshipType;
28
+ variableDetails: TCoreVariableRelationship[];
29
+ transitive: boolean;
30
+ }
31
+ /** Top-level result from `analyzePremiseRelationships`. */
32
+ export interface TCorePremiseRelationshipAnalysis {
33
+ focusedPremiseId: string;
34
+ premises: TCorePremiseRelationResult[];
35
+ }
36
+ //# sourceMappingURL=relationships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/lib/types/relationships.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAA;AAE3D,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,YAAY,CAAA;AAE1D,sFAAsF;AACtF,MAAM,WAAW,uBAAuB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,qBAAqB,CAAA;CAClC;AAED,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,uBAAuB,EAAE,CAAA;CACzC;AAED,yFAAyF;AACzF,MAAM,MAAM,4BAA4B,GAClC,YAAY,GACZ,eAAe,GACf,aAAa,GACb,YAAY,GACZ,WAAW,CAAA;AAEjB,oGAAoG;AACpG,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,YAAY,GAAG,eAAe,GAAG,aAAa,CAAA;CAC/D;AAED,kFAAkF;AAClF,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,4BAA4B,CAAA;IAC1C,eAAe,EAAE,yBAAyB,EAAE,CAAA;IAC5C,UAAU,EAAE,OAAO,CAAA;CACtB;AAED,2DAA2D;AAC3D,MAAM,WAAW,gCAAgC;IAC7C,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,0BAA0B,EAAE,CAAA;CACzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=relationships.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../../src/lib/types/relationships.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export declare const POSITION_MIN = 0;
2
+ export declare const POSITION_MAX: number;
3
+ export declare const POSITION_INITIAL: number;
4
+ export declare function midpoint(a: number, b: number): number;
5
+ //# sourceMappingURL=position.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/position.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,IAAI,CAAA;AAC7B,eAAO,MAAM,YAAY,QAA0B,CAAA;AACnD,eAAO,MAAM,gBAAgB,QAA+B,CAAA;AAE5D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -0,0 +1,7 @@
1
+ export const POSITION_MIN = 0;
2
+ export const POSITION_MAX = Number.MAX_SAFE_INTEGER;
3
+ export const POSITION_INITIAL = Math.floor(POSITION_MAX / 2);
4
+ export function midpoint(a, b) {
5
+ return a + (b - a) / 2;
6
+ }
7
+ //# sourceMappingURL=position.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.js","sourceRoot":"","sources":["../../../src/lib/utils/position.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAA;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,gBAAgB,CAAA;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;AAE5D,MAAM,UAAU,QAAQ,CAAC,CAAS,EAAE,CAAS;IACzC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polintpro/proposit-core",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Core engine for building and manipulating propositional logic arguments.",
5
5
  "license": "MIT",
6
6
  "keywords": [