eyeprolog 1.2.28 → 1.2.29

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 CHANGED
@@ -104,6 +104,9 @@ modules, DCGs, quads, libraries, proofs, and the other documented extensions.
104
104
 
105
105
  The auditable processor-requirement checklist lives in
106
106
  [`test/conformance/ISO-COMPLIANCE.md`](test/conformance/ISO-COMPLIANCE.md).
107
+ The separate [WG17 syntax ledger](test/conformance/WG17-SYNTAX-STATUS.md)
108
+ records executable dispositions for all 366 active upstream syntax cases
109
+ (100% traced) and runs as part of `npm test`.
107
110
  EyeProlog does not yet claim independent certification or closure of every
108
111
  normative Part 1 requirement.
109
112
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.2.28",
6
+ "version": "1.2.29",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
package/src/solver.js CHANGED
@@ -291,8 +291,8 @@ export class Solver {
291
291
  const rest = selectedIndex === 0 ? goals.slice(1) : [...goals.slice(0, selectedIndex), ...goals.slice(selectedIndex + 1)];
292
292
  if (goal.type === 'atom' && goal.name === '!' && goal.arity === 0) {
293
293
  const marker = active[active.length - 1] ?? null;
294
- this.cutEpoch++;
295
294
  if (marker) marker.cutEpoch = (marker.cutEpoch ?? 0) + 1;
295
+ else this.cutEpoch++;
296
296
  for (const solveStack of this.solveStacks) {
297
297
  for (let i = solveStack.length - 1; i >= 0; i--) {
298
298
  if (marker == null || solveStack[i].active?.includes(marker)) solveStack.splice(i, 1);
@@ -35,7 +35,7 @@ error-ordering alternative to an individual executable assertion.
35
35
  | 7.4 — Prolog text and directives | audit | All Part 1 directive indicators are parsed; include/ensure-loaded/operator/flag/character-conversion behavior has executable coverage. Cross-text `multifile/1` and ordering constraints require explicit shall-by-shall audit. |
36
36
  | 7.5-7.6 — database and term/clause conversion | audit | Dynamic database and logical-update-view suites. Strict mode restores Part 1 private-static/public-dynamic `clause/2` access. Public/private and multi-text requirements still need complete mapping. |
37
37
  | 7.7 — execution and backtracking | audit | Control/search suites. Strict mode disables EyeProlog automatic tabling, cycle guards, and recursive numeric shortcuts so core execution uses ordinary clause selection/backtracking. |
38
- | 7.8 — control constructs and exceptions | audit | call, cut, conjunction, disjunction, if-then, catch/throw, renamed-copy tests. |
38
+ | 7.8 — control constructs and exceptions | audit | call, cut, conjunction, disjunction (including failed branches after callee-local cuts), if-then, catch/throw, renamed-copy tests. |
39
39
  | 7.9 — expression evaluation | audit | Arithmetic/evaluation/error suites, including Corrigenda. Exceptional-value/error-precedence matrix remains to be exhaustively enumerated. |
40
40
  | 7.10 — input/output concepts | audit | Stream, character/byte I/O, read/write options, operator-sensitive write-back, Corrigendum 3 writer cases. Full option cross-product remains open. |
41
41
  | 7.11 — flags | audit | Required Part 1 flags implemented. Normal and strict modes use the ISO `unknown=error` default; strict mode excludes the EyeProlog `occurs_check` extension. |
@@ -9,7 +9,8 @@ The suite is intentionally file-based. Exact standard output, errors, warnings,
9
9
  and proof output test the behavior of the JavaScript implementation.
10
10
  [ISO-MATRIX.md](ISO-MATRIX.md) maps Part 1 normative clause families, all three
11
11
  corrigenda, Part 2 modules, and Part 3 definite clause grammars to representative
12
- executable cases.
12
+ executable cases. [WG17-SYNTAX-STATUS.md](WG17-SYNTAX-STATUS.md) records the
13
+ complete one-to-one trace for all 366 active upstream syntax cases.
13
14
 
14
15
  “Conformance” here means conformance to EyeProlog's documented ISO compatibility
15
16
  profile and implementation extensions. The default registry covers the exact
@@ -68,6 +69,12 @@ Run the Part 1 + Corrigenda strict-core processor gate:
68
69
  npm run test:iso-strict
69
70
  ```
70
71
 
72
+ Run the complete WG17 syntax matrix independently:
73
+
74
+ ```sh
75
+ npm run test:wg17-syntax
76
+ ```
77
+
71
78
  Summarize conformance coverage by category:
72
79
 
73
80
  ```sh
@@ -103,9 +110,10 @@ Scryer Prolog, Trealla Prolog, and SWI-Prolog. Their upstream identifiers and li
103
110
  are recorded in [THIRD_PARTY.md](THIRD_PARTY.md).
104
111
 
105
112
  The corpus has 386 cases in `iso/` and 792 file-based conformance cases in
106
- total. The generated `conformance-report.md` is the authoritative source for
107
- current category totals. Together with regression, documentation-sync, API,
108
- example, and book-example checks, `npm test` is the release gate.
113
+ total. The separate strict-reader WG17 matrix has 366 executable dispositions.
114
+ The generated `conformance-report.md` is the authoritative source for current
115
+ category totals. Together with regression, documentation-sync, API, example,
116
+ and book-example checks, `npm test` is the release gate.
109
117
 
110
118
  ## Updating expected output
111
119
 
@@ -33,6 +33,16 @@ if_then_cut(Value) :-
33
33
  (true -> (!, choice(Value)); fail).
34
34
  if_then_cut(fallback).
35
35
 
36
+ callee_cut_then_fail :-
37
+ !,
38
+ fail.
39
+
40
+ callee_cut_disjunction :-
41
+ (callee_cut_then_fail; true).
42
+
43
+ between_disjunction :-
44
+ (between(1, 1, _), false; true).
45
+
36
46
  %% goal: committed_answer(X0)
37
47
 
38
48
  committed_answer(Value) :-
@@ -67,3 +77,13 @@ call_local_answer(Kind, Value) :-
67
77
 
68
78
  if_then_answer(Value) :-
69
79
  if_then_cut(Value).
80
+
81
+ %% goal: callee_cut_disjunction_answer
82
+
83
+ callee_cut_disjunction_answer :-
84
+ callee_cut_disjunction.
85
+
86
+ %% goal: between_disjunction_answer
87
+
88
+ between_disjunction_answer :-
89
+ between_disjunction.
@@ -7,3 +7,5 @@ disjunction_answer(a).
7
7
  call_local_answer(fallback, ok).
8
8
  if_then_answer(a).
9
9
  if_then_answer(b).
10
+ callee_cut_disjunction_answer.
11
+ between_disjunction_answer.
@@ -1831,8 +1831,11 @@ sorted-list operation. No process-global variable registry or creation ordinal
1831
1831
  is retained or exposed through later comparisons.
1832
1832
 
1833
1833
  EyeProlog periodically checks detectable JavaScript heap use and keeps a quarter
1834
- of the host heap ceiling in reserve so the solver can unwind and report
1835
- `resource_error(memory)` before a fatal host out-of-memory abort. Embedders may
1834
+ of the applicable host heap ceiling in reserve so the solver can unwind and report
1835
+ `resource_error(memory)` before a fatal host out-of-memory abort. When Node is
1836
+ started with `--max-old-space-size`, the guard compares that old-generation
1837
+ ceiling with V8's non-young heap spaces; short-lived new-generation allocations
1838
+ therefore do not cause a false resource error. Embedders may
1836
1839
  replace that automatically derived soft ceiling with `maxMemoryBytes`; setting
1837
1840
  it to `Infinity` disables the proactive check. Environments that do not expose
1838
1841
  heap use cannot provide the proactive check. Host capacity failures that V8
@@ -5000,7 +5003,10 @@ travel_status(From, To, Status) :-
5000
5003
  discards alternatives created since entry into the current predicate call.
5001
5004
  The two can produce the same first answer without expressing the same control
5002
5005
  boundary. Keep cut close to the choice it documents and test the complete
5003
- answer set before and after introducing it.
5006
+ answer set before and after introducing it. A cut executed inside a predicate
5007
+ called by one disjunction branch remains local to that predicate: if the branch
5008
+ later fails, `Left ; Right` must still try `Right`. This remains true for
5009
+ cut-bearing validation helpers used by generators such as `between/3`.
5004
5010
 
5005
5011
  Exceptions separate an exceptional call from ordinary logical failure:
5006
5012
 
@@ -5252,7 +5258,11 @@ error rather than guessing an encoding.
5252
5258
  `read/1-2` reads the next term. `read_term/2-3` can also return all variables,
5253
5259
  source variable names, and singletons. The metadata contains variables, so a
5254
5260
  program normally validates or transforms it before placing it in a ground
5255
- query answer. `stream_property/2` exposes mode, type, alias, position, and
5261
+ query answer. Every read operation creates a fresh variable set: a source name
5262
+ such as `X` in two separately read terms does not alias either the caller's `X`
5263
+ or the variable named `X` by the other read. Within one read term, repeated
5264
+ occurrences and the variables returned through its metadata still share as
5265
+ written. `stream_property/2` exposes mode, type, alias, position, and
5256
5266
  end state. `current_input/1`, `current_output/1`, `set_input/1`, and
5257
5267
  `set_output/1` manage defaults shared by nested goals.
5258
5268
 
@@ -5612,7 +5622,7 @@ collision because other Prolog systems commonly reject it while loading.
5612
5622
  | `\+(+Goal)` | Negation as finite failure. It succeeds once when `Goal` has no solution and never exports bindings made while testing `Goal`. Bind variables needed by the test first. |
5613
5623
  | `once(+Goal)` | Returns only the first solution of `Goal`, or fails when there is none. |
5614
5624
  | `repeat` | Produces an unbounded sequence of successes; normally paired with a test, cut, exception, or `halt/0`. |
5615
- | `Left ; Right` | Enumerates `Left`, then `Right`, restoring the incoming environment between branches. |
5625
+ | `Left ; Right` | Enumerates `Left`, then `Right`, restoring the incoming environment between branches. A cut inside a called predicate cannot discard the other branch. |
5616
5626
  | `If -> Then` | Commits to the first solution of `If` and runs `Then`; it does not provide an else branch by itself. |
5617
5627
  | `(If -> Then ; Else)` | Runs `Then` from the first solution of `If`, otherwise runs `Else`. Alternatives of `If` are discarded. |
5618
5628
  | `catch(+Goal,?Catcher,+Recovery)` | Runs `Goal`; on a matching thrown ball or `PrologError`, unifies it with `Catcher` and calls `Recovery`. Runtime errors are exposed as *error(Formal,eyeprolog)*. |
@@ -7005,7 +7015,7 @@ hand.
7005
7015
 
7006
7016
  #### Running and extending the corpus
7007
7017
 
7008
- Run all 189 normal answer goldens and the 60 selected proof goldens with:
7018
+ Run all 211 normal answer goldens and the 61 selected proof goldens with:
7009
7019
 
7010
7020
  ```sh
7011
7021
  npm run test:examples
@@ -7050,6 +7060,7 @@ syntax. Separate corpora cover expected errors, warnings, and proofs:
7050
7060
  ```sh
7051
7061
  npm run test:conformance
7052
7062
  npm run test:iso-strict
7063
+ npm run test:wg17-syntax
7053
7064
  node test/run-conformance-report.mjs
7054
7065
  ```
7055
7066
 
@@ -7058,14 +7069,16 @@ Part 1 conformance audit. It distinguishes implemented/tested families from
7058
7069
  requirements whose normative `shall` clauses, option combinations, or error
7059
7070
  precedence still need one-by-one closure. `test/conformance/ISO-MATRIX.md`
7060
7071
  maps language families to representative executable cases.
7072
+ `test/conformance/WG17-SYNTAX-STATUS.md` separately traces all 366 active
7073
+ upstream syntax cases to exact strict-reader outcomes, with no untraced case.
7061
7074
 
7062
7075
  The complete suite must pass before release. The file-based conformance corpus
7063
7076
  contains 792 cases, including 386 focused ISO
7064
7077
  cases derived from the success, failure, mode, and error behavior in
7065
7078
  ISO/IEC 13211-1 clauses 7 and 8, Part 2 modules, and Part 3 grammar rules.
7066
- Separate exact-output suites check 189 normal
7067
- examples and 60 proof examples; all extracted book programs are parsed and
7068
- their declared goals are executed. The seven-case
7079
+ Separate exact-output suites check 211 normal
7080
+ examples and 61 proof examples; all extracted book programs are parsed and
7081
+ their declared goals are executed. The eight-case
7069
7082
  playground contract suite imports the production worker, sends real reasoning
7070
7083
  requests through its message protocol, and crawls the served module graph for
7071
7084
  missing assets, bad MIME types, and static Node-only imports. The generated
package/why-eyeprolog.md CHANGED
@@ -20,7 +20,8 @@ syntax.
20
20
  EyeProlog implements the Part 1 core together with Technical Corrigenda 1, 2,
21
21
  and 3, Part 2 modules, and the Part 3 definite clause grammar specification.
22
22
  Its executable conformance matrix and tests document the supported
23
- behavior. This is extensive implementation evidence, not certification by an
23
+ behavior, including a complete executable trace of the 366 active WG17 syntax
24
+ cases. This is extensive implementation evidence, not certification by an
24
25
  independent standards body.
25
26
 
26
27
  ## Why a small implementation?