eyemind 0.6.3 → 0.6.4
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 +1 -1
- package/SPEC.md +48 -64
- package/package.json +1 -1
- package/src/version.js +1 -1
package/README.md
CHANGED
|
@@ -474,7 +474,7 @@ type('socrates', 'human')
|
|
|
474
474
|
verdict('checked')
|
|
475
475
|
```
|
|
476
476
|
|
|
477
|
-
A `checked` verdict
|
|
477
|
+
A `checked` verdict establishes that every claim follows from the program and every required answer of the original questions is claimed. When the run reports only derived facts, source facts and backward-only answers are not required conclusions. A failed check lists `failure(Detail)` facts, ends with `verdict(failed(N))` and exits with code 2. A halted run's proof establishes that its claims follow, without establishing answer completeness. To check answers to `--goal` questions, pass the same goals when checking. [SPEC §11](https://eyereasoner.github.io/eyemind/SPEC#11-proof-checking) defines the check.
|
|
478
478
|
|
|
479
479
|
The report's comments explain which checks succeeded, with references to
|
|
480
480
|
SPEC Sections 11.2–11.6. They distinguish complete answers from a halted
|
package/SPEC.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
```text
|
|
4
4
|
Title: The Logic Script (LS) Language and Proof Format
|
|
5
|
-
Version: eyemind 0.6.
|
|
5
|
+
Version: eyemind 0.6.4
|
|
6
6
|
```
|
|
7
7
|
|
|
8
8
|
This document specifies Logic Script (LS): the syntax and meaning of its
|
|
@@ -202,9 +202,8 @@ Proofs:
|
|
|
202
202
|
([Section 11.2](#112-original-questions)).
|
|
203
203
|
- **Replay**: re-executing the firing a step records, from its source rule,
|
|
204
204
|
with the bindings of each point of the search ([Section 11.4](#114-replaying-derived-facts)).
|
|
205
|
-
- **Checks**: of a proof, that the checker finds no failure
|
|
206
|
-
|
|
207
|
-
follow from the program ([Section 11.1](#111-what-a-checked-proof-establishes)).
|
|
205
|
+
- **Checks**: of a proof, that the checker finds no failure
|
|
206
|
+
([Section 11.1](#111-what-a-checked-proof-establishes)).
|
|
208
207
|
- **Check report**: what a checker writes: the claims, any failures and a
|
|
209
208
|
verdict ([Section 12](#12-check-reports)).
|
|
210
209
|
|
|
@@ -227,6 +226,7 @@ An atom used as a predicate has arity 0. A compound's name and arity identify
|
|
|
227
226
|
its constructor. Integers and floats are distinct: `1` and `1.0` MUST NOT
|
|
228
227
|
unify. Booleans, `null`, `undefined`, infinities and NaN are not terms.
|
|
229
228
|
Nonfinite numeric values MUST be rejected.
|
|
229
|
+
Atoms and numbers are **atomic** terms.
|
|
230
230
|
|
|
231
231
|
### 2.2 Lists
|
|
232
232
|
|
|
@@ -295,7 +295,7 @@ another script, resolved as [Section 3.2](#32-names) specifies, so scripts share
|
|
|
295
295
|
declarations.
|
|
296
296
|
|
|
297
297
|
The supplied names are the statements of [Section 3.4](#34-statements), `forward`, `backward`,
|
|
298
|
-
`preds`, `vars`, `struct`, the controls and primitives of [Section 4](#4-goals-and-primitives), the
|
|
298
|
+
`preds`, `vars`, `struct`, `float`, the controls and primitives of [Section 4](#4-goals-and-primitives), the
|
|
299
299
|
atom `fail`. Other names are resolved as [Section 3.2](#32-names) specifies.
|
|
300
300
|
|
|
301
301
|
An embedding MAY supply additional library names. Their operations and
|
|
@@ -696,9 +696,10 @@ an incorrect or partial value. The bounds are implementation-defined.
|
|
|
696
696
|
A body goal depends on a clause when the goal, renamed apart, unifies with
|
|
697
697
|
one of the clause's heads. The dependency is **closed** when the goal occurs
|
|
698
698
|
inside a negation or as the goal of a collection ([Section 4.2](#42-controls)), and **open**
|
|
699
|
-
otherwise. Each clause has a rank: the least assignment
|
|
700
|
-
rank is at least the rank of every clause it depends on, plus
|
|
701
|
-
dependency. Forward rules run in order of rank
|
|
699
|
+
otherwise. Each clause has a nonnegative integer rank: the least assignment
|
|
700
|
+
such that its rank is at least the rank of every clause it depends on, plus
|
|
701
|
+
one for a closed dependency. Forward rules run in order of rank
|
|
702
|
+
([Section 8.2](#82-forward-evaluation-and-witnesses)).
|
|
702
703
|
|
|
703
704
|
A program MUST be rejected when:
|
|
704
705
|
|
|
@@ -1073,9 +1074,8 @@ infinite closure. A finite model does not ensure search termination:
|
|
|
1073
1074
|
`implied_by(p(X), p(X))` has an empty least model, but searching `p('a')`
|
|
1074
1075
|
recurs indefinitely. Exceeding a resource bound raises an error ([Section
|
|
1075
1076
|
8.3](#83-resource-bounds)). Contradictions halt without completing the closure ([Section 8.5](#85-contradictions)).
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
whole program.
|
|
1077
|
+
The guarantees and limits of a checked proof are defined in
|
|
1078
|
+
[Section 11.1](#111-what-a-checked-proof-establishes).
|
|
1079
1079
|
|
|
1080
1080
|
## 8. Evaluation and Conclusions
|
|
1081
1081
|
|
|
@@ -1115,15 +1115,12 @@ and `p(2)` publishes `a(1)`, `b(1)`, `a(2)`, `b(2)`. For each head:
|
|
|
1115
1115
|
program writes it (an anonymous one as `_0`, `_1`, ..., [Section 3.3](#33-term-construction)), and
|
|
1116
1116
|
`Arguments` the list of
|
|
1117
1117
|
the ground values the solution gives the heads' other variables, in order
|
|
1118
|
-
of their first occurrence in the heads.
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
that a value of the solution brought in, which no head variable stands
|
|
1125
|
-
for, keeps its own name when no other term of the firing has it; the
|
|
1126
|
-
others take that name followed by the first of `1`, `2`, ... that is
|
|
1118
|
+
of their first occurrence in the heads. When several head variables stand
|
|
1119
|
+
for one term, the first of them in the heads names it, whichever way
|
|
1120
|
+
unification bound them. A variable that a value of the solution brought
|
|
1121
|
+
in, which no head variable stands for, keeps its own name when no other
|
|
1122
|
+
term of the firing has it; the others take that name followed by the first
|
|
1123
|
+
of `1`, `2`, ... that is
|
|
1127
1124
|
free, in order of first occurrence in the heads. A rule that keeps meeting new firings does
|
|
1128
1125
|
not terminate ([Section 8.3](#83-resource-bounds)). Derived facts other than scoped inspection
|
|
1129
1126
|
patterns ([Section 6.3](#63-source-rule-inspection)) are therefore ground. A
|
|
@@ -1212,9 +1209,6 @@ depth, goals started or forward rounds are provided, they count as follows:
|
|
|
1212
1209
|
including the final round that adds nothing; a stratum without forward
|
|
1213
1210
|
rules has no rounds.
|
|
1214
1211
|
|
|
1215
|
-
A run that exceeds a bound MUST report resource exhaustion. Answers found
|
|
1216
|
-
before exhaustion MUST NOT be presented as the complete result of that run.
|
|
1217
|
-
|
|
1218
1212
|
### 8.4 External goals
|
|
1219
1213
|
|
|
1220
1214
|
A run MAY be given goals. Each goal is read on its own, so goals share no
|
|
@@ -1265,8 +1259,8 @@ rather than return a proof that does not check, as for results the format
|
|
|
1265
1259
|
cannot establish ([Section 11.1](#111-what-a-checked-proof-establishes)) or a table that would meet an error. It
|
|
1266
1260
|
MAY bound the work of making tables; exceeding the bound is such an error
|
|
1267
1261
|
and MUST NOT change the run's answers. A run without conclusions has a proof
|
|
1268
|
-
without claims, whose
|
|
1269
|
-
answers.
|
|
1262
|
+
without claims, whose certificate establishes that there are no required
|
|
1263
|
+
answers ([Section 11.5](#115-deciding-the-claims)).
|
|
1270
1264
|
|
|
1271
1265
|
## 9. Document Syntax and Canonical Text
|
|
1272
1266
|
|
|
@@ -1326,8 +1320,8 @@ conjunction rules of [Section 4.1](#41-goal-syntax).
|
|
|
1326
1320
|
String escapes are `\\`, `\'`, `\"`, `\n`, `\r`, `\t`, `\b`, `\f`,
|
|
1327
1321
|
`\v`, `\0` (not followed by a decimal digit), `\xHH`, `\uHHHH` and
|
|
1328
1322
|
`\u{H...}` with one to six hexadecimal digits denoting a Unicode code point.
|
|
1329
|
-
Other escapes and
|
|
1330
|
-
|
|
1323
|
+
Other escapes and unescaped characters U+0000–U+001F except tab MUST be
|
|
1324
|
+
rejected. This includes raw line feeds and carriage returns; U+2028 and
|
|
1331
1325
|
U+2029 are allowed in a string as themselves. Outside
|
|
1332
1326
|
strings, layout consists of spaces, tabs, carriage returns, line feeds and
|
|
1333
1327
|
the byte-order-mark character, plus comments. A line feed outside brackets
|
|
@@ -1368,7 +1362,7 @@ Object keys may also use these reserved names, since keys denote atom text.
|
|
|
1368
1362
|
`hex` is the lowercase hexadecimal code point of `c`. The variable name `A-B`
|
|
1369
1363
|
is thus written `VAR_A_2d_B`. A reader decodes such a name back
|
|
1370
1364
|
([Section 9.1](#91-accepted-document-syntax)).
|
|
1371
|
-
- A list is written `[I1, I2, ...]`; an open list ends with `, ...Tail`.
|
|
1365
|
+
- A list is written `[I1, I2, ...]`; an open or improper list ends with `, ...Tail`.
|
|
1372
1366
|
|
|
1373
1367
|
### 9.3 Canonical compounds
|
|
1374
1368
|
|
|
@@ -1484,10 +1478,9 @@ called(p(A), [p(_1)])
|
|
|
1484
1478
|
|
|
1485
1479
|
## 11. Proof Checking
|
|
1486
1480
|
|
|
1487
|
-
A checker
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
program, those goals. The source program is the authority for clauses and
|
|
1481
|
+
A checker verifies a proof's claims against its source program. Its inputs
|
|
1482
|
+
are the program, the proof document and, when the proof answers external
|
|
1483
|
+
goals, those goals. The source program is the authority for clauses and
|
|
1491
1484
|
questions; the proof supplies evidence to check. The outcome is `checked`
|
|
1492
1485
|
or a list of failures.
|
|
1493
1486
|
|
|
@@ -1524,11 +1517,12 @@ two listings coincide ([Section 10.3](#103-certificate)), and when a variable's
|
|
|
1524
1517
|
|
|
1525
1518
|
### 11.1 What a checked proof establishes
|
|
1526
1519
|
|
|
1527
|
-
A proof **checks** when the checker finds no failure.
|
|
1528
|
-
from the source program
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1520
|
+
A proof **checks** when the checker finds no failure. Its claims then follow
|
|
1521
|
+
from the source program. Unless the proof is halted, every claim is an
|
|
1522
|
+
answer of an original question, and every required answer
|
|
1523
|
+
([Section 11.5](#115-deciding-the-claims)) is claimed, up to variable
|
|
1524
|
+
renaming. A checked proof without claims establishes that there are no
|
|
1525
|
+
required answers.
|
|
1532
1526
|
|
|
1533
1527
|
For a program with negation, "follows" is relative to the facts the
|
|
1534
1528
|
listings hold: the check establishes that they are supported by replayed
|
|
@@ -1546,12 +1540,11 @@ A checked proof does not establish:
|
|
|
1546
1540
|
- that the supplied program expresses the author's intended model.
|
|
1547
1541
|
|
|
1548
1542
|
Some results cannot be established by this proof format, and their proofs
|
|
1549
|
-
do not check: a first answer or
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
search whose table would not close.
|
|
1543
|
+
do not check: a first answer or collection requiring uncertified answer
|
|
1544
|
+
order ([Section 11.3](#113-answering-calls)); a firing of a restricted rule
|
|
1545
|
+
with a guard ([Section 7.2](#72-variables-and-witnesses)); a comparison
|
|
1546
|
+
`compare/3` of terms that are not ground, since renaming a table need not
|
|
1547
|
+
preserve the order of variable names; and a search whose table would not close.
|
|
1555
1548
|
|
|
1556
1549
|
### 11.2 Original questions
|
|
1557
1550
|
|
|
@@ -1655,12 +1648,11 @@ starting with no bindings, against the step's corresponding use:
|
|
|
1655
1648
|
- A primitive runs on the bindings of that point. Its first solution under
|
|
1656
1649
|
which the goal can still unify with the use is taken. `compare/3` with a
|
|
1657
1650
|
compared term that is not ground does not replay.
|
|
1658
|
-
- `once/1`, `not/1`, `findall/3` and `findall_sorted/3`
|
|
1659
|
-
the
|
|
1660
|
-
[Section 11.3](#113-answering-calls).
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
use.
|
|
1651
|
+
- `once/1`, `not/1`, `findall/3` and `findall_sorted/3` are evaluated from
|
|
1652
|
+
the certificate on the bindings of that point, with the binding and
|
|
1653
|
+
certified-order requirements of [Section 11.3](#113-answering-calls).
|
|
1654
|
+
The control MUST succeed and its resulting goal MUST still unify with
|
|
1655
|
+
the use.
|
|
1664
1656
|
- Any other goal, as it stands at that point, is answered from the
|
|
1665
1657
|
certificate as in [Section 11.3](#113-answering-calls), when that search consults no listing:
|
|
1666
1658
|
the answer identical to the use up to renaming is taken, or else the first
|
|
@@ -1689,10 +1681,6 @@ derived pattern's variables are all supplied by an inspection or a listed
|
|
|
1689
1681
|
pattern. Each step's bindings MUST name distinct variables of its rule,
|
|
1690
1682
|
whose values unify with what the replay gave them.
|
|
1691
1683
|
|
|
1692
|
-
Replay re-executes each recorded firing, so a test of whether a variable is
|
|
1693
|
-
bound sees what a search sees, a first answer is the search's first answer,
|
|
1694
|
-
and arithmetic is computed rather than accepted.
|
|
1695
|
-
|
|
1696
1684
|
### 11.5 Deciding the claims
|
|
1697
1685
|
|
|
1698
1686
|
For a proof that is not halted:
|
|
@@ -1748,19 +1736,15 @@ A check report is a document ([Section 9.1](#91-accepted-document-syntax)) holdi
|
|
|
1748
1736
|
The comment MUST identify the claims as checked answers only when the proof
|
|
1749
1737
|
checks, as following from a halted program when it checks and is halted, and
|
|
1750
1738
|
as unverified claims when it fails; a proof without claims that checks MUST
|
|
1751
|
-
be said to establish that
|
|
1752
|
-
|
|
1739
|
+
be said to establish that there are no required answers
|
|
1740
|
+
([Section 11.1](#111-what-a-checked-proof-establishes)). Comments MAY explain
|
|
1741
|
+
the checks of Sections [11.2](#112-original-questions)–[11.6](#116-nothing-unused),
|
|
1742
|
+
but MUST NOT assert guarantees beyond those of the verdict. Their wording
|
|
1743
|
+
is informative and MAY differ. The wording of `Detail`, and
|
|
1753
1744
|
the number and order of failures, are informative: a conforming checker
|
|
1754
1745
|
agrees on the verdict `checked` or failed. A report is ordinary data:
|
|
1755
1746
|
`facts_from` ([Section 3.4](#34-statements)) states it as facts.
|
|
1756
1747
|
|
|
1757
|
-
Explanatory comments can describe the checks of Sections
|
|
1758
|
-
[11.2](#112-original-questions)–[11.6](#116-nothing-unused). They do not add
|
|
1759
|
-
evidence or change the verdict. A failed report must not describe those
|
|
1760
|
-
checks as having succeeded; a checked halted proof establishes the replay
|
|
1761
|
-
of its claims, without establishing answer completeness
|
|
1762
|
-
([Section 11.1](#111-what-a-checked-proof-establishes)).
|
|
1763
|
-
|
|
1764
1748
|
## 13. Conformance
|
|
1765
1749
|
|
|
1766
1750
|
A conforming reasoner MUST implement the program syntax, semantics and
|
|
@@ -1817,8 +1801,8 @@ object = "{", [ pair, { ",", pair }, [ "," ] ], "}" ;
|
|
|
1817
1801
|
pair = ( identifier | string ), ":", expression ;
|
|
1818
1802
|
number = integer, [ "n" ] | float ;
|
|
1819
1803
|
integer = "0" | nonzero, { digit } ;
|
|
1820
|
-
float = (
|
|
1821
|
-
|
|
|
1804
|
+
float = ( integer, ".", { digit } | ".", digits ), [ exponent ]
|
|
1805
|
+
| integer, exponent ;
|
|
1822
1806
|
exponent = ( "e" | "E" ), [ "+" | "-" ], digits ;
|
|
1823
1807
|
digits = digit, { digit } ;
|
|
1824
1808
|
digit = "0" | nonzero ;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eyemind",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "A dependency-free Logic Script (LS) reasoner with forward and backward reasoning, checkable proofs, and RDF 1.2, Notation3 (N3) and SPARQL 1.2 RL (SRL) interoperability.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// The release this checkout is; ./release keeps it in step with package.json.
|
|
2
|
-
export const VERSION = '0.6.
|
|
2
|
+
export const VERSION = '0.6.4';
|