eyeprolog 1.5.46 → 1.5.47

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.
@@ -6,8 +6,8 @@ Scale) research team, as part of the **Koreografeye** project.
6
6
 
7
7
  ## Standards
8
8
 
9
- Conformance work on this repository is checked against the following documents,
10
- which are consulted under a single-user licence and are not redistributed here:
9
+ Conformance work on this repository targets the following standards.
10
+ Licensed standards documents are not redistributed here:
11
11
 
12
12
  - ISO/IEC 13211-1:1995, *Information technology — Programming languages —
13
13
  Prolog — Part 1: General core*
@@ -15,7 +15,7 @@ which are consulted under a single-user licence and are not redistributed here:
15
15
  - ISO/IEC 13211-1:1995/Cor.2:2012
16
16
  - ISO/IEC 13211-1:1995/Cor.3:2017
17
17
  - ISO/IEC 13211-2:2000, *Part 2: Modules*, and its 2013 amendment
18
- - ISO/IEC TS 13211-3:2023, *Part 3: Definite clause grammar rules*
18
+ - ISO/IEC TS 13211-3:2025, *Part 3: Definite clause grammar rules*
19
19
 
20
20
  ## External conformance corpora
21
21
 
@@ -47,27 +47,21 @@ spelling therefore changes this report even when no corpus file is added or remo
47
47
  | variables | 16 | 7 | 0 | 0 | 23 |
48
48
  | **Total** | **493** | **272** | **19** | **21** | **805** |
49
49
 
50
- ## Known deviations
50
+ ## DCG conformance clarification
51
51
 
52
- These are conscious departures from a standards clause, not open defects.
52
+ EyeProlog checks the input and remainder of `phrase/2-3` and reports
53
+ `type_error(list, S)` when an argument is neither a list nor a partial list.
54
+ These implementation-defined checks follow ISO/IEC TS 13211-3:2025,
55
+ 8.18.1.3 g and h; this behavior is not a known deviation.
53
56
 
