eyeprolog 1.5.88 → 1.5.90

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.
Files changed (61) hide show
  1. package/conformance-report.md +2 -2
  2. package/package.json +1 -1
  3. package/src/quads.js +25 -3
  4. package/test/conformance/README.md +1 -1
  5. package/test/conformance/THIRD_PARTY.md +5 -0
  6. package/test/conformance/cases/iso/scryer_call_zero_arity.pl +6 -0
  7. package/test/conformance/cases/iso/scryer_op_bar_prefix_permission.pl +6 -0
  8. package/test/conformance/cases/iso/scryer_op_name_list_unbound_element.pl +6 -0
  9. package/test/conformance/cases/iso/scryer_op_specifier_type_error.pl +6 -0
  10. package/test/conformance/cases/iso/scryer_op_wrong_arity_existence_error.pl +6 -0
  11. package/test/conformance/cases/iso/trealla_bagof_setof_duplicate_handling.pl +15 -0
  12. package/test/conformance/cases/iso/trealla_call_transparent_to_disjunction.pl +7 -0
  13. package/test/conformance/cases/iso/trealla_copy_term_binding_direction.pl +9 -0
  14. package/test/conformance/cases/iso/trealla_dif_unification_shared_var.pl +6 -0
  15. package/test/conformance/cases/iso/trealla_disjunction_commit_and_fallthrough.pl +11 -0
  16. package/test/conformance/cases/iso/trealla_findall_bagof_grouping.pl +13 -0
  17. package/test/conformance/cases/iso/trealla_float_literal_representation_error.pl +9 -0
  18. package/test/conformance/cases/iso/trealla_if_then_noncallable_then.pl +6 -0
  19. package/test/conformance/cases/iso/trealla_mod_sign_rules.pl +14 -0
  20. package/test/conformance/cases/iso/trealla_negation_eager_callability.pl +9 -0
  21. package/test/conformance/cases/iso/trealla_number_chars_skips_comments.pl +7 -0
  22. package/test/conformance/cases/iso/trealla_number_chars_syntax_error.pl +6 -0
  23. package/test/conformance/cases/iso/trealla_occurs_check_rational_tree_subtleties.pl +8 -0
  24. package/test/conformance/cases/iso/trealla_occurs_check_reverse_order.pl +7 -0
  25. package/test/conformance/cases/iso/trealla_quoted_atom_line_continuation.pl +7 -0
  26. package/test/conformance/cases/iso/trealla_retract_backtracking.pl +15 -0
  27. package/test/conformance/cases/iso/trealla_shared_argument_aliasing.pl +8 -0
  28. package/test/conformance/cases/iso/trealla_sort_duplicates_and_empty.pl +9 -0
  29. package/test/conformance/cases/iso/trealla_unicode_length_agreement.pl +9 -0
  30. package/test/conformance/cases/iso/trealla_write_associative_operators.pl +11 -0
  31. package/test/conformance/cases/iso/trealla_write_term_ignore_ops_quoted_independence.pl +10 -0
  32. package/test/conformance/cases/iso/trealla_write_term_variable_names_malformed.pl +6 -0
  33. package/test/conformance/expected/iso/scryer_call_zero_arity.pl +1 -0
  34. package/test/conformance/expected/iso/scryer_op_bar_prefix_permission.pl +1 -0
  35. package/test/conformance/expected/iso/scryer_op_name_list_unbound_element.pl +1 -0
  36. package/test/conformance/expected/iso/scryer_op_specifier_type_error.pl +1 -0
  37. package/test/conformance/expected/iso/scryer_op_wrong_arity_existence_error.pl +1 -0
  38. package/test/conformance/expected/iso/trealla_bagof_setof_duplicate_handling.pl +1 -0
  39. package/test/conformance/expected/iso/trealla_call_transparent_to_disjunction.pl +1 -0
  40. package/test/conformance/expected/iso/trealla_copy_term_binding_direction.pl +1 -0
  41. package/test/conformance/expected/iso/trealla_dif_unification_shared_var.pl +1 -0
  42. package/test/conformance/expected/iso/trealla_disjunction_commit_and_fallthrough.pl +1 -0
  43. package/test/conformance/expected/iso/trealla_findall_bagof_grouping.pl +1 -0
  44. package/test/conformance/expected/iso/trealla_float_literal_representation_error.pl +1 -0
  45. package/test/conformance/expected/iso/trealla_if_then_noncallable_then.pl +1 -0
  46. package/test/conformance/expected/iso/trealla_mod_sign_rules.pl +1 -0
  47. package/test/conformance/expected/iso/trealla_negation_eager_callability.pl +1 -0
  48. package/test/conformance/expected/iso/trealla_number_chars_skips_comments.pl +1 -0
  49. package/test/conformance/expected/iso/trealla_number_chars_syntax_error.pl +1 -0
  50. package/test/conformance/expected/iso/trealla_occurs_check_rational_tree_subtleties.pl +1 -0
  51. package/test/conformance/expected/iso/trealla_occurs_check_reverse_order.pl +1 -0
  52. package/test/conformance/expected/iso/trealla_quoted_atom_line_continuation.pl +2 -0
  53. package/test/conformance/expected/iso/trealla_retract_backtracking.pl +5 -0
  54. package/test/conformance/expected/iso/trealla_shared_argument_aliasing.pl +2 -0
  55. package/test/conformance/expected/iso/trealla_sort_duplicates_and_empty.pl +1 -0
  56. package/test/conformance/expected/iso/trealla_unicode_length_agreement.pl +1 -0
  57. package/test/conformance/expected/iso/trealla_write_associative_operators.pl +7 -0
  58. package/test/conformance/expected/iso/trealla_write_term_ignore_ops_quoted_independence.pl +6 -0
  59. package/test/conformance/expected/iso/trealla_write_term_variable_names_malformed.pl +1 -0
  60. package/test/regression/cases-regression.mjs +36 -6
  61. package/the-art-of-eyeprolog.md +1 -1
