eyemind 0.6.2 → 0.6.3

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
@@ -463,11 +463,25 @@ goes unchecked.
463
463
  type('socrates', 'mortal')
464
464
  type('socrates', 'human')
465
465
 
466
+ // Proof check (SPEC 11.2-11.6):
467
+ // Questions: every claim is an answer, and every required answer is claimed.
468
+ // Call tables: every consulted table matches its one-level expansion against the program.
469
+ // Derived listings: every consulted listing is closed under the forward rules.
470
+ // Replay: every required firing replays from no bindings; primitives, controls and
471
+ // Skolem witnesses are checked at the bindings where they run.
472
+ // Evidence: every recorded step, call table and listing is used by the check.
473
+
466
474
  verdict('checked')
467
475
  ```
468
476
 
469
477
  A `checked` verdict thus establishes two things: every claim follows from the program, and the claims are every answer of the original questions. A question with no claims is shown to have no answers by its table. 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, not that they are every answer. 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.
470
478
 
479
+ The report's comments explain which checks succeeded, with references to
480
+ SPEC Sections 11.2–11.6. They distinguish complete answers from a halted
481
+ proof's replayed claims. A failed report keeps its claims unverified and
482
+ lists the failures. These explanations are JavaScript comments: reading the
483
+ report with `facts_from` still gives just its claims, failures and verdict.
484
+
471
485
  Some results cannot be certified by this format, and `--proof` then reports an error while a plain run still gives the answers:
472
486
 
473
487
  - a first answer or a collection whose order rests on derived facts with more than one answer, since a listing does not show the order facts were derived in (a `findall_sorted` of ground items does not depend on it);
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.2
5
+ Version: eyemind 0.6.3
6
6
  ```
7
7
 
8
8
  This document specifies Logic Script (LS): the syntax and meaning of its
@@ -1740,7 +1740,9 @@ A check report is a document ([Section 9.1](#91-accepted-document-syntax)) holdi
1740
1740
  2. an empty line;
1741
1741
  3. when the check failed, a comment line, then one `failure(Detail)` per
1742
1742
  failure, where `Detail` is an atom, then an empty line;
1743
- 4. `verdict('checked')`, or `verdict(failed(N))` where `N`, at least 1, is
1743
+ 4. optional comment lines explaining the outcome of the check, then an
1744
+ empty line when those comments are present;
1745
+ 5. `verdict('checked')`, or `verdict(failed(N))` where `N`, at least 1, is
1744
1746
  the number of failure lines.
1745
1747
 
1746
1748
  The comment MUST identify the claims as checked answers only when the proof
@@ -1752,6 +1754,13 @@ the number and order of failures, are informative: a conforming checker
1752
1754
  agrees on the verdict `checked` or failed. A report is ordinary data:
1753
1755
  `facts_from` ([Section 3.4](#34-statements)) states it as facts.
1754
1756
 
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
+
1755
1764
  ## 13. Conformance
1756
1765
 
1757
1766
  A conforming reasoner MUST implement the program syntax, semantics and
@@ -1864,5 +1873,13 @@ Its check report ([Section 12](#12-check-reports)):
1864
1873
  type('socrates', 'mortal')
1865
1874
  type('socrates', 'human')
1866
1875
 
1876
+ // Proof check (SPEC 11.2-11.6):
1877
+ // Questions: every claim is an answer, and every required answer is claimed.
1878
+ // Call tables: every consulted table matches its one-level expansion against the program.
1879
+ // Derived listings: every consulted listing is closed under the forward rules.
1880
+ // Replay: every required firing replays from no bindings; primitives, controls and
1881
+ // Skolem witnesses are checked at the bindings where they run.
1882
+ // Evidence: every recorded step, call table and listing is used by the check.
1883
+
1867
1884
  verdict('checked')
1868
1885
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyemind",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
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/proof.js CHANGED
@@ -324,8 +324,8 @@ function verdict(report) {
324
324
  return report.valid ? 'checked' : new Struct('failed', [BigInt(report.failures.length)]);
325
325
  }
326
326
 
327
- // The report as JavaScript source: the claims, then a failure(Detail) per
328
- // failure, then the verdict.
327
+ // The report as JavaScript source: the claims, any failures, and the verdict.
328
+ // Explain a successful check only after the whole procedure has passed.
329
329
  export function checkReport(report) {
330
330
  const heading = !report.valid ? '// Unverified claims: proof checking failed.'
331
331
  : report.halted ? '// Checked claims: these follow from the input program, which halted.'
@@ -337,6 +337,23 @@ export function checkReport(report) {
337
337
  for (const { detail } of report.failures) lines.push(text(new Struct('failure', [detail])));
338
338
  lines.push('');
339
339
  }
340
+ if (report.valid) {
341
+ lines.push('// Proof check (SPEC 11.2-11.6):');
342
+ if (report.halted) {
343
+ lines.push("// Halted proof: every claim, including 'false', replays its recorded firing.",
344
+ '// Answer completeness is not established for a halted proof.');
345
+ } else {
346
+ lines.push('// Questions: every claim is an answer, and every required answer is claimed.');
347
+ }
348
+ lines.push('// Call tables: every consulted table matches its one-level expansion against the program.',
349
+ '// Derived listings: every consulted listing is closed under the forward rules.',
350
+ '// Replay: every required firing replays from no bindings; primitives, controls and',
351
+ '// Skolem witnesses are checked at the bindings where they run.',
352
+ '// Evidence: every recorded step, call table and listing is used by the check.');
353
+ } else {
354
+ lines.push('// Proof check (SPEC 11): failed; no claim is certified by this report.');
355
+ }
356
+ lines.push('');
340
357
  lines.push(text(new Struct('verdict', [verdict(report)])));
341
358
  return `${lines.join('\n')}\n`;
342
359
  }
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';
2
+ export const VERSION = '0.6.3';