@stevenvo780/st-lang 2.0.3 → 2.5.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.
Files changed (100) hide show
  1. package/dist/cli/index.js.map +1 -1
  2. package/dist/lexer/tokens.d.ts.map +1 -1
  3. package/dist/parser/parser.d.ts +1 -0
  4. package/dist/parser/parser.d.ts.map +1 -1
  5. package/dist/parser/parser.js +99 -22
  6. package/dist/parser/parser.js.map +1 -1
  7. package/dist/profiles/aristotelian/syllogistic.d.ts.map +1 -1
  8. package/dist/profiles/aristotelian/syllogistic.js +219 -15
  9. package/dist/profiles/aristotelian/syllogistic.js.map +1 -1
  10. package/dist/profiles/arithmetic/index.d.ts +1 -6
  11. package/dist/profiles/arithmetic/index.d.ts.map +1 -1
  12. package/dist/profiles/arithmetic/index.js +142 -65
  13. package/dist/profiles/arithmetic/index.js.map +1 -1
  14. package/dist/profiles/classical/first-order.d.ts +2 -0
  15. package/dist/profiles/classical/first-order.d.ts.map +1 -1
  16. package/dist/profiles/classical/first-order.js +375 -51
  17. package/dist/profiles/classical/first-order.js.map +1 -1
  18. package/dist/profiles/classical/propositional.d.ts +7 -0
  19. package/dist/profiles/classical/propositional.d.ts.map +1 -1
  20. package/dist/profiles/classical/propositional.js +467 -32
  21. package/dist/profiles/classical/propositional.js.map +1 -1
  22. package/dist/profiles/deontic/standard.d.ts.map +1 -1
  23. package/dist/profiles/deontic/standard.js +13 -1
  24. package/dist/profiles/deontic/standard.js.map +1 -1
  25. package/dist/profiles/epistemic/s5.d.ts.map +1 -1
  26. package/dist/profiles/epistemic/s5.js +14 -1
  27. package/dist/profiles/epistemic/s5.js.map +1 -1
  28. package/dist/profiles/intuitionistic/propositional.d.ts.map +1 -1
  29. package/dist/profiles/intuitionistic/propositional.js +98 -13
  30. package/dist/profiles/intuitionistic/propositional.js.map +1 -1
  31. package/dist/profiles/modal/k.d.ts.map +1 -1
  32. package/dist/profiles/modal/k.js +9 -1
  33. package/dist/profiles/modal/k.js.map +1 -1
  34. package/dist/profiles/paraconsistent/belnap.d.ts +2 -1
  35. package/dist/profiles/paraconsistent/belnap.d.ts.map +1 -1
  36. package/dist/profiles/paraconsistent/belnap.js +81 -4
  37. package/dist/profiles/paraconsistent/belnap.js.map +1 -1
  38. package/dist/profiles/probabilistic/basic.d.ts.map +1 -1
  39. package/dist/profiles/probabilistic/basic.js +71 -1
  40. package/dist/profiles/probabilistic/basic.js.map +1 -1
  41. package/dist/profiles/shared/base-profile.d.ts +4 -2
  42. package/dist/profiles/shared/base-profile.d.ts.map +1 -1
  43. package/dist/profiles/shared/base-profile.js +72 -11
  44. package/dist/profiles/shared/base-profile.js.map +1 -1
  45. package/dist/profiles/shared/tableau-engine.d.ts +7 -7
  46. package/dist/profiles/shared/tableau-engine.d.ts.map +1 -1
  47. package/dist/profiles/shared/tableau-engine.js +74 -70
  48. package/dist/profiles/shared/tableau-engine.js.map +1 -1
  49. package/dist/profiles/temporal/ltl.d.ts +1 -0
  50. package/dist/profiles/temporal/ltl.d.ts.map +1 -1
  51. package/dist/profiles/temporal/ltl.js +65 -0
  52. package/dist/profiles/temporal/ltl.js.map +1 -1
  53. package/dist/protocol/handler.d.ts.map +1 -1
  54. package/dist/protocol/handler.js +96 -27
  55. package/dist/protocol/handler.js.map +1 -1
  56. package/dist/runtime/cross-system-compare.d.ts +4 -0
  57. package/dist/runtime/cross-system-compare.d.ts.map +1 -0
  58. package/dist/runtime/cross-system-compare.js +50 -0
  59. package/dist/runtime/cross-system-compare.js.map +1 -0
  60. package/dist/runtime/fallacies.d.ts.map +1 -1
  61. package/dist/runtime/fallacies.js +130 -0
  62. package/dist/runtime/fallacies.js.map +1 -1
  63. package/dist/runtime/format.d.ts +5 -0
  64. package/dist/runtime/format.d.ts.map +1 -1
  65. package/dist/runtime/format.js +54 -6
  66. package/dist/runtime/format.js.map +1 -1
  67. package/dist/runtime/formula-classifier.d.ts +18 -0
  68. package/dist/runtime/formula-classifier.d.ts.map +1 -0
  69. package/dist/runtime/formula-classifier.js +183 -0
  70. package/dist/runtime/formula-classifier.js.map +1 -0
  71. package/dist/runtime/interpreter.d.ts +1 -0
  72. package/dist/runtime/interpreter.d.ts.map +1 -1
  73. package/dist/runtime/interpreter.js +221 -49
  74. package/dist/runtime/interpreter.js.map +1 -1
  75. package/dist/runtime/known-theorems.d.ts +12 -0
  76. package/dist/runtime/known-theorems.d.ts.map +1 -0
  77. package/dist/runtime/known-theorems.js +147 -0
  78. package/dist/runtime/known-theorems.js.map +1 -0
  79. package/dist/tests/arithmetic.test.js +81 -27
  80. package/dist/tests/arithmetic.test.js.map +1 -1
  81. package/dist/tests/core.test.js +2 -2
  82. package/dist/tests/core.test.js.map +1 -1
  83. package/dist/tests/engines.test.js +1 -1
  84. package/dist/tests/engines.test.js.map +1 -1
  85. package/dist/tests/examples.test.js +1 -7
  86. package/dist/tests/examples.test.js.map +1 -1
  87. package/dist/tests/exhaustive-matrix.test.js +2 -2
  88. package/dist/tests/philosophy.test.js +2 -0
  89. package/dist/tests/philosophy.test.js.map +1 -1
  90. package/dist/tests/profiles.test.js +111 -0
  91. package/dist/tests/profiles.test.js.map +1 -1
  92. package/dist/tests/stress-exhaustive.test.d.ts +2 -0
  93. package/dist/tests/stress-exhaustive.test.d.ts.map +1 -0
  94. package/dist/tests/stress-exhaustive.test.js +1448 -0
  95. package/dist/tests/stress-exhaustive.test.js.map +1 -0
  96. package/dist/tests/v1-features.test.js +10 -4
  97. package/dist/tests/v1-features.test.js.map +1 -1
  98. package/dist/types/index.d.ts +29 -0
  99. package/dist/types/index.d.ts.map +1 -1
  100. package/package.json +2 -2
