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.
- package/ACKNOWLEDGEMENTS.md +3 -3
- package/conformance-report.md +14 -20
- package/package.json +1 -1
- package/src/iso.js +4 -6
- package/test/conformance/cases/iso/part3_grammar_body_constructs.pl +10 -11
- package/test/conformance/cases/iso/part3_phrase_examples.pl +1 -2
- package/test/run-conformance-report.mjs +17 -25
package/ACKNOWLEDGEMENTS.md
CHANGED
|
@@ -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
|
|
10
|
-
|
|
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:
|
|
18
|
+
- ISO/IEC TS 13211-3:2025, *Part 3: Definite clause grammar rules*
|
|
19
19
|
|
|
20
20
|
## External conformance corpora
|
|
21
21
|
|
package/conformance-report.md
CHANGED
|
@@ -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
|
-
##
|
|
50
|
+
## DCG conformance clarification
|
|
51
51
|
|
|
52
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
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:
|
|
3026
|
-
// type_error(
|
|
3027
|
-
//
|
|
3028
|
-
//
|
|
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:
|
|
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
|
-
%
|
|
4
|
+
% phrase([], S0, S) is true iff S0 = S.
|
|
6
5
|
answer(empty_sequence, S) :- phrase([], [a,b], S).
|
|
7
6
|
|
|
8
|
-
%
|
|
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
|
-
%
|
|
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
|
-
%
|
|
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
|
-
%
|
|
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
|
-
%
|
|
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
|
-
%
|
|
25
|
+
% phrase(!, S0, S) is true iff S0 = S.
|
|
27
26
|
answer(cut_identity, S) :- phrase(!, [a,b], S).
|
|
28
27
|
|
|
29
|
-
%
|
|
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
|
-
%
|
|
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)
|
|
@@ -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(...
|
|
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
|
-
//
|
|
137
|
-
|
|
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
|
-
'##
|
|
140
|
+
'## DCG conformance clarification',
|
|
143
141
|
'',
|
|
144
|
-
'
|
|
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
|
-
'
|
|
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
|
-
'
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
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
|
}
|