@proposit/proposit-core 4.2.0 → 5.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 +2 -2
- package/dist/cli/commands/expressions.js +1 -1
- package/dist/cli/commands/expressions.js.map +1 -1
- package/dist/cli/commands/graph.d.ts.map +1 -1
- package/dist/cli/commands/graph.js +2 -0
- package/dist/cli/commands/graph.js.map +1 -1
- package/dist/cli/import.d.ts.map +1 -1
- package/dist/cli/import.js +4 -1
- package/dist/cli/import.js.map +1 -1
- package/dist/cli/schemata.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/formula-validation.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/stages/formula-validation.js +1 -0
- package/dist/extensions/pipelines/base/stages/formula-validation.js.map +1 -1
- package/dist/lib/core/evaluation/argument-evaluation.d.ts.map +1 -1
- package/dist/lib/core/evaluation/argument-evaluation.js +46 -1
- package/dist/lib/core/evaluation/argument-evaluation.js.map +1 -1
- package/dist/lib/core/evaluation/belnap.d.ts +22 -0
- package/dist/lib/core/evaluation/belnap.d.ts.map +1 -1
- package/dist/lib/core/evaluation/belnap.js +29 -0
- package/dist/lib/core/evaluation/belnap.js.map +1 -1
- package/dist/lib/core/expression-manager-checks.d.ts.map +1 -1
- package/dist/lib/core/expression-manager-checks.js +23 -9
- package/dist/lib/core/expression-manager-checks.js.map +1 -1
- package/dist/lib/core/expression-manager.d.ts +5 -3
- package/dist/lib/core/expression-manager.d.ts.map +1 -1
- package/dist/lib/core/expression-manager.js +9 -3
- package/dist/lib/core/expression-manager.js.map +1 -1
- package/dist/lib/core/parser/formula-gen.js +183 -91
- package/dist/lib/core/parser/formula.d.ts +3 -0
- package/dist/lib/core/parser/formula.d.ts.map +1 -1
- package/dist/lib/core/parser/formula.js.map +1 -1
- package/dist/lib/core/premise-engine.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.js +12 -2
- package/dist/lib/core/premise-engine.js.map +1 -1
- package/dist/lib/grammar/an-rules.d.ts +6 -5
- package/dist/lib/grammar/an-rules.d.ts.map +1 -1
- package/dist/lib/grammar/an-rules.js +12 -8
- package/dist/lib/grammar/an-rules.js.map +1 -1
- package/dist/lib/grammar/bounded-subtree.d.ts +8 -6
- package/dist/lib/grammar/bounded-subtree.d.ts.map +1 -1
- package/dist/lib/grammar/bounded-subtree.js +14 -10
- package/dist/lib/grammar/bounded-subtree.js.map +1 -1
- package/dist/lib/grammar/validators/evaluable.d.ts +3 -3
- package/dist/lib/grammar/validators/evaluable.d.ts.map +1 -1
- package/dist/lib/grammar/validators/evaluable.js +8 -5
- package/dist/lib/grammar/validators/evaluable.js.map +1 -1
- package/dist/lib/grammar/validators/presentable.d.ts +10 -9
- package/dist/lib/grammar/validators/presentable.d.ts.map +1 -1
- package/dist/lib/grammar/validators/presentable.js +30 -21
- package/dist/lib/grammar/validators/presentable.js.map +1 -1
- package/dist/lib/grammar/validators/structural.d.ts +1 -1
- package/dist/lib/grammar/validators/structural.d.ts.map +1 -1
- package/dist/lib/grammar/validators/structural.js +9 -2
- package/dist/lib/grammar/validators/structural.js.map +1 -1
- package/dist/lib/parsing/argument-parser.d.ts.map +1 -1
- package/dist/lib/parsing/argument-parser.js +4 -1
- package/dist/lib/parsing/argument-parser.js.map +1 -1
- package/dist/lib/schemata/propositional.d.ts +3 -3
- package/dist/lib/schemata/propositional.d.ts.map +1 -1
- package/dist/lib/schemata/propositional.js +1 -0
- package/dist/lib/schemata/propositional.js.map +1 -1
- package/package.json +1 -1
|
@@ -186,20 +186,22 @@ function peg$parse(input, options) {
|
|
|
186
186
|
const peg$c3 = "<->";
|
|
187
187
|
const peg$c4 = "implies";
|
|
188
188
|
const peg$c5 = "iff";
|
|
189
|
-
const peg$c6 = "
|
|
190
|
-
const peg$c7 = "
|
|
191
|
-
const peg$c8 = "
|
|
192
|
-
const peg$c9 = "
|
|
193
|
-
const peg$c10 = "
|
|
194
|
-
const peg$c11 = "
|
|
195
|
-
const peg$c12 = "
|
|
196
|
-
const peg$c13 = "
|
|
197
|
-
const peg$c14 = "
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const peg$
|
|
201
|
-
const peg$
|
|
202
|
-
const peg$
|
|
189
|
+
const peg$c6 = "xor";
|
|
190
|
+
const peg$c7 = "\u2228";
|
|
191
|
+
const peg$c8 = "||";
|
|
192
|
+
const peg$c9 = "or";
|
|
193
|
+
const peg$c10 = "\u2227";
|
|
194
|
+
const peg$c11 = "&&";
|
|
195
|
+
const peg$c12 = "and";
|
|
196
|
+
const peg$c13 = "not";
|
|
197
|
+
const peg$c14 = "(";
|
|
198
|
+
const peg$c15 = ")";
|
|
199
|
+
|
|
200
|
+
const peg$r0 = /^[\^\u2295\u22BB]/;
|
|
201
|
+
const peg$r1 = /^[!\xAC]/;
|
|
202
|
+
const peg$r2 = /^[A-Za-z_]/;
|
|
203
|
+
const peg$r3 = /^[A-Za-z0-9_]/;
|
|
204
|
+
const peg$r4 = /^[ \t\n\r]/;
|
|
203
205
|
|
|
204
206
|
const peg$e0 = peg$literalExpectation("\u2192", false);
|
|
205
207
|
const peg$e1 = peg$literalExpectation("->", false);
|
|
@@ -207,36 +209,42 @@ function peg$parse(input, options) {
|
|
|
207
209
|
const peg$e3 = peg$literalExpectation("<->", false);
|
|
208
210
|
const peg$e4 = peg$literalExpectation("implies", true);
|
|
209
211
|
const peg$e5 = peg$literalExpectation("iff", true);
|
|
210
|
-
const peg$e6 = peg$
|
|
211
|
-
const peg$e7 = peg$literalExpectation("
|
|
212
|
-
const peg$e8 = peg$literalExpectation("
|
|
213
|
-
const peg$e9 = peg$literalExpectation("
|
|
214
|
-
const peg$e10 = peg$literalExpectation("
|
|
215
|
-
const peg$e11 = peg$literalExpectation("
|
|
216
|
-
const peg$e12 = peg$
|
|
217
|
-
const peg$e13 = peg$literalExpectation("
|
|
218
|
-
const peg$e14 = peg$
|
|
219
|
-
const peg$e15 = peg$literalExpectation("
|
|
220
|
-
const peg$e16 = peg$
|
|
221
|
-
const peg$e17 = peg$
|
|
222
|
-
const peg$e18 = peg$classExpectation([" ", "
|
|
212
|
+
const peg$e6 = peg$classExpectation(["^", "\u2295", "\u22BB"], false, false, false);
|
|
213
|
+
const peg$e7 = peg$literalExpectation("xor", true);
|
|
214
|
+
const peg$e8 = peg$literalExpectation("\u2228", false);
|
|
215
|
+
const peg$e9 = peg$literalExpectation("||", false);
|
|
216
|
+
const peg$e10 = peg$literalExpectation("or", true);
|
|
217
|
+
const peg$e11 = peg$literalExpectation("\u2227", false);
|
|
218
|
+
const peg$e12 = peg$literalExpectation("&&", false);
|
|
219
|
+
const peg$e13 = peg$literalExpectation("and", true);
|
|
220
|
+
const peg$e14 = peg$classExpectation(["!", "\xAC"], false, false, false);
|
|
221
|
+
const peg$e15 = peg$literalExpectation("not", true);
|
|
222
|
+
const peg$e16 = peg$literalExpectation("(", false);
|
|
223
|
+
const peg$e17 = peg$literalExpectation(")", false);
|
|
224
|
+
const peg$e18 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false, false);
|
|
225
|
+
const peg$e19 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false, false);
|
|
226
|
+
const peg$e20 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false, false);
|
|
223
227
|
|
|
224
228
|
function peg$f0(expr) { return expr; }
|
|
225
229
|
function peg$f1(left, op, right) {
|
|
226
230
|
const type = (op === "→" || op === "->" || op.toLowerCase() === "implies") ? "implies" : "iff";
|
|
227
231
|
return binaryNode(type, left, right);
|
|
228
232
|
}
|
|
229
|
-
function peg$f2(first,
|
|
233
|
+
function peg$f2(first, d) { return d; }
|
|
230
234
|
function peg$f3(first, rest) {
|
|
231
|
-
return naryNode("
|
|
235
|
+
return naryNode("xor", first, rest);
|
|
232
236
|
}
|
|
233
|
-
function peg$f4(first,
|
|
237
|
+
function peg$f4(first, c) { return c; }
|
|
234
238
|
function peg$f5(first, rest) {
|
|
239
|
+
return naryNode("or", first, rest);
|
|
240
|
+
}
|
|
241
|
+
function peg$f6(first, u) { return u; }
|
|
242
|
+
function peg$f7(first, rest) {
|
|
235
243
|
return naryNode("and", first, rest);
|
|
236
244
|
}
|
|
237
|
-
function peg$
|
|
238
|
-
function peg$
|
|
239
|
-
function peg$
|
|
245
|
+
function peg$f8(operand) { return notNode(operand); }
|
|
246
|
+
function peg$f9(expr) { return expr; }
|
|
247
|
+
function peg$f10(name) { return variableNode(name); }
|
|
240
248
|
let peg$currPos = options.peg$currPos | 0;
|
|
241
249
|
let peg$savedPos = peg$currPos;
|
|
242
250
|
const peg$posDetailsCache = [{ line: 1, column: 1 }];
|
|
@@ -429,7 +437,7 @@ function peg$parse(input, options) {
|
|
|
429
437
|
let s0, s1, s2, s3, s4, s5;
|
|
430
438
|
|
|
431
439
|
s0 = peg$currPos;
|
|
432
|
-
s1 = peg$
|
|
440
|
+
s1 = peg$parseExclusiveDisjunction();
|
|
433
441
|
if (s1 !== peg$FAILED) {
|
|
434
442
|
s2 = peg$parse_();
|
|
435
443
|
if (input.charCodeAt(peg$currPos) === 8594) {
|
|
@@ -486,7 +494,7 @@ function peg$parse(input, options) {
|
|
|
486
494
|
}
|
|
487
495
|
if (s3 !== peg$FAILED) {
|
|
488
496
|
s4 = peg$parse_();
|
|
489
|
-
s5 = peg$
|
|
497
|
+
s5 = peg$parseExclusiveDisjunction();
|
|
490
498
|
if (s5 !== peg$FAILED) {
|
|
491
499
|
peg$savedPos = s0;
|
|
492
500
|
s0 = peg$f1(s1, s3, s5);
|
|
@@ -503,7 +511,91 @@ function peg$parse(input, options) {
|
|
|
503
511
|
s0 = peg$FAILED;
|
|
504
512
|
}
|
|
505
513
|
if (s0 === peg$FAILED) {
|
|
506
|
-
s0 = peg$
|
|
514
|
+
s0 = peg$parseExclusiveDisjunction();
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return s0;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function peg$parseExclusiveDisjunction() {
|
|
521
|
+
let s0, s1, s2, s3, s4, s5, s6, s7;
|
|
522
|
+
|
|
523
|
+
s0 = peg$currPos;
|
|
524
|
+
s1 = peg$parseDisjunction();
|
|
525
|
+
if (s1 !== peg$FAILED) {
|
|
526
|
+
s2 = [];
|
|
527
|
+
s3 = peg$currPos;
|
|
528
|
+
s4 = peg$parse_();
|
|
529
|
+
s5 = input.charAt(peg$currPos);
|
|
530
|
+
if (peg$r0.test(s5)) {
|
|
531
|
+
peg$currPos++;
|
|
532
|
+
} else {
|
|
533
|
+
s5 = peg$FAILED;
|
|
534
|
+
if (peg$silentFails === 0) { peg$fail(peg$e6); }
|
|
535
|
+
}
|
|
536
|
+
if (s5 === peg$FAILED) {
|
|
537
|
+
s5 = input.substr(peg$currPos, 3);
|
|
538
|
+
if (s5.toLowerCase() === peg$c6) {
|
|
539
|
+
peg$currPos += (3);
|
|
540
|
+
} else {
|
|
541
|
+
s5 = peg$FAILED;
|
|
542
|
+
if (peg$silentFails === 0) { peg$fail(peg$e7); }
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (s5 !== peg$FAILED) {
|
|
546
|
+
s6 = peg$parse_();
|
|
547
|
+
s7 = peg$parseDisjunction();
|
|
548
|
+
if (s7 !== peg$FAILED) {
|
|
549
|
+
peg$savedPos = s3;
|
|
550
|
+
s3 = peg$f2(s1, s7);
|
|
551
|
+
} else {
|
|
552
|
+
peg$currPos = s3;
|
|
553
|
+
s3 = peg$FAILED;
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
peg$currPos = s3;
|
|
557
|
+
s3 = peg$FAILED;
|
|
558
|
+
}
|
|
559
|
+
while (s3 !== peg$FAILED) {
|
|
560
|
+
s2.push(s3);
|
|
561
|
+
s3 = peg$currPos;
|
|
562
|
+
s4 = peg$parse_();
|
|
563
|
+
s5 = input.charAt(peg$currPos);
|
|
564
|
+
if (peg$r0.test(s5)) {
|
|
565
|
+
peg$currPos++;
|
|
566
|
+
} else {
|
|
567
|
+
s5 = peg$FAILED;
|
|
568
|
+
if (peg$silentFails === 0) { peg$fail(peg$e6); }
|
|
569
|
+
}
|
|
570
|
+
if (s5 === peg$FAILED) {
|
|
571
|
+
s5 = input.substr(peg$currPos, 3);
|
|
572
|
+
if (s5.toLowerCase() === peg$c6) {
|
|
573
|
+
peg$currPos += (3);
|
|
574
|
+
} else {
|
|
575
|
+
s5 = peg$FAILED;
|
|
576
|
+
if (peg$silentFails === 0) { peg$fail(peg$e7); }
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (s5 !== peg$FAILED) {
|
|
580
|
+
s6 = peg$parse_();
|
|
581
|
+
s7 = peg$parseDisjunction();
|
|
582
|
+
if (s7 !== peg$FAILED) {
|
|
583
|
+
peg$savedPos = s3;
|
|
584
|
+
s3 = peg$f2(s1, s7);
|
|
585
|
+
} else {
|
|
586
|
+
peg$currPos = s3;
|
|
587
|
+
s3 = peg$FAILED;
|
|
588
|
+
}
|
|
589
|
+
} else {
|
|
590
|
+
peg$currPos = s3;
|
|
591
|
+
s3 = peg$FAILED;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
peg$savedPos = s0;
|
|
595
|
+
s0 = peg$f3(s1, s2);
|
|
596
|
+
} else {
|
|
597
|
+
peg$currPos = s0;
|
|
598
|
+
s0 = peg$FAILED;
|
|
507
599
|
}
|
|
508
600
|
|
|
509
601
|
return s0;
|
|
@@ -519,27 +611,27 @@ function peg$parse(input, options) {
|
|
|
519
611
|
s3 = peg$currPos;
|
|
520
612
|
s4 = peg$parse_();
|
|
521
613
|
if (input.charCodeAt(peg$currPos) === 8744) {
|
|
522
|
-
s5 = peg$
|
|
614
|
+
s5 = peg$c7;
|
|
523
615
|
peg$currPos++;
|
|
524
616
|
} else {
|
|
525
617
|
s5 = peg$FAILED;
|
|
526
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
618
|
+
if (peg$silentFails === 0) { peg$fail(peg$e8); }
|
|
527
619
|
}
|
|
528
620
|
if (s5 === peg$FAILED) {
|
|
529
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
530
|
-
s5 = peg$
|
|
621
|
+
if (input.substr(peg$currPos, 2) === peg$c8) {
|
|
622
|
+
s5 = peg$c8;
|
|
531
623
|
peg$currPos += 2;
|
|
532
624
|
} else {
|
|
533
625
|
s5 = peg$FAILED;
|
|
534
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
626
|
+
if (peg$silentFails === 0) { peg$fail(peg$e9); }
|
|
535
627
|
}
|
|
536
628
|
if (s5 === peg$FAILED) {
|
|
537
629
|
s5 = input.substr(peg$currPos, 2);
|
|
538
|
-
if (s5.toLowerCase() === peg$
|
|
630
|
+
if (s5.toLowerCase() === peg$c9) {
|
|
539
631
|
peg$currPos += (2);
|
|
540
632
|
} else {
|
|
541
633
|
s5 = peg$FAILED;
|
|
542
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
634
|
+
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
|
543
635
|
}
|
|
544
636
|
}
|
|
545
637
|
}
|
|
@@ -548,7 +640,7 @@ function peg$parse(input, options) {
|
|
|
548
640
|
s7 = peg$parseConjunction();
|
|
549
641
|
if (s7 !== peg$FAILED) {
|
|
550
642
|
peg$savedPos = s3;
|
|
551
|
-
s3 = peg$
|
|
643
|
+
s3 = peg$f4(s1, s7);
|
|
552
644
|
} else {
|
|
553
645
|
peg$currPos = s3;
|
|
554
646
|
s3 = peg$FAILED;
|
|
@@ -562,27 +654,27 @@ function peg$parse(input, options) {
|
|
|
562
654
|
s3 = peg$currPos;
|
|
563
655
|
s4 = peg$parse_();
|
|
564
656
|
if (input.charCodeAt(peg$currPos) === 8744) {
|
|
565
|
-
s5 = peg$
|
|
657
|
+
s5 = peg$c7;
|
|
566
658
|
peg$currPos++;
|
|
567
659
|
} else {
|
|
568
660
|
s5 = peg$FAILED;
|
|
569
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
661
|
+
if (peg$silentFails === 0) { peg$fail(peg$e8); }
|
|
570
662
|
}
|
|
571
663
|
if (s5 === peg$FAILED) {
|
|
572
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
573
|
-
s5 = peg$
|
|
664
|
+
if (input.substr(peg$currPos, 2) === peg$c8) {
|
|
665
|
+
s5 = peg$c8;
|
|
574
666
|
peg$currPos += 2;
|
|
575
667
|
} else {
|
|
576
668
|
s5 = peg$FAILED;
|
|
577
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
669
|
+
if (peg$silentFails === 0) { peg$fail(peg$e9); }
|
|
578
670
|
}
|
|
579
671
|
if (s5 === peg$FAILED) {
|
|
580
672
|
s5 = input.substr(peg$currPos, 2);
|
|
581
|
-
if (s5.toLowerCase() === peg$
|
|
673
|
+
if (s5.toLowerCase() === peg$c9) {
|
|
582
674
|
peg$currPos += (2);
|
|
583
675
|
} else {
|
|
584
676
|
s5 = peg$FAILED;
|
|
585
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
677
|
+
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
|
586
678
|
}
|
|
587
679
|
}
|
|
588
680
|
}
|
|
@@ -591,7 +683,7 @@ function peg$parse(input, options) {
|
|
|
591
683
|
s7 = peg$parseConjunction();
|
|
592
684
|
if (s7 !== peg$FAILED) {
|
|
593
685
|
peg$savedPos = s3;
|
|
594
|
-
s3 = peg$
|
|
686
|
+
s3 = peg$f4(s1, s7);
|
|
595
687
|
} else {
|
|
596
688
|
peg$currPos = s3;
|
|
597
689
|
s3 = peg$FAILED;
|
|
@@ -602,7 +694,7 @@ function peg$parse(input, options) {
|
|
|
602
694
|
}
|
|
603
695
|
}
|
|
604
696
|
peg$savedPos = s0;
|
|
605
|
-
s0 = peg$
|
|
697
|
+
s0 = peg$f5(s1, s2);
|
|
606
698
|
} else {
|
|
607
699
|
peg$currPos = s0;
|
|
608
700
|
s0 = peg$FAILED;
|
|
@@ -621,27 +713,27 @@ function peg$parse(input, options) {
|
|
|
621
713
|
s3 = peg$currPos;
|
|
622
714
|
s4 = peg$parse_();
|
|
623
715
|
if (input.charCodeAt(peg$currPos) === 8743) {
|
|
624
|
-
s5 = peg$
|
|
716
|
+
s5 = peg$c10;
|
|
625
717
|
peg$currPos++;
|
|
626
718
|
} else {
|
|
627
719
|
s5 = peg$FAILED;
|
|
628
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
720
|
+
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
|
629
721
|
}
|
|
630
722
|
if (s5 === peg$FAILED) {
|
|
631
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
632
|
-
s5 = peg$
|
|
723
|
+
if (input.substr(peg$currPos, 2) === peg$c11) {
|
|
724
|
+
s5 = peg$c11;
|
|
633
725
|
peg$currPos += 2;
|
|
634
726
|
} else {
|
|
635
727
|
s5 = peg$FAILED;
|
|
636
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
728
|
+
if (peg$silentFails === 0) { peg$fail(peg$e12); }
|
|
637
729
|
}
|
|
638
730
|
if (s5 === peg$FAILED) {
|
|
639
731
|
s5 = input.substr(peg$currPos, 3);
|
|
640
|
-
if (s5.toLowerCase() === peg$
|
|
732
|
+
if (s5.toLowerCase() === peg$c12) {
|
|
641
733
|
peg$currPos += (3);
|
|
642
734
|
} else {
|
|
643
735
|
s5 = peg$FAILED;
|
|
644
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
736
|
+
if (peg$silentFails === 0) { peg$fail(peg$e13); }
|
|
645
737
|
}
|
|
646
738
|
}
|
|
647
739
|
}
|
|
@@ -650,7 +742,7 @@ function peg$parse(input, options) {
|
|
|
650
742
|
s7 = peg$parseUnary();
|
|
651
743
|
if (s7 !== peg$FAILED) {
|
|
652
744
|
peg$savedPos = s3;
|
|
653
|
-
s3 = peg$
|
|
745
|
+
s3 = peg$f6(s1, s7);
|
|
654
746
|
} else {
|
|
655
747
|
peg$currPos = s3;
|
|
656
748
|
s3 = peg$FAILED;
|
|
@@ -664,27 +756,27 @@ function peg$parse(input, options) {
|
|
|
664
756
|
s3 = peg$currPos;
|
|
665
757
|
s4 = peg$parse_();
|
|
666
758
|
if (input.charCodeAt(peg$currPos) === 8743) {
|
|
667
|
-
s5 = peg$
|
|
759
|
+
s5 = peg$c10;
|
|
668
760
|
peg$currPos++;
|
|
669
761
|
} else {
|
|
670
762
|
s5 = peg$FAILED;
|
|
671
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
763
|
+
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
|
672
764
|
}
|
|
673
765
|
if (s5 === peg$FAILED) {
|
|
674
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
675
|
-
s5 = peg$
|
|
766
|
+
if (input.substr(peg$currPos, 2) === peg$c11) {
|
|
767
|
+
s5 = peg$c11;
|
|
676
768
|
peg$currPos += 2;
|
|
677
769
|
} else {
|
|
678
770
|
s5 = peg$FAILED;
|
|
679
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
771
|
+
if (peg$silentFails === 0) { peg$fail(peg$e12); }
|
|
680
772
|
}
|
|
681
773
|
if (s5 === peg$FAILED) {
|
|
682
774
|
s5 = input.substr(peg$currPos, 3);
|
|
683
|
-
if (s5.toLowerCase() === peg$
|
|
775
|
+
if (s5.toLowerCase() === peg$c12) {
|
|
684
776
|
peg$currPos += (3);
|
|
685
777
|
} else {
|
|
686
778
|
s5 = peg$FAILED;
|
|
687
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
779
|
+
if (peg$silentFails === 0) { peg$fail(peg$e13); }
|
|
688
780
|
}
|
|
689
781
|
}
|
|
690
782
|
}
|
|
@@ -693,7 +785,7 @@ function peg$parse(input, options) {
|
|
|
693
785
|
s7 = peg$parseUnary();
|
|
694
786
|
if (s7 !== peg$FAILED) {
|
|
695
787
|
peg$savedPos = s3;
|
|
696
|
-
s3 = peg$
|
|
788
|
+
s3 = peg$f6(s1, s7);
|
|
697
789
|
} else {
|
|
698
790
|
peg$currPos = s3;
|
|
699
791
|
s3 = peg$FAILED;
|
|
@@ -704,7 +796,7 @@ function peg$parse(input, options) {
|
|
|
704
796
|
}
|
|
705
797
|
}
|
|
706
798
|
peg$savedPos = s0;
|
|
707
|
-
s0 = peg$
|
|
799
|
+
s0 = peg$f7(s1, s2);
|
|
708
800
|
} else {
|
|
709
801
|
peg$currPos = s0;
|
|
710
802
|
s0 = peg$FAILED;
|
|
@@ -718,19 +810,19 @@ function peg$parse(input, options) {
|
|
|
718
810
|
|
|
719
811
|
s0 = peg$currPos;
|
|
720
812
|
s1 = input.charAt(peg$currPos);
|
|
721
|
-
if (peg$
|
|
813
|
+
if (peg$r1.test(s1)) {
|
|
722
814
|
peg$currPos++;
|
|
723
815
|
} else {
|
|
724
816
|
s1 = peg$FAILED;
|
|
725
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
817
|
+
if (peg$silentFails === 0) { peg$fail(peg$e14); }
|
|
726
818
|
}
|
|
727
819
|
if (s1 === peg$FAILED) {
|
|
728
820
|
s1 = input.substr(peg$currPos, 3);
|
|
729
|
-
if (s1.toLowerCase() === peg$
|
|
821
|
+
if (s1.toLowerCase() === peg$c13) {
|
|
730
822
|
peg$currPos += (3);
|
|
731
823
|
} else {
|
|
732
824
|
s1 = peg$FAILED;
|
|
733
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
825
|
+
if (peg$silentFails === 0) { peg$fail(peg$e15); }
|
|
734
826
|
}
|
|
735
827
|
}
|
|
736
828
|
if (s1 !== peg$FAILED) {
|
|
@@ -738,7 +830,7 @@ function peg$parse(input, options) {
|
|
|
738
830
|
s3 = peg$parseUnary();
|
|
739
831
|
if (s3 !== peg$FAILED) {
|
|
740
832
|
peg$savedPos = s0;
|
|
741
|
-
s0 = peg$
|
|
833
|
+
s0 = peg$f8(s3);
|
|
742
834
|
} else {
|
|
743
835
|
peg$currPos = s0;
|
|
744
836
|
s0 = peg$FAILED;
|
|
@@ -759,11 +851,11 @@ function peg$parse(input, options) {
|
|
|
759
851
|
|
|
760
852
|
s0 = peg$currPos;
|
|
761
853
|
if (input.charCodeAt(peg$currPos) === 40) {
|
|
762
|
-
s1 = peg$
|
|
854
|
+
s1 = peg$c14;
|
|
763
855
|
peg$currPos++;
|
|
764
856
|
} else {
|
|
765
857
|
s1 = peg$FAILED;
|
|
766
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
858
|
+
if (peg$silentFails === 0) { peg$fail(peg$e16); }
|
|
767
859
|
}
|
|
768
860
|
if (s1 !== peg$FAILED) {
|
|
769
861
|
s2 = peg$parse_();
|
|
@@ -771,15 +863,15 @@ function peg$parse(input, options) {
|
|
|
771
863
|
if (s3 !== peg$FAILED) {
|
|
772
864
|
s4 = peg$parse_();
|
|
773
865
|
if (input.charCodeAt(peg$currPos) === 41) {
|
|
774
|
-
s5 = peg$
|
|
866
|
+
s5 = peg$c15;
|
|
775
867
|
peg$currPos++;
|
|
776
868
|
} else {
|
|
777
869
|
s5 = peg$FAILED;
|
|
778
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
870
|
+
if (peg$silentFails === 0) { peg$fail(peg$e17); }
|
|
779
871
|
}
|
|
780
872
|
if (s5 !== peg$FAILED) {
|
|
781
873
|
peg$savedPos = s0;
|
|
782
|
-
s0 = peg$
|
|
874
|
+
s0 = peg$f9(s3);
|
|
783
875
|
} else {
|
|
784
876
|
peg$currPos = s0;
|
|
785
877
|
s0 = peg$FAILED;
|
|
@@ -797,7 +889,7 @@ function peg$parse(input, options) {
|
|
|
797
889
|
s1 = peg$parseIdentifier();
|
|
798
890
|
if (s1 !== peg$FAILED) {
|
|
799
891
|
peg$savedPos = s0;
|
|
800
|
-
s1 = peg$
|
|
892
|
+
s1 = peg$f10(s1);
|
|
801
893
|
}
|
|
802
894
|
s0 = s1;
|
|
803
895
|
}
|
|
@@ -811,29 +903,29 @@ function peg$parse(input, options) {
|
|
|
811
903
|
s0 = peg$currPos;
|
|
812
904
|
s1 = peg$currPos;
|
|
813
905
|
s2 = input.charAt(peg$currPos);
|
|
814
|
-
if (peg$
|
|
906
|
+
if (peg$r2.test(s2)) {
|
|
815
907
|
peg$currPos++;
|
|
816
908
|
} else {
|
|
817
909
|
s2 = peg$FAILED;
|
|
818
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
910
|
+
if (peg$silentFails === 0) { peg$fail(peg$e18); }
|
|
819
911
|
}
|
|
820
912
|
if (s2 !== peg$FAILED) {
|
|
821
913
|
s3 = [];
|
|
822
914
|
s4 = input.charAt(peg$currPos);
|
|
823
|
-
if (peg$
|
|
915
|
+
if (peg$r3.test(s4)) {
|
|
824
916
|
peg$currPos++;
|
|
825
917
|
} else {
|
|
826
918
|
s4 = peg$FAILED;
|
|
827
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
919
|
+
if (peg$silentFails === 0) { peg$fail(peg$e19); }
|
|
828
920
|
}
|
|
829
921
|
while (s4 !== peg$FAILED) {
|
|
830
922
|
s3.push(s4);
|
|
831
923
|
s4 = input.charAt(peg$currPos);
|
|
832
|
-
if (peg$
|
|
924
|
+
if (peg$r3.test(s4)) {
|
|
833
925
|
peg$currPos++;
|
|
834
926
|
} else {
|
|
835
927
|
s4 = peg$FAILED;
|
|
836
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
928
|
+
if (peg$silentFails === 0) { peg$fail(peg$e19); }
|
|
837
929
|
}
|
|
838
930
|
}
|
|
839
931
|
s2 = [s2, s3];
|
|
@@ -857,20 +949,20 @@ function peg$parse(input, options) {
|
|
|
857
949
|
peg$silentFails++;
|
|
858
950
|
s0 = [];
|
|
859
951
|
s1 = input.charAt(peg$currPos);
|
|
860
|
-
if (peg$
|
|
952
|
+
if (peg$r4.test(s1)) {
|
|
861
953
|
peg$currPos++;
|
|
862
954
|
} else {
|
|
863
955
|
s1 = peg$FAILED;
|
|
864
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
956
|
+
if (peg$silentFails === 0) { peg$fail(peg$e20); }
|
|
865
957
|
}
|
|
866
958
|
while (s1 !== peg$FAILED) {
|
|
867
959
|
s0.push(s1);
|
|
868
960
|
s1 = input.charAt(peg$currPos);
|
|
869
|
-
if (peg$
|
|
961
|
+
if (peg$r4.test(s1)) {
|
|
870
962
|
peg$currPos++;
|
|
871
963
|
} else {
|
|
872
964
|
s1 = peg$FAILED;
|
|
873
|
-
if (peg$silentFails === 0) { peg$fail(peg$
|
|
965
|
+
if (peg$silentFails === 0) { peg$fail(peg$e20); }
|
|
874
966
|
}
|
|
875
967
|
}
|
|
876
968
|
peg$silentFails--;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/parser/formula.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GACjB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAA;AAI5D,gHAAgH;AAChH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAEvD"}
|
|
1
|
+
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/parser/formula.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GACjB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAA;AAI5D,gHAAgH;AAChH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAEvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formula.js","sourceRoot":"","sources":["../../../../src/lib/core/parser/formula.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"formula.js","sourceRoot":"","sources":["../../../../src/lib/core/parser/formula.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAWpD,MAAM,UAAU,GAAG,QAA0C,CAAA;AAE7D,gHAAgH;AAChH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"premise-engine.d.ts","sourceRoot":"","sources":["../../../src/lib/core/premise-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AE,MAAM,MAAM,GAC1B,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC;IAsC7C;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAWlC,OAAO,CAAC,sBAAsB;IAiC9B,OAAO,CAAC,mBAAmB;IAY3B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,oBAAoB;CAQ/B"}
|
|
@@ -3,7 +3,7 @@ import { DefaultMap } from "../utils/default-map.js";
|
|
|
3
3
|
import { midpoint, POSITION_INITIAL, POSITION_MAX, } from "../utils/position.js";
|
|
4
4
|
import { sortedCopyById, sortedUnique, withoutUndefinedValues, } from "../utils/collections.js";
|
|
5
5
|
import { HierarchicalChecksumCache } from "./checksum-cache.js";
|
|
6
|
-
import { belnapAnd, belnapIff, belnapImplies, belnapNot, belnapOr, } from "./evaluation/belnap.js";
|
|
6
|
+
import { belnapAnd, belnapIff, belnapImplies, belnapNot, belnapOr, belnapXor, } from "./evaluation/belnap.js";
|
|
7
7
|
import { buildDirectionalVacuity, makeErrorIssue, makeValidationResult, } from "./evaluation/validation.js";
|
|
8
8
|
import { Value } from "typebox/value";
|
|
9
9
|
import { PREMISE_SCHEMA_INVALID, PREMISE_ROOT_EXPRESSION_INVALID, PREMISE_VARIABLE_REF_NOT_FOUND, } from "../types/validation.js";
|
|
@@ -991,7 +991,9 @@ export class PremiseEngine extends HierarchicalChecksumCache {
|
|
|
991
991
|
expressionId: expr.id,
|
|
992
992
|
}));
|
|
993
993
|
}
|
|
994
|
-
if ((expr.operator === "and" ||
|
|
994
|
+
if ((expr.operator === "and" ||
|
|
995
|
+
expr.operator === "or" ||
|
|
996
|
+
expr.operator === "xor") &&
|
|
995
997
|
children.length < 2) {
|
|
996
998
|
issues.push(makeErrorIssue({
|
|
997
999
|
code: "EXPR_CHILD_COUNT_INVALID",
|
|
@@ -1076,6 +1078,12 @@ export class PremiseEngine extends HierarchicalChecksumCache {
|
|
|
1076
1078
|
case "or":
|
|
1077
1079
|
value = children.reduce((acc, child) => belnapOr(acc, evaluateExpression(child.id)), false);
|
|
1078
1080
|
break;
|
|
1081
|
+
// Seeded `false` because that is xor's identity, not because
|
|
1082
|
+
// `or` is: parity counts the true operands, so seeding `true`
|
|
1083
|
+
// would report every operand count with the opposite parity.
|
|
1084
|
+
case "xor":
|
|
1085
|
+
value = children.reduce((acc, child) => belnapXor(acc, evaluateExpression(child.id)), false);
|
|
1086
|
+
break;
|
|
1079
1087
|
case "implies": {
|
|
1080
1088
|
const left = children[0];
|
|
1081
1089
|
const right = children[1];
|
|
@@ -1433,6 +1441,8 @@ export class PremiseEngine extends HierarchicalChecksumCache {
|
|
|
1433
1441
|
return "↔";
|
|
1434
1442
|
case "not":
|
|
1435
1443
|
return "¬";
|
|
1444
|
+
case "xor":
|
|
1445
|
+
return "⊻";
|
|
1436
1446
|
}
|
|
1437
1447
|
}
|
|
1438
1448
|
snapshot() {
|