@@ -0,0 +1,1448 @@
1
+ "use strict";
2
+ // ============================================================
3
+ // ST Stress Tests — Exhaustive edge-case coverage
4
+ // Every profile, every operator, every runtime feature, every edge case
5
+ // ============================================================
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const vitest_1 = require("vitest");
8
+ const interpreter_1 = require("../runtime/interpreter");
9
+ /** Helper: ejecuta código ST y retorna resultado */
10
+ function run(source, file = '<test>') {
11
+ const interp = new interpreter_1.Interpreter();
12
+ return interp.execute(source, file);
13
+ }
14
+ /** Helper: ejecuta y espera éxito (exitCode 0, sin errores) */
15
+ function runOk(source) {
16
+ const out = run(source);
17
+ if (out.exitCode !== 0) {
18
+ const errs = out.diagnostics
19
+ .filter((d) => d.severity === 'error')
20
+ .map((d) => `L${d.line}: ${d.message}`)
21
+ .join('\n');
22
+ throw new Error(`exitCode=${out.exitCode}\n${errs}\nstdout:\n${out.stdout}`);
23
+ }
24
+ return out;
25
+ }
26
+ /** Helper: ejecuta y espera que contenga texto */
27
+ function expectOutput(source, ...markers) {
28
+ const out = runOk(source);
29
+ for (const m of markers) {
30
+ (0, vitest_1.expect)(out.stdout).toContain(m);
31
+ }
32
+ return out;
33
+ }
34
+ /** Helper: ejecuta y espera error (diagnostics con severity error) */
35
+ function expectError(source) {
36
+ const out = run(source);
37
+ const errs = out.diagnostics.filter((d) => d.severity === 'error');
38
+ (0, vitest_1.expect)(errs.length).toBeGreaterThan(0);
39
+ return out;
40
+ }
41
+ // ============================================================
42
+ // 1. CLASSICAL PROPOSITIONAL — Exhaustive
43
+ // ============================================================
44
+ (0, vitest_1.describe)('Classical Propositional — Exhaustive', () => {
45
+ // 1.1 Tautologías fundamentales
46
+ const tautologies = [
47
+ ['LEM', 'P | !P'],
48
+ ['Double Negation Elim', '!!P -> P'],
49
+ ['Double Negation Intro', 'P -> !!P'],
50
+ ['Identity', 'P -> P'],
51
+ ['Explosion', '(P & !P) -> Q'],
52
+ ['Modus Ponens pattern', '((P -> Q) & P) -> Q'],
53
+ ['Modus Tollens pattern', '((P -> Q) & !Q) -> !P'],
54
+ ['Hypothetical Syllogism', '((P -> Q) & (Q -> R)) -> (P -> R)'],
55
+ ['Disjunctive Syllogism', '((P | Q) & !P) -> Q'],
56
+ ['Constructive Dilemma', '((P -> Q) & (R -> S) & (P | R)) -> (Q | S)'],
57
+ ['Contraposition', '(P -> Q) <-> (!Q -> !P)'],
58
+ ['De Morgan AND', '!(P & Q) <-> (!P | !Q)'],
59
+ ['De Morgan OR', '!(P | Q) <-> (!P & !Q)'],
60
+ ['Distribution AND over OR', '(P & (Q | R)) <-> ((P & Q) | (P & R))'],
61
+ ['Distribution OR over AND', '(P | (Q & R)) <-> ((P | Q) & (P | R))'],
62
+ ['Absorption AND', '(P & (P | Q)) <-> P'],
63
+ ['Absorption OR', '(P | (P & Q)) <-> P'],
64
+ ['Idempotence AND', '(P & P) <-> P'],
65
+ ['Idempotence OR', '(P | P) <-> P'],
66
+ ['Biconditional reflexivity', 'P <-> P'],
67
+ ['Biconditional symmetry (material)', '(P <-> Q) -> (Q <-> P)'],
68
+ ['Pierce law', '((P -> Q) -> P) -> P'],
69
+ ['Currying', '((P & Q) -> R) <-> (P -> (Q -> R))'],
70
+ ['Exportation', '((P & Q) -> R) -> (P -> (Q -> R))'],
71
+ ['Importation', '(P -> (Q -> R)) -> ((P & Q) -> R)'],
72
+ ['Negation intro pattern', '((P -> Q) & (P -> !Q)) -> !P'],
73
+ ['Triple negation', '!!!P <-> !P'],
74
+ ['Material impl definition', '(P -> Q) <-> (!P | Q)'],
75
+ ];
76
+ for (const [name, formula] of tautologies) {
77
+ (0, vitest_1.it)(`tautology: ${name}`, () => {
78
+ expectOutput(`logic classical.propositional\ncheck valid ${formula}`);
79
+ });
80
+ }
81
+ // 1.2 Contingencias (satisfacibles pero no válidas)
82
+ const contingencies = [
83
+ ['Simple atom', 'P'],
84
+ ['Simple conjunction', 'P & Q'],
85
+ ['Simple disjunction', 'P | Q'],
86
+ ['Simple implication', 'P -> Q'],
87
+ ['Simple biconditional', 'P <-> Q'],
88
+ ['Mixed', '(P -> Q) & P'],
89
+ ['Three vars', '(P & Q) | R'],
90
+ ];
91
+ for (const [name, formula] of contingencies) {
92
+ (0, vitest_1.it)(`contingency: ${name} (satisfiable, not valid)`, () => {
93
+ const out1 = runOk(`logic classical.propositional\ncheck satisfiable ${formula}`);
94
+ (0, vitest_1.expect)(out1.stdout).toBeDefined();
95
+ // Should NOT be valid
96
+ const out2 = run(`logic classical.propositional\ncheck valid ${formula}`);
97
+ (0, vitest_1.expect)(out2.stdout.toUpperCase()).not.toContain('TAUTOLOG');
98
+ });
99
+ }
100
+ // 1.3 Contradicciones (insatisfacibles)
101
+ const contradictions = [
102
+ ['Basic', 'P & !P'],
103
+ ['Two var', '(P & !P) & Q'],
104
+ ['Implication contradiction', '(P -> Q) & (P -> !Q) & P'],
105
+ ['Complex', '((P | Q) & !P & !Q)'],
106
+ ];
107
+ for (const [name, formula] of contradictions) {
108
+ (0, vitest_1.it)(`contradiction: ${name}`, () => {
109
+ const out = runOk(`logic classical.propositional\ncheck satisfiable ${formula}`);
110
+ // Debería ser insatisfacible
111
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).toMatch(/insatisfacible|unsatisfiable|no es satisfacible/i);
112
+ });
113
+ }
114
+ // 1.4 NAND, NOR, XOR operators
115
+ (0, vitest_1.describe)('Extended operators', () => {
116
+ (0, vitest_1.it)('NAND truth table matches !(P & Q)', () => {
117
+ runOk(`logic classical.propositional\ncheck equivalent (P !& Q), (!(P & Q))`);
118
+ });
119
+ (0, vitest_1.it)('NOR truth table matches !(P | Q)', () => {
120
+ runOk(`logic classical.propositional\ncheck equivalent (P !| Q), (!(P | Q))`);
121
+ });
122
+ (0, vitest_1.it)('XOR definition', () => {
123
+ runOk(`logic classical.propositional\ncheck equivalent (P ^ Q), ((P | Q) & !(P & Q))`);
124
+ });
125
+ (0, vitest_1.it)('NAND is satisfiable', () => {
126
+ runOk(`logic classical.propositional\ncheck satisfiable (P !& Q)`);
127
+ });
128
+ (0, vitest_1.it)('NOR is satisfiable', () => {
129
+ runOk(`logic classical.propositional\ncheck satisfiable (P !| Q)`);
130
+ });
131
+ (0, vitest_1.it)('XOR is satisfiable', () => {
132
+ runOk(`logic classical.propositional\ncheck satisfiable (P ^ Q)`);
133
+ });
134
+ (0, vitest_1.it)('nested NAND/NOR/XOR', () => {
135
+ runOk(`logic classical.propositional\ncheck satisfiable ((P !& Q) | (R !| S) & (A ^ B))`);
136
+ });
137
+ });
138
+ // 1.5 Derivation rules
139
+ (0, vitest_1.describe)('Derivation — all rules', () => {
140
+ (0, vitest_1.it)('Modus Ponens', () => {
141
+ expectOutput(`
142
+ logic classical.propositional
143
+ axiom mp1 = P -> Q
144
+ axiom mp2 = P
145
+ derive Q from {mp1, mp2}
146
+ `, '✓ [derive]');
147
+ });
148
+ (0, vitest_1.it)('Modus Tollens', () => {
149
+ expectOutput(`
150
+ logic classical.propositional
151
+ axiom mt1 = P -> Q
152
+ axiom mt2 = !Q
153
+ derive !P from {mt1, mt2}
154
+ `, '✓ [derive]');
155
+ });
156
+ (0, vitest_1.it)('Hypothetical Syllogism', () => {
157
+ expectOutput(`
158
+ logic classical.propositional
159
+ axiom hs1 = P -> Q
160
+ axiom hs2 = Q -> R
161
+ derive P -> R from {hs1, hs2}
162
+ `, '✓ [derive]');
163
+ });
164
+ (0, vitest_1.it)('Disjunctive Syllogism', () => {
165
+ expectOutput(`
166
+ logic classical.propositional
167
+ axiom ds1 = P | Q
168
+ axiom ds2 = !P
169
+ derive Q from {ds1, ds2}
170
+ `, '✓ [derive]');
171
+ });
172
+ (0, vitest_1.it)('Conjunction Introduction', () => {
173
+ expectOutput(`
174
+ logic classical.propositional
175
+ axiom ci1 = P
176
+ axiom ci2 = Q
177
+ derive P & Q from {ci1, ci2}
178
+ `, '✓ [derive]');
179
+ });
180
+ (0, vitest_1.it)('Conjunction Elimination left', () => {
181
+ expectOutput(`
182
+ logic classical.propositional
183
+ axiom ce1 = P & Q
184
+ derive P from {ce1}
185
+ `, '✓ [derive]');
186
+ });
187
+ (0, vitest_1.it)('Conjunction Elimination right', () => {
188
+ expectOutput(`
189
+ logic classical.propositional
190
+ axiom ce2 = P & Q
191
+ derive Q from {ce2}
192
+ `, '✓ [derive]');
193
+ });
194
+ (0, vitest_1.it)('Disjunction Introduction', () => {
195
+ expectOutput(`
196
+ logic classical.propositional
197
+ axiom di1 = P
198
+ derive P | Q from {di1}
199
+ `, '✓ [derive]');
200
+ });
201
+ (0, vitest_1.it)('Double Negation Elimination', () => {
202
+ expectOutput(`
203
+ logic classical.propositional
204
+ axiom dn1 = !!P
205
+ derive P from {dn1}
206
+ `, '✓ [derive]');
207
+ });
208
+ (0, vitest_1.it)('Biconditional Elimination', () => {
209
+ expectOutput(`
210
+ logic classical.propositional
211
+ axiom be1 = P <-> Q
212
+ axiom be2 = P
213
+ derive Q from {be1, be2}
214
+ `, '✓ [derive]');
215
+ });
216
+ (0, vitest_1.it)('Chain of 4 implications', () => {
217
+ expectOutput(`
218
+ logic classical.propositional
219
+ axiom c1 = A -> B
220
+ axiom c2 = B -> C
221
+ axiom c3 = C -> D
222
+ axiom c4 = A
223
+ derive D from {c1, c2, c3, c4}
224
+ `, '✓ [derive]');
225
+ });
226
+ (0, vitest_1.it)('Invalid derivation does not succeed', () => {
227
+ const out = runOk(`
228
+ logic classical.propositional
229
+ axiom inv1 = P -> Q
230
+ axiom inv2 = Q
231
+ derive P from {inv1, inv2}
232
+ `);
233
+ (0, vitest_1.expect)(out.stdout).toContain('✗');
234
+ });
235
+ });
236
+ // 1.6 Truth tables
237
+ (0, vitest_1.describe)('Truth tables', () => {
238
+ (0, vitest_1.it)('1 variable: P -> P', () => {
239
+ const out = runOk(`logic classical.propositional\ntruth_table P -> P`);
240
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).toMatch(/tautolog|verdader|tabla/i);
241
+ });
242
+ (0, vitest_1.it)('2 variables: P & Q', () => {
243
+ const out = expectOutput(`logic classical.propositional\ntruth_table P & Q`);
244
+ // Should have 4 rows
245
+ (0, vitest_1.expect)(out.stdout).toContain('P');
246
+ (0, vitest_1.expect)(out.stdout).toContain('Q');
247
+ });
248
+ (0, vitest_1.it)('3 variables: (P & Q) | R', () => {
249
+ runOk(`logic classical.propositional\ntruth_table (P & Q) | R`);
250
+ });
251
+ (0, vitest_1.it)('4 variables', () => {
252
+ runOk(`logic classical.propositional\ntruth_table (A -> B) & (C -> D)`);
253
+ });
254
+ });
255
+ // 1.7 Countermodel
256
+ (0, vitest_1.describe)('Countermodel', () => {
257
+ (0, vitest_1.it)('finds countermodel for non-tautology', () => {
258
+ expectOutput(`logic classical.propositional\ncountermodel P -> Q`);
259
+ });
260
+ (0, vitest_1.it)('no countermodel for tautology', () => {
261
+ const out = runOk(`logic classical.propositional\ncountermodel P | !P`);
262
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).toMatch(/no se encontr|tautolog|no countermodel/i);
263
+ });
264
+ });
265
+ // 1.8 Equivalence checking
266
+ (0, vitest_1.describe)('Equivalence', () => {
267
+ (0, vitest_1.it)('De Morgan equivalences', () => {
268
+ runOk(`logic classical.propositional\ncheck equivalent !(P & Q), (!P | !Q)`);
269
+ runOk(`logic classical.propositional\ncheck equivalent !(P | Q), (!P & !Q)`);
270
+ });
271
+ (0, vitest_1.it)('Material implication', () => {
272
+ runOk(`logic classical.propositional\ncheck equivalent (P -> Q), (!P | Q)`);
273
+ });
274
+ (0, vitest_1.it)('Non-equivalent formulas', () => {
275
+ const out = runOk(`logic classical.propositional\ncheck equivalent P, Q`);
276
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).toMatch(/no son equivalentes|not equivalent|no equivalen/i);
277
+ });
278
+ });
279
+ // 1.9 Prove command
280
+ (0, vitest_1.describe)('Prove', () => {
281
+ (0, vitest_1.it)('proves tautology', () => {
282
+ expectOutput(`
283
+ logic classical.propositional
284
+ axiom a1 = P -> Q
285
+ axiom a2 = P
286
+ theorem t1 = Q
287
+ prove Q from {a1, a2}
288
+ `, '✓');
289
+ });
290
+ (0, vitest_1.it)('fails to prove non-theorem', () => {
291
+ const out = runOk(`
292
+ logic classical.propositional
293
+ axiom a1 = P -> Q
294
+ axiom a2 = Q
295
+ theorem t1 = P
296
+ prove P from {a1, a2}
297
+ `);
298
+ (0, vitest_1.expect)(out.stdout).toContain('✗');
299
+ });
300
+ });
301
+ });
302
+ // ============================================================
303
+ // 2. CLASSICAL FIRST ORDER — Exhaustive
304
+ // ============================================================
305
+ (0, vitest_1.describe)('Classical First Order — Exhaustive', () => {
306
+ (0, vitest_1.it)('universal instantiation: forall x P(x) -> P(a)', () => {
307
+ expectOutput(`logic classical.first_order\ncheck valid (forall x P(x)) -> P(a)`);
308
+ });
309
+ (0, vitest_1.it)('existential generalization: P(a) -> exists x P(x)', () => {
310
+ expectOutput(`logic classical.first_order\ncheck valid P(a) -> (exists x P(x))`);
311
+ });
312
+ (0, vitest_1.it)('vacuous universal: forall x P -> P (no x free in P)', () => {
313
+ runOk(`logic classical.first_order\ncheck valid (forall x (P -> P))`);
314
+ });
315
+ (0, vitest_1.it)('nested quantifiers: forall x exists y R(x,y)', () => {
316
+ runOk(`logic classical.first_order\nlet f = forall x (exists y R(x, y))\nprint f`);
317
+ });
318
+ (0, vitest_1.it)('quantifier duality: !forall x P(x) <-> exists x !P(x)', () => {
319
+ runOk(`logic classical.first_order\ncheck valid !(forall x P(x)) <-> (exists x !P(x))`);
320
+ });
321
+ (0, vitest_1.it)('equality reflexivity: forall x (x = x)', () => {
322
+ runOk(`logic classical.first_order\ncheck valid forall x (x = x)`);
323
+ });
324
+ (0, vitest_1.it)('complex: forall x (P(x) -> Q(x)) & P(a) -> Q(a)', () => {
325
+ expectOutput(`logic classical.first_order\ncheck valid ((forall x (P(x) -> Q(x))) & P(a)) -> Q(a)`);
326
+ });
327
+ (0, vitest_1.it)('invalid: exists x P(x) -> forall x P(x)', () => {
328
+ const out = runOk(`logic classical.first_order\ncheck valid (exists x P(x)) -> (forall x P(x))`);
329
+ // This is NOT valid in FOL
330
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).not.toContain('valida en fol');
331
+ });
332
+ (0, vitest_1.it)('satisfiability of pure existential', () => {
333
+ runOk(`logic classical.first_order\ncheck satisfiable exists x P(x)`);
334
+ });
335
+ (0, vitest_1.it)('derivation in FOL', () => {
336
+ expectOutput(`
337
+ logic classical.first_order
338
+ axiom all_mortal = forall x (H(x) -> M(x))
339
+ axiom socrates = H(s)
340
+ derive M(s) from {all_mortal, socrates}
341
+ `, '✓');
342
+ });
343
+ });
344
+ // ============================================================
345
+ // 3. MODAL K — Exhaustive
346
+ // ============================================================
347
+ (0, vitest_1.describe)('Modal K — Exhaustive', () => {
348
+ (0, vitest_1.it)('K axiom: [](P -> Q) -> ([]P -> []Q)', () => {
349
+ expectOutput(`logic modal.k\ncheck valid [](P -> Q) -> ([]P -> []Q)`, 'VÁLIDA');
350
+ });
351
+ (0, vitest_1.it)('necessitation: valid prop -> []valid prop (schema)', () => {
352
+ // [](P -> P) should be valid
353
+ expectOutput(`logic modal.k\ncheck valid [](P -> P)`, 'VÁLIDA');
354
+ });
355
+ (0, vitest_1.it)('T axiom NOT valid in K: []P -> P', () => {
356
+ const out = runOk(`logic modal.k\ncheck valid []P -> P`);
357
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
358
+ });
359
+ (0, vitest_1.it)('4 axiom NOT valid in K: []P -> [][]P', () => {
360
+ const out = runOk(`logic modal.k\ncheck valid []P -> [][]P`);
361
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
362
+ });
363
+ (0, vitest_1.it)('5 axiom NOT valid in K: <>P -> []<>P', () => {
364
+ const out = runOk(`logic modal.k\ncheck valid <>P -> []<>P`);
365
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
366
+ });
367
+ (0, vitest_1.it)('B axiom NOT valid in K: P -> []<>P', () => {
368
+ const out = runOk(`logic modal.k\ncheck valid P -> []<>P`);
369
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
370
+ });
371
+ (0, vitest_1.it)('modal duality: []P <-> !<>!P', () => {
372
+ expectOutput(`logic modal.k\ncheck valid []P <-> !<>!P`, 'VÁLIDA');
373
+ });
374
+ (0, vitest_1.it)('diamond duality: <>P <-> ![]!P', () => {
375
+ expectOutput(`logic modal.k\ncheck valid <>P <-> ![]!P`, 'VÁLIDA');
376
+ });
377
+ (0, vitest_1.it)('nested modalities: [][]P should be parseable', () => {
378
+ runOk(`logic modal.k\nlet f = [][]P\nprint f`);
379
+ });
380
+ (0, vitest_1.it)('mixed modal and propositional', () => {
381
+ runOk(`logic modal.k\ncheck satisfiable ([]P & <>Q)`);
382
+ });
383
+ (0, vitest_1.it)('satisfiability: <>P is satisfiable', () => {
384
+ runOk(`logic modal.k\ncheck satisfiable <>P`);
385
+ });
386
+ (0, vitest_1.it)('satisfiability: []P & !P is satisfiable in K (no reflexivity)', () => {
387
+ runOk(`logic modal.k\ncheck satisfiable ([]P & !P)`);
388
+ });
389
+ });
390
+ // ============================================================
391
+ // 4. DEONTIC STANDARD — Exhaustive
392
+ // ============================================================
393
+ (0, vitest_1.describe)('Deontic Standard — Exhaustive', () => {
394
+ (0, vitest_1.it)('D axiom: O(P) -> P(P) (obligation implies permission)', () => {
395
+ expectOutput(`logic deontic.standard\ncheck valid [](P) -> <>(P)`, 'VÁLIDA');
396
+ });
397
+ (0, vitest_1.it)('K axiom holds: [](P->Q) -> ([]P -> []Q)', () => {
398
+ expectOutput(`logic deontic.standard\ncheck valid [](P -> Q) -> ([]P -> []Q)`, 'VÁLIDA');
399
+ });
400
+ (0, vitest_1.it)('T axiom NOT valid: O(P) -> P', () => {
401
+ const out = runOk(`logic deontic.standard\ncheck valid []P -> P`);
402
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
403
+ });
404
+ (0, vitest_1.it)('obligation-permission consistency', () => {
405
+ runOk(`logic deontic.standard\ncheck satisfiable ([]P & <>(Q))`);
406
+ });
407
+ (0, vitest_1.it)('forbidden = obligatory not: [](! P)', () => {
408
+ runOk(`logic deontic.standard\nlet forbidden = [](!P)\nprint forbidden`);
409
+ });
410
+ (0, vitest_1.it)('deontic conflict satisfiable: O(P) & O(!P)', () => {
411
+ // In KD this should be unsatisfiable (by D axiom leads to P(P) & P(!P) which is fine,
412
+ // but O(P) & O(!P) -> P(P) & P(!P) -> P(P & !P)? Actually in KD it might be sat)
413
+ runOk(`logic deontic.standard\ncheck satisfiable ([]P & [](!P))`);
414
+ });
415
+ });
416
+ // ============================================================
417
+ // 5. EPISTEMIC S5 — Exhaustive
418
+ // ============================================================
419
+ (0, vitest_1.describe)('Epistemic S5 — Exhaustive', () => {
420
+ (0, vitest_1.it)('T axiom (veridicality): K(P) -> P', () => {
421
+ expectOutput(`logic epistemic.s5\ncheck valid []P -> P`, 'VÁLIDA');
422
+ });
423
+ (0, vitest_1.it)('4 axiom (positive introspection): K(P) -> K(K(P))', () => {
424
+ expectOutput(`logic epistemic.s5\ncheck valid []P -> [][]P`, 'VÁLIDA');
425
+ });
426
+ (0, vitest_1.it)('B axiom (negative introspection dual): P -> []<>P', () => {
427
+ expectOutput(`logic epistemic.s5\ncheck valid P -> []<>P`, 'VÁLIDA');
428
+ });
429
+ (0, vitest_1.it)('5 axiom: <>P -> []<>P', () => {
430
+ expectOutput(`logic epistemic.s5\ncheck valid <>P -> []<>P`, 'VÁLIDA');
431
+ });
432
+ (0, vitest_1.it)('knowledge is factive: K(P & Q) -> P', () => {
433
+ expectOutput(`logic epistemic.s5\ncheck valid [](P & Q) -> P`, 'VÁLIDA');
434
+ });
435
+ (0, vitest_1.it)('K distributes: K(P -> Q) -> (K(P) -> K(Q))', () => {
436
+ expectOutput(`logic epistemic.s5\ncheck valid [](P -> Q) -> ([]P -> []Q)`, 'VÁLIDA');
437
+ });
438
+ (0, vitest_1.it)('unknown is possible: !K(P) -> <>(!P)', () => {
439
+ runOk(`logic epistemic.s5\ncheck valid (![]P) -> <>(!P)`);
440
+ });
441
+ });
442
+ // ============================================================
443
+ // 6. INTUITIONISTIC — Exhaustive
444
+ // ============================================================
445
+ (0, vitest_1.describe)('Intuitionistic Propositional — Exhaustive', () => {
446
+ // Valid intuitionistically
447
+ const intuValid = [
448
+ ['P -> !!P', 'double negation introduction'],
449
+ ['(P -> Q) -> (!Q -> !P)', 'contraposition'],
450
+ ['!P -> (P -> Q)', 'ex falso quodlibet'],
451
+ ['(P & !P) -> Q', 'explosion'],
452
+ ['P -> P', 'identity'],
453
+ ['(P -> (Q -> R)) -> ((P -> Q) -> (P -> R))', 'S combinator'],
454
+ ['(P & Q) -> P', 'conjunction elimination left'],
455
+ ['(P & Q) -> Q', 'conjunction elimination right'],
456
+ ['P -> (P | Q)', 'disjunction introduction left'],
457
+ ['Q -> (P | Q)', 'disjunction introduction right'],
458
+ ['(P -> R) -> ((Q -> R) -> ((P | Q) -> R))', 'disjunction elimination'],
459
+ ['!!!(P) -> !(P)', 'triple negation to single'],
460
+ ['!(P) -> !!!(P)', 'single negation to triple'],
461
+ ];
462
+ for (const [formula, name] of intuValid) {
463
+ (0, vitest_1.it)(`valid: ${name}`, () => {
464
+ runOk(`logic intuitionistic.propositional\ncheck valid ${formula}`);
465
+ });
466
+ }
467
+ // NOT valid intuitionistically (classical tautologies that fail)
468
+ const intuInvalid = [
469
+ ['P | !P', 'LEM (excluded middle)'],
470
+ ['!!P -> P', 'double negation elimination'],
471
+ ['((P -> Q) -> P) -> P', 'Peirce law'],
472
+ ['(!P -> !Q) -> (Q -> P)', 'contraposition converse'],
473
+ ];
474
+ for (const [formula, name] of intuInvalid) {
475
+ (0, vitest_1.it)(`NOT valid intuitionistically: ${name}`, () => {
476
+ const out = runOk(`logic intuitionistic.propositional\ncheck valid ${formula}`);
477
+ // Should be rejected or not valid
478
+ const lower = out.stdout.toLowerCase();
479
+ (0, vitest_1.expect)(lower).toMatch(/rechazada|no es válida|no válida|invalid|refutada|contraejemplo|not valid/i);
480
+ });
481
+ }
482
+ (0, vitest_1.it)('satisfiability check works', () => {
483
+ runOk(`logic intuitionistic.propositional\ncheck satisfiable P`);
484
+ });
485
+ });
486
+ // ============================================================
487
+ // 7. TEMPORAL LTL — Exhaustive
488
+ // ============================================================
489
+ (0, vitest_1.describe)('Temporal LTL — Exhaustive', () => {
490
+ (0, vitest_1.it)('G(P) -> F(P): always implies eventually', () => {
491
+ expectOutput(`logic temporal.ltl\ncheck valid [](P) -> <>(P)`, 'VÁLIDA');
492
+ });
493
+ (0, vitest_1.it)('G(P) -> P: always implies now (reflexivity)', () => {
494
+ expectOutput(`logic temporal.ltl\ncheck valid [](P) -> P`, 'VÁLIDA');
495
+ });
496
+ (0, vitest_1.it)('G(P) -> G(G(P)): transitivity (S4)', () => {
497
+ expectOutput(`logic temporal.ltl\ncheck valid []P -> [][]P`, 'VÁLIDA');
498
+ });
499
+ (0, vitest_1.it)('F duality: F(P) <-> !G(!P)', () => {
500
+ expectOutput(`logic temporal.ltl\ncheck valid <>(P) <-> !([](!P))`, 'VÁLIDA');
501
+ });
502
+ (0, vitest_1.it)('next operator: X(P) parseable', () => {
503
+ runOk(`logic temporal.ltl\nlet f = next P\nprint f`);
504
+ });
505
+ (0, vitest_1.it)('until operator: P until Q parseable', () => {
506
+ runOk(`logic temporal.ltl\nlet f = P until Q\nprint f`);
507
+ });
508
+ (0, vitest_1.it)('satisfiability of diamond', () => {
509
+ runOk(`logic temporal.ltl\ncheck satisfiable <>(P)`);
510
+ });
511
+ (0, vitest_1.it)('5 axiom NOT valid in S4 (temporal): <>P -> []<>P', () => {
512
+ const out = runOk(`logic temporal.ltl\ncheck valid <>P -> []<>P`);
513
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
514
+ });
515
+ });
516
+ // ============================================================
517
+ // 8. ARISTOTELIAN SYLLOGISTIC — Exhaustive
518
+ // ============================================================
519
+ (0, vitest_1.describe)('Aristotelian Syllogistic — Exhaustive', () => {
520
+ // All 19 valid syllogisms
521
+ const validSyllogisms = [
522
+ // Figure 1: M-P, S-M ⊢ S-P
523
+ [
524
+ 'Barbara (AAA-1)',
525
+ '(forall x (M(x) -> P(x))) & (forall x (S(x) -> M(x))) -> (forall x (S(x) -> P(x)))',
526
+ ],
527
+ [
528
+ 'Celarent (EAE-1)',
529
+ '(forall x (M(x) -> !P(x))) & (forall x (S(x) -> M(x))) -> (forall x (S(x) -> !P(x)))',
530
+ ],
531
+ [
532
+ 'Darii (AII-1)',
533
+ '(forall x (M(x) -> P(x))) & (exists x (S(x) & M(x))) -> (exists x (S(x) & P(x)))',
534
+ ],
535
+ [
536
+ 'Ferio (EIO-1)',
537
+ '(forall x (M(x) -> !P(x))) & (exists x (S(x) & M(x))) -> (exists x (S(x) & !P(x)))',
538
+ ],
539
+ // Figure 2: P-M, S-M ⊢ S-P
540
+ [
541
+ 'Cesare (EAE-2)',
542
+ '(forall x (P(x) -> !M(x))) & (forall x (S(x) -> M(x))) -> (forall x (S(x) -> !P(x)))',
543
+ ],
544
+ [
545
+ 'Camestres (AEE-2)',
546
+ '(forall x (P(x) -> M(x))) & (forall x (S(x) -> !M(x))) -> (forall x (S(x) -> !P(x)))',
547
+ ],
548
+ [
549
+ 'Festino (EIO-2)',
550
+ '(forall x (P(x) -> !M(x))) & (exists x (S(x) & M(x))) -> (exists x (S(x) & !P(x)))',
551
+ ],
552
+ [
553
+ 'Baroco (AOO-2)',
554
+ '(forall x (P(x) -> M(x))) & (exists x (S(x) & !M(x))) -> (exists x (S(x) & !P(x)))',
555
+ ],
556
+ // Figure 3: M-P, M-S ⊢ S-P
557
+ [
558
+ 'Darapti (AAI-3)',
559
+ '(forall x (M(x) -> P(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & P(x)))',
560
+ ],
561
+ [
562
+ 'Disamis (IAI-3)',
563
+ '(exists x (M(x) & P(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & P(x)))',
564
+ ],
565
+ [
566
+ 'Datisi (AII-3)',
567
+ '(forall x (M(x) -> P(x))) & (exists x (M(x) & S(x))) -> (exists x (S(x) & P(x)))',
568
+ ],
569
+ [
570
+ 'Felapton (EAO-3)',
571
+ '(forall x (M(x) -> !P(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & !P(x)))',
572
+ ],
573
+ [
574
+ 'Bocardo (OAO-3)',
575
+ '(exists x (M(x) & !P(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & !P(x)))',
576
+ ],
577
+ [
578
+ 'Ferison (EIO-3)',
579
+ '(forall x (M(x) -> !P(x))) & (exists x (M(x) & S(x))) -> (exists x (S(x) & !P(x)))',
580
+ ],
581
+ // Figure 4: P-M, M-S ⊢ S-P
582
+ [
583
+ 'Bramantip (AAI-4)',
584
+ '(forall x (P(x) -> M(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & P(x)))',
585
+ ],
586
+ [
587
+ 'Camenes (AEE-4)',
588
+ '(forall x (P(x) -> M(x))) & (forall x (M(x) -> !S(x))) -> (forall x (S(x) -> !P(x)))',
589
+ ],
590
+ [
591
+ 'Dimaris (IAI-4)',
592
+ '(exists x (P(x) & M(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & P(x)))',
593
+ ],
594
+ [
595
+ 'Fesapo (EAO-4)',
596
+ '(forall x (P(x) -> !M(x))) & (forall x (M(x) -> S(x))) -> (exists x (S(x) & !P(x)))',
597
+ ],
598
+ [
599
+ 'Fresison (EIO-4)',
600
+ '(forall x (P(x) -> !M(x))) & (exists x (M(x) & S(x))) -> (exists x (S(x) & !P(x)))',
601
+ ],
602
+ ];
603
+ for (const [name, formula] of validSyllogisms) {
604
+ (0, vitest_1.it)(`valid: ${name}`, () => {
605
+ runOk(`logic aristotelian.syllogistic\ncheck valid ${formula}`);
606
+ });
607
+ }
608
+ // Invalid syllogisms
609
+ const invalidSyllogisms = [
610
+ [
611
+ 'Affirming consequent',
612
+ '(forall x (M(x) -> P(x))) & (forall x (S(x) -> P(x))) -> (forall x (S(x) -> M(x)))',
613
+ ],
614
+ [
615
+ 'Undistributed middle',
616
+ '(exists x (M(x) & P(x))) & (exists x (S(x) & M(x))) -> (exists x (S(x) & P(x)))',
617
+ ],
618
+ ];
619
+ for (const [name, formula] of invalidSyllogisms) {
620
+ (0, vitest_1.it)(`invalid: ${name}`, () => {
621
+ const out = runOk(`logic aristotelian.syllogistic\ncheck valid ${formula}`);
622
+ const lower = out.stdout.toLowerCase();
623
+ // Should not be recognized as valid syllogism
624
+ const isMarkedValid = lower.includes('silogismo válido') ||
625
+ lower.includes('barbara') ||
626
+ lower.includes('celarent');
627
+ // If recognized as valid that's wrong, but the engine may just not detect it as a syllogism pattern
628
+ // which is also acceptable - it should at least not crash
629
+ (0, vitest_1.expect)(isMarkedValid).toBe(false);
630
+ });
631
+ }
632
+ });
633
+ // ============================================================
634
+ // 9. PARACONSISTENT BELNAP — Exhaustive
635
+ // ============================================================
636
+ (0, vitest_1.describe)('Paraconsistent Belnap — Exhaustive', () => {
637
+ (0, vitest_1.it)('P & !P is SATISFIABLE (Both value)', () => {
638
+ const out = runOk(`logic paraconsistent.belnap\ncheck satisfiable P & !P`);
639
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).toMatch(/satisfacible|satisfiable/i);
640
+ });
641
+ (0, vitest_1.it)('P | !P is NOT a tautology in Belnap (None value)', () => {
642
+ const out = runOk(`logic paraconsistent.belnap\ncheck valid P | !P`);
643
+ // In Belnap with 4 values, P|!P can fail when P=N(None)
644
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
645
+ });
646
+ (0, vitest_1.it)('P -> P is valid in Belnap', () => {
647
+ const out = runOk(`logic paraconsistent.belnap\ncheck valid P -> P`);
648
+ // In Belnap 4-valued, P->P should be valid (all 4 values give designated)
649
+ (0, vitest_1.expect)(out.stdout.toLowerCase()).toMatch(/válida|valid/i);
650
+ });
651
+ (0, vitest_1.it)('explosion fails in Belnap: (P & !P) -> Q', () => {
652
+ const out = runOk(`logic paraconsistent.belnap\ncheck valid (P & !P) -> Q`);
653
+ // Explosion should NOT be valid in paraconsistent logic
654
+ (0, vitest_1.expect)(out.stdout).not.toContain('VÁLIDA');
655
+ });
656
+ (0, vitest_1.it)('conjunction is satisfiable', () => {
657
+ runOk(`logic paraconsistent.belnap\ncheck satisfiable P & Q`);
658
+ });
659
+ (0, vitest_1.it)('disjunction is satisfiable', () => {
660
+ runOk(`logic paraconsistent.belnap\ncheck satisfiable P | Q`);
661
+ });
662
+ (0, vitest_1.it)('check equivalent works', () => {
663
+ runOk(`logic paraconsistent.belnap\ncheck equivalent P, P`);
664
+ });
665
+ (0, vitest_1.it)('double negation: !!P equivalent to P in Belnap', () => {
666
+ runOk(`logic paraconsistent.belnap\ncheck equivalent !!P, P`);
667
+ });
668
+ (0, vitest_1.it)('satisfiability of complex contradiction', () => {
669
+ runOk(`logic paraconsistent.belnap\ncheck satisfiable (P & !P) & (Q | !Q)`);
670
+ });
671
+ });
672
+ // ============================================================
673
+ // 10. PROBABILISTIC — Exhaustive
674
+ // ============================================================
675
+ (0, vitest_1.describe)('Probabilistic Basic — Exhaustive', () => {
676
+ (0, vitest_1.it)('tautology: P | !P has probability 1', () => {
677
+ expectOutput(`logic probabilistic.basic\ncheck valid P | !P`, 'tautología');
678
+ });
679
+ (0, vitest_1.it)('contradiction: P & !P is not valid', () => {
680
+ const out = runOk(`logic probabilistic.basic\ncheck valid P & !P`);
681
+ (0, vitest_1.expect)(out.stdout).not.toContain('tautología');
682
+ });
683
+ (0, vitest_1.it)('implication tautology: P -> P', () => {
684
+ expectOutput(`logic probabilistic.basic\ncheck valid P -> P`, 'tautología');
685
+ });
686
+ (0, vitest_1.it)('satisfiability of simple atom', () => {
687
+ runOk(`logic probabilistic.basic\ncheck satisfiable P`);
688
+ });
689
+ (0, vitest_1.it)('satisfiability of conjunction', () => {
690
+ runOk(`logic probabilistic.basic\ncheck satisfiable P & Q`);
691
+ });
692
+ (0, vitest_1.it)('3 variables', () => {
693
+ runOk(`logic probabilistic.basic\ncheck valid ((P & Q) -> P)`);
694
+ });
695
+ (0, vitest_1.it)('material implication probabilistic', () => {
696
+ runOk(`logic probabilistic.basic\ncheck valid (P -> P) & (Q -> Q)`);
697
+ });
698
+ });
699
+ // ============================================================
700
+ // 11. ARITHMETIC — Exhaustive
701
+ // ============================================================
702
+ (0, vitest_1.describe)('Arithmetic — Exhaustive', () => {
703
+ (0, vitest_1.it)('addition', () => {
704
+ expectOutput(`logic arithmetic\ncheck valid (2 + 3) >= 5`, 'verdadero');
705
+ });
706
+ (0, vitest_1.it)('subtraction', () => {
707
+ expectOutput(`logic arithmetic\ncheck valid (10 - 3) >= 7`, 'verdadero');
708
+ });
709
+ (0, vitest_1.it)('multiplication', () => {
710
+ expectOutput(`logic arithmetic\ncheck valid (4 * 3) >= 12`, 'verdadero');
711
+ });
712
+ (0, vitest_1.it)('division', () => {
713
+ expectOutput(`logic arithmetic\ncheck valid (10 / 2) >= 5`, 'verdadero');
714
+ });
715
+ (0, vitest_1.it)('modulo', () => {
716
+ expectOutput(`logic arithmetic\ncheck valid (10 % 3) >= 1`, 'verdadero');
717
+ });
718
+ (0, vitest_1.it)('comparison operators', () => {
719
+ runOk(`logic arithmetic\ncheck valid 5 > 3`);
720
+ runOk(`logic arithmetic\ncheck valid 3 < 5`);
721
+ runOk(`logic arithmetic\ncheck valid 5 >= 5`);
722
+ runOk(`logic arithmetic\ncheck valid 5 <= 5`);
723
+ });
724
+ (0, vitest_1.it)('nested arithmetic', () => {
725
+ runOk(`logic arithmetic\ncheck valid ((2 + 3) * 2) >= 10`);
726
+ });
727
+ (0, vitest_1.it)('negative result', () => {
728
+ runOk(`logic arithmetic\ncheck valid (3 - 5) < 0`);
729
+ });
730
+ (0, vitest_1.it)('division by zero does not crash', () => {
731
+ // Should not throw, may return NaN or error gracefully
732
+ const out = run(`logic arithmetic\ncheck valid (5 / 0) >= 0`);
733
+ // Just check it doesn't crash
734
+ (0, vitest_1.expect)(out).toBeDefined();
735
+ });
736
+ (0, vitest_1.it)('complex expression', () => {
737
+ runOk(`logic arithmetic\ncheck valid ((100 / 10) + (3 * 2) - 1) >= 15`);
738
+ });
739
+ (0, vitest_1.it)('zero operations', () => {
740
+ runOk(`logic arithmetic\ncheck valid (0 + 0) >= 0`);
741
+ runOk(`logic arithmetic\ncheck valid (0 * 100) >= 0`);
742
+ });
743
+ (0, vitest_1.it)('let with arithmetic', () => {
744
+ expectOutput(`
745
+ logic arithmetic
746
+ let total = 2 + 3
747
+ print total
748
+ `, '(2 + 3)');
749
+ });
750
+ });
751
+ // ============================================================
752
+ // 12. RUNTIME / INTERPRETER — Edge Cases
753
+ // ============================================================
754
+ (0, vitest_1.describe)('Runtime — Control Flow', () => {
755
+ (0, vitest_1.it)('if valid', () => {
756
+ expectOutput(`
757
+ logic classical.propositional
758
+ if valid (P | !P) {
759
+ print "yes"
760
+ }
761
+ `, 'yes');
762
+ });
763
+ (0, vitest_1.it)('if satisfiable', () => {
764
+ expectOutput(`
765
+ logic classical.propositional
766
+ if satisfiable (P & Q) {
767
+ print "sat"
768
+ }
769
+ `, 'sat');
770
+ });
771
+ (0, vitest_1.it)('if unsatisfiable', () => {
772
+ expectOutput(`
773
+ logic classical.propositional
774
+ if unsatisfiable (P & !P) {
775
+ print "unsat"
776
+ }
777
+ `, 'unsat');
778
+ });
779
+ (0, vitest_1.it)('if invalid', () => {
780
+ expectOutput(`
781
+ logic classical.propositional
782
+ if invalid P {
783
+ print "inv"
784
+ }
785
+ `, 'inv');
786
+ });
787
+ (0, vitest_1.it)('if-else', () => {
788
+ expectOutput(`
789
+ logic classical.propositional
790
+ if valid P {
791
+ print "wrong"
792
+ } else {
793
+ print "correct"
794
+ }
795
+ `, 'correct');
796
+ });
797
+ (0, vitest_1.it)('nested if', () => {
798
+ expectOutput(`
799
+ logic classical.propositional
800
+ if valid (P -> P) {
801
+ if valid (Q -> Q) {
802
+ print "nested"
803
+ }
804
+ }
805
+ `, 'nested');
806
+ });
807
+ (0, vitest_1.it)('for loop over set', () => {
808
+ expectOutput(`
809
+ logic classical.propositional
810
+ for X in {A, B, C} {
811
+ print X
812
+ }
813
+ `, 'A');
814
+ });
815
+ (0, vitest_1.it)('while loop with safety', () => {
816
+ expectOutput(`
817
+ logic classical.propositional
818
+ let counter = 0
819
+ while valid (P -> P) {
820
+ set counter = counter + 1
821
+ if valid (P -> P) {
822
+ print counter
823
+ }
824
+ }
825
+ `, '1');
826
+ });
827
+ (0, vitest_1.it)('for loop iterates all items', () => {
828
+ const out = runOk(`
829
+ logic classical.propositional
830
+ for X in {P, Q, R} {
831
+ print X
832
+ }
833
+ `);
834
+ (0, vitest_1.expect)(out.stdout).toContain('P');
835
+ (0, vitest_1.expect)(out.stdout).toContain('Q');
836
+ (0, vitest_1.expect)(out.stdout).toContain('R');
837
+ });
838
+ });
839
+ (0, vitest_1.describe)('Runtime — Functions', () => {
840
+ (0, vitest_1.it)('basic function declaration and call', () => {
841
+ expectOutput(`
842
+ logic classical.propositional
843
+ fn greet(Name) {
844
+ print Name
845
+ }
846
+ greet(Hello)
847
+ `, 'Hello');
848
+ });
849
+ (0, vitest_1.it)('function with return', () => {
850
+ expectOutput(`
851
+ logic classical.propositional
852
+ fn double(X) {
853
+ return X
854
+ }
855
+ let result = double(P)
856
+ print result
857
+ `, 'P');
858
+ });
859
+ (0, vitest_1.it)('function with multiple params', () => {
860
+ expectOutput(`
861
+ logic classical.propositional
862
+ fn pair(A, B) {
863
+ print A
864
+ print B
865
+ }
866
+ pair(X, Y)
867
+ `, 'X');
868
+ });
869
+ (0, vitest_1.it)('nested function calls', () => {
870
+ runOk(`
871
+ logic classical.propositional
872
+ fn f(X) {
873
+ print X
874
+ }
875
+ fn g(Y) {
876
+ f(Y)
877
+ }
878
+ g(Hello)
879
+ `);
880
+ });
881
+ });
882
+ (0, vitest_1.describe)('Runtime — Theories (OOP)', () => {
883
+ (0, vitest_1.it)('basic theory', () => {
884
+ expectOutput(`
885
+ logic classical.propositional
886
+ theory MyTheory {
887
+ axiom a1 = P -> Q
888
+ theorem t1 = !Q -> !P
889
+ }
890
+ print MyTheory.a1
891
+ `, 'P');
892
+ });
893
+ (0, vitest_1.it)('theory with extends', () => {
894
+ runOk(`
895
+ logic classical.propositional
896
+ theory Base {
897
+ axiom a1 = P -> Q
898
+ }
899
+ theory Child extends Base {
900
+ axiom a2 = Q -> R
901
+ }
902
+ print Child.a1
903
+ `);
904
+ });
905
+ (0, vitest_1.it)('theory with private', () => {
906
+ runOk(`
907
+ logic classical.propositional
908
+ theory Secret {
909
+ private axiom hidden = P -> Q
910
+ axiom visible = Q -> R
911
+ }
912
+ print Secret.visible
913
+ `);
914
+ });
915
+ });
916
+ (0, vitest_1.describe)('Runtime — Proof Blocks', () => {
917
+ (0, vitest_1.it)('prove from axioms', () => {
918
+ runOk(`
919
+ logic classical.propositional
920
+ axiom a1 = P -> Q
921
+ axiom a2 = P
922
+ theorem t1 = Q
923
+ prove Q from {a1, a2}
924
+ `);
925
+ });
926
+ });
927
+ (0, vitest_1.describe)('Runtime — Text Layer', () => {
928
+ (0, vitest_1.it)('passage and formalize', () => {
929
+ runOk(`
930
+ logic classical.propositional
931
+ let p1 = passage([[ If it rains, the ground is wet. ]])
932
+ let f1 = formalize p1 as P -> Q
933
+ `);
934
+ });
935
+ (0, vitest_1.it)('claim and support', () => {
936
+ runOk(`
937
+ logic classical.propositional
938
+ let p1 = passage([[ All humans are mortal. ]])
939
+ let f1 = formalize p1 as P -> Q
940
+ claim c1 = P -> Q
941
+ support c1 <- p1
942
+ `);
943
+ });
944
+ (0, vitest_1.it)('confidence', () => {
945
+ runOk(`
946
+ logic classical.propositional
947
+ let p1 = passage([[ Probably true ]])
948
+ let f1 = formalize p1 as P
949
+ confidence p1 = 0.9
950
+ `);
951
+ });
952
+ (0, vitest_1.it)('context', () => {
953
+ runOk(`
954
+ logic classical.propositional
955
+ context ctx1 = "Philosophy class"
956
+ let p1 = passage([[ Socrates is mortal ]])
957
+ let f1 = formalize p1 as P
958
+ `);
959
+ });
960
+ (0, vitest_1.it)('render command', () => {
961
+ runOk(`
962
+ logic classical.propositional
963
+ let p1 = passage([[ Test passage ]])
964
+ let f1 = formalize p1 as P -> Q
965
+ render f1
966
+ `);
967
+ });
968
+ (0, vitest_1.it)('explain command', () => {
969
+ runOk(`
970
+ logic classical.propositional
971
+ let f = P -> Q
972
+ explain f
973
+ `);
974
+ });
975
+ (0, vitest_1.it)('analyze command', () => {
976
+ runOk(`
977
+ logic classical.propositional
978
+ analyze {P, P -> Q} -> Q
979
+ `);
980
+ });
981
+ });
982
+ (0, vitest_1.describe)('Runtime — Import/Export', () => {
983
+ (0, vitest_1.it)('export declarations', () => {
984
+ // Export wraps a full statement
985
+ runOk(`
986
+ logic classical.propositional
987
+ export axiom a1 = P -> Q
988
+ `);
989
+ });
990
+ });
991
+ (0, vitest_1.describe)('Runtime — Set (reassignment)', () => {
992
+ (0, vitest_1.it)('set variable', () => {
993
+ expectOutput(`
994
+ logic classical.propositional
995
+ let x = P
996
+ set x = Q
997
+ print x
998
+ `, 'Q');
999
+ });
1000
+ });
1001
+ (0, vitest_1.describe)('Runtime — Print variations', () => {
1002
+ (0, vitest_1.it)('print string literal', () => {
1003
+ expectOutput(`
1004
+ logic classical.propositional
1005
+ print "hello world"
1006
+ `, 'hello world');
1007
+ });
1008
+ (0, vitest_1.it)('print formula', () => {
1009
+ expectOutput(`
1010
+ logic classical.propositional
1011
+ let f = P & Q
1012
+ print f
1013
+ `, '∧');
1014
+ });
1015
+ (0, vitest_1.it)('print number (arithmetic)', () => {
1016
+ expectOutput(`
1017
+ logic arithmetic
1018
+ let n = 42
1019
+ print n
1020
+ `, '42');
1021
+ });
1022
+ });
1023
+ // ============================================================
1024
+ // 13. PARSER EDGE CASES
1025
+ // ============================================================
1026
+ (0, vitest_1.describe)('Parser — Edge Cases', () => {
1027
+ (0, vitest_1.it)('empty program does not crash', () => {
1028
+ const out = run('');
1029
+ (0, vitest_1.expect)(out).toBeDefined();
1030
+ });
1031
+ (0, vitest_1.it)('only whitespace', () => {
1032
+ const out = run(' \n\n\n ');
1033
+ (0, vitest_1.expect)(out).toBeDefined();
1034
+ });
1035
+ (0, vitest_1.it)('only comments (// lines)', () => {
1036
+ runOk(`// This is a comment\n// Another comment`);
1037
+ });
1038
+ (0, vitest_1.it)('deeply nested parentheses', () => {
1039
+ runOk(`logic classical.propositional\nlet f = ((((((P))))))\nprint f`);
1040
+ });
1041
+ (0, vitest_1.it)('very long formula name', () => {
1042
+ runOk(`logic classical.propositional\nlet f = VeryLongVariableName -> AnotherLongName\nprint f`);
1043
+ });
1044
+ (0, vitest_1.it)('single letter atoms', () => {
1045
+ runOk(`logic classical.propositional\nlet f = A & B & C & D & E\nprint f`);
1046
+ });
1047
+ (0, vitest_1.it)('mixed operators precedence', () => {
1048
+ runOk(`logic classical.propositional\ncheck valid (P & Q | R) -> (P & Q | R)`);
1049
+ });
1050
+ (0, vitest_1.it)('back arrow in support', () => {
1051
+ runOk(`logic classical.propositional\nlet p1 = passage([[ test ]])\nlet f1 = formalize p1 as P\nclaim c1 = P\nsupport c1 <- p1`);
1052
+ });
1053
+ (0, vitest_1.it)('multiple logic switches', () => {
1054
+ runOk(`
1055
+ logic classical.propositional
1056
+ print "a"
1057
+ logic modal.k
1058
+ print "b"
1059
+ logic arithmetic
1060
+ print "c"
1061
+ logic paraconsistent.belnap
1062
+ print "d"
1063
+ `);
1064
+ });
1065
+ (0, vitest_1.it)('syntax error gives diagnostic', () => {
1066
+ expectError(`logic classical.propositional\nlet = `);
1067
+ });
1068
+ (0, vitest_1.it)('unknown profile gives error', () => {
1069
+ expectError(`logic nonexistent.profile`);
1070
+ });
1071
+ });
1072
+ // ============================================================
1073
+ // 14. SPANISH KEYWORDS (Bilingüe)
1074
+ // ============================================================
1075
+ (0, vitest_1.describe)('Spanish Keywords — Bilingüe', () => {
1076
+ (0, vitest_1.it)('logica, axioma, teorema, derivar, desde', () => {
1077
+ expectOutput(`
1078
+ logica classical.propositional
1079
+ axioma a1 = P -> Q
1080
+ axioma a2 = P
1081
+ derivar Q desde {a1, a2}
1082
+ `, '✓');
1083
+ });
1084
+ (0, vitest_1.it)('verificar, valido', () => {
1085
+ runOk(`logica classical.propositional\nverificar valido P -> P`);
1086
+ });
1087
+ (0, vitest_1.it)('sea (let), imprimir (print)', () => {
1088
+ expectOutput(`
1089
+ logica classical.propositional
1090
+ sea f = P & Q
1091
+ imprimir f
1092
+ `, '∧');
1093
+ });
1094
+ (0, vitest_1.it)('si/sino (if/else)', () => {
1095
+ expectOutput(`
1096
+ logica classical.propositional
1097
+ si valido (P -> P) {
1098
+ imprimir "verdadero"
1099
+ } sino {
1100
+ imprimir "falso"
1101
+ }
1102
+ `, 'verdadero');
1103
+ });
1104
+ (0, vitest_1.it)('para/en (for/in)', () => {
1105
+ expectOutput(`
1106
+ logica classical.propositional
1107
+ para X en {A, B} {
1108
+ imprimir X
1109
+ }
1110
+ `, 'A');
1111
+ });
1112
+ (0, vitest_1.it)('funcion/retornar', () => {
1113
+ runOk(`
1114
+ logica classical.propositional
1115
+ funcion saludar(Nombre) {
1116
+ imprimir Nombre
1117
+ }
1118
+ saludar(Mundo)
1119
+ `);
1120
+ });
1121
+ (0, vitest_1.it)('teoria/extiende/privado', () => {
1122
+ runOk(`
1123
+ logica classical.propositional
1124
+ teoria MiTeoria {
1125
+ axioma a1 = P -> Q
1126
+ }
1127
+ teoria Hija extiende MiTeoria {
1128
+ axioma a2 = Q -> R
1129
+ }
1130
+ `);
1131
+ });
1132
+ (0, vitest_1.it)('pasaje/formalizar/como', () => {
1133
+ runOk(`
1134
+ logica classical.propositional
1135
+ sea p1 = pasaje([[ Si llueve, el piso se moja ]])
1136
+ sea f1 = formalizar p1 como P -> Q
1137
+ `);
1138
+ });
1139
+ (0, vitest_1.it)('contramodelo', () => {
1140
+ runOk(`logica classical.propositional\ncontramodelo P -> Q`);
1141
+ });
1142
+ (0, vitest_1.it)('tabla_verdad', () => {
1143
+ runOk(`logica classical.propositional\ntabla_verdad P & Q`);
1144
+ });
1145
+ (0, vitest_1.it)('probar', () => {
1146
+ runOk(`
1147
+ logica classical.propositional
1148
+ axioma a1 = P -> Q
1149
+ axioma a2 = P
1150
+ teorema t1 = Q
1151
+ probar Q desde {a1, a2}
1152
+ `);
1153
+ });
1154
+ (0, vitest_1.it)('paratodo/existe', () => {
1155
+ runOk(`
1156
+ logica classical.first_order
1157
+ verificar valido (paratodo x P(x)) -> P(a)
1158
+ `);
1159
+ });
1160
+ (0, vitest_1.it)('asumir/demostrar/qed', () => {
1161
+ runOk(`
1162
+ logica classical.propositional
1163
+ axioma a1 = P -> Q
1164
+ axioma a2 = P
1165
+ teorema t1 = Q
1166
+ probar Q desde {a1, a2}
1167
+ `);
1168
+ });
1169
+ (0, vitest_1.it)('afirmacion/soporte/confianza/contexto', () => {
1170
+ runOk(`
1171
+ logica classical.propositional
1172
+ sea p1 = pasaje([[ Algo ]])
1173
+ sea f1 = formalizar p1 como P
1174
+ afirmacion c1 = P
1175
+ soporte c1 <- p1
1176
+ confianza p1 = 0.8
1177
+ contexto ctx1 = "Contexto"
1178
+ `);
1179
+ });
1180
+ (0, vitest_1.it)('mostrar (render)', () => {
1181
+ runOk(`
1182
+ logica classical.propositional
1183
+ sea p1 = pasaje([[ Hola ]])
1184
+ sea f1 = formalizar p1 como P
1185
+ mostrar f1
1186
+ `);
1187
+ });
1188
+ (0, vitest_1.it)('explicar', () => {
1189
+ runOk(`
1190
+ logica classical.propositional
1191
+ sea f = P -> Q
1192
+ explicar f
1193
+ `);
1194
+ });
1195
+ (0, vitest_1.it)('analizar', () => {
1196
+ runOk(`
1197
+ logica classical.propositional
1198
+ analizar {P, P -> Q} -> Q
1199
+ `);
1200
+ });
1201
+ (0, vitest_1.it)('mientras (while)', () => {
1202
+ runOk(`
1203
+ logica classical.propositional
1204
+ sea c = 0
1205
+ mientras valido (P -> P) {
1206
+ asignar c = c + 1
1207
+ imprimir c
1208
+ }
1209
+ `);
1210
+ });
1211
+ (0, vitest_1.it)('exportar/importar', () => {
1212
+ runOk(`
1213
+ logica classical.propositional
1214
+ exportar axioma a1 = P -> Q
1215
+ `);
1216
+ });
1217
+ (0, vitest_1.it)('siguiente/hasta (next/until) in temporal', () => {
1218
+ runOk(`
1219
+ logica temporal.ltl
1220
+ sea f = siguiente P
1221
+ imprimir f
1222
+ `);
1223
+ });
1224
+ });
1225
+ // ============================================================
1226
+ // 15. CROSS-PROFILE STRESS
1227
+ // ============================================================
1228
+ (0, vitest_1.describe)('Cross-Profile Stress', () => {
1229
+ (0, vitest_1.it)('rapidly switch between all 11 profiles', () => {
1230
+ runOk(`
1231
+ logic classical.propositional
1232
+ check valid P -> P
1233
+
1234
+ logic classical.first_order
1235
+ check valid (forall x P(x)) -> P(a)
1236
+
1237
+ logic modal.k
1238
+ check valid [](P -> Q) -> ([]P -> []Q)
1239
+
1240
+ logic deontic.standard
1241
+ check valid [](P) -> <>(P)
1242
+
1243
+ logic epistemic.s5
1244
+ check valid []P -> P
1245
+
1246
+ logic intuitionistic.propositional
1247
+ check valid P -> !!P
1248
+
1249
+ logic temporal.ltl
1250
+ check valid [](P) -> <>(P)
1251
+
1252
+ logic aristotelian.syllogistic
1253
+ check valid (forall x (M(x) -> P(x))) & (forall x (S(x) -> M(x))) -> (forall x (S(x) -> P(x)))
1254
+
1255
+ logic paraconsistent.belnap
1256
+ check satisfiable P & !P
1257
+
1258
+ logic probabilistic.basic
1259
+ check valid P | !P
1260
+
1261
+ logic arithmetic
1262
+ check valid (2 + 3) >= 5
1263
+ `);
1264
+ });
1265
+ (0, vitest_1.it)('declarations persist across profile switches', () => {
1266
+ expectOutput(`
1267
+ logic classical.propositional
1268
+ let f = P -> Q
1269
+ print f
1270
+ logic modal.k
1271
+ print f
1272
+ `, '→');
1273
+ });
1274
+ (0, vitest_1.it)('heavy computation: many checks in sequence', () => {
1275
+ let src = 'logic classical.propositional\n';
1276
+ for (let i = 0; i < 50; i++) {
1277
+ src += `check valid P${i} -> P${i}\n`;
1278
+ }
1279
+ runOk(src);
1280
+ });
1281
+ (0, vitest_1.it)('many axioms and derivations', () => {
1282
+ let src = 'logic classical.propositional\n';
1283
+ for (let i = 0; i < 20; i++) {
1284
+ src += `axiom a${i} = P${i} -> P${i + 1}\n`;
1285
+ }
1286
+ src += 'axiom base = P0\n';
1287
+ src += 'derive P1 from {a0, base}\n';
1288
+ runOk(src);
1289
+ });
1290
+ (0, vitest_1.it)('many print statements', () => {
1291
+ let src = 'logic classical.propositional\n';
1292
+ for (let i = 0; i < 100; i++) {
1293
+ src += `print "line${i}"\n`;
1294
+ }
1295
+ const out = runOk(src);
1296
+ (0, vitest_1.expect)(out.stdout).toContain('line0');
1297
+ (0, vitest_1.expect)(out.stdout).toContain('line99');
1298
+ });
1299
+ (0, vitest_1.it)('large for loop', () => {
1300
+ // Generate a set with many elements
1301
+ const items = Array.from({ length: 20 }, (_, i) => `V${i}`).join(', ');
1302
+ runOk(`
1303
+ logic classical.propositional
1304
+ for X in {${items}} {
1305
+ print X
1306
+ }
1307
+ `);
1308
+ });
1309
+ });
1310
+ // ============================================================
1311
+ // 16. API FUNCTIONS — Edge Cases
1312
+ // ============================================================
1313
+ (0, vitest_1.describe)('API — Edge Cases', () => {
1314
+ (0, vitest_1.it)('builtin typeof', () => {
1315
+ runOk(`
1316
+ logic classical.propositional
1317
+ let f = P -> Q
1318
+ print typeof(f)
1319
+ `);
1320
+ });
1321
+ (0, vitest_1.it)('builtin is_valid', () => {
1322
+ runOk(`
1323
+ logic classical.propositional
1324
+ let f = P -> P
1325
+ print is_valid(f)
1326
+ `);
1327
+ });
1328
+ (0, vitest_1.it)('builtin is_satisfiable', () => {
1329
+ runOk(`
1330
+ logic classical.propositional
1331
+ let f = P & Q
1332
+ print is_satisfiable(f)
1333
+ `);
1334
+ });
1335
+ (0, vitest_1.it)('builtin get_atoms', () => {
1336
+ runOk(`
1337
+ logic classical.propositional
1338
+ let f = P & Q & R
1339
+ print get_atoms(f)
1340
+ `);
1341
+ });
1342
+ });
1343
+ // ============================================================
1344
+ // 17. OPERATOR COMBINATORICS
1345
+ // ============================================================
1346
+ (0, vitest_1.describe)('Operator Combinatorics', () => {
1347
+ const binaryOps = ['&', '|', '->', '<->', '!&', '!|', '^'];
1348
+ for (const op of binaryOps) {
1349
+ (0, vitest_1.it)(`binary op ${op} parses and evaluates`, () => {
1350
+ runOk(`logic classical.propositional\nlet f = P ${op} Q\nprint f`);
1351
+ });
1352
+ (0, vitest_1.it)(`binary op ${op} in check valid`, () => {
1353
+ // P op P should at least parse
1354
+ run(`logic classical.propositional\ncheck valid P ${op} P`);
1355
+ });
1356
+ }
1357
+ (0, vitest_1.it)('all unary: !, !!, !!!', () => {
1358
+ runOk(`logic classical.propositional
1359
+ let a = !P
1360
+ let b = !!P
1361
+ let c = !!!P
1362
+ print a
1363
+ print b
1364
+ print c
1365
+ `);
1366
+ });
1367
+ (0, vitest_1.it)('all binary combos on 2 atoms', () => {
1368
+ // P OP1 Q OP2 R with various ops
1369
+ runOk(`logic classical.propositional
1370
+ let f1 = (P & Q) | R
1371
+ let f2 = (P | Q) & R
1372
+ let f3 = (P -> Q) & (Q -> R)
1373
+ let f4 = (P <-> Q) -> R
1374
+ let f5 = (P !& Q) | (R !| S)
1375
+ let f6 = (P ^ Q) -> (Q ^ P)
1376
+ print f1
1377
+ print f2
1378
+ print f3
1379
+ print f4
1380
+ print f5
1381
+ print f6
1382
+ `);
1383
+ });
1384
+ (0, vitest_1.it)('deeply nested: 10 levels', () => {
1385
+ runOk(`logic classical.propositional
1386
+ let deep = P -> (Q -> (R -> (S -> (T -> (U -> (V -> (W -> (X -> (Y -> Z)))))))))
1387
+ print deep
1388
+ `);
1389
+ });
1390
+ (0, vitest_1.it)('wide conjunction: 10 atoms', () => {
1391
+ runOk(`logic classical.propositional
1392
+ let wide = A & B & C & D & E & F & G & H & I & J
1393
+ print wide
1394
+ check satisfiable A & B & C & D & E & F & G & H & I & J
1395
+ `);
1396
+ });
1397
+ (0, vitest_1.it)('wide disjunction: 10 atoms', () => {
1398
+ runOk(`logic classical.propositional
1399
+ let wide = A | B | C | D | E | F | G | H | I | J
1400
+ print wide
1401
+ check valid A | B | C | D | E | F | G | H | I | J | !A
1402
+ `);
1403
+ });
1404
+ });
1405
+ // ============================================================
1406
+ // 18. ERROR RECOVERY — Does not crash
1407
+ // ============================================================
1408
+ (0, vitest_1.describe)('Error Recovery — No crashes', () => {
1409
+ const badInputs = [
1410
+ 'logic',
1411
+ 'logic classical.propositional\ncheck',
1412
+ 'logic classical.propositional\ncheck valid',
1413
+ 'logic classical.propositional\nderive',
1414
+ 'logic classical.propositional\nderive X from',
1415
+ 'logic classical.propositional\nderive X from {}',
1416
+ 'logic classical.propositional\nlet',
1417
+ 'logic classical.propositional\nlet x',
1418
+ 'logic classical.propositional\nlet x =',
1419
+ 'logic classical.propositional\naxiom',
1420
+ 'logic classical.propositional\naxiom a =',
1421
+ 'logic classical.propositional\ntheorem',
1422
+ 'logic classical.propositional\nprove',
1423
+ 'logic classical.propositional\ntruth_table',
1424
+ 'logic classical.propositional\ncountermodel',
1425
+ 'logic classical.propositional\nfor',
1426
+ 'logic classical.propositional\nfor X in',
1427
+ 'logic classical.propositional\nwhile',
1428
+ 'logic classical.propositional\nif',
1429
+ 'logic classical.propositional\nfn',
1430
+ 'logic classical.propositional\nfn f(',
1431
+ 'logic classical.propositional\ntheory',
1432
+ 'logic classical.propositional\ntheory T {',
1433
+ ')))(((',
1434
+ '&&&|||',
1435
+ 'let 123 = abc',
1436
+ 'logic classical.propositional\nprint',
1437
+ 'logic classical.propositional\nset',
1438
+ 'logic classical.propositional\nset x',
1439
+ 'logic classical.propositional\nexport',
1440
+ 'logic classical.propositional\nimport',
1441
+ ];
1442
+ for (let i = 0; i < badInputs.length; i++) {
1443
+ (0, vitest_1.it)(`bad input #${i + 1} does not throw`, () => {
1444
+ (0, vitest_1.expect)(() => run(badInputs[i])).not.toThrow();
1445
+ });
1446
+ }
1447
+ });
1448
+ //# sourceMappingURL=stress-exhaustive.test.js.map