eyemind 0.5.28 → 0.5.29
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 +160 -2
- package/SPEC.md +61 -285
- package/package.json +1 -1
- package/src/proof.js +1 -1
- package/src/version.js +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ eyemind is a **JavaScript rule language** with forward and backward reasoning an
|
|
|
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
|
|
|
10
|
-
The playground runs programs in your browser; the specification defines the language, its canonical text, the proof format and the C1–C10 checks. The examples are 135 runnable programs, each with a card deck and saved conclusions, proofs and check reports. The conformance suite has 1388 cases that test
|
|
10
|
+
The playground runs programs in your browser; the specification defines the language, its canonical text, the proof format and the C1–C10 checks. The examples are 135 runnable programs, each with a card deck and saved conclusions, proofs and check reports. The conformance suite has 1388 cases that test language and proof behavior through a command adapter, together with implementation interface checks; run it [in your browser](https://eyereasoner.github.io/eyemind/playground/conformance).
|
|
11
11
|
|
|
12
12
|
## Contents
|
|
13
13
|
|
|
@@ -24,10 +24,14 @@ The playground runs programs in your browser; the specification defines the lang
|
|
|
24
24
|
- [SPARQL 1.2 RL](#sparql-12-rl)
|
|
25
25
|
- [How eyemind reasons](#how-eyemind-reasons)
|
|
26
26
|
- [Proofs, and what checking one means](#proofs-and-what-checking-one-means)
|
|
27
|
+
- [Native proof data](#native-proof-data)
|
|
28
|
+
- [JSON check reports](#json-check-reports)
|
|
27
29
|
- [Why negation and collection are safe](#why-negation-and-collection-are-safe)
|
|
28
30
|
- [Checking the translation](#checking-the-translation)
|
|
29
31
|
- [Examples and the playground](#examples-and-the-playground)
|
|
30
32
|
- [Command line](#command-line)
|
|
33
|
+
- [Resource limits](#resource-limits)
|
|
34
|
+
- [Unused clauses](#unused-clauses)
|
|
31
35
|
- [Troubleshooting](#troubleshooting)
|
|
32
36
|
- [JavaScript library](#javascript-library)
|
|
33
37
|
- [What is deliberately absent](#what-is-deliberately-absent)
|
|
@@ -472,6 +476,84 @@ verdict('checked')
|
|
|
472
476
|
|
|
473
477
|
A `checked` verdict thus establishes two things: every claim follows from the program, and the claims are every answer of the original questions. The `called/2` table of each question lists all its answers and is checked against the program, so a proof that omits one fails C10, and a question with no claims is shown to have no answers. A failed check gives `failure(Condition, Conclusion, Detail)` facts, `verdict(failed(N))` and exit code 2. What a certificate cannot settle stays an `obligation(...)` with the verdict `checked_with_obligations`, among them `obligation('call_fidelity', 'all_answers', Question)` for a question whose answers it cannot show complete; `--strict-proof` rejects those. To check answers to `--goal` questions, pass the same goals when checking. [SPEC §11](https://eyereasoner.github.io/eyemind/SPEC#11-proof-checking) defines every condition.
|
|
474
478
|
|
|
479
|
+
### Native proof data
|
|
480
|
+
|
|
481
|
+
These N3 and SRL encodings are implementation extensions to the canonical
|
|
482
|
+
proof documents. Language and proof conformance does not require them.
|
|
483
|
+
|
|
484
|
+
The native proof resource is `<urn:eyemind:proof>`, of type `pe:Proof`, where
|
|
485
|
+
`pe:` is `https://eyereasoner.github.io/pe#` and `em:` is
|
|
486
|
+
`https://eyereasoner.github.io/eyemind/proof#`. It has `em:format` equal to
|
|
487
|
+
`"n3"` or `"srl"`, `pe:claims` as an ordered collection of claim displays,
|
|
488
|
+
and `em:records` as an ordered collection of record IRIs. Record `N`, counted
|
|
489
|
+
from 1, is `<urn:eyemind:proof#recordN>` and has one `em:term` containing its
|
|
490
|
+
[Section 10](https://eyereasoner.github.io/eyemind/SPEC#10-proof-documents) statement, encoded as a tagged collection:
|
|
491
|
+
|
|
492
|
+
| Term | Collection |
|
|
493
|
+
| --- | --- |
|
|
494
|
+
| Atom | `(em:atom "text")` |
|
|
495
|
+
| Integer | `(em:integer "digits")`, with a minus for a negative integer |
|
|
496
|
+
| Float | `(em:float "number")`, preserving signed zero as `"-0"` |
|
|
497
|
+
| Variable | `(em:variable "name")`, including anonymous-variable status |
|
|
498
|
+
| `iri(I)` with an RDF-compatible IRI | `(em:iri <I>)` |
|
|
499
|
+
| Nonempty proper list | `(em:list (EncodedItem ...))` |
|
|
500
|
+
| Compound | `(em:compound "name" (EncodedArgument ...))` |
|
|
501
|
+
|
|
502
|
+
The empty list is the atom `"[]"`. Other compounds, including open lists,
|
|
503
|
+
quoted graphs and Skolem terms, use the compound encoding. A string field
|
|
504
|
+
containing a character RDF cannot represent uses an `em:utf16` typed literal
|
|
505
|
+
whose lexical form is four lowercase hexadecimal digits per UTF-16 code
|
|
506
|
+
unit. This retains every atom and variable name accepted by
|
|
507
|
+
[Section 9.2](https://eyereasoner.github.io/eyemind/SPEC#92-canonical-atoms-numbers-variables-and-lists).
|
|
508
|
+
|
|
509
|
+
A triple goal's display is an N3 quoted formula, or an SRL RDF triple term.
|
|
510
|
+
Other goals use their tagged encoding. A step record also displays
|
|
511
|
+
`pe:conclusion`, `pe:rule` for a `clause(N)` justification, `pe:source` for
|
|
512
|
+
`source(N)`, or `pe:justification` for another justification. `pe:binding`
|
|
513
|
+
is an ordered collection of `(VariableName Value)` pairs, and `pe:uses` an
|
|
514
|
+
ordered collection of premise displays. Non-native binding values retain
|
|
515
|
+
their tagged encoding. Search records display `pe:derived`, `pe:searched`
|
|
516
|
+
or `pe:called` and an ordered `pe:answers` collection. Clause numbers name
|
|
517
|
+
the compiled program's clauses, whose authority is still the source input.
|
|
518
|
+
SRL proofs contain only `DATA` and declarations, never rules or imports.
|
|
519
|
+
|
|
520
|
+
When an SRL rule set uses `NOW`, `UUID` or `STRUUID`, its compiled program
|
|
521
|
+
includes one ground `srl_execution(Now, Seed)` fact. `Now` is an ISO UTC
|
|
522
|
+
timestamp with milliseconds and `Seed` contains 64 lowercase hexadecimal
|
|
523
|
+
digits. The compiler captures these external inputs once per compilation;
|
|
524
|
+
they remain fixed throughout evaluation. To check a saved SRL proof, the
|
|
525
|
+
format loader may recover this fact from its clause records, validate its
|
|
526
|
+
two fields, and recompile the source with that execution context. All other
|
|
527
|
+
clauses still come from the source, and all displays undergo C1–C10 as
|
|
528
|
+
usual. This establishes consequences of the recorded context, without
|
|
529
|
+
certifying a clock observation or the entropy of the seed.
|
|
530
|
+
|
|
531
|
+
The reader decodes every record, verifies all displays and properties against
|
|
532
|
+
those records, and applies the unchanged checks of
|
|
533
|
+
[Section 11](https://eyereasoner.github.io/eyemind/SPEC#11-proof-checking) to the decoded
|
|
534
|
+
certificate. A missing, extra, duplicate or inconsistent property fails C3.
|
|
535
|
+
Numeric literal displays retain their decimal digits during this comparison;
|
|
536
|
+
distinct decimal literals do not agree merely by rounding to binary64.
|
|
537
|
+
Prefix aliases and reordering top-level properties are accepted, as is
|
|
538
|
+
consistent blank-node renaming; the order of collections and formula triples
|
|
539
|
+
is retained. Displayed claims cannot replace encoded claims, and neither
|
|
540
|
+
representation can change the source authority or supply missing evidence.
|
|
541
|
+
|
|
542
|
+
### JSON check reports
|
|
543
|
+
|
|
544
|
+
With `--json`, checking modes write a JSON report instead of a term document.
|
|
545
|
+
The JSON form includes `answers`, an array of the initial claims' canonical
|
|
546
|
+
texts, including unverified claims when `valid` is false. It also has `valid` (boolean), `steps`,
|
|
547
|
+
`claims`, `verified`, `redecided` (the count `recomputed`), `composed`,
|
|
548
|
+
`uses` (the number of uses of all steps, integers), `trusted`
|
|
549
|
+
(a list of `{kind, conclusion, reason?}`, with `reason: 'original_call'`
|
|
550
|
+
for a claim's call-fidelity obligation and `reason: 'all_answers'` for a
|
|
551
|
+
question's answer-completeness obligation), `failures` (a list of
|
|
552
|
+
`{condition, detail, conclusion?}`) and `conditions` (a list of
|
|
553
|
+
`{id, name, covered, failed}`), where `conclusion` is a canonical text.
|
|
554
|
+
Its variables keep the names the document gives them, rather than being
|
|
555
|
+
renamed for each report fact as in the text form.
|
|
556
|
+
|
|
475
557
|
### Why negation and collection are safe
|
|
476
558
|
|
|
477
559
|
A negation `not(G)` concludes from what is *absent* and a collection `findall(T, G, L)` from *everything* present, so both are only right once nothing more can be derived:
|
|
@@ -534,7 +616,80 @@ eyemind [OPTION ...] [FILE ...]
|
|
|
534
616
|
| `--base IRI` | Resolve relative IRIs of the inputs against `IRI` instead of each file's location. |
|
|
535
617
|
| `-v`, `--version`, `-h`, `--help` | Print the version or the usage. |
|
|
536
618
|
|
|
537
|
-
|
|
619
|
+
`--proof`, `--prove-and-check`, `--check-proof` and `--unused` are mutually
|
|
620
|
+
exclusive. `--json` and `--strict-proof` need a checking mode. `--goal` reads
|
|
621
|
+
each goal as a data document, with an array denoting conjunction. With
|
|
622
|
+
`--check-proof`, supply the original goals the proof answers.
|
|
623
|
+
|
|
624
|
+
With `--prove-and-check`, reasoning bounds and `--stats` apply to proof
|
|
625
|
+
generation; an invalid check returns 2, otherwise the run's halt code is
|
|
626
|
+
retained. Input with a line starting with `step(` or `called(` is recognized
|
|
627
|
+
as a proof document; when supplied as a program, it produces an error
|
|
628
|
+
explaining how to check it instead.
|
|
629
|
+
|
|
630
|
+
`--stats` writes `inferences` (goals started), `rounds` (forward rounds over
|
|
631
|
+
all strata), and `derived` (facts added during reasoning). `derived` excludes
|
|
632
|
+
source facts, query answers and `'false'`. A run that exceeds a reasoning
|
|
633
|
+
bound writes no conclusions to standard output, including answers found
|
|
634
|
+
before exhaustion.
|
|
635
|
+
|
|
636
|
+
| Exit code | Meaning |
|
|
637
|
+
| --- | --- |
|
|
638
|
+
| 0 | Success, including a valid proof check. |
|
|
639
|
+
| 1 | An error, printed to standard error as `eyemind: message`. |
|
|
640
|
+
| 2 | An invalid proof check; the report is printed as usual. |
|
|
641
|
+
| 65 | The run concluded `'false'` and halted. |
|
|
642
|
+
|
|
643
|
+
The command line, JSON output, additional input formats, native proof
|
|
644
|
+
encodings, library API and browser interface describe this implementation.
|
|
645
|
+
They are outside the language and proof specification.
|
|
646
|
+
|
|
647
|
+
### Resource limits
|
|
648
|
+
|
|
649
|
+
The JavaScript implementation defaults to a depth limit of 1000000, an
|
|
650
|
+
inference limit of 1000000 and a limit of 1000 forward rounds per stratum.
|
|
651
|
+
Compiled N3 and SRL programs use 1000000, 1000000000 and 100000 respectively.
|
|
652
|
+
Each supplied bound must be a positive integer no greater than
|
|
653
|
+
9007199254740991.
|
|
654
|
+
|
|
655
|
+
Arithmetic also limits integer growth: `pow(A, B)` with integer `B > 0` and
|
|
656
|
+
`abs(A) > 1` raises an error when `B` times the bit length of `A` exceeds
|
|
657
|
+
2^26. An integer left shift `shl(A, B)` raises an error when `B` exceeds
|
|
658
|
+
2^26. These limits protect the process from excessively large allocations.
|
|
659
|
+
|
|
660
|
+
Auxiliary C10 certification is bounded per question by the smaller of the
|
|
661
|
+
run's inference limit and 50,000 calls plus answers, and by 8,388,608 UTF-16
|
|
662
|
+
code units of answer text. Hitting these limits leaves an obligation and
|
|
663
|
+
does not change the run's answers.
|
|
664
|
+
|
|
665
|
+
### Unused clauses
|
|
666
|
+
|
|
667
|
+
A clause is **unused** when no conclusion's recorded derivation cites it,
|
|
668
|
+
unless a negation or collection in the proof could consult it and its
|
|
669
|
+
omission changes the conclusions or halt code, or causes an error. The clauses a
|
|
670
|
+
negation or collection could consult are those whose heads have the name and
|
|
671
|
+
arity of a goal it reaches through the program's bodies. Running the program
|
|
672
|
+
without a clause leaves every other clause its number ([Section 3.5](https://eyereasoner.github.io/eyemind/SPEC#35-clause-constraints-and-numbering)), so the
|
|
673
|
+
Skolem terms of the other rules ([Section 8.2](https://eyereasoner.github.io/eyemind/SPEC#82-forward-evaluation-and-witnesses)) do not change.
|
|
674
|
+
|
|
675
|
+
Unused clauses are reported one per line, in clause order, as
|
|
676
|
+
`unused(line(L), Display)`, where `L` is the source line where the statement call begins; facts read
|
|
677
|
+
by `facts_from` use that call's line. `Display` is as in [Section 10.2](https://eyereasoner.github.io/eyemind/SPEC#102-clause-displays); with several
|
|
678
|
+
scripts, clause order tells which script a line belongs to. The listing is
|
|
679
|
+
the result whether or not the program halts with `'false'`, and the command
|
|
680
|
+
exits with code 0 after it.
|
|
681
|
+
|
|
682
|
+
A clause compiled from a template inherits its generator's source line.
|
|
683
|
+
|
|
684
|
+
"Unused" is relative to the recorded derivations, which are the first ones
|
|
685
|
+
found ([Section 8.7](https://eyereasoner.github.io/eyemind/SPEC#87-proof-generation)). A clause that only offers a second derivation of a
|
|
686
|
+
conclusion, such as a duplicate rule, is unused, though leaving out the
|
|
687
|
+
clause that offers the first one would make it used; leaving out several
|
|
688
|
+
unused clauses together can therefore change the conclusions. A
|
|
689
|
+
`contradiction` rule that never fires changes no conclusion and is unused,
|
|
690
|
+
though it guards the program against data that would make it fire; so are
|
|
691
|
+
the clauses only its negations or collections could consult, since they are
|
|
692
|
+
not in the proof.
|
|
538
693
|
|
|
539
694
|
## Troubleshooting
|
|
540
695
|
|
|
@@ -580,6 +735,9 @@ Cut, conditional commitment, mutable databases, attributed variables, constraint
|
|
|
580
735
|
|
|
581
736
|
## Development
|
|
582
737
|
|
|
738
|
+
eyemind is authored and maintained by Jos De Roo. Codex and Claude Code are
|
|
739
|
+
development tools used by the author.
|
|
740
|
+
|
|
583
741
|
```sh
|
|
584
742
|
npm test # unit, examples, conformance, command line, playground
|
|
585
743
|
npm test -- unit examples # these sections, plus W3C EARL
|
package/SPEC.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
```text
|
|
4
4
|
Title: The eyemind Rule Language and Proof Format
|
|
5
|
-
Version: eyemind 0.5.
|
|
5
|
+
Version: eyemind 0.5.29
|
|
6
6
|
```
|
|
7
7
|
|
|
8
8
|
This document specifies the syntax and meaning of eyemind programs and data
|
|
@@ -82,13 +82,8 @@ proof.
|
|
|
82
82
|
- [11.13 C10 Call fidelity](#1113-c10-call-fidelity)
|
|
83
83
|
- [11.14 Counts and validity](#1114-counts-and-validity)
|
|
84
84
|
- [12. Check Reports](#12-check-reports)
|
|
85
|
-
|
|
86
|
-
- [
|
|
87
|
-
- [13.1 Invocation and options](#131-invocation-and-options)
|
|
88
|
-
- [13.2 Unused clauses](#132-unused-clauses)
|
|
89
|
-
- [14. Conformance](#14-conformance)
|
|
90
|
-
- [14.1 Conformance test suite](#141-conformance-test-suite)
|
|
91
|
-
- [15. Security](#15-security)
|
|
85
|
+
- [13. Conformance](#13-conformance)
|
|
86
|
+
- [14. Security](#14-security)
|
|
92
87
|
- [Appendix A. Document Grammar](#appendix-a-document-grammar)
|
|
93
88
|
- [Appendix B. Example](#appendix-b-example)
|
|
94
89
|
|
|
@@ -99,13 +94,19 @@ proof.
|
|
|
99
94
|
### 1.1 Scope
|
|
100
95
|
|
|
101
96
|
This specification defines eyemind's terms, program syntax, semantics,
|
|
102
|
-
evaluation,
|
|
97
|
+
evaluation, data documents, proof documents and proof checking.
|
|
103
98
|
Programs are JavaScript scripts. Conclusions, proofs and check reports are
|
|
104
99
|
data documents whose expressions MUST be read without execution.
|
|
105
100
|
|
|
106
|
-
The
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
The requirements apply to any conforming implementation. JavaScript is the
|
|
102
|
+
program notation; it does not prescribe the implementation language, data
|
|
103
|
+
structures or execution architecture. Observable behavior is specified
|
|
104
|
+
independently of those choices.
|
|
105
|
+
|
|
106
|
+
Command-line options, exit codes, library APIs, browser interfaces,
|
|
107
|
+
additional input formats and proof encodings, installation and release
|
|
108
|
+
procedures are outside this specification. [Section 1.3](#13-terminology)
|
|
109
|
+
defines the terms used throughout.
|
|
109
110
|
|
|
110
111
|
### 1.2 Requirements and notation
|
|
111
112
|
|
|
@@ -185,7 +186,7 @@ Runs:
|
|
|
185
186
|
(Sections [7.2](#72-variables-and-witnesses) and [8.2](#82-forward-evaluation-and-witnesses)).
|
|
186
187
|
- **External goal**: a goal given to a run from outside the program
|
|
187
188
|
([Section 8.4](#84-external-goals)).
|
|
188
|
-
- **Halt**: the end of a run that concludes `'false'
|
|
189
|
+
- **Halt**: the end of a run that concludes `'false'`
|
|
189
190
|
([Section 8.5](#85-contradictions)).
|
|
190
191
|
- **Conclusion**: a term reported by a run ([Section 8.6](#86-reported-conclusions)).
|
|
191
192
|
- **Reasoner**: a processor that evaluates programs and checks its generated
|
|
@@ -321,8 +322,10 @@ declarations.
|
|
|
321
322
|
|
|
322
323
|
The supplied names are the statements of [Section 3.4](#34-statements), `forward`, `backward`,
|
|
323
324
|
`preds`, `vars`, `struct`, the controls and primitives of [Section 4](#4-goals-and-primitives), the
|
|
324
|
-
atom `fail
|
|
325
|
-
|
|
325
|
+
atom `fail`. Other names are resolved as [Section 3.2](#32-names) specifies.
|
|
326
|
+
|
|
327
|
+
An embedding MAY supply additional library names. Their operations and
|
|
328
|
+
programs that depend on them are outside this specification.
|
|
326
329
|
|
|
327
330
|
### 3.2 Names
|
|
328
331
|
|
|
@@ -460,8 +463,7 @@ It only states facts. A path requires file access; a text string does not.
|
|
|
460
463
|
|
|
461
464
|
After embedded rule calls have been excluded ([Section 6.2](#62-inline-rule-templates)), clauses are
|
|
462
465
|
numbered from 1 in statement order. A multi-argument `fact` contributes one
|
|
463
|
-
numbered clause per argument.
|
|
464
|
-
statement call begins; facts read by `facts_from` use that call's line.
|
|
466
|
+
numbered clause per argument.
|
|
465
467
|
|
|
466
468
|
A clause MUST be rejected when:
|
|
467
469
|
|
|
@@ -708,12 +710,11 @@ An evaluation MUST raise an error, rather than produce a value, on a division
|
|
|
708
710
|
or modulo by zero, a domain error (such as `sqrt(-1)`, `log(0)`, or a
|
|
709
711
|
logarithm `log(X, B)` whose `X` or base `B` is not positive or whose `B` is
|
|
710
712
|
1), a bitwise operation, `isqrt`, `gcd` or `lcm` on a float, a negative shift
|
|
711
|
-
count, when the result
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
exceeds 2^26.
|
|
713
|
+
count, or when the result is not a finite real number.
|
|
714
|
+
|
|
715
|
+
An implementation MAY bound the resources used by arithmetic. If a bound
|
|
716
|
+
is exceeded, evaluation MUST report resource exhaustion instead of returning
|
|
717
|
+
an incorrect or partial value. The bounds are implementation-defined.
|
|
717
718
|
|
|
718
719
|
## 6. Rule Structure
|
|
719
720
|
|
|
@@ -784,9 +785,9 @@ template's body; its head and direction are those of the template. A forward
|
|
|
784
785
|
template keeps its head conjunction; a backward template appends one clause
|
|
785
786
|
per head. Continue processing appended clauses in order, compiling nested
|
|
786
787
|
forward templates in the same way. Original clause numbers are kept;
|
|
787
|
-
appended clauses are numbered consecutively and
|
|
788
|
-
|
|
789
|
-
|
|
788
|
+
appended clauses are numbered consecutively. `forward` and `backward` are
|
|
789
|
+
displayed as `implies` and `implied_by`. The original generating clause
|
|
790
|
+
retains its template heads.
|
|
790
791
|
|
|
791
792
|
For example, `implies(cat(X), implies(dog(Y), test('yes')))` as the only
|
|
792
793
|
stated clause has these displays:
|
|
@@ -871,8 +872,8 @@ make one of its negated goals true without also satisfying a
|
|
|
871
872
|
contradiction's body. N. Küchenmeister, A. Ivliev, D. Arndt and
|
|
872
873
|
M. Krötzsch, "Stratified Negation in RDF Rules: A Correct Approach"
|
|
873
874
|
(arXiv:2607.28778), call such programs chain-stratified under constraints.
|
|
874
|
-
This section defines
|
|
875
|
-
|
|
875
|
+
This section defines a conservative decision procedure: a program it
|
|
876
|
+
accepts is chain-stratified in the paper's sense.
|
|
876
877
|
It is made only for a program [Section 6.1](#61-dependencies-and-stratification) rejects for a closed cycle.
|
|
877
878
|
|
|
878
879
|
**Rules.** The rules are the forward clauses and the backward clauses with a
|
|
@@ -1159,8 +1160,7 @@ and `p(2)` publishes `a(1)`, `b(1)`, `a(2)`, `b(2)`. For each head:
|
|
|
1159
1160
|
checker verifies the Skolem terms of a proof (C8, [Section 11.11](#1111-c8-witness-integrity));
|
|
1160
1161
|
- a head `'true'` reports the instance of the rule's body, as a conjunction,
|
|
1161
1162
|
once per distinct instance (by identity of canonical text);
|
|
1162
|
-
- a head `'false'` records the conclusion `'false'` and stops all reasoning
|
|
1163
|
-
with halt code 65;
|
|
1163
|
+
- a head `'false'` records the conclusion `'false'` and stops all reasoning;
|
|
1164
1164
|
- a template head derives a rule instance as specified in [Section 6.2](#62-inline-rule-templates);
|
|
1165
1165
|
- any other head is added as a derived fact unless an identical fact is
|
|
1166
1166
|
already derived or is a ground fact of the program.
|
|
@@ -1226,28 +1226,24 @@ a pattern identical up to renaming of its variables was already derived.
|
|
|
1226
1226
|
|
|
1227
1227
|
### 8.3 Resource bounds
|
|
1228
1228
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
as complete. The bounds count as follows:
|
|
1229
|
+
An implementation MAY bound evaluation resources. Exceeding a bound MUST
|
|
1230
|
+
raise an error; a partial result MUST NOT be returned as complete. Limits
|
|
1231
|
+
and their configuration are implementation-defined. When bounds on search
|
|
1232
|
+
depth, goals started or forward rounds are provided, they count as follows:
|
|
1234
1233
|
|
|
1235
1234
|
- A goal solved by a rule is one level deeper than the goal whose body it is
|
|
1236
1235
|
in, and a goal asked from outside or a forward rule's premise is at level
|
|
1237
|
-
0; solving a goal through more
|
|
1238
|
-
|
|
1239
|
-
- Every goal the search starts counts once toward
|
|
1236
|
+
0; solving a goal through more nested rule bodies than the depth bound
|
|
1237
|
+
allows exceeds it. A goal solved by a fact adds no level.
|
|
1238
|
+
- Every goal the search starts counts once toward the inference bound,
|
|
1240
1239
|
including each conjunction, control and primitive, in forward premises as
|
|
1241
1240
|
in goals: `[p(X), p(Y)]` against one fact starts three goals.
|
|
1242
|
-
- Every forward round of a stratum counts toward
|
|
1241
|
+
- Every forward round of a stratum counts toward the round bound,
|
|
1243
1242
|
including the final round that adds nothing; a stratum without forward
|
|
1244
1243
|
rules has no rounds.
|
|
1245
1244
|
|
|
1246
|
-
A run that exceeds a bound
|
|
1247
|
-
|
|
1248
|
-
reached, and exits with code 1 ([Section 13.1](#131-invocation-and-options)).
|
|
1249
|
-
|
|
1250
|
-
Each supplied bound MUST be a positive integer no greater than 9007199254740991.
|
|
1245
|
+
A run that exceeds a bound MUST report resource exhaustion. Answers found
|
|
1246
|
+
before exhaustion MUST NOT be presented as the complete result of that run.
|
|
1251
1247
|
|
|
1252
1248
|
### 8.4 External goals
|
|
1253
1249
|
|
|
@@ -1260,7 +1256,8 @@ this goal or an earlier one of the same run.
|
|
|
1260
1256
|
|
|
1261
1257
|
### 8.5 Contradictions
|
|
1262
1258
|
|
|
1263
|
-
A run
|
|
1259
|
+
A run halts exactly when it concludes `'false'`. The halt is part of its
|
|
1260
|
+
result and stops evaluation as specified in [Section 8.2](#82-forward-evaluation-and-witnesses).
|
|
1264
1261
|
|
|
1265
1262
|
### 8.6 Reported conclusions
|
|
1266
1263
|
|
|
@@ -1274,7 +1271,6 @@ The conclusions of a run are, in order:
|
|
|
1274
1271
|
4. otherwise: every derived fact, in the order derived.
|
|
1275
1272
|
|
|
1276
1273
|
Rule instances are not facts and cannot be queried as enabling predicates.
|
|
1277
|
-
The `derived` statistic counts only facts added during reasoning.
|
|
1278
1274
|
|
|
1279
1275
|
The output of a run is a comment line saying which of these the conclusions
|
|
1280
1276
|
are, followed by the canonical text ([Section 9](#9-document-syntax-and-canonical-text)) of each conclusion, one per
|
|
@@ -1294,7 +1290,8 @@ when supported. Each negation and collection of a proof gets the search certific
|
|
|
1294
1290
|
that settles it (Sections [10.4](#104-search-certificates) and [11.12](#1112-c9-search-closure)) whenever [Section 11.12](#1112-c9-search-closure) allows one. A
|
|
1295
1291
|
table holds every answer of its call, so it can search beyond where the run
|
|
1296
1292
|
stopped, as under `once`; a boundary whose tables would meet an error, or
|
|
1297
|
-
exceed
|
|
1293
|
+
exceed the inference bound while recording calls and answers
|
|
1294
|
+
([Section 8.3](#83-resource-bounds)), stays trusted. So does a
|
|
1298
1295
|
boundary of a halted run ([Section 8.5](#85-contradictions)) whose listings a rule of a later stratum
|
|
1299
1296
|
would extend: the run stopped before its fixpoint, so its derived facts need
|
|
1300
1297
|
not be closed under the rules. A
|
|
@@ -1865,7 +1862,7 @@ Host math is the one exception to identical re-decision. A `'builtin'` step
|
|
|
1865
1862
|
`log10`, a trigonometric or hyperbolic function, or `pow`, also passes C5
|
|
1866
1863
|
when `E` evaluates to a float at most 4 units in the last place from `V`,
|
|
1867
1864
|
that is, with at most 3 floats between them. Such results may differ between
|
|
1868
|
-
conforming implementations ([Section
|
|
1865
|
+
conforming implementations ([Section 13](#13-conformance)). C5 therefore accepts this bounded
|
|
1869
1866
|
variation. C10 still compares actual answers of the original question;
|
|
1870
1867
|
when those answers depend on host math, a proof MAY fail C10 on another
|
|
1871
1868
|
implementation even when its primitive steps pass C5. Every other recomputed result MUST be identical; a difference
|
|
@@ -2113,9 +2110,7 @@ requires:
|
|
|
2113
2110
|
enclosing generators are not all in the program never fires, and closure
|
|
2114
2111
|
skips it.
|
|
2115
2112
|
|
|
2116
|
-
For example,
|
|
2117
|
-
[Nixon diamond proof](https://eyereasoner.github.io/eyemind/examples/proof/nixon-diamond.js)
|
|
2118
|
-
contains this step and certificate:
|
|
2113
|
+
For example, a proof of a negation can contain this step and certificate:
|
|
2119
2114
|
|
|
2120
2115
|
```js
|
|
2121
2116
|
step(not(nonpacifist('ada')), 'absent', {}, [])
|
|
@@ -2392,7 +2387,7 @@ an empty document leaves `r('c')` as an obligation. A question answered
|
|
|
2392
2387
|
from source facts alone needs no table, so its required answers come from
|
|
2393
2388
|
the facts.
|
|
2394
2389
|
|
|
2395
|
-
**Limits and production of certificates.** The
|
|
2390
|
+
**Limits and production of certificates.** The certificate format requires
|
|
2396
2391
|
complete tables, even for a relation called under `once`. Later recursion
|
|
2397
2392
|
or an error may prevent a table from closing although `once` itself
|
|
2398
2393
|
terminates. A certificate for just the searched prefix is not defined, so
|
|
@@ -2401,11 +2396,11 @@ call fidelity then remains unproved.
|
|
|
2401
2396
|
A reasoner MUST attempt call-fidelity certification for every proof it
|
|
2402
2397
|
generates ([Section 8.7](#87-proof-generation)). It MAY bound this auxiliary
|
|
2403
2398
|
production. Exceeding that bound leaves an obligation and MUST NOT change
|
|
2404
|
-
the run's answers. The bounds are
|
|
2399
|
+
the run's answers. The bounds are implementation-defined, so conforming
|
|
2405
2400
|
reasoners may differ in which generated claims carry call-fidelity
|
|
2406
|
-
obligations.
|
|
2407
|
-
|
|
2408
|
-
|
|
2401
|
+
obligations. A checker MUST
|
|
2402
|
+
decide each supplied certificate from its contents and the source program,
|
|
2403
|
+
without assuming the limits or decisions of the processor that produced it.
|
|
2409
2404
|
|
|
2410
2405
|
**Relevance and counts.** Call tables and their supporting listings serve
|
|
2411
2406
|
the claims for C7; their listed facts are reachable through that evidence.
|
|
@@ -2501,176 +2496,15 @@ each subsequent report fact are renamed `A`, `B`, ..., `Z`, `A1`, ... in order
|
|
|
2501
2496
|
of first occurrence. A report is ordinary data: `facts_from` ([Section 3.4](#34-statements))
|
|
2502
2497
|
states it as facts.
|
|
2503
2498
|
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
The JSON form includes `answers`, an array of the initial claims' canonical
|
|
2507
|
-
texts, including unverified claims when `valid` is false. It also has `valid` (boolean), `steps`,
|
|
2508
|
-
`claims`, `verified`, `redecided` (the count `recomputed`), `composed`,
|
|
2509
|
-
`uses` (the number of uses of all steps, integers), `trusted`
|
|
2510
|
-
(a list of `{kind, conclusion, reason?}`, with `reason: 'original_call'`
|
|
2511
|
-
for a claim's call-fidelity obligation and `reason: 'all_answers'` for a
|
|
2512
|
-
question's answer-completeness obligation), `failures` (a list of
|
|
2513
|
-
`{condition, detail, conclusion?}`) and `conditions` (a list of
|
|
2514
|
-
`{id, name, covered, failed}`), where `conclusion` is a canonical text.
|
|
2515
|
-
Its variables keep the names the document gives them, rather than being
|
|
2516
|
-
renamed for each report fact as in the text form.
|
|
2517
|
-
|
|
2518
|
-
## 13. Command-Line Interface
|
|
2519
|
-
|
|
2520
|
-
### 13.1 Invocation and options
|
|
2521
|
-
|
|
2522
|
-
```text
|
|
2523
|
-
eyemind [OPTION ...] [FILE ...]
|
|
2524
|
-
```
|
|
2525
|
-
|
|
2526
|
-
| Option | Meaning |
|
|
2527
|
-
| --- | --- |
|
|
2528
|
-
| (none) | Load the files, or standard input, as one program and print its conclusions. |
|
|
2529
|
-
| `-p`, `--proof` | Print the proof document instead. |
|
|
2530
|
-
| `-c`, `--prove-and-check` | Generate a proof, check the rendered proof against the input program, and print its answers and check report. |
|
|
2531
|
-
| `--check-proof FILE` | Check the proof in `FILE` (`-` for standard input) against the program and print its answers and report. |
|
|
2532
|
-
| `--json` | With either checking mode, print the report, including `answers`, as JSON. |
|
|
2533
|
-
| `--goal GOAL` | Ask `GOAL`, read as in [Section 9.1](#91-accepted-document-syntax), where an array is a conjunction; MAY be repeated. With `--check-proof`, the goals the proof answers. |
|
|
2534
|
-
| `--strict-proof` | With either checking mode, forbid trusted obligations. |
|
|
2535
|
-
| `--unused` | Print the unused clauses ([Section 13.2](#132-unused-clauses)). |
|
|
2536
|
-
| `--stats` | Print reasoning statistics as JSON to standard error: `inferences`, the goals started, which `--max-inferences` bounds; `rounds`, the forward rounds run over all strata; and `derived`, the facts forward rules added, not counting a conclusion the program states as a fact, a query's answers or `'false'`. |
|
|
2537
|
-
| `--max-depth N`, `--max-iterations N`, `--max-inferences N` | The bounds of [Section 8.3](#83-resource-bounds), with the values it allows. |
|
|
2538
|
-
| `-v`, `--version` | Print the version. |
|
|
2539
|
-
| `-h`, `--help` | Print the usage, including every option and its short alias where one exists. |
|
|
2540
|
-
|
|
2541
|
-
`--proof`, `--prove-and-check`, `--check-proof` and `--unused` are mutually
|
|
2542
|
-
exclusive. `--json` and `--strict-proof` need a checking mode. With
|
|
2543
|
-
`--prove-and-check`, reasoning bounds and `--stats` apply to proof generation;
|
|
2544
|
-
an invalid check returns 2, otherwise the run's halt code is retained
|
|
2545
|
-
(65 for a contradiction, 0 otherwise). A program
|
|
2546
|
-
text that has a line starting with `step(` or `called(` is a proof document; given one as
|
|
2547
|
-
a program, the command line MUST say how to check it instead.
|
|
2548
|
-
|
|
2549
|
-
Files are programs ([Section 3](#3-program-syntax)) unless an
|
|
2550
|
-
implementation reads other formats. eyemind reads files by their extension:
|
|
2551
|
-
`.ttl`, `.trig`, `.nt` and `.nq` as RDF 1.2 data, joining a program as
|
|
2552
|
-
`rdf(S, P, O, G)` facts, `.n3` as Notation3 and `.srl` as a SPARQL 1.2 RL rule
|
|
2553
|
-
set, both compiled to a program, with the options `--to FORMAT` (the output
|
|
2554
|
-
format of the conclusions), `--all`, `--program` and `--base IRI`; its README
|
|
2555
|
-
describes the mappings. Such formats are outside conformance: a conforming
|
|
2556
|
-
implementation need not read them, and the suite does not test them. The
|
|
2557
|
-
proofs and checks of a compiled program are those of any program.
|
|
2558
|
-
|
|
2559
|
-
For N3 and SRL inputs, `--proof` writes native proof data, `.n3` and `.srl`
|
|
2560
|
-
respectively. This is an additional representation of the complete proof of
|
|
2561
|
-
[Section 10](#10-proof-documents), outside conformance. JavaScript programs and the core library
|
|
2562
|
-
continue to write the canonical representation. `--check-proof` recognizes
|
|
2563
|
-
all three representations from their contents, regardless of filename;
|
|
2564
|
-
check reports retain the representation of [Section 12](#12-check-reports).
|
|
2565
|
-
|
|
2566
|
-
The native proof resource is `<urn:eyemind:proof>`, of type `pe:Proof`, where
|
|
2567
|
-
`pe:` is `https://eyereasoner.github.io/pe#` and `em:` is
|
|
2568
|
-
`https://eyereasoner.github.io/eyemind/proof#`. It has `em:format` equal to
|
|
2569
|
-
`"n3"` or `"srl"`, `pe:claims` as an ordered collection of claim displays,
|
|
2570
|
-
and `em:records` as an ordered collection of record IRIs. Record `N`, counted
|
|
2571
|
-
from 1, is `<urn:eyemind:proof#recordN>` and has one `em:term` containing its
|
|
2572
|
-
[Section 10](#10-proof-documents) statement, encoded as a tagged collection:
|
|
2573
|
-
|
|
2574
|
-
| Term | Collection |
|
|
2575
|
-
| --- | --- |
|
|
2576
|
-
| Atom | `(em:atom "text")` |
|
|
2577
|
-
| Integer | `(em:integer "digits")`, with a minus for a negative integer |
|
|
2578
|
-
| Float | `(em:float "number")`, preserving signed zero as `"-0"` |
|
|
2579
|
-
| Variable | `(em:variable "name")`, including anonymous-variable status |
|
|
2580
|
-
| `iri(I)` with an RDF-compatible IRI | `(em:iri <I>)` |
|
|
2581
|
-
| Nonempty proper list | `(em:list (EncodedItem ...))` |
|
|
2582
|
-
| Compound | `(em:compound "name" (EncodedArgument ...))` |
|
|
2583
|
-
|
|
2584
|
-
The empty list is the atom `"[]"`. Other compounds, including open lists,
|
|
2585
|
-
quoted graphs and Skolem terms, use the compound encoding. A string field
|
|
2586
|
-
containing a character RDF cannot represent uses an `em:utf16` typed literal
|
|
2587
|
-
whose lexical form is four lowercase hexadecimal digits per UTF-16 code
|
|
2588
|
-
unit. This retains every atom and variable name accepted by
|
|
2589
|
-
[Section 9.2](#92-canonical-atoms-numbers-variables-and-lists).
|
|
2590
|
-
|
|
2591
|
-
A triple goal's display is an N3 quoted formula, or an SRL RDF triple term.
|
|
2592
|
-
Other goals use their tagged encoding. A step record also displays
|
|
2593
|
-
`pe:conclusion`, `pe:rule` for a `clause(N)` justification, `pe:source` for
|
|
2594
|
-
`source(N)`, or `pe:justification` for another justification. `pe:binding`
|
|
2595
|
-
is an ordered collection of `(VariableName Value)` pairs, and `pe:uses` an
|
|
2596
|
-
ordered collection of premise displays. Non-native binding values retain
|
|
2597
|
-
their tagged encoding. Search records display `pe:derived`, `pe:searched`
|
|
2598
|
-
or `pe:called` and an ordered `pe:answers` collection. Clause numbers name
|
|
2599
|
-
the compiled program's clauses, whose authority is still the source input.
|
|
2600
|
-
SRL proofs contain only `DATA` and declarations, never rules or imports.
|
|
2601
|
-
|
|
2602
|
-
When an SRL rule set uses `NOW`, `UUID` or `STRUUID`, its compiled program
|
|
2603
|
-
includes one ground `srl_execution(Now, Seed)` fact. `Now` is an ISO UTC
|
|
2604
|
-
timestamp with milliseconds and `Seed` contains 64 lowercase hexadecimal
|
|
2605
|
-
digits. The compiler captures these external inputs once per compilation;
|
|
2606
|
-
they remain fixed throughout evaluation. To check a saved SRL proof, the
|
|
2607
|
-
format loader may recover this fact from its clause records, validate its
|
|
2608
|
-
two fields, and recompile the source with that execution context. All other
|
|
2609
|
-
clauses still come from the source, and all displays undergo C1–C10 as
|
|
2610
|
-
usual. This establishes consequences of the recorded context, without
|
|
2611
|
-
certifying a clock observation or the entropy of the seed.
|
|
2612
|
-
|
|
2613
|
-
The reader decodes every record, verifies all displays and properties against
|
|
2614
|
-
those records, and applies the unchanged checks of
|
|
2615
|
-
[Section 11](#11-proof-checking) to the decoded
|
|
2616
|
-
certificate. A missing, extra, duplicate or inconsistent property fails C3.
|
|
2617
|
-
Numeric literal displays retain their decimal digits during this comparison;
|
|
2618
|
-
distinct decimal literals MUST NOT agree merely by rounding to binary64.
|
|
2619
|
-
Prefix aliases and reordering top-level properties are accepted, as is
|
|
2620
|
-
consistent blank-node renaming; the order of collections and formula triples
|
|
2621
|
-
is retained. Displayed claims cannot replace encoded claims, and neither
|
|
2622
|
-
representation can change the source authority or supply missing evidence.
|
|
2623
|
-
|
|
2624
|
-
eyemind also reads RDF Message Logs in these four RDF syntaxes, announced by
|
|
2625
|
-
a `*-messages` version. Replay supplies ordered envelopes and quoted payloads
|
|
2626
|
-
to N3 or JavaScript rules; `--stream-messages` evaluates each message
|
|
2627
|
-
independently and supports incremental Node input. Replay can produce and
|
|
2628
|
-
check ordinary eyemind proofs. The streaming mode rejects proof generation,
|
|
2629
|
-
proof checking, `--program` and `--unused`. These mappings and this option
|
|
2630
|
-
are also outside conformance; the README describes their supported behavior.
|
|
2631
|
-
|
|
2632
|
-
| Exit code | Meaning |
|
|
2633
|
-
| --- | --- |
|
|
2634
|
-
| 0 | Success, including a check that found the proof valid. |
|
|
2635
|
-
| 1 | An error, printed to standard error as `eyemind: message`. |
|
|
2636
|
-
| 2 | A check that found the proof not valid; the report is printed as usual. |
|
|
2637
|
-
| 65 | The run halted ([Section 8.5](#85-contradictions)). |
|
|
2638
|
-
|
|
2639
|
-
### 13.2 Unused clauses
|
|
2640
|
-
|
|
2641
|
-
A clause is **unused** when no conclusion's recorded derivation cites it,
|
|
2642
|
-
unless a negation or collection in the proof could consult it and its
|
|
2643
|
-
omission changes the conclusions or halt code, or causes an error. The clauses a
|
|
2644
|
-
negation or collection could consult are those whose heads have the name and
|
|
2645
|
-
arity of a goal it reaches through the program's bodies. Running the program
|
|
2646
|
-
without a clause leaves every other clause its number ([Section 3.5](#35-clause-constraints-and-numbering)), so the
|
|
2647
|
-
Skolem terms of the other rules ([Section 8.2](#82-forward-evaluation-and-witnesses)) do not change.
|
|
2648
|
-
|
|
2649
|
-
Unused clauses are reported one per line, in clause order, as
|
|
2650
|
-
`unused(line(L), Display)`, where `L` is the clause's line ([Section 3.5](#35-clause-constraints-and-numbering)) in
|
|
2651
|
-
the script that states it, and `Display` as in [Section 10.2](#102-clause-displays); with several
|
|
2652
|
-
scripts, clause order tells which script a line belongs to. The listing is
|
|
2653
|
-
the result whether or not the program halts with `'false'`, and the command
|
|
2654
|
-
exits with code 0 after it.
|
|
2655
|
-
|
|
2656
|
-
"Unused" is relative to the recorded derivations, which are the first ones
|
|
2657
|
-
found ([Section 8.7](#87-proof-generation)). A clause that only offers a second derivation of a
|
|
2658
|
-
conclusion, such as a duplicate rule, is unused, though leaving out the
|
|
2659
|
-
clause that offers the first one would make it used; leaving out several
|
|
2660
|
-
unused clauses together can therefore change the conclusions. A
|
|
2661
|
-
`contradiction` rule that never fires changes no conclusion and is unused,
|
|
2662
|
-
though it guards the program against data that would make it fire; so are
|
|
2663
|
-
the clauses only its negations or collections could consult, since they are
|
|
2664
|
-
not in the proof.
|
|
2665
|
-
|
|
2666
|
-
## 14. Conformance
|
|
2499
|
+
## 13. Conformance
|
|
2667
2500
|
|
|
2668
2501
|
A conforming reasoner MUST implement the program syntax, semantics and
|
|
2669
2502
|
evaluation of Sections [2](#2-terms)–[8](#8-evaluation-and-conclusions) and the document and proof formats of Sections
|
|
2670
2503
|
[9](#9-document-syntax-and-canonical-text)–[12](#12-check-reports). A conforming checker MUST implement Sections [9](#9-document-syntax-and-canonical-text)–[12](#12-check-reports) against the supplied
|
|
2671
2504
|
program, including the clause and template rules of Sections [3](#3-program-syntax) and [6](#6-rule-structure),
|
|
2672
|
-
without invoking a reasoner to complete the certificate.
|
|
2673
|
-
|
|
2505
|
+
without invoking a reasoner to complete the certificate. Conformance does
|
|
2506
|
+
not require a particular command-line interface, library API, browser
|
|
2507
|
+
interface or test runner.
|
|
2674
2508
|
|
|
2675
2509
|
Canonical term spelling, conclusion order, proof contents and report counts
|
|
2676
2510
|
are required as specified. Comment wording and failure `Detail` text are
|
|
@@ -2679,70 +2513,12 @@ so. Float results of `exp`, logarithms, trigonometric and hyperbolic
|
|
|
2679
2513
|
functions, and `pow` with floats MAY differ by one unit in the last place,
|
|
2680
2514
|
and C5 accepts a result of such a function within 4 units ([Section 11.8](#118-c5-re-decision)).
|
|
2681
2515
|
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
[Section 13.1](#131-invocation-and-options) as a black box: each case creates files, runs the command and
|
|
2689
|
-
compares its exit code and output with what this specification requires.
|
|
2690
|
-
The suite is the `conformance` directory of the eyemind repository. Its
|
|
2691
|
-
expected outputs are derived from this specification; where a case and this
|
|
2692
|
-
specification disagree, the specification governs and the case is wrong.
|
|
2693
|
-
|
|
2694
|
-
**Manifest.** `manifest.json` is a JSON array that lists the case files in
|
|
2695
|
-
the order they run. Each element is an object with three string members:
|
|
2696
|
-
`file`, the name of a case file in the same directory; `spec`, the sections
|
|
2697
|
-
of this specification it tests, separated by commas; and `topic`, a
|
|
2698
|
-
description. The cases of a file run in the order they appear in it.
|
|
2699
|
-
|
|
2700
|
-
**Case files.** A case file is a document ([Section 9.1](#91-accepted-document-syntax)), read as data and
|
|
2701
|
-
never executed, whatever its file name extension. Each of its terms is one
|
|
2702
|
-
case, `conformance(Name, Settings)`, where `Name` is an atom unique in the
|
|
2703
|
-
suite and `Settings` is a proper list of the settings below. A **block** is a
|
|
2704
|
-
proper list of atoms, each one line; its text is each line followed by a
|
|
2705
|
-
line feed, so `[]` is empty text. A file MUST NOT contain any other term,
|
|
2706
|
-
and a setting other than these is an error in the suite.
|
|
2707
|
-
|
|
2708
|
-
| Setting | Meaning | When absent |
|
|
2709
|
-
| --- | --- | --- |
|
|
2710
|
-
| `spec(S)` | `S`, an atom: the sections the case tests, separated by commas. | |
|
|
2711
|
-
| `args(A)` | `A`, an atom: the command's arguments, split into words as described below. | `'program.js'` |
|
|
2712
|
-
| `exit(N)` | `N`, an integer: the exit code required. | `0` |
|
|
2713
|
-
| `stderr(M)` | Standard error: `'empty'`, no text; `'nonempty'`, some text other than white space; `'json'`, one JSON value; `prefix(T)`, text that starts with the atom `T`. | Not compared |
|
|
2714
|
-
| `file(Name, Block)` | A file the case creates before running; `Name` is a relative path whose `/` separates directories. | |
|
|
2715
|
-
| `stdin(Block)` | Standard input. | Empty |
|
|
2716
|
-
| `stdout(Block)` | Standard output, compared line by line. | Not compared |
|
|
2717
|
-
| `stdout('nonempty')` | Standard output contains text other than white space. | |
|
|
2718
|
-
| `stdout_json(Block)` | Standard output, compared as JSON. | |
|
|
2719
|
-
| `stdout_text(T)` | Standard output given as the atom `T`, for text a block cannot show, such as text without a final line feed; compared as `stdout` compares. | |
|
|
2720
|
-
|
|
2721
|
-
Each setting appears at most once in a case, except `file`.
|
|
2722
|
-
|
|
2723
|
-
**Running a case.** A case runs in a new empty directory. Each `file`
|
|
2724
|
-
setting creates its file there, with any directories its path names. The
|
|
2725
|
-
command then runs in that directory, with the words of `args` after the
|
|
2726
|
-
command's own words and with the `stdin` text on standard input. `args` is
|
|
2727
|
-
split into words as a POSIX shell splits a command line without expansions:
|
|
2728
|
-
white space separates words; text between single quotes is taken as is;
|
|
2729
|
-
between double quotes a backslash escapes only `"`, `\`, `$`, `` ` `` and a
|
|
2730
|
-
line feed; elsewhere a backslash escapes the next character; and adjacent
|
|
2731
|
-
quoted and unquoted parts join into one word.
|
|
2732
|
-
|
|
2733
|
-
**Passing.** A case passes when the exit code equals `exit` and standard
|
|
2734
|
-
output and standard error meet the settings that compare them. Line by line,
|
|
2735
|
-
the expected and actual standard output MUST have the same number of lines,
|
|
2736
|
-
and each expected line MUST equal the actual one, except that each `…`
|
|
2737
|
-
(U+2026) in an expected line matches any sequence of characters within that
|
|
2738
|
-
line; this specification leaves such text, for example a failure detail, to
|
|
2739
|
-
the implementation ([Section 14](#14-conformance)). As JSON, both outputs MUST parse, and they
|
|
2740
|
-
MUST be equal as JSON values: arrays element by element, objects with the
|
|
2741
|
-
same member names whatever their order, numbers by their values, and
|
|
2742
|
-
strings as lines are, so that an expected string containing `…` matches any
|
|
2743
|
-
string of that form.
|
|
2744
|
-
|
|
2745
|
-
## 15. Security
|
|
2516
|
+
Tests and example documents can provide evidence of conformance. Passing
|
|
2517
|
+
a test suite does not replace these requirements, and the behavior of an
|
|
2518
|
+
implementation does not define them. When a test or implementation
|
|
2519
|
+
disagrees with this specification, this specification governs.
|
|
2520
|
+
|
|
2521
|
+
## 14. Security
|
|
2746
2522
|
|
|
2747
2523
|
Programs execute JavaScript and require the caller's trust. Documents,
|
|
2748
2524
|
including proofs, reports, goals and `facts_from` input, MUST be read as data
|
package/package.json
CHANGED
package/src/proof.js
CHANGED
|
@@ -58,7 +58,7 @@ function sameValue(a, b) {
|
|
|
58
58
|
|
|
59
59
|
// Whether term, read through env, is exactly target, variables included.
|
|
60
60
|
// The functions whose float results may differ between hosts' math libraries
|
|
61
|
-
// (SPEC Section
|
|
61
|
+
// (SPEC Section 13), and how far apart, in units in the last place, a claimed
|
|
62
62
|
// result of one of them may be from the recomputed one (Section 11.8).
|
|
63
63
|
const HOST_MATH = new Set(['exp', 'log', 'log2', 'log10', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
|
|
64
64
|
'sinh', 'cosh', 'tanh', 'pow']);
|
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.5.
|
|
2
|
+
export const VERSION = '0.5.29';
|