eyeprolog 1.3.69 → 1.3.71

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.
@@ -522,7 +522,7 @@
522
522
  "query": "writeq([:-,-]).",
523
523
  "input": "writeq([:-,-]).",
524
524
  "readCount": 1,
525
- "expected": "[:-,-] ³",
525
+ "expected": "[:-,-]",
526
526
  "outcome": {
527
527
  "type": "success",
528
528
  "stages": [
@@ -586,7 +586,7 @@
586
586
  "query": "writeq([.,.(.,.,.)]).",
587
587
  "input": "writeq([.,.(.,.,.)]).",
588
588
  "readCount": 1,
589
- "expected": "['.','.'('.','.','.')] ³",
589
+ "expected": "['.','.'('.','.','.')]",
590
590
  "outcome": {
591
591
  "type": "success",
592
592
  "stages": [
@@ -602,7 +602,7 @@
602
602
  "query": "writeq((a :- b,c)).",
603
603
  "input": "writeq((a :- b,c)).",
604
604
  "readCount": 1,
605
- "expected": "a:-b,c³",
605
+ "expected": "a:-b,c",
606
606
  "outcome": {
607
607
  "type": "success",
608
608
  "stages": [
@@ -618,7 +618,7 @@
618
618
  "query": "write_canonical([a]).",
619
619
  "input": "write_canonical([a]).",
620
620
  "readCount": 1,
621
- "expected": "'.'(a,[])³",
621
+ "expected": "'.'(a,[])",
622
622
  "outcome": {
623
623
  "type": "success",
624
624
  "stages": [
@@ -1052,7 +1052,7 @@
1052
1052
  "query": "(- (1)) = -(1).",
1053
1053
  "input": "(- (1)) = -(1).",
1054
1054
  "readCount": 1,
1055
- "expected": "succeeds°",
1055
+ "expected": "succeeds",
1056
1056
  "outcome": {
1057
1057
  "type": "success",
1058
1058
  "stages": [
@@ -1068,7 +1068,7 @@
1068
1068
  "query": "(- -1) = -(-1).",
1069
1069
  "input": "(- -1) = -(-1).",
1070
1070
  "readCount": 1,
1071
- "expected": "succeeds°",
1071
+ "expected": "succeeds",
1072
1072
  "outcome": {
1073
1073
  "type": "success",
1074
1074
  "stages": [
@@ -1084,7 +1084,7 @@
1084
1084
  "query": "(- 1^2) = ^(-1,2).",
1085
1085
  "input": "(- 1^2) = ^(-1,2).",
1086
1086
  "readCount": 1,
1087
- "expected": "succeeds°",
1087
+ "expected": "succeeds",
1088
1088
  "outcome": {
1089
1089
  "type": "success",
1090
1090
  "stages": [
@@ -1303,12 +1303,12 @@
1303
1303
  "query": "writeq(-(1)).",
1304
1304
  "input": "writeq(-(1)).",
1305
1305
  "readCount": 1,
1306
- "expected": "- (1)³",
1306
+ "expected": "- (1)",
1307
1307
  "outcome": {
1308
1308
  "type": "success",
1309
1309
  "stages": [
1310
1310
  {
1311
- "output": "-(1)",
1311
+ "output": "- (1)",
1312
1312
  "variables": "[]"
1313
1313
  }
1314
1314
  ]
@@ -1335,12 +1335,12 @@
1335
1335
  "query": "writeq(-(1^2)).",
1336
1336
  "input": "writeq(-(1^2)).",
1337
1337
  "readCount": 1,
1338
- "expected": "- (1^2)³",
1338
+ "expected": "- (1^2)",
1339
1339
  "outcome": {
1340
1340
  "type": "success",
1341
1341
  "stages": [
1342
1342
  {
1343
- "output": "-(1^2)",
1343
+ "output": "- (1^2)",
1344
1344
  "variables": "[]"
1345
1345
  }
1346
1346
  ]
@@ -1351,12 +1351,12 @@
1351
1351
  "query": "writeq(-(a^2)).",
1352
1352
  "input": "writeq(-(a^2)).",
1353
1353
  "readCount": 1,
1354
- "expected": "- (a^2)³",
1354
+ "expected": "- (a^2)",
1355
1355
  "outcome": {
1356
1356
  "type": "success",
1357
1357
  "stages": [
1358
1358
  {
1359
- "output": "-a^2",
1359
+ "output": "- (a^2)",
1360
1360
  "variables": "[]"
1361
1361
  }
1362
1362
  ]
@@ -1367,12 +1367,12 @@
1367
1367
  "query": "writeq(-((a,b))).",
1368
1368
  "input": "writeq(-((a,b))).",
1369
1369
  "readCount": 1,
1370
- "expected": "- (a,b)³",
1370
+ "expected": "- (a,b)",
1371
1371
  "outcome": {
1372
1372
  "type": "success",
1373
1373
  "stages": [
1374
1374
  {
1375
- "output": "-(a,b)",
1375
+ "output": "- (a,b)",
1376
1376
  "variables": "[]"
1377
1377
  }
1378
1378
  ]
@@ -1388,7 +1388,7 @@
1388
1388
  "type": "success",
1389
1389
  "stages": [
1390
1390
  {
1391
- "output": "-(1*2)",
1391
+ "output": "- (1*2)",
1392
1392
  "variables": "[]"
1393
1393
  }
1394
1394
  ]
@@ -1420,7 +1420,7 @@
1420
1420
  "type": "success",
1421
1421
  "stages": [
1422
1422
  {
1423
- "output": "-(-)",
1423
+ "output": "- (-)",
1424
1424
  "variables": "[]"
1425
1425
  }
1426
1426
  ]
@@ -1431,7 +1431,7 @@
1431
1431
  "query": "writeq(-[-]).",
1432
1432
  "input": "writeq(-[-]).",
1433
1433
  "readCount": 1,
1434
- "expected": "-[-] ³",
1434
+ "expected": "-[-]",
1435
1435
  "outcome": {
1436
1436
  "type": "success",
1437
1437
  "stages": [
@@ -1479,7 +1479,7 @@
1479
1479
  "query": "writeq(-{a}).",
1480
1480
  "input": "writeq(-{a}).",
1481
1481
  "readCount": 1,
1482
- "expected": "-{a}³",
1482
+ "expected": "-{a}",
1483
1483
  "outcome": {
1484
1484
  "type": "success",
1485
1485
  "stages": [
@@ -1532,7 +1532,7 @@
1532
1532
  "type": "success",
1533
1533
  "stages": [
1534
1534
  {
1535
- "output": "- -(1)",
1535
+ "output": "- - (1)",
1536
1536
  "variables": "[]"
1537
1537
  }
1538
1538
  ]
@@ -1543,7 +1543,7 @@
1543
1543
  "query": "op(100,yfx,~).\nwriteq(-(1~2~3)).",
1544
1544
  "input": "op(100,yfx,~).\nwriteq(-(1~2~3)).",
1545
1545
  "readCount": 2,
1546
- "expected": "- (1~2~3)³",
1546
+ "expected": "- (1~2~3)",
1547
1547
  "outcome": {
1548
1548
  "type": "success",
1549
1549
  "stages": [
@@ -1552,7 +1552,7 @@
1552
1552
  "variables": "[]"
1553
1553
  },
1554
1554
  {
1555
- "output": "-(1~2~3)",
1555
+ "output": "- (1~2~3)",
1556
1556
  "variables": "[]"
1557
1557
  }
1558
1558
  ]
@@ -1563,7 +1563,7 @@
1563
1563
  "query": " /**/ writeq(- (1~2)).",
1564
1564
  "input": "(catch((op(100,yfx,~)), _, true) -> true ; true).\n writeq(- (1~2)).",
1565
1565
  "readCount": 2,
1566
- "expected": "- (1~2)³",
1566
+ "expected": "- (1~2)",
1567
1567
  "outcome": {
1568
1568
  "type": "success",
1569
1569
  "stages": [
@@ -1572,7 +1572,7 @@
1572
1572
  "variables": "[]"
1573
1573
  },
1574
1574
  {
1575
- "output": "-(1~2)",
1575
+ "output": "- (1~2)",
1576
1576
  "variables": "[]"
1577
1577
  }
1578
1578
  ]
@@ -1619,7 +1619,7 @@
1619
1619
  "query": "op(9,xf,'$VAR'), writeq(- '$VAR'(0)).",
1620
1620
  "input": "op(9,xf,'$VAR'), writeq(- '$VAR'(0)).",
1621
1621
  "readCount": 1,
1622
- "expected": "-A ³",
1622
+ "expected": "-A",
1623
1623
  "outcome": {
1624
1624
  "type": "success",
1625
1625
  "stages": [
@@ -1695,7 +1695,7 @@
1695
1695
  "query": "compound(+1).",
1696
1696
  "input": "compound(+1).",
1697
1697
  "readCount": 1,
1698
- "expected": "succeeds ²",
1698
+ "expected": "succeeds",
1699
1699
  "outcome": {
1700
1700
  "type": "success",
1701
1701
  "stages": [
@@ -1711,7 +1711,7 @@
1711
1711
  "query": "compound(+ 1).",
1712
1712
  "input": "compound(+ 1).",
1713
1713
  "readCount": 1,
1714
- "expected": "succeeds ²",
1714
+ "expected": "succeeds",
1715
1715
  "outcome": {
1716
1716
  "type": "success",
1717
1717
  "stages": [
@@ -1727,7 +1727,7 @@
1727
1727
  "query": "writeq(+1^2).",
1728
1728
  "input": "writeq(+1^2).",
1729
1729
  "readCount": 1,
1730
- "expected": "+1^2 ²",
1730
+ "expected": "+1^2",
1731
1731
  "outcome": {
1732
1732
  "type": "success",
1733
1733
  "stages": [
@@ -1754,7 +1754,7 @@
1754
1754
  "query": "writeq([+{a},+[]]).",
1755
1755
  "input": "writeq([+{a},+[]]).",
1756
1756
  "readCount": 1,
1757
- "expected": "[+{a},+[]] ² ³",
1757
+ "expected": "[+{a},+[]]",
1758
1758
  "outcome": {
1759
1759
  "type": "success",
1760
1760
  "stages": [
@@ -1819,7 +1819,7 @@
1819
1819
  "query": "op(999,xfy,'|').",
1820
1820
  "input": "op(999,xfy,'|').",
1821
1821
  "readCount": 1,
1822
- "expected": "p._e.(c., o.,'|') ²",
1822
+ "expected": "p._e.(c., o.,'|')",
1823
1823
  "outcome": {
1824
1824
  "type": "error",
1825
1825
  "formal": "permission_error(create, operator)"
@@ -1952,7 +1952,7 @@
1952
1952
  "query": "current_op(200,fy,+).",
1953
1953
  "input": "current_op(200,fy,+).",
1954
1954
  "readCount": 1,
1955
- "expected": "succeeds ²",
1955
+ "expected": "succeeds",
1956
1956
  "outcome": {
1957
1957
  "type": "success",
1958
1958
  "stages": [
@@ -2984,7 +2984,7 @@
2984
2984
  "type": "success",
2985
2985
  "stages": [
2986
2986
  {
2987
- "output": "-(a*b)",
2987
+ "output": "- (a*b)",
2988
2988
  "variables": "[]"
2989
2989
  }
2990
2990
  ]
@@ -3000,7 +3000,7 @@
3000
3000
  "type": "success",
3001
3001
  "stages": [
3002
3002
  {
3003
- "output": "\\(a*b)",
3003
+ "output": "\\ (a*b)",
3004
3004
  "variables": "[]"
3005
3005
  }
3006
3006
  ]
@@ -3173,7 +3173,7 @@
3173
3173
  "query": "writeq('$VAR'(0)).",
3174
3174
  "input": "writeq('$VAR'(0)).",
3175
3175
  "readCount": 1,
3176
- "expected": "A ³",
3176
+ "expected": "A",
3177
3177
  "outcome": {
3178
3178
  "type": "success",
3179
3179
  "stages": [
@@ -3738,7 +3738,7 @@
3738
3738
  "query": " /**/ writeq(\"a\").",
3739
3739
  "input": "(catch((set_prolog_flag(\n double_quotes,chars)), _, true) -> true ; true).\n writeq(\"a\").",
3740
3740
  "readCount": 2,
3741
- "expected": "[a] ³",
3741
+ "expected": "[a]",
3742
3742
  "outcome": {
3743
3743
  "type": "success",
3744
3744
  "stages": [
@@ -3885,7 +3885,7 @@
3885
3885
  "query": " /**/ writeq((a-->b,c|d)).",
3886
3886
  "input": "(catch((op(1105,xfy,'|')), _, true) -> true ; true).\n writeq((a-->b,c|d)).",
3887
3887
  "readCount": 2,
3888
- "expected": "a-->b,c|d² ³",
3888
+ "expected": "a-->b,c|d",
3889
3889
  "outcome": {
3890
3890
  "type": "success",
3891
3891
  "stages": [
@@ -3956,7 +3956,7 @@
3956
3956
  "query": " /**/ writeq([(a|b)]).",
3957
3957
  "input": "(catch((op(1105,xfy,'|')), _, true) -> true ; true).\n writeq([(a|b)]).",
3958
3958
  "readCount": 2,
3959
- "expected": "[(a|b)] ³",
3959
+ "expected": "[(a|b)]",
3960
3960
  "outcome": {
3961
3961
  "type": "success",
3962
3962
  "stages": [
@@ -4210,7 +4210,7 @@
4210
4210
  "query": "op(400,fx,f).\nwriteq(f/*.*/(1,2)).",
4211
4211
  "input": "op(400,fx,f).\nwriteq(f/*.*/(1,2)).",
4212
4212
  "readCount": 2,
4213
- "expected": "f (1,2)³",
4213
+ "expected": "f (1,2)",
4214
4214
  "outcome": {
4215
4215
  "type": "success",
4216
4216
  "stages": [
@@ -4660,7 +4660,7 @@
4660
4660
  "query": "op(500, xfy, {}).",
4661
4661
  "input": "op(500, xfy, {}).",
4662
4662
  "readCount": 1,
4663
- "expected": "p._e.(c.,o.,{}) ²",
4663
+ "expected": "p._e.(c.,o.,{})",
4664
4664
  "outcome": {
4665
4665
  "type": "error",
4666
4666
  "formal": "permission_error(create, operator)"
@@ -4958,7 +4958,7 @@
4958
4958
  "variables": "[]"
4959
4959
  },
4960
4960
  {
4961
- "output": "~(a=b)",
4961
+ "output": "~ (a=b)",
4962
4962
  "variables": "[]"
4963
4963
  }
4964
4964
  ]
@@ -4974,7 +4974,7 @@
4974
4974
  "type": "success",
4975
4975
  "stages": [
4976
4976
  {
4977
- "output": "\\(a=b)",
4977
+ "output": "\\ (a=b)",
4978
4978
  "variables": "[]"
4979
4979
  }
4980
4980
  ]
@@ -4990,7 +4990,7 @@
4990
4990
  "type": "success",
4991
4991
  "stages": [
4992
4992
  {
4993
- "output": "+(a=b)",
4993
+ "output": "+ (a=b)",
4994
4994
  "variables": "[]"
4995
4995
  }
4996
4996
  ]
@@ -5076,7 +5076,7 @@
5076
5076
  "type": "success",
5077
5077
  "stages": [
5078
5078
  {
5079
- "output": "+(1*2)^3",
5079
+ "output": "+ (1*2)^3",
5080
5080
  "variables": "[]"
5081
5081
  }
5082
5082
  ]
@@ -5092,7 +5092,7 @@
5092
5092
  "type": "success",
5093
5093
  "stages": [
5094
5094
  {
5095
- "output": "-((1*2)^3)",
5095
+ "output": "- ((1*2)^3)",
5096
5096
  "variables": "[]"
5097
5097
  }
5098
5098
  ]
@@ -314,6 +314,19 @@ probe :- empty_assoc(A), copy_term_nat(A, _), bb_b_put(current, ok), bb_get(curr
314
314
  goal: "catch((VN=[[]],write_term(T,[variable_names(VN)])),error(E,_),writeq(E))",
315
315
  });
316
316
  assertEqual(list.stdout, 'domain_error(write_option,variable_names([[]]))', 'list culprit');
317
+
318
+ assertEqual(run('', { isoStrict: true, goal: 'writeq(-(1^2))' }).stdout.split('writeq(')[0],
319
+ '- (1^2)', 'writeq negative power layout');
320
+ assertEqual(run('', { isoStrict: true, goal: 'writeq(-(a^2))' }).stdout.split('writeq(')[0],
321
+ '- (a^2)', 'writeq symbolic negative power layout');
322
+ assertEqual(run('', {
323
+ isoStrict: true,
324
+ goal: "write_term(-X^2,[variable_names(['X'=X])])",
325
+ }).stdout, '- (X^2)', 'write_term variable_names negative power layout');
326
+ assertEqual(run('', {
327
+ isoStrict: true,
328
+ goal: "X=1,write_term(-X^2,[variable_names(['X'=X])])",
329
+ }).stdout.split('1 = 1')[0], '- (1^2)', 'write_term bound variable negative power layout');
317
330
  },
318
331
  },
319
332
  {
@@ -3703,6 +3716,16 @@ function documentationSyncCases() {
3703
3716
  assertEqual(parsed[0].query, 'set_prolog_flag( double_quotes,chars).', 'normalized query');
3704
3717
  },
3705
3718
  },
3719
+ {
3720
+ name: 'WG17 upgrader removes presentation footnote markers from Codex text',
3721
+ run: () => {
3722
+ const rows = Array.from({ length: 120 }, (_, index) =>
3723
+ `<tr><td>${index + 1}<td>writeq(-(1^2)).<td>- (1^2)&sup3;`).join('\n');
3724
+ const html = `<table><tr><th>#<th>Query<th>Codex${rows}</table>`;
3725
+ const parsed = parseWg17SyntaxTable(html);
3726
+ assertEqual(parsed[0].expected, '- (1^2)', 'normalized Codex expectation');
3727
+ },
3728
+ },
3706
3729
  {
3707
3730
  name: 'WG17 upstream expectations independently validate reviewed outcomes',
3708
3731
  run: () => {
@@ -3719,6 +3742,22 @@ function documentationSyncCases() {
3719
3742
  true,
3720
3743
  'observable output',
3721
3744
  );
3745
+ const negativePower = { id: 183, input: 'writeq(-(1^2)).' };
3746
+ assertEqual(
3747
+ matchesUpstreamExpectation('- (1^2)', { type: 'success', stages: [{ output: '-(1^2)', variables: '[]' }] }, negativePower),
3748
+ false,
3749
+ 'mandatory operator/parenthesis layout is not erased',
3750
+ );
3751
+ assertEqual(
3752
+ matchesUpstreamExpectation('- (a^2)', { type: 'success', stages: [{ output: '-a^2', variables: '[]' }] }, negativePower),
3753
+ false,
3754
+ 'mandatory negative-power parentheses are not erased',
3755
+ );
3756
+ assertEqual(
3757
+ matchesUpstreamExpectation('- (1^2)', { type: 'success', stages: [{ output: '- (1 ^ 2)', variables: '[]' }] }, negativePower),
3758
+ true,
3759
+ 'non-semantic internal operator spacing remains flexible',
3760
+ );
3722
3761
  const repeated = {
3723
3762
  id: 227, input: 'write_canonical(B+B).',
3724
3763
  outcome: { type: 'success', stages: [{ output: '+(_A,_A)', variables: "['B' = B]" }] },
@@ -3798,7 +3837,7 @@ function documentationSyncCases() {
3798
3837
  'README cover links to the book',
3799
3838
  );
3800
3839
  for (const filename of ['src/iso.js', 'src/dcg.js', 'src/atts.js', 'src/standard-library.js',
3801
- 'src/CLPZ-MIGRATION.md', 'src/lib/aggregate.pl', 'src/lib/atts.pl', 'src/lib/comparison.pl', 'src/lib/dates.pl',
3840
+ 'src/lib/aggregate.pl', 'src/lib/atts.pl', 'src/lib/comparison.pl', 'src/lib/dates.pl',
3802
3841
  'src/lib/iso_ext.pl', 'src/lib/lists.pl', 'src/lib/primes.pl', 'src/lib/prologue.pl',
3803
3842
  'src/lib/random.pl', 'src/lib/strings.pl', 'src/lib/uuid.pl',
3804
3843
  'src/playground-worker.js']) {
@@ -4900,7 +4939,7 @@ answer(ok) :-
4900
4939
  assertEqual(Boolean(registry.get('is', 2)), true, 'ISO is/2 exists');
4901
4940
  assertEqual(Boolean(registry.get('append', 3)), false, 'append/3 is not ISO core');
4902
4941
  assertEqual(library.eyePrologLibrary, true, 'complete registry marker');
4903
- assertEqual(library.defs.size, 175, 'EyeProlog registry contains ISO definitions, cleanup controls, observability extensions, WFS tnot/1, and private library adapters');
4942
+ assertEqual(library.defs.size, 154, 'EyeProlog registry contains ISO definitions, cleanup controls, observability extensions, WFS tnot/1, and generic library adapters');
4904
4943
  assertEqual(Boolean(registry.get('phrase', 2)), true, 'Part 3 phrase/2 exists');
4905
4944
  assertEqual(Boolean(registry.get('phrase', 3)), true, 'Part 3 phrase/3 exists');
4906
4945
  assertEqual(registry.get('statistics', 0), null, 'statistics/0 is absent from the ISO registry');
@@ -4938,8 +4977,8 @@ answer(ok) :-
4938
4977
  assertEqual(registry.get('eyeprolog__countall', 2), null, 'private countall adapter is absent from ISO registry');
4939
4978
  assertEqual(Boolean(library.get('eyeprolog__countall', 2)), true, 'private countall adapter is registered for EyeProlog');
4940
4979
  assertEqual(Boolean(library.get('eyeprolog__time', 1)), true, 'private time adapter is registered for EyeProlog');
4941
- assertEqual(Boolean(library.get('eyeprolog__clpz_labeling', 2)), true, 'private CLP(Z) labeling adapter is registered');
4942
- assertEqual(Boolean(library.get('eyeprolog__clpz_global_cardinality', 3)), true, 'private CLP(Z) cardinality adapter is registered');
4980
+ assertEqual(library.get('eyeprolog__clpz_labeling', 2), null, 'CLP(Z) labeling is implemented in Prolog');
4981
+ assertEqual(library.get('eyeprolog__clpz_global_cardinality', 3), null, 'CLP(Z) cardinality is implemented in Prolog');
4943
4982
  assertEqual(registry.get('put_atts', 2), null, 'put_atts/2 is absent from the ISO registry');
4944
4983
  assertEqual(Boolean(library.get('put_atts', 2)), true, 'put_atts/2 is registered for attributed-variable libraries');
4945
4984
  assertEqual(Boolean(library.get('$put_to_attr_list', 3)), true, 'private attribute-list adapter is registered');
@@ -5079,7 +5118,7 @@ repeated(X) :- X in 1..3, all_distinct([X, X]).
5079
5118
  `);
5080
5119
  assertEqual(program.findGroup('labeling', 2)?.module, 'clpz', 'labeling/2 module');
5081
5120
  assertEqual(run(program, { goals: ['answer(X, Y, B)', 'contradiction', 'pruned(Domain)', 'hall(Domain)', 'repeated(X)'] }).stdout,
5082
- 'answer(1, 4, 1).\nanswer(2, 3, 0).\npruned(1 \\/ 3).\nhall(3).\n', 'CLP(Z) constrained answers');
5121
+ 'answer(1, 4, 1).\nanswer(2, 3, 0).\npruned(1 \\/ 3).\nhall(3..3).\n', 'CLP(Z) constrained answers');
5083
5122
  },
5084
5123
  },
5085
5124
  {
package/test/run-wg17.mjs CHANGED
@@ -140,6 +140,38 @@ function stripLayoutOutsideQuotes(text) {
140
140
  return output.replace(/\.$/, '').replace(/([eE])\+(?=\d)/g, '$1');
141
141
  }
142
142
 
143
+ function leadingGraphicOperatorParenSignature(text) {
144
+ const source = presentationText(text);
145
+ let index = 0;
146
+ const operators = [];
147
+ while (index < source.length) {
148
+ const match = source.slice(index).match(/^[!#$&*+\-./<=>?@^~\\]+/);
149
+ if (match == null) return null;
150
+ operators.push(match[0]);
151
+ index += match[0].length;
152
+ const layoutStart = index;
153
+ while (/\s/.test(source[index] ?? '')) index++;
154
+ if (index === layoutStart) return null;
155
+ if (source[index] === '(') return operators;
156
+ }
157
+ return null;
158
+ }
159
+
160
+ function preservesLeadingOperatorParenLayout(expected, actual) {
161
+ const signature = leadingGraphicOperatorParenSignature(expected);
162
+ if (signature == null) return true;
163
+ const source = presentationText(actual);
164
+ let index = 0;
165
+ for (const operator of signature) {
166
+ if (!source.startsWith(operator, index)) return false;
167
+ index += operator.length;
168
+ const layoutStart = index;
169
+ while (/\s/.test(source[index] ?? '')) index++;
170
+ if (index === layoutStart) return false;
171
+ }
172
+ return source[index] === '(';
173
+ }
174
+
143
175
  function normalizeExampleVariables(text) {
144
176
  const names = new Map();
145
177
  let next = 0;
@@ -248,6 +280,10 @@ function textExpectationMatches(expectedText, actual, item, example = false) {
248
280
  left = normalizeExampleVariables(left);
249
281
  right = normalizeExampleVariables(right);
250
282
  }
283
+ // Some Codex expectations intentionally carry a mandatory lexical
284
+ // boundary, notably Cor.3 prefix-operator cases such as `- (1^2)`. Do not
285
+ // erase that boundary before the semantic/layout-tolerant fallbacks below.
286
+ if (!preservesLeadingOperatorParenLayout(left, right)) continue;
251
287
  if (stripLayoutOutsideQuotes(left) === stripLayoutOutsideQuotes(right)) return true;
252
288
  if (termEquivalent(left, right, item)) return true;
253
289
  if (example) {
@@ -6414,28 +6414,24 @@ level projects module `attribute_goals//1` hooks as residual goals. The checked
6414
6414
  [`examples/attributed-variables.pl`](https://github.com/eyereasoner/eyeprolog/blob/main/examples/attributed-variables.pl)
6415
6415
  demonstrates binding verification and attribute transfer across aliases.
6416
6416
 
6417
- `library(clpz)` follows the familiar Trealla and Scryer convention for
6418
- constraint logic programming over integers. EyeProlog currently provides finite
6419
- interval and union domains, arithmetic and reified constraints, backtrackable
6420
- labeling with `ff`, `up`, and `down`, global distinctness, linear sums and scalar
6421
- products, chains, elements, value counting, extensional tuple tables,
6422
- lexicographic chains, serialized schedules, global cardinality with costs,
6423
- Hamiltonian circuits, three-way comparison, and domain reflection. Its existing
6424
- `src/clpz.js` store is now explicitly transitional: the attributed-variable layer
6425
- is intended to support staged reuse of Markus Triska's MIT-licensed
6426
- [Scryer `clpz.pl`](https://github.com/mthom/scryer-prolog/blob/master/src/lib/clpz.pl).
6427
- The generic compile-time expansion blocker is now closed: normal-profile source
6428
- loading runs module-local and `user` `term_expansion/2` and `goal_expansion/2`
6429
- hooks, accepts clause-list expansions, preserves surrounding variable sharing,
6430
- and provides `expand_term/2` for processor DCG lowering. EyeProlog now also
6431
- registers the Scryer support modules needed by that source (`assoc`, `pairs`,
6432
- `between`, `dcgs`, `terms`, `error`, `si`, `freeze`, `arithmetic`, `debug`, and
6433
- `format`) and supplies a generic copy-on-write backtrackable blackboard. The
6434
- remaining migration step is to vendor and load a pinned upstream `clpz.pl`, then
6435
- establish behavioral and performance parity before removing the JS kernel. The
6436
- migration state is tracked in [`src/CLPZ-MIGRATION.md`](src/CLPZ-MIGRATION.md).
6437
- Until parity is reached, the JS kernel remains the active implementation so
6438
- existing CLP(Z) behavior does not regress.
6417
+ `library(clpz)` is Markus Triska's MIT-licensed Scryer Prolog implementation of
6418
+ constraint logic programming over integers, bundled as `src/lib/clpz.pl`.
6419
+ EyeProlog executes the Prolog propagator implementation through the generic
6420
+ attributed-variable machinery in `src/term.js` and `src/atts.js`. The library
6421
+ provides relational arithmetic and reification, finite and union domains,
6422
+ labeling, all-different/all-distinct constraints, sums and scalar products,
6423
+ extensional tuple tables, lexicographic chains, serialized and cumulative
6424
+ scheduling, global cardinality with costs, Hamiltonian circuits, `disjoint2/1`,
6425
+ `automaton/3,8`, value counting, comparison, and domain reflection.
6426
+
6427
+ The compiler services used by the library are ordinary EyeProlog facilities:
6428
+ module-local and `user` `term_expansion/2` and `goal_expansion/2`, clause-list
6429
+ expansion, and `expand_term/2` for processor DCG lowering. The same runtime also
6430
+ provides a generic copy-on-write backtrackable blackboard and the supporting
6431
+ Prolog modules `assoc`, `pairs`, `between`, `dcgs`, `terms`, `error`, `si`,
6432
+ `freeze`, `arithmetic`, `debug`, and `format`. The bundled CLP(Z) source is
6433
+ synchronized with Scryer commit `e3df91e25f8a09ee942c04e8baef553bba5c6110`,
6434
+ Git blob `806445c11e14c8b2515f3de7f309e0ac04d9ad04`.
6439
6435
 
6440
6436
  Alongside its interop entries `call_nth/2`, `time/1`, and `.../2`,
6441
6437
  `library(iso_ext)` also exports EyeProlog's extension relations `countall/2`,
@@ -7204,9 +7200,9 @@ mode at a time.
7204
7200
  | --- | --- | --- |
7205
7201
  | [CLP(Z) factorial](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-factorial.pl) | Declarative predecessor and product constraints propagate a factorial without mode-sensitive `is/2`. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-factorial.pl) |
7206
7202
  | [CLP(Z) global constraints](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-global-constraints.pl) | Compatibility tables, lexicographic and serialized schedules, global cardinality with costs, circuits, value counting, and integer comparison. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-global-constraints.pl) |
7207
- | [CLP(Z) N-queens](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-n-queens.pl) | Eight-queens using finite domains, delayed diagonal constraints, `all_distinct/1`, and first-fail labeling, plus a small multi-solution enumeration check. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-n-queens.pl) |
7203
+ | [CLP(Z) N-queens](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-n-queens.pl) | A checked eight-queens witness using finite domains, delayed diagonal constraints, `all_distinct/1`, and first-fail labeling, plus a four-queens multi-solution search. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-n-queens.pl) |
7208
7204
  | [CLP(Z) resource allocation](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-resource-allocation.pl) | Resource assignment using `element/3`, `sum/3`, `scalar_product/4`, reification, labeling options, and domain reflection. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-resource-allocation.pl) |
7209
- | [CLP(Z) Sudoku 9×9](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-sudoku-9x9.pl) | The difficult AI Escargot puzzle modeled with finite domains, 27 all-distinct constraints, and first-fail labeling. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-sudoku-9x9.pl) |
7205
+ | [CLP(Z) Sudoku 9×9](https://github.com/eyereasoner/eyeprolog/blob/main/examples/clpz-sudoku-9x9.pl) | The AI Escargot 9×9 model with finite domains, 27 all-distinct constraints, and first-fail labeling; the default golden verifies its known solution while `sudoku9/1` remains the search relation. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/clpz-sudoku-9x9.pl) |
7210
7206
  | [Combinatorics Findall Sort](https://github.com/eyereasoner/eyeprolog/blob/main/examples/combinatorics-findall-sort.pl) | Eyelet-inspired combinations example using `findall/3` and ISO `sort/2`. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/combinatorics-findall-sort.pl) |
7211
7207
  | [Floating Point](https://github.com/eyereasoner/eyeprolog/blob/main/examples/floating-point.pl) | Floating-point arithmetic and comparisons. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/floating-point.pl) · [proof](https://github.com/eyereasoner/eyeprolog/blob/main/examples/proof/floating-point.pl) |
7212
7208
  | [Atomic conversion](https://github.com/eyereasoner/eyeprolog/blob/main/examples/iso-atomic-conversion.pl) | Atom splitting, character atoms, Unicode codes, and numeric parsing. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/iso-atomic-conversion.pl) |
@@ -99,10 +99,14 @@ upstream assertion.
99
99
 
100
100
  ## Current standing
101
101
 
102
+ The percentage below is **traceability coverage**, not a conformance pass rate.
103
+ A represented case still has to pass the executable upstream assertion in
104
+ \`test/run-wg17.mjs\`.
105
+
102
106
  | Measure | Count |
103
107
  | --- | ---: |
104
108
  | Active upstream cases | ${activeIds.length} |
105
- | Executable EyeProlog dispositions | ${coveredIds.length} (${percentage}%) |
109
+ | Upstream cases represented in the executable matrix | ${coveredIds.length} (${percentage}%) |
106
110
  | Not yet traced one-by-one | ${untracedIds.length} |
107
111
  | Deleted upstream identifiers | ${formatRanges(manifest.upstream.deletedIds)} |
108
112
 
@@ -16,6 +16,7 @@ const namedEntities = new Map([
16
16
  ['amp', '&'], ['lt', '<'], ['gt', '>'], ['quot', '"'], ['apos', "'"],
17
17
  ['nbsp', '\u00a0'], ['ndash', '–'], ['mdash', '—'], ['minus', '−'],
18
18
  ['hellip', '…'], ['middot', '·'], ['times', '×'], ['laquo', '«'], ['raquo', '»'],
19
+ ['sup2', '²'], ['sup3', '³'], ['deg', '°'],
19
20
  ]);
20
21
 
21
22
  export function decodeHtmlEntities(text) {
@@ -96,7 +97,7 @@ export function parseWg17SyntaxTable(html) {
96
97
  // They are not part of the Prolog source being specified, so normalize
97
98
  // them to ordinary spaces before snapshotting/comparing rows.
98
99
  const query = htmlCellText(cells[1]).replace(/\u00a0/g, ' ');
99
- const expected = htmlCellText(cells[2]).replace(/\u00a0/g, ' ').replace(/[ \t\n]+/g, ' ').trim();
100
+ const expected = htmlCellText(cells[2]).replace(/\u00a0/g, ' ').replace(/[²³°]/g, '').replace(/[ \t\n]+/g, ' ').trim();
100
101
  if (query.length === 0 || expected.length === 0) continue;
101
102
  cases.push({ id, query, expected });
102
103
  seen.add(id);