eyemind 0.6.1 → 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 +25 -9
- package/SPEC.md +28 -11
- package/package.json +4 -2
- package/src/cli.js +3 -3
- package/src/formats.js +4 -4
- package/src/index.js +4 -4
- package/src/lang.js +2 -2
- package/src/n3-builtins.js +2 -2
- package/src/n3.js +3 -3
- package/src/proof.js +19 -2
- package/src/srl-functions.js +2 -2
- package/src/srl.js +1 -1
- package/src/version.js +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://doi.org/10.5281/zenodo.23824021)
|
|
4
4
|
[](https://www.npmjs.com/package/eyemind)
|
|
5
5
|
|
|
6
|
-
eyemind is a
|
|
6
|
+
eyemind is a dependency-free reasoner for **Logic Script (LS)**, a rule language with JavaScript syntax. LS programs state facts, rules, and queries; eyemind draws conclusions using forward and backward reasoning, and can produce proofs that a separate checker verifies against your program. It interoperates with **RDF 1.2**, **Notation3 (N3)** and **SPARQL 1.2 RL (SRL)**: RDF supplies data, and N3 and SRL compile to LS programs whose proofs use the same checker. It runs as a command-line program, a JavaScript library, and a browser application.
|
|
7
7
|
|
|
8
8
|
[Playground](https://eyereasoner.github.io/eyemind/playground/) · [Specification](https://eyereasoner.github.io/eyemind/SPEC) · [Conformance](https://eyereasoner.github.io/eyemind/conformance/) · [Examples](https://eyereasoner.github.io/eyemind/examples/)
|
|
9
9
|
|
|
@@ -49,7 +49,7 @@ Prolog, Datalog, N3 and SRL already exist, and eyemind adds no new logic: rules
|
|
|
49
49
|
- what a rule says exists, as the Skolem term of that rule firing;
|
|
50
50
|
- whether each answer really answers the question asked, and whether every answer of the question is there.
|
|
51
51
|
- A forged proof must never pass the check, so a result is something you can hand to someone who does not trust your engine.
|
|
52
|
-
2. **
|
|
52
|
+
2. **Logic Script programs are JavaScript scripts.**
|
|
53
53
|
- There is no syntax to learn, no parser to install and no dependency.
|
|
54
54
|
- The same program runs on the command line, as a library and in a browser tab.
|
|
55
55
|
- Conclusions and proofs are data that is read back into terms without being run.
|
|
@@ -57,14 +57,14 @@ Prolog, Datalog, N3 and SRL already exist, and eyemind adds no new logic: rules
|
|
|
57
57
|
- Classic Datalog is forward-only and has no function terms; Prolog is backward-only.
|
|
58
58
|
- eyemind does both: forward rounds compute what follows, backward search answers questions, the two call each other, and what a rule says exists becomes a Skolem term.
|
|
59
59
|
4. **A specification written for other implementers.**
|
|
60
|
-
- The specification and its black-box [conformance suite](https://eyereasoner.github.io/eyemind/conformance/) let someone else build an independent
|
|
60
|
+
- The specification and its black-box [conformance suite](https://eyereasoner.github.io/eyemind/conformance/) let someone else build an independent LS implementation and test it.
|
|
61
61
|
- Agreement between independent implementations is what makes a proof worth more than "trust our code".
|
|
62
62
|
5. **Exact numbers.** Integers are BigInts and are never silently turned into floats.
|
|
63
63
|
|
|
64
64
|
When eyemind is not the right tool:
|
|
65
65
|
|
|
66
66
|
- If you do not need proofs, use the mature tools: SWI-Prolog and XSB have tabling, and Soufflé is fast at scale.
|
|
67
|
-
- N3 and SRL are designed around RDF and Web data. eyemind does not compete there: RDF is read as data (see [RDF 1.2](#rdf-12)), and N3 programs and SRL rule sets compile to
|
|
67
|
+
- N3 and SRL are designed around RDF and Web data. eyemind does not compete there: RDF is read as data (see [RDF 1.2](#rdf-12)), and N3 programs and SRL rule sets compile to LS (see [Notation3](#notation3) and [SPARQL 1.2 RL](#sparql-12-rl)).
|
|
68
68
|
- eyemind is for cases where someone else has to be able to check why a conclusion holds: audits, compliance, and decisions between parties that do not trust each other.
|
|
69
69
|
|
|
70
70
|
## Install and run
|
|
@@ -93,7 +93,7 @@ The report ends with `verdict('checked')`. `eyemind -c examples/socrates.js` doe
|
|
|
93
93
|
|
|
94
94
|
## Your first program
|
|
95
95
|
|
|
96
|
-
Save this as `/tmp/family.js`, or paste it into the [playground](https://eyereasoner.github.io/eyemind/playground/):
|
|
96
|
+
Logic Script sources use the `.js` extension. Save this LS program as `/tmp/family.js`, or paste it into the [playground](https://eyereasoner.github.io/eyemind/playground/):
|
|
97
97
|
|
|
98
98
|
```js
|
|
99
99
|
fact(parent('alice', 'bob'))
|
|
@@ -200,7 +200,7 @@ A reified triple `<< s p o >>` and an annotation `{| ... |}` become their reifie
|
|
|
200
200
|
|
|
201
201
|
### Notation3
|
|
202
202
|
|
|
203
|
-
A file ending in `.n3` is Notation3: eyemind compiles its facts and rules into
|
|
203
|
+
A file ending in `.n3` is Notation3: eyemind compiles its facts and rules into an LS program, with the N3 built-ins it uses written as LS rules, and writes the conclusions back as N3. RDF default-graph data joins the N3 document as triples:
|
|
204
204
|
|
|
205
205
|
```sh
|
|
206
206
|
eyemind examples/family-n3.n3 # the derived triples as N3
|
|
@@ -341,7 +341,7 @@ returns `messages` plus its replay representation. Both take `format`,
|
|
|
341
341
|
|
|
342
342
|
### SPARQL 1.2 RL
|
|
343
343
|
|
|
344
|
-
A file ending in `.srl` is a [SPARQL 1.2 RL](https://www.w3.org/TR/sparql12-rl/) rule set: eyemind parses and analyzes it, then compiles it into
|
|
344
|
+
A file ending in `.srl` is a [SPARQL 1.2 RL](https://www.w3.org/TR/sparql12-rl/) rule set: eyemind parses and analyzes it, then compiles it into an LS program, with the SPARQL functions and aggregates it uses written as LS rules, and RDF data files given with it are its base graph. The result is the inference graph, as Turtle:
|
|
345
345
|
|
|
346
346
|
```sh
|
|
347
347
|
eyemind rules.srl facts.ttl # the inference graph as Turtle
|
|
@@ -402,7 +402,7 @@ The two work together: a forward rule's premise can call a backward definition,
|
|
|
402
402
|
|
|
403
403
|
A proof holds the claims, the certificate that answers the program's
|
|
404
404
|
questions, and the recorded firings behind derived facts as `step(...)`
|
|
405
|
-
records. Every input writes the same JavaScript proof: an N3 document or SRL rule set is compiled to an
|
|
405
|
+
records. Every input writes the same JavaScript proof: an N3 document or SRL rule set is compiled to an LS program, and
|
|
406
406
|
its proof cites that program's clauses, with triples as `rdf(S, P, O)` (an
|
|
407
407
|
SRL inference as `inf(S, P, O)`) over `iri(...)` and `literal(...)` terms:
|
|
408
408
|
|
|
@@ -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);
|
|
@@ -528,7 +542,7 @@ eyemind [OPTION ...] [FILE ...]
|
|
|
528
542
|
|
|
529
543
|
| Option | Meaning |
|
|
530
544
|
| --- | --- |
|
|
531
|
-
| (none) | Load the files, or standard input, as one program and print its conclusions. `.ttl`, `.trig`, `.nt` and `.nq` files
|
|
545
|
+
| (none) | Load the files, or standard input, as one program and print its conclusions. `.js` files and standard input are Logic Script, `.ttl`, `.trig`, `.nt` and `.nq` files RDF data, `.n3` Notation3 and `.srl` a SPARQL 1.2 RL rule set. |
|
|
532
546
|
| `-p`, `--proof` | Print the proof instead. |
|
|
533
547
|
| `-c`, `--prove-and-check` | Generate a proof, check it, and print the checked answers with the report. |
|
|
534
548
|
| `--check-proof FILE` | Check a saved proof (`-` for standard input) against the program. |
|
|
@@ -714,4 +728,6 @@ the scorer's `--live` option checks the current remote resources instead.
|
|
|
714
728
|
|
|
715
729
|
**eyemind** joins *eye* and *mind*: facts and rules lead to conclusions whose reasoning can be inspected and checked.
|
|
716
730
|
|
|
731
|
+
**Logic Script (LS)** names the language: facts, rules, and queries written in JavaScript syntax. eyemind is the reasoner that runs LS programs and checks their proofs.
|
|
732
|
+
|
|
717
733
|
MIT licensed; see [LICENSE.md](LICENSE.md).
|
package/SPEC.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# <img src="assets/eye.png" alt="" width="48" height="48" align="absmiddle">
|
|
1
|
+
# <img src="assets/eye.png" alt="" width="48" height="48" align="absmiddle"> Logic Script (LS) specification
|
|
2
2
|
|
|
3
3
|
```text
|
|
4
|
-
Title: The
|
|
5
|
-
Version: eyemind 0.6.
|
|
4
|
+
Title: The Logic Script (LS) Language and Proof Format
|
|
5
|
+
Version: eyemind 0.6.3
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
This document specifies the syntax and meaning of
|
|
9
|
-
documents, their observable evaluation, their proofs, and
|
|
10
|
-
checked.
|
|
8
|
+
This document specifies Logic Script (LS): the syntax and meaning of its
|
|
9
|
+
programs and data documents, their observable evaluation, their proofs, and
|
|
10
|
+
how a proof is checked. eyemind is an implementation of LS.
|
|
11
11
|
|
|
12
12
|
## Table of Contents
|
|
13
13
|
|
|
@@ -83,9 +83,9 @@ checked.
|
|
|
83
83
|
|
|
84
84
|
### 1.1 Scope
|
|
85
85
|
|
|
86
|
-
This specification defines
|
|
86
|
+
This specification defines Logic Script's terms, program syntax, semantics,
|
|
87
87
|
evaluation, data documents, proof documents and proof checking.
|
|
88
|
-
|
|
88
|
+
LS programs are JavaScript scripts. Conclusions, proofs and check reports are
|
|
89
89
|
data documents whose expressions MUST be read without execution.
|
|
90
90
|
|
|
91
91
|
The requirements apply to any conforming implementation. JavaScript is the
|
|
@@ -285,8 +285,8 @@ own code point; a valid surrogate pair denotes one supplementary code point.
|
|
|
285
285
|
|
|
286
286
|
### 3.1 Scripts
|
|
287
287
|
|
|
288
|
-
A program consists of one or more non-strict JavaScript scripts.
|
|
289
|
-
may use JavaScript declarations, expressions, functions and control flow to
|
|
288
|
+
A Logic Script program consists of one or more non-strict JavaScript scripts.
|
|
289
|
+
Each script may use JavaScript declarations, expressions, functions and control flow to
|
|
290
290
|
construct its clauses. No import is required for the statements and term
|
|
291
291
|
constructors defined here. Clauses are stated in the order their statement
|
|
292
292
|
calls occur; multiple input scripts are processed in input order. Each
|
|
@@ -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.
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eyemind",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "A dependency-free
|
|
3
|
+
"version": "0.6.3",
|
|
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",
|
|
7
7
|
"exports": {
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"reasoner",
|
|
31
31
|
"rules",
|
|
32
32
|
"logic",
|
|
33
|
+
"logic-script",
|
|
34
|
+
"javascript",
|
|
33
35
|
"proof",
|
|
34
36
|
"datalog"
|
|
35
37
|
],
|
package/src/cli.js
CHANGED
|
@@ -8,9 +8,9 @@ import { VERSION } from './version.js';
|
|
|
8
8
|
import { srlContextFromProof } from './srl.js';
|
|
9
9
|
|
|
10
10
|
export const HELP = `Usage: eyemind [OPTION ...] [FILE ...]
|
|
11
|
-
|
|
12
|
-
by
|
|
13
|
-
and .srl as a SPARQL 1.2 RL rule set, both compiled to
|
|
11
|
+
Logic Script (LS) programs use JavaScript syntax. Forward rules run to a fixpoint.
|
|
12
|
+
Files are read by extension: .js as LS, .ttl, .trig, .nt and .nq as RDF 1.2 data,
|
|
13
|
+
.n3 as Notation3 and .srl as a SPARQL 1.2 RL rule set, both compiled to LS.
|
|
14
14
|
-p, --proof Print a proof of the conclusions
|
|
15
15
|
-c, --prove-and-check Generate a proof and check it against the input program
|
|
16
16
|
--check-proof FILE Check a proof and print its answers and verdict (- for stdin)
|
package/src/formats.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
// The inputs of a run in other formats than
|
|
1
|
+
// The inputs of a run in other formats than Logic Script, and its output as
|
|
2
2
|
// RDF or N3.
|
|
3
3
|
//
|
|
4
4
|
// A file's extension says what it holds:
|
|
5
5
|
//
|
|
6
|
-
// .js and standard input
|
|
6
|
+
// .js and standard input a Logic Script (LS) program
|
|
7
7
|
// .ttl .trig .nt .nq RDF 1.2 data: with a program, rdf(S, P, O, G)
|
|
8
8
|
// facts; with an N3 document, default triples and
|
|
9
9
|
// graph:content formulas for named graphs; with a
|
|
10
10
|
// rule set, its base graph
|
|
11
|
-
// .n3 Notation3, compiled to an
|
|
11
|
+
// .n3 Notation3, compiled to an LS program
|
|
12
12
|
// .srl a SPARQL 1.2 RL rule set, compiled to one
|
|
13
13
|
//
|
|
14
|
-
// The compiled program is ordinary
|
|
14
|
+
// The compiled program is ordinary LS: proofs, checking and --unused
|
|
15
15
|
// apply to it. SRL execution functions capture a context that a saved proof
|
|
16
16
|
// retains; compiling with that context reproduces the same program later.
|
|
17
17
|
import { EyemindError, Struct } from './terms.js';
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// eyemind: reasoning you can see, in JavaScript.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// against the program, using
|
|
3
|
+
// Logic Script (LS) states facts, rules and queries in JavaScript syntax.
|
|
4
|
+
// Forward rules materialize conclusions until a fixpoint; backward rules are
|
|
5
|
+
// decided when a goal asks for them. A separate checker verifies proofs
|
|
6
|
+
// against the program, using their call tables and recorded firings.
|
|
7
7
|
export { VERSION } from './version.js';
|
|
8
8
|
export { Result, run, unusedClauses } from './engine.js';
|
|
9
9
|
export { readGoal } from './goals.js';
|
package/src/lang.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// Writing programs in JavaScript.
|
|
1
|
+
// Writing Logic Script (LS) programs in JavaScript.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// An LS program is a JavaScript script that states facts, rules and queries:
|
|
4
4
|
//
|
|
5
5
|
// fact(type('socrates', 'human'))
|
|
6
6
|
// fact(subclass_of('human', 'mortal'))
|
package/src/n3-builtins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// N3 built-ins as
|
|
1
|
+
// N3 built-ins as Logic Script backward rules.
|
|
2
2
|
//
|
|
3
3
|
// Each built-in predicate of a rule body becomes a goal n3_<ns>_<name>(S, O)
|
|
4
|
-
// whose definition is written here in
|
|
4
|
+
// whose definition is written here in Logic Script, so the compiled program
|
|
5
5
|
// is self-contained and every built-in step is an ordinary, checkable
|
|
6
6
|
// derivation. A definition lists the helpers it needs; the compiler copies
|
|
7
7
|
// the definitions a program uses, and their helpers, into the program.
|
package/src/n3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// N3 documents compiled to
|
|
1
|
+
// N3 documents compiled to Logic Script (LS) programs.
|
|
2
2
|
//
|
|
3
3
|
// Every N3 statement becomes rdf(Subject, Predicate, Object): the document's
|
|
4
4
|
// own triples are facts, and a run concludes the triples its forward rules
|
|
5
|
-
// derive that were not already facts. Rules become
|
|
5
|
+
// derive that were not already facts. Rules become LS rules:
|
|
6
6
|
//
|
|
7
7
|
// { B } => { H }. implies(B, H) forward; restricted(B, H)
|
|
8
8
|
// when H has blank nodes
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
// backward rules. A quoted formula is a graph term: its own blank nodes and
|
|
21
21
|
// universals are qbnode(Label) and qvar(Name), and a rule's graph pattern
|
|
22
22
|
// matches it as a set, up to a one-to-one renaming of those. Built-in
|
|
23
|
-
// predicates of a body become goals defined in
|
|
23
|
+
// predicates of a body become goals defined in LS (n3-builtins.js).
|
|
24
24
|
import { run } from './engine.js';
|
|
25
25
|
import { loadText } from './lang.js';
|
|
26
26
|
import { Program, Source } from './program.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,
|
|
328
|
-
//
|
|
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/srl-functions.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// SPARQL expressions and aggregates as
|
|
1
|
+
// SPARQL expressions and aggregates as Logic Script backward rules.
|
|
2
2
|
//
|
|
3
3
|
// An expression compiles to goals that bind its value; a function is a goal
|
|
4
4
|
// srl_<name>(Arguments..., Result) whose definition is written here in
|
|
5
|
-
//
|
|
5
|
+
// Logic Script, so the compiled program is self-contained and every
|
|
6
6
|
// function step is an ordinary, checkable derivation. A SPARQL error is a
|
|
7
7
|
// goal that fails: FILTER then rejects the solution and SET drops it, as
|
|
8
8
|
// SPARQL 1.2 RL evaluates them. A definition lists the definitions it needs;
|
package/src/srl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPARQL 1.2 RL rule sets compiled to
|
|
1
|
+
// SPARQL 1.2 RL rule sets compiled to Logic Script (LS) programs.
|
|
2
2
|
//
|
|
3
3
|
// Rule sets are read by the SRL tokenizer, parser and analysis (the
|
|
4
4
|
// srl-*.js files): parsing gives the rule set's data blocks and rules, and the
|
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.3';
|