54
- ### phrase/2-3 terminal-sequence type errors
57
+ The Part 3 implementation target is
58
+ [ISO/IEC TS 13211-3:2025](https://www.iso.org/standard/83635.html).
59
+ The public [error subclause](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/draft-8.18.1.3)
60
+ also specifies `list` for these checks.
55
61
 
56
- ISO/IEC TS 13211-3:2023, 8.18.1.4 c and d specify that a processor which
57
- checks the terminal-sequence arguments of `phrase/2-3` shall report
58
- `type_error(terminal_sequence, S)`. Error clause c is required for
59
- `phrase/2` and implementation defined for `phrase/3`.
60
-
61
- EyeProlog checks both arguments but reports `type_error(list, S)`.
62
- Ulrich Neumerkel's `phrase_quad.pl` corpus, which the release gate fetches
63
- live from TU Wien, accepts only `false` or `type_error(list, S)` for quads
64
- 41 and 42, so the published TS and that corpus cannot both be satisfied.
65
- The corpus predates the TS. Changing the error term is a one-line edit in
66
- `phraseSolutions` (`src/iso.js`); it additionally requires relaxing quads
67
- 41-42 of the Neumerkel gate.
68
-
69
- Note that TS 13211-3, 7.14.7.2 gives `phrase({true}, nonlist, S)` as an
70
- example which succeeds with `S = nonlist`, which is consistent with the TS
71
- permitting `phrase/3` to omit the check entirely. EyeProlog prefers the
72
- stricter diagnostic that the TS also explicitly allows.
62
+ The [phrase comparison](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/phrase)
63
+ links the machine-readable `phrase_quad.pl` corpus. `npm test` fetches and
64
+ runs that corpus live through the Neumerkel gate; the offline regression
65
+ suite runs all 58 vendored quads. Neither expectations nor error matching
66
+ are relaxed for quads 41-44.
73
67
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.5.46",
6
+ "version": "1.5.47",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
package/src/iso.js CHANGED
@@ -3022,12 +3022,10 @@ function* phraseSolutions({ solver, goal, env }, state) {
3022
3022
  const input = goal.args[1];
3023
3023
  const requestedOutput = goal.arity === 2 ? emptyTerminalSequence() : goal.args[2];
3024
3024
  validateDcgEmbeddedGoals(grammarBody, input, requestedOutput);
3025
- // ISO/IEC TS 13211-3:2023, 8.18.1.4 c and d require
3026
- // type_error(terminal_sequence, S) here. EyeProlog still reports
3027
- // type_error(list, S): Ulrich Neumerkel's phrase_quad corpus, which the
3028
- // release gate fetches live, accepts only `false` or type_error(list, S)
3029
- // for quads 41-42, so the two cannot currently both be satisfied. See
3030
- // conformance-report.md, "Known deviations".
3025
+ // ISO/IEC TS 13211-3:2025, 8.18.1.3 g and h permit these checks
3026
+ // and specify type_error(list, S) for invalid terminal-sequence arguments.
3027
+ // Keep both diagnostics and the unmodified upstream phrase quad gate.
3028
+ // See conformance-report.md and issue #94.
3031
3029
  if (!isListOrPartialList(input, env)) {
3032
3030
  throw new PrologError('type_error(list)', deref(input, env));
3033
3031
  }
@@ -1,35 +1,34 @@
1
- % ISO/IEC TS 13211-3:2023, 7.14 - the semantics of each grammar body element,
2
- % expressed as the phrase/3 identities the TS states for them.
1
+ % ISO/IEC TS 13211-3:2025 grammar-body semantics regressions.
3
2
  digit(D) --> [D], { member(D, [a,b]) }.
4
3
 
5
- % 7.14.1 phrase([], S0, S) is true iff S0 = S.
4
+ % phrase([], S0, S) is true iff S0 = S.
6
5
  answer(empty_sequence, S) :- phrase([], [a,b], S).
7
6
 
8
- % 7.14.3 phrase((A,B), S0, S) iff phrase(A, S0, S1), phrase(B, S1, S).
7
+ % phrase((A,B), S0, S) iff phrase(A, S0, S1), phrase(B, S1, S).
9
8
  answer(concatenation, S) :- phrase(([a], [b]), [a,b,c], S).
10
9
 
11
- % 7.14.4 phrase((A;B), S0, S) iff ( phrase(A,S0,S) ; phrase(B,S0,S) ).
10
+ % phrase((A;B), S0, S) iff ( phrase(A,S0,S) ; phrase(B,S0,S) ).
12
11
  answer(alternative, S) :- phrase(([a] ; [b]), [b,c], S).
13
12
 
14
- % 7.14.5.3 the if-then-else examples given verbatim in the TS.
13
+ % if-then-else regression examples.
15
14
  answer(ite_13, yes) :- phrase((("1" | "2") -> "3" ; "4"), "13").
16
15
  answer(ite_23, yes) :- phrase((("1" | "2") -> "3" ; "4"), "23").
17
16
  answer(ite_4, yes) :- phrase((("1" | "2") -> "3" ; "4"), "4").
18
17
  answer(ite_single, no) :- \+ phrase((("1" | "2") -> "3" ; "4"), [_]).
19
18
 
20
- % 7.14.7 phrase({G}, S0, S) is true iff ( G, S0 = S ).
19
+ % phrase({G}, S0, S) is true iff ( G, S0 = S ).
21
20
  answer(grammar_body_goal, S) :- phrase({true}, [a], S).
22
21
 
23
- % 7.14.9 phrase(phrase(NT), S0, S) iff phrase(NT, S0, S).
22
+ % phrase(phrase(NT), S0, S) iff phrase(NT, S0, S).
24
23
  answer(phrase_nonterminal, S) :- phrase(phrase([a]), [a,b], S).
25
24
 
26
- % 7.14.10 phrase(!, S0, S) is true iff S0 = S.
25
+ % phrase(!, S0, S) is true iff S0 = S.
27
26
  answer(cut_identity, S) :- phrase(!, [a,b], S).
28
27
 
29
- % 7.14.11 phrase(\+ GRBody, S0, S) iff ( \+ phrase(GRBody, S0, _), S0 = S ).
28
+ % phrase(\+ GRBody, S0, S) iff ( \+ phrase(GRBody, S0, _), S0 = S ).
30
29
  answer(negation_identity, S) :- phrase(\+ [a], [b,c], S).
31
30
  answer(negation_blocks, no) :- \+ phrase(\+ [a], [a], _).
32
31
 
33
- % 7.14.2 ('.')//2 separates a terminal from the rest of the sequence.
32
+ % ('.')//2 separates a terminal from the rest of the sequence.
34
33
  answer(terminal_split, D) :- phrase(digit(D), [b]).
35
34
  %% goal: answer(X0, X1)
@@ -1,5 +1,4 @@
1
- % ISO/IEC TS 13211-3:2023, 8.18.1.5 - the worked phrase/2 and phrase/3
2
- % examples, using the grammar given verbatim in that subclause.
1
+ % ISO/IEC TS 13211-3:2025 phrase/2 and phrase/3 regression examples.
3
2
  determiner --> [the].
4
3
  determiner --> [a].
5
4
 
@@ -119,7 +119,7 @@ export function formatConformanceReport(report = buildConformanceReport()) {
119
119
  }
120
120
  lines.push(`| **Total** | **${report.total.positive}** | **${report.total.errors}** | **${report.total.warnings}** | **${report.total.proofs}** | **${report.total.total}** |`);
121
121
 
122
- lines.push(...knownDeviationSection());
122
+ lines.push(...dcgConformanceSection());
123
123
 
124
124
  if (report.corpusIssues.length > 0) {
125
125
  lines.push('', '## Corpus issues', '');
@@ -133,35 +133,27 @@ export function formatConformanceReport(report = buildConformanceReport()) {
133
133
  return `${lines.join('\n')}\n`;
134
134
  }
135
135
 
136
- // Deviations that are known, deliberate, and traceable to a specific clause.
137
- // Keeping them in the generated report means they survive regeneration instead
138
- // of living only in a commit message.
139
- function knownDeviationSection() {
136
+ // Keep the standards clarification in the generated report.
137
+ function dcgConformanceSection() {
140
138
  return [
141
139
  '',
142
- '## Known deviations',
140
+ '## DCG conformance clarification',
143
141
  '',
144
- 'These are conscious departures from a standards clause, not open defects.',
142
+ 'EyeProlog checks the input and remainder of `phrase/2-3` and reports',
143
+ '`type_error(list, S)` when an argument is neither a list nor a partial list.',
144
+ 'These implementation-defined checks follow ISO/IEC TS 13211-3:2025,',
145
+ '8.18.1.3 g and h; this behavior is not a known deviation.',
145
146
  '',
146
- '### phrase/2-3 terminal-sequence type errors',
147
+ 'The Part 3 implementation target is',
148
+ '[ISO/IEC TS 13211-3:2025](https://www.iso.org/standard/83635.html).',
149
+ 'The public [error subclause](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/draft-8.18.1.3)',
150
+ 'also specifies `list` for these checks.',
147
151
  '',
148
- 'ISO/IEC TS 13211-3:2023, 8.18.1.4 c and d specify that a processor which',
149
- 'checks the terminal-sequence arguments of `phrase/2-3` shall report',
150
- '`type_error(terminal_sequence, S)`. Error clause c is required for',
151
- '`phrase/2` and implementation defined for `phrase/3`.',
152
- '',
153
- 'EyeProlog checks both arguments but reports `type_error(list, S)`.',
154
- 'Ulrich Neumerkel\'s `phrase_quad.pl` corpus, which the release gate fetches',
155
- 'live from TU Wien, accepts only `false` or `type_error(list, S)` for quads',
156
- '41 and 42, so the published TS and that corpus cannot both be satisfied.',
157
- 'The corpus predates the TS. Changing the error term is a one-line edit in',
158
- '`phraseSolutions` (`src/iso.js`); it additionally requires relaxing quads',
159
- '41-42 of the Neumerkel gate.',
160
- '',
161
- 'Note that TS 13211-3, 7.14.7.2 gives `phrase({true}, nonlist, S)` as an',
162
- 'example which succeeds with `S = nonlist`, which is consistent with the TS',
163
- 'permitting `phrase/3` to omit the check entirely. EyeProlog prefers the',
164
- 'stricter diagnostic that the TS also explicitly allows.',
152
+ 'The [phrase comparison](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/phrase)',
153
+ 'links the machine-readable `phrase_quad.pl` corpus. `npm test` fetches and',
154
+ 'runs that corpus live through the Neumerkel gate; the offline regression',
155
+ 'suite runs all 58 vendored quads. Neither expectations nor error matching',
156
+ 'are relaxed for quads 41-44.',
165
157
  '',
166
158
  ];
167
159
  }