@@ -24,7 +24,7 @@ bytes, avoiding a second live fetch and its race window.
24
24
  | context | 11 | 0 | 0 | 0 | 11 |
25
25
  | control | 15 | 0 | 0 | 0 | 15 |
26
26
  | explicit-tabling | 6 | 0 | 0 | 0 | 6 |
27
- | iso | 211 | 219 | 0 | 0 | 430 |
27
+ | iso | 238 | 219 | 0 | 0 | 457 |
28
28
  | lists | 52 | 3 | 0 | 0 | 55 |
29
29
  | modules | 2 | 0 | 0 | 0 | 2 |
30
30
  | negation | 8 | 0 | 19 | 0 | 27 |
@@ -37,7 +37,7 @@ bytes, avoiding a second live fetch and its race window.
37
37
  | terms | 26 | 3 | 0 | 0 | 29 |
38
38
  | unification | 18 | 0 | 0 | 0 | 18 |
39
39
  | variables | 16 | 7 | 0 | 0 | 23 |
40
- | **Total** | **533** | **274** | **19** | **21** | **847** |
40
+ | **Total** | **560** | **274** | **19** | **21** | **874** |
41
41
 
42
42
  ## DCG conformance clarification
43
43
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.5.88",
6
+ "version": "1.5.90",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
package/src/quads.js CHANGED
@@ -162,6 +162,21 @@ function checkAlternative(program, quad, alternative, options, context, unordere
162
162
  // matchLeaf accepts it once this disproof gate has been cleared.
163
163
  if (requiresSto && actual.nstoObserved) return { ok: false };
164
164
 
165
+ // The reverse of the check above: execution that actually triggered
166
+ // occurs-check produced an implementation-dependent outcome (ISO 7.3.3
167
+ // Note 2 -- succeed, loop, or fail are all conforming), even when none of
168
+ // this alternative's own leaves say so. A leaf making a positive claim
169
+ // about that outcome without an `sto` tag would silently misrepresent an
170
+ // implementation choice as a portably decided one (see issue #111's
171
+ // `\+ \+ -X=X` follow-up: a bare `false.` happens to match here, but only
172
+ // because this engine always occurs-checks -- a non-occurs-checking engine
173
+ // would see `true` instead). An `unexpected` leaf is a negative claim
174
+ // instead, and already has its own STO carve-out below
175
+ // (`stoPermitsUnexpected`, issue #60), so leave those alone here.
176
+ if (!requiresSto && actual.stoObserved && !leaves.some((leaf) => leaf.unexpected)) {
177
+ return { ok: false, alternative };
178
+ }
179
+
165
180
  if (hasInputSpec) {
166
181
  const leaf = leaves[0];
167
182
  const exactConsumption = actual.inputPosition === input.length;
@@ -1010,15 +1025,22 @@ const FAILURE_LABELS = {
1010
1025
  function formatAlternativeContext(program, description, alternative) {
1011
1026
  const parts = splitOperator(description, '|');
1012
1027
  if (parts.length <= 1 || !parts.includes(alternative)) return null;
1028
+ // Every detail line under a `quads: ...` header shares one 3-space report
1029
+ // margin (the same margin the plain `?- ...` and `expected: ...` lines
1030
+ // already use) -- reproduce the answer-description syntax's own layout
1031
+ // (a bare 3-space indent for the first alternative, a leading `| `/`; `
1032
+ // marker for a later alternative/leaf) *inside* that margin, so a marker
1033
+ // character lines up under the `?` above it rather than at column 0.
1034
+ const margin = ' ';
1013
1035
  const lines = [];
1014
1036
  parts.forEach((part, index) => {
1015
- const prefix = index === 0 ? ' ' : '| ';
1037
+ const marker = index === 0 ? ' ' : '| ';
1016
1038
  if (part !== alternative) {
1017
- lines.push(`${prefix}...`);
1039
+ lines.push(`${margin}${marker}...`);
1018
1040
  return;
1019
1041
  }
1020
1042
  splitOperator(part, ';').forEach((leaf, leafIndex) => {
1021
- lines.push(`${leafIndex === 0 ? prefix : '; '}${formatQuadTerm(program, leaf)}`);
1043
+ lines.push(`${margin}${leafIndex === 0 ? marker : '; '}${formatQuadTerm(program, leaf)}`);
1022
1044
  });
1023
1045
  });
1024
1046
  // A trailing `...` glued straight to a full stop reads as four dots; the
@@ -138,7 +138,7 @@ Selected cases are adapted from the ISO and standard-core suites of Logtalk,
138
138
  Scryer Prolog, Trealla Prolog, and SWI-Prolog. Their upstream identifiers and licenses
139
139
  are recorded in [THIRD_PARTY.md](THIRD_PARTY.md).
140
140
 
141
- The corpus has 430 cases in `iso/` and 847 file-based conformance cases in total. Of those, 11 cases in `stc/` are explicitly labelled working-draft review evidence rather than normative ISO claims. The strict-reader WG17 syntax matrix is discovered dynamically and executed live by the Neumerkel gate, the same as its other seven TU Wien sources; release/report checks separately verify the tracked `NEUMERKEL-LATEST.md`. The generated `conformance-report.md` records local corpus totals and links to that live evidence. Together with regression, documentation-sync, API, example, and book-example checks, `npm test` is the release gate.
141
+ The corpus has 457 cases in `iso/` and 874 file-based conformance cases in total. Of those, 11 cases in `stc/` are explicitly labelled working-draft review evidence rather than normative ISO claims. The strict-reader WG17 syntax matrix is discovered dynamically and executed live by the Neumerkel gate, the same as its other seven TU Wien sources; release/report checks separately verify the tracked `NEUMERKEL-LATEST.md`. The generated `conformance-report.md` records local corpus totals and links to that live evidence. Together with regression, documentation-sync, API, example, and book-example checks, `npm test` is the release gate.
142
142
 
143
143
  ## Updating expected output
144
144
 
@@ -36,6 +36,11 @@ adapted from `tests-pl/iso-conformity-tests.pl` in
36
36
  identifies the corresponding upstream test numbers. The cases were rewritten
37
37
  for EyeProlog's file-based query and exact-output harness.
38
38
 
39
+ Additional operator-directive and control-construct error-condition cases
40
+ under `iso/` are adapted from Scryer's `tests-pl/invalid_decl*.pl` and
41
+ `tests-pl/issue831-call0.pl` regression fixtures. Each adapted file identifies
42
+ its upstream source file.
43
+
39
44
  BSD 3-Clause License
40
45
 
41
46
  Copyright (c) 2016, Mark Thom
@@ -0,0 +1,6 @@
1
+ % Adapted from Scryer Prolog tests-pl/issue831-call0.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: call_zero_arity(X0)
4
+
5
+ call_zero_arity(E) :-
6
+ catch(call, error(E, _), true).
@@ -0,0 +1,6 @@
1
+ % Adapted from Scryer Prolog tests-pl/invalid_decl15.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: op_bar_prefix_permission(X0)
4
+
5
+ op_bar_prefix_permission(E) :-
6
+ catch(op(1150, fx, '|'), error(E, _), true).
@@ -0,0 +1,6 @@
1
+ % Adapted from Scryer Prolog tests-pl/invalid_decl11.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: op_name_list_unbound_element(X0)
4
+
5
+ op_name_list_unbound_element(E) :-
6
+ catch(op(10, xf, [example, _]), error(E, _), true).
@@ -0,0 +1,6 @@
1
+ % Adapted from Scryer Prolog tests-pl/invalid_decl7.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: op_specifier_type_error(X0)
4
+
5
+ op_specifier_type_error(E) :-
6
+ catch(op(10, 42, example), error(E, _), true).
@@ -0,0 +1,6 @@
1
+ % Adapted from Scryer Prolog tests-pl/invalid_decl4.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: op_wrong_arity_existence_error(X0)
4
+
5
+ op_wrong_arity_existence_error(E) :-
6
+ catch(op(5, xfx, example, extra), error(E, _), true).
@@ -0,0 +1,15 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0049.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: bagof_setof_duplicate_handling(X0, X1)
4
+
5
+ foo_dup(a, b, c).
6
+ foo_dup(a, b, d).
7
+ foo_dup(a, b, a).
8
+ foo_dup(a, b, a).
9
+ foo_dup(b, c, f).
10
+ foo_dup(b, c, e).
11
+ foo_dup(c, c, g).
12
+
13
+ bagof_setof_duplicate_handling(Bag, Set) :-
14
+ bagof(C, A^B^foo_dup(A, B, C), Bag),
15
+ setof(C, A^B^foo_dup(A, B, C), Set).
@@ -0,0 +1,7 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0016.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: call_transparent_to_disjunction(ok)
4
+
5
+ call_transparent_to_disjunction(ok) :-
6
+ call((true ; false)),
7
+ call((false ; true)).
@@ -0,0 +1,9 @@
1
+ % Adapted from Trealla Prolog tests/issues/test1136.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: copy_term_binding_direction(ok)
4
+
5
+ copy_term_binding_direction(ok) :-
6
+ copy_term(X, 3), var(X),
7
+ copy_term(f(Y), f(3)), var(Y),
8
+ copy_term(3, Z), Z == 3,
9
+ \+ copy_term(f(_), 3).
@@ -0,0 +1,6 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0090.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: dif_unification_shared_var(ok)
4
+
5
+ dif_unification_shared_var(ok) :-
6
+ [A, 1] \= [A, 2].
@@ -0,0 +1,11 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0059.pl (test5a, test5b).
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: disjunction_commit_and_fallthrough(ok)
4
+
5
+ name_d(john).
6
+ name_d(mary).
7
+ name_d(tom).
8
+
9
+ disjunction_commit_and_fallthrough(ok) :-
10
+ ( name_d(john) ; write('ERROR') ), !,
11
+ ( name_d(fred) ; name_d(mary) ), !.
@@ -0,0 +1,13 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0028.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: findall_bagof_grouping(X0)
4
+
5
+ foo_groups(a, b, c).
6
+ foo_groups(a, b, d).
7
+ foo_groups(b, c, e).
8
+ foo_groups(b, c, f).
9
+ foo_groups(c, c, g).
10
+ foo_groups(d, e, g).
11
+
12
+ findall_bagof_grouping(L) :-
13
+ findall(Cs, bagof(C, foo_groups(_, _, C), Cs), L).
@@ -0,0 +1,9 @@
1
+ % Adapted from Trealla Prolog tests/issues/test1140.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: float_literal_representation_error(X0, X1, X2, X3)
4
+
5
+ float_literal_representation_error(MaxFloat, MinFloat, Underflow, BadSyntax) :-
6
+ catch(number_chars(_, "9.9e999"), error(MaxFloat, _), true),
7
+ catch(number_chars(_, "-9.9e999"), error(MinFloat, _), true),
8
+ number_chars(Underflow, "9.9e-999"),
9
+ catch(number_chars(_, "9.9ee"), error(BadSyntax, _), true).
@@ -0,0 +1,6 @@
1
+ % Adapted from Trealla Prolog tests/issues/test0898.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: if_then_noncallable_then(X0)
4
+
5
+ if_then_noncallable_then(E) :-
6
+ catch(call((true -> false, 1)), error(E, _), true).
@@ -0,0 +1,14 @@
1
+ % Adapted from Trealla Prolog tests/issues/test0078.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: mod_sign_rules(X0, X1, X2, X3, X4, X5, X6, X7, X8)
4
+
5
+ mod_sign_rules(M1, M2, M3, M4, M5, M6, M7, Big, M8) :-
6
+ M1 is 1 mod 3,
7
+ M2 is -1 mod 3,
8
+ M3 is -1 mod -3,
9
+ M4 is 1 mod -3,
10
+ M5 is -2 mod 3,
11
+ M6 is -2 mod -3,
12
+ M7 is 2 mod -3,
13
+ Big is (1 << 150) mod (3 << 150),
14
+ M8 is -5 mod -3.
@@ -0,0 +1,9 @@
1
+ % Adapted from Trealla Prolog tests/issues/test1110.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: negation_eager_callability(X0, X1, X2, X3)
4
+
5
+ negation_eager_callability(DisjSecond, DisjFirst, Conj, Ordinary) :-
6
+ catch((\+ (true ; 1), fail), error(DisjSecond, _), true),
7
+ catch((\+ (1 ; true), fail), error(DisjFirst, _), true),
8
+ catch((\+ (fail, 1), fail), error(Conj, _), true),
9
+ ( \+ fail, \+ \+ true, \+ member(z, [a, b, c]) -> Ordinary = ok ; Ordinary = bad ).
@@ -0,0 +1,7 @@
1
+ % Adapted from Trealla Prolog tests/issues/test0796.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: number_chars_skips_comments(X0, X1)
4
+
5
+ number_chars_skips_comments(N1, N2) :-
6
+ number_chars(N1, "%$$$\n1"),
7
+ number_chars(N2, "/*$$$*/-2").
@@ -0,0 +1,6 @@
1
+ % Adapted from Trealla Prolog tests/issues/test0791.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: number_chars_syntax_error(X0)
4
+
5
+ number_chars_syntax_error(E) :-
6
+ catch(number_chars(_, "1-2"), error(E, _), true).
@@ -0,0 +1,8 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0092.pl (main2, main3).
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: occurs_check_rational_tree_subtleties(ok)
4
+
5
+ occurs_check_rational_tree_subtleties(ok) :-
6
+ \+ (A4 = [A4 | A4], A4 = [_B4, A4]),
7
+ \+ (A5 = B5, A5 = [A5 | A5], A5 = [B5, A5]),
8
+ \+ unify_with_occurs_check(A, [[[A]] | A]).
@@ -0,0 +1,7 @@
1
+ % Adapted from Trealla Prolog tests/issues/test0805.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: occurs_check_reverse_order(ok)
4
+
5
+ occurs_check_reverse_order(ok) :-
6
+ \+ unify_with_occurs_check(L, [_ | L]),
7
+ \+ unify_with_occurs_check([_ | L], L).
@@ -0,0 +1,7 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0039.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: quoted_atom_line_continuation(ok)
4
+
5
+ quoted_atom_line_continuation(ok) :-
6
+ write('foo\
7
+ bar'), nl.
@@ -0,0 +1,15 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0021.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: retract_backtracking(ok)
4
+
5
+ :- dynamic(x24/1).
6
+
7
+ populate_x24 :-
8
+ assertz(x24(0)),
9
+ assertz(x24(1)),
10
+ assertz(x24(2)),
11
+ assertz(x24(3)).
12
+
13
+ retract_backtracking(ok) :-
14
+ populate_x24,
15
+ ( retract(x24(X)), write(X), nl, fail ; true ).
@@ -0,0 +1,8 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0047.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: shared_argument_aliasing(ok)
4
+
5
+ foo_shared(A, B) :- A = 1, write(B), nl.
6
+
7
+ shared_argument_aliasing(ok) :-
8
+ foo_shared(X, X).
@@ -0,0 +1,9 @@
1
+ % Adapted from Trealla Prolog tests/issues/test0114.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: sort_duplicates_and_empty(X0, X1, X2)
4
+
5
+ sort_duplicates_and_empty(Empty, Sorted, SortedCodes) :-
6
+ sort([], Empty),
7
+ sort("", Empty),
8
+ sort([c, b, a, ' ', a, b, c], Sorted),
9
+ sort("cba abc", SortedCodes).
@@ -0,0 +1,9 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0013.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: unicode_length_agreement(X0)
4
+
5
+ unicode_length_agreement(L) :-
6
+ atom_length('一二三', L1),
7
+ length("一二三", L2),
8
+ L1 = L2, L1 = 3,
9
+ L = L1.
@@ -0,0 +1,11 @@
1
+ % Adapted from Trealla Prolog tests/tests/test0035.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: write_associative_operators(ok)
4
+
5
+ write_associative_operators(ok) :-
6
+ write((1 / 2 / 3)), nl,
7
+ write((a, b, c)), nl,
8
+ write({a, b, c}), nl,
9
+ write(((1 / 2) / 3)), nl,
10
+ write((a, (b, c))), nl,
11
+ write({a, (b, c)}), nl.
@@ -0,0 +1,10 @@
1
+ % Adapted from Trealla Prolog tests/issues/test1137.pl.
2
+ % See test/conformance/THIRD_PARTY.md.
3
+ %% goal: write_term_ignore_ops_quoted_independence(ok)
4
+
5
+ write_term_ignore_ops_quoted_independence(ok) :-
6
+ write_term('a b', [ignore_ops(true)]), nl,
7
+ write_term('a b', [ignore_ops(true), quoted(true)]), nl,
8
+ write_term(1 + 2 * 3, [ignore_ops(true)]), nl,
9
+ write_term([a, b | c], [ignore_ops(true)]), nl,
10
+ write_term({a}, [ignore_ops(true)]), nl.
@@ -0,0 +1,6 @@
1
+ % Adapted from Trealla Prolog tests/issues/test1090.pl (first sub-case only;
2
+ % see test/conformance/THIRD_PARTY.md).
3
+ %% goal: write_term_variable_names_malformed(X0)
4
+
5
+ write_term_variable_names_malformed(E1) :-
6
+ catch(write_term(_, [variable_names([a | non_list])]), error(E1, _), true).
@@ -0,0 +1 @@
1
+ call_zero_arity(existence_error(procedure, call / 0)).
@@ -0,0 +1 @@
1
+ op_bar_prefix_permission(permission_error(create, operator, '|')).
@@ -0,0 +1 @@
1
+ op_name_list_unbound_element(instantiation_error).
@@ -0,0 +1 @@
1
+ op_specifier_type_error(type_error(atom, 42)).
@@ -0,0 +1 @@
1
+ op_wrong_arity_existence_error(existence_error(procedure, op / 4)).
@@ -0,0 +1 @@
1
+ bagof_setof_duplicate_handling("cdaafeg", "acdefg").
@@ -0,0 +1 @@
1
+ call_transparent_to_disjunction(ok).
@@ -0,0 +1 @@
1
+ copy_term_binding_direction(ok).
@@ -0,0 +1 @@
1
+ dif_unification_shared_var(ok).
@@ -0,0 +1 @@
1
+ disjunction_commit_and_fallthrough(ok).
@@ -0,0 +1 @@
1
+ findall_bagof_grouping(["cd", "ef", "g", "g"]).
@@ -0,0 +1 @@
1
+ float_literal_representation_error(representation_error(max_float), representation_error(min_float), 0.0, syntax_error(number)).
@@ -0,0 +1 @@
1
+ if_then_noncallable_then(type_error(callable, (true -> false, 1))).
@@ -0,0 +1 @@
1
+ mod_sign_rules(1, 2, -1, -2, 1, -2, -1, 1427247692705959881058285969449495136382746624, -2).
@@ -0,0 +1 @@
1
+ negation_eager_callability(type_error(callable, (true ; 1)), type_error(callable, (1 ; true)), type_error(callable, (fail, 1)), ok).
@@ -0,0 +1 @@
1
+ number_chars_skips_comments(1, -2).
@@ -0,0 +1 @@
1
+ number_chars_syntax_error(syntax_error(number)).
@@ -0,0 +1 @@
1
+ occurs_check_rational_tree_subtleties(ok).
@@ -0,0 +1 @@
1
+ occurs_check_reverse_order(ok).
@@ -0,0 +1,2 @@
1
+ foobar
2
+ quoted_atom_line_continuation(ok).
@@ -0,0 +1,5 @@
1
+ 0
2
+ 1
3
+ 2
4
+ 3
5
+ retract_backtracking(ok).
@@ -0,0 +1,2 @@
1
+ 1
2
+ shared_argument_aliasing(ok).
@@ -0,0 +1 @@
1
+ sort_duplicates_and_empty([], " abc", " abc").
@@ -0,0 +1 @@
1
+ unicode_length_agreement(3).
@@ -0,0 +1,7 @@
1
+ 1/2/3
2
+ a,b,c
3
+ {a,b,c}
4
+ 1/2/3
5
+ a,b,c
6
+ {a,b,c}
7
+ write_associative_operators(ok).
@@ -0,0 +1,6 @@
1
+ a b
2
+ 'a b'
3
+ +(1,*(2,3))
4
+ .(a,.(b,c))
5
+ {}(a)
6
+ write_term_ignore_ops_quoted_independence(ok).
@@ -0,0 +1 @@
1
+ write_term_variable_names_malformed(domain_error(write_option, variable_names("a"||non_list))).
@@ -2586,13 +2586,16 @@ c4 ?- call((!;1)).
2586
2586
  assertEqual(result.failed, 1, 'quad failed');
2587
2587
  // Laid out the same way the answer-description syntax itself lays
2588
2588
  // out alternatives (a leading `|`) and leaves (a leading `;`), per
2589
- // Ulrich's own proposed shape in that follow-up comment.
2589
+ // Ulrich's own proposed shape in that follow-up comment, inside the
2590
+ // same 3-space report margin every other detail line under a
2591
+ // `quads: ...` header uses -- so each `|`/`;` marker lines up under
2592
+ // the `?` of the `?- ...` line above it, not at column 0.
2590
2593
  assertIncludes(result.stdout,
2591
- ' ...\n' +
2592
- '| sto, Xs = [E | Xs]\n' +
2593
- '; Xs = [_A | _B], Ys = [E | Ys]\n' +
2594
- '; ..., ad_infinitum\n' +
2595
- '| ... .\n',
2594
+ ' ...\n' +
2595
+ ' | sto, Xs = [E | Xs]\n' +
2596
+ ' ; Xs = [_A | _B], Ys = [E | Ys]\n' +
2597
+ ' ; ..., ad_infinitum\n' +
2598
+ ' | ... .\n',
2596
2599
  'sibling-elided alternative context');
2597
2600
  assertIncludes(result.stdout, ' expected: Ys = [E | Ys].\n', 'still-precise offending sub-term');
2598
2601
  },
@@ -2688,6 +2691,33 @@ c4 ?- call((!;1)).
2688
2691
  assertIncludes(nsto.stdout, 'quads: FAILED 34, <input>:3', 'NSTO diagnostic');
2689
2692
  },
2690
2693
  },
2694
+ {
2695
+ name: 'quad sto is required, not merely tolerated, once execution observes occurs-check (issue #111 follow-up)',
2696
+ run: () => {
2697
+ // https://github.com/eyereasoner/eyeprolog/issues/111#issuecomment-5645863132:
2698
+ // `\+ \+ -X=X` fails only because this engine always occurs-checks
2699
+ // plain `=`/2 (ISO 7.3.3 Note 2 leaves succeed/loop/fail all
2700
+ // conforming); a non-occurs-checking engine sees `-X=X` succeed
2701
+ // (creating a cyclic X), so `\+ \+` sees `true` instead. A bare
2702
+ // `false.` -- with no `sto` tag -- misrepresents that as a portably
2703
+ // decided outcome, so it must be rejected even though it happens to
2704
+ // match this engine's own behavior; only the honestly `sto`-tagged
2705
+ // claim may pass.
2706
+ const bare = publicApi.runQuads('?- \\+ \\+ -X=X.\n false.\n');
2707
+ assertEqual(bare.passed, 0, 'undeclared sto claim rejected');
2708
+ assertEqual(bare.failed, 1, 'undeclared sto claim rejected');
2709
+
2710
+ const declared = publicApi.runQuads('?- \\+ \\+ -X=X.\n sto, false.\n');
2711
+ assertEqual(declared.passed, 1, 'declared sto claim accepted');
2712
+ assertEqual(declared.failed, 0, 'declared sto claim accepted');
2713
+
2714
+ // An `unexpected` leaf is a negative claim with its own, separate STO
2715
+ // carve-out (issue #60, tested above); this new rule must not touch it.
2716
+ const unexpected = publicApi.runQuads('?- \\+ \\+ -X=X.\n false, unexpected.\n');
2717
+ assertEqual(unexpected.passed, 0, 'wrong negative claim still rejected on its own terms');
2718
+ assertEqual(unexpected.failed, 1, 'wrong negative claim still rejected on its own terms');
2719
+ },
2720
+ },
2691
2721
  {
2692
2722
  name: 'quads peeks/1 supplies one unconsumed look-ahead character (issue #62)',
2693
2723
  run: () => {
@@ -10438,7 +10438,7 @@ must preserve the same observable outcome. Additional normal-mode syntax may
10438
10438
  accept texts outside the strict grammar, but it may not reinterpret an accepted
10439
10439
  standard case.
10440
10440
 
10441
- The file-based conformance corpus contains 847 cases, including 430 focused ISO cases derived from the success, failure, mode, and error behavior in ISO/IEC 13211-1 clauses 7 and 8, Part 2 modules, and Part 3 grammar rules.
10441
+ The file-based conformance corpus contains 874 cases, including 457 focused ISO cases derived from the success, failure, mode, and error behavior in ISO/IEC 13211-1 clauses 7 and 8, Part 2 modules, and Part 3 grammar rules.
10442
10442
  Separate exact-output suites check 229 normal examples and 61 proof examples; all executable chapter programs are parsed and their declared goals are executed. The nine-case
10443
10443
  playground contract suite imports the production worker, sends real reasoning
10444
10444
  requests through its message protocol, and crawls the served module graph for