eyeprolog 1.3.39 → 1.3.40
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
|
@@ -91,6 +91,11 @@ execution as positive STO evidence, and rejects `sto` when a finite execution
|
|
|
91
91
|
completes without such an event (for example `?- true. sto.`). If execution is
|
|
92
92
|
cut short by a search/resource boundary, the STO claim remains conservatively
|
|
93
93
|
unverified rather than being guessed.
|
|
94
|
+
For nontermination expectations, `loops` is kept distinct from resource
|
|
95
|
+
exhaustion: structural loop evidence may satisfy `loops`, while a bounded
|
|
96
|
+
search that cannot establish the requested answer sequence is reported as
|
|
97
|
+
`UNDECIDED`. In CLI quad mode, failures use exit status `1`; if there are no
|
|
98
|
+
failures but at least one undecided quad, the exit status is `2`.
|
|
94
99
|
|
|
95
100
|
## Tabling and well-founded negation
|
|
96
101
|
|
package/examples/book/README.md
CHANGED
package/package.json
CHANGED
package/the-art-of-eyeprolog.md
CHANGED
|
@@ -6896,26 +6896,67 @@ described answer or error, including output produced before a later exception.
|
|
|
6896
6896
|
Its argument may be an exact character list/string or a DCG body: terminal
|
|
6897
6897
|
sequences, conjunction/disjunction, `...`/`ad_infinitum` sequence wildcards,
|
|
6898
6898
|
and user-defined DCG nonterminals are matched against the captured characters.
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6899
|
+
The advanced stream annotations `peeks/1` and `waits`, and the unordered
|
|
6900
|
+
`other_answer_sequence` annotation, are not executed by the current runner.
|
|
6901
|
+
|
|
6902
|
+
#### STO, loops, and undecided quad results
|
|
6903
|
+
|
|
6904
|
+
Following Trealla's quad convention, `sto` declares that a query is subject to
|
|
6905
|
+
occurs-check. EyeProlog checks this conservatively rather than attempting a
|
|
6906
|
+
complete STO/NSTO decision procedure. During the query's ordinary execution,
|
|
6907
|
+
the finite-tree unifier records a concrete occurs-check event as positive STO
|
|
6908
|
+
evidence; the query is not run a second time merely to probe STO-ness. A finite
|
|
6909
|
+
execution that completes naturally without such an event disproves `sto`, while
|
|
6910
|
+
a search or resource boundary leaves the declaration conservatively unchecked.
|
|
6911
|
+
The answer portion of an `sto`-annotated leaf remains implementation-dependent
|
|
6912
|
+
and is therefore not compared.
|
|
6913
|
+
|
|
6914
|
+
For example, the cyclic binding in the first query provides positive STO
|
|
6915
|
+
evidence, whereas the second query is finite and cannot be STO:
|
|
6916
|
+
|
|
6917
|
+
```eyeprolog
|
|
6918
|
+
?- X = s(X).
|
|
6919
|
+
X = ..., unexpected.
|
|
6920
|
+
false, unexpected.
|
|
6921
|
+
sto, false
|
|
6922
|
+
| sto, true.
|
|
6923
|
+
|
|
6924
|
+
?- true.
|
|
6925
|
+
sto. % fails: no STO evidence
|
|
6926
|
+
```
|
|
6927
|
+
|
|
6928
|
+
When a quad declares STO and the execution observes an occurs-check event, an
|
|
6929
|
+
unannotated `unexpected` leaf does not reject the implementation-dependent
|
|
6930
|
+
finite-tree outcome. This is partial STO detection only: EyeProlog makes a
|
|
6931
|
+
definite statement where execution provides definite evidence and otherwise
|
|
6932
|
+
does not guess.
|
|
6933
|
+
|
|
6934
|
+
`loops` is kept distinct from merely exhausting the quad runner's resources.
|
|
6935
|
+
EyeProlog accepts structural nontermination evidence such as an active-variant
|
|
6936
|
+
recursion cycle, with the loop depth/inference bounds as a bounded fallback:
|
|
6937
|
+
|
|
6938
|
+
```eyeprolog
|
|
6939
|
+
inf :- inf, inf.
|
|
6940
|
+
|
|
6941
|
+
?- inf.
|
|
6942
|
+
loops.
|
|
6943
|
+
```
|
|
6944
|
+
|
|
6945
|
+
Ordinary answer descriptions also have a finite inference budget (100000 by
|
|
6946
|
+
default). Exhausting that budget does **not** establish `loops` and does not
|
|
6947
|
+
turn an unfinished search into `false`; instead the description is reported as
|
|
6948
|
+
`UNDECIDED`, for example:
|
|
6949
|
+
|
|
6950
|
+
```text
|
|
6951
|
+
quads: UNDECIDED expensive_case, program.pl:12
|
|
6952
|
+
undecided: inference limit reached.
|
|
6953
|
+
```
|
|
6954
|
+
|
|
6955
|
+
Thus quad execution has three useful outcomes: passed, failed, and undecided.
|
|
6956
|
+
When there are no failures but at least one undecided description, the CLI exits
|
|
6957
|
+
with status `2`. The JavaScript API may override the ordinary search budget with
|
|
6958
|
+
`quadMaxInferences`; `loopMaxDepth` and `loopMaxInferences` control the explicit
|
|
6959
|
+
`loops` probe.
|
|
6919
6960
|
|
|
6920
6961
|
The JavaScript API exposes the same operation without process I/O:
|
|
6921
6962
|
|