eyemind 0.8.52 → 0.9.1

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/LE-SPEC.md CHANGED
@@ -1,572 +1,316 @@
1
1
  # Logical English
2
2
 
3
- eyemind reads `.le` files as the language defined here and compiles
4
- them to ordinary Logic Script (LS). This is an input extension; the meaning of
5
- the compiled program is defined by the [LS specification](https://eyereasoner.github.io/eyemind/LS-SPEC).
6
- It supports statements and computations in a fixed grammar. It does not parse
7
- arbitrary mathematical prose or check textbook proof arguments.
8
-
9
- ## Documents and names
10
-
11
- A document is a sequence of sentences, each ending in `.`. Whitespace and line
12
- breaks separate tokens; a sentence can span lines. `#` starts a comment through
13
- the end of the line, except inside a quoted name. Examples separate their header
14
- comments from the body and put an empty line before each body comment block.
15
-
16
- Keywords are case-insensitive. Names are case-sensitive. Class and relation
17
- names start with a lowercase ASCII letter, followed by ASCII letters, digits or
18
- underscores. Names of LS primitives and controls are reserved as relation names.
19
- There is no implicit vocabulary, pluralization, pronoun resolution or spelling
20
- normalization. `integer`, for example, is a user-defined class whose facts supply
21
- its members; it does not enumerate all mathematical integers.
22
-
23
- An individual can be an unquoted name such as `Socrates` or `alice`. A variable
24
- is one capital ASCII letter optionally followed by digits, such as `X` or `Y1`.
25
- Variables must be declared in their sentence; a quoted `"X"` is an individual.
26
- Names containing spaces, punctuation or non-ASCII characters use JSON double
27
- quotes, as in `"René Descartes"`. JSON escapes retain their usual meanings.
28
- Quote names that would introduce a sentence, such as `"Every"` or `"If"`.
29
-
30
- Terms also include integers, floats, closed lists and compounds:
31
-
32
- ```text
33
- 9007199254740993
34
- -0.0
35
- [Alice, Bob, [1, 2]]
36
- pair(Alice, Bob)
37
- "a compound name"(Alice, 1)
38
- ```
39
-
40
- Integers have optional leading `-`, no leading zero except `0`, and arbitrary
41
- precision. A decimal point with digits on both sides, or an exponent, denotes a
42
- finite binary64 float: `1.0`, `0.25`, `1e3`. Integers and floats remain distinct
43
- terms. `1.` is integer `1` followed by the sentence terminator. Nonfinite numeric
44
- tokens are rejected. A compound has at least one argument. A closed list may be
45
- empty; there is no open-list surface syntax, although a `"."(Head, Tail)` compound
46
- can retain an LS list with a nonempty tail as data. Term and expression
47
- nesting is limited to 256 levels.
48
-
49
- ## Positive statements
50
-
51
- The following forms have the indicated LS meanings. `T`, `U` and the arguments
52
- stand for terms; `class` and `relation` stand for names as defined above.
53
-
54
- | LE form | LS term |
55
- | --- | --- |
56
- | `T is a class` | `class(T)` |
57
- | `T is an class` | `class(T)` |
58
- | `T is class` | `class(T)` |
59
- | `T is a relation of U` | `relation(T, U)` |
60
- | `T is an relation of U` | `relation(T, U)` |
61
- | `T has relation U` | `relation(T, U)` |
62
- | `relation(T, U, ...)` | The corresponding compound goal. |
63
- | `relation` | An atom used as a goal, with arity zero. |
64
-
65
- The articles `a` and `an` have the same semantics. They do not introduce an
66
- existential variable. For example, `Socrates is a human.` states
67
- `fact(human('Socrates'))`. Write an existential declaration to introduce an
68
- unnamed individual.
69
-
70
- `and` joins positive statements. A sentence containing only positive statements
71
- states them as facts. A universally quantified fact is explicit:
72
-
73
- ```text
74
- Ada is a human and Ada is a mathematician.
75
- For every X, matching(pair(X, X)).
76
- ```
77
-
78
- Variables declared by `For every` are universal within that sentence. Each
79
- sentence has its own scope. Repeating a declaration in one scope is an error.
80
-
81
- ## RDF vocabulary names
82
-
83
- Declare a prefix before using its names. ODRL, DPV and DPV extension
84
- namespaces can appear together in the same file.
85
-
86
- ```text
87
- Use prefix ex with namespace "https://example.org/research#".
88
- Use prefix odrl with namespace "http://www.w3.org/ns/odrl/2/".
89
- Use prefix dpv with namespace "https://w3id.org/dpv#".
90
-
91
- ex:agreement is an odrl:Agreement.
92
- ex:study is a dpv:Process.
93
- ex:study has dpv:hasPurpose dpv:AcademicResearch.
94
-
95
- Find every X such that X has dpv:hasPurpose dpv:AcademicResearch.
96
- ```
97
-
98
- Prefixes start with an ASCII letter and can also contain digits and
99
- underscores. Local names contain ASCII letters, digits, underscores and
100
- hyphens, and cannot start with a hyphen. Prefixes and local names are
101
- case-sensitive. A declaration binds a prefix to a quoted absolute IRI.
102
- Each file declares its own prefixes, at most once per prefix. Prefix
103
- expansion appends the local name to the namespace exactly as stated.
104
- `iri("...")` terms can express IRIs outside this abbreviation syntax.
105
-
106
- In facts, rules and questions, a qualified class or property uses the
107
- same `rdf/3` relation:
108
-
109
- | LE form | LS term |
110
- | --- | --- |
111
- | `T is a ex:Class` | `rdf(T, iri("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), iri("https://example.org/research#Class"))` |
112
- | `T has ex:property U` or `T is an ex:property of U` | `rdf(T, iri("https://example.org/research#property"), U)` |
113
- | `ex:item` in any term position | `iri("https://example.org/research#item")` |
114
-
115
- `Every` rules also accept qualified classes on either side. Qualified
116
- statements take a resource or variable as their subject. Objects can
117
- also be numbers and explicit RDF terms such as
118
- `literal("dataset", datatype("http://www.w3.org/2001/XMLSchema#string"))`.
119
- Ordinary unqualified class and relation names retain their LS meanings.
120
-
121
- The default LE output abbreviates IRIs using available prefixes and
122
- includes the declarations it uses. Other IRIs retain their explicit
123
- terms. When input files assign the same prefix to different namespaces,
124
- the final declaration supplies the output abbreviation. Earlier files'
125
- expanded IRIs retain their values. For triple conclusions, `--to turtle`
126
- writes the RDF graph and `--all` adds the stated RDF facts.
127
-
128
- Prefix declarations specify names. The facts and rules supply their
129
- meaning for a run. The research access example uses ODRL permissions,
130
- prohibitions, constraints and a duty with DPV purpose and consent
131
- evidence. Its ordinary LE rules specify the scenario's policy decisions; a
132
- Turtle companion decides similar requests with the ODRL snapshot evaluator.
133
- [Research access example](https://eyereasoner.github.io/eyemind/examples/deck/research-access-le) · [Turtle companion](https://eyereasoner.github.io/eyemind/examples/deck/research-access-odrl) · [ODRL Vocabulary](https://www.w3.org/TR/odrl-vocab/) · [Data Privacy Vocabulary 2.3](https://w3id.org/dpv/2.3/dpv/)
134
-
135
- ## Rules and calculations
136
-
137
- ```text
138
- Every human is mortal.
139
- Every human is mortal and animal.
140
- For every X and Y, if X is a parent of Y then X is an ancestor of Y.
141
- If Alice is a person then Alice is a participant.
142
- ```
143
-
144
- `Every A is B.` compiles to `implies(A(X), B(X))`, with a fresh clause-local
145
- variable; `a` or `an` may precede each class after `is`, as in
146
- `Every human is a mortal.`. An if/then sentence compiles its premises and conclusions to one
147
- forward LS rule. Both sides may contain conjunctions. A conclusion variable
148
- must be supplied by a premise or explicitly declared existentially. The
149
- compiler checks the stated order of premises for calculations and absence tests;
150
- actual values must also satisfy LS's runtime requirements.
151
-
152
- These additional forms are available in premises and questions:
153
-
154
- | LE form | LS goal |
3
+ [Logical English](https://github.com/LogicalContractsOrg/LogicalEnglish) (LE)
4
+ is the controlled natural language of Robert Kowalski, Jacinto Dávila, Miguel
5
+ Calejo, Galileo Sartor and their colleagues for writing legal and business
6
+ rules as English that a computer runs. eyemind reads `.le` files in the core
7
+ that the original implementation, LE 1.0 with its
8
+ [syntax document](https://github.com/LogicalContractsOrg/LogicalEnglish/blob/main/le_syntax.md),
9
+ and [Logical English 2](https://github.com/LogicalContractsOrg/LogicalEnglish2)
10
+ share, and compiles them to ordinary Logic Script (LS). This is an input
11
+ extension: the meaning of the compiled program is defined by the
12
+ [LS specification](https://eyereasoner.github.io/eyemind/LS-SPEC), and this
13
+ document says how eyemind reads LE and what it compiles each part to. Where the
14
+ two LE implementations differ, it says which reading eyemind follows.
15
+
16
+ ## Documents
17
+
18
+ A document is a sequence of sections. Each section starts with a header that
19
+ ends with `:`:
20
+
21
+ | Header | Section |
155
22
  | --- | --- |
156
- | `Y is the value of E` | `is(Y, E)` |
157
- | `X is greater than E` | `gt(X, E)` |
158
- | `X is less than E` | `lt(X, E)` |
159
- | `X is at least E` | `ge(X, E)` |
160
- | `X is at most E` | `le(X, E)` |
161
- | `X is equal to E` | `eq(X, E)` |
162
- | `X is different from E` | `ne(X, E)` |
163
-
164
- Expressions contain numbers, declared variables, parentheses, unary `-` and
165
- binary `+`, `-`, `*`, `/`. Unary minus binds most tightly, then multiplication
166
- and division, then addition and subtraction. Binary operators associate left.
167
- They compile to `neg`, `add`, `sub`, `mul` and `div`. Only the value-of form
168
- binds its left variable; comparisons require their inputs beforehand.
169
-
170
- An expression can also call an LS arithmetic function by name, with
171
- expressions as its arguments, and use the constants `pi`, `e` and `tau`:
172
-
173
- ```text
174
- For every X and Y, if X is a number and Y is the value of exp(log(X) * 3) + gcd(12, 18) * cos(pi)
175
- then Y is a result of X.
176
- ```
177
-
178
- The functions are those of [LS-SPEC Section 5.2](https://eyereasoner.github.io/eyemind/LS-SPEC#52-functions-and-arities),
179
- such as `pow`, `floordiv`, `mod`, `gcd`, `lcm`, `sqrt`, `exp`, `log`, `sin`,
180
- `cos`, `atan2`, `abs` and `hypot`, except `and`, `or` and `not`, which are LE
181
- words. A call with an arity the function does not take is an error naming
182
- its line. As in LS, `pow` and `floordiv` of integers stay exact, while
183
- `exp`, `log` and the trigonometric functions give floats.
184
-
185
- ```text
186
- 4 is an integer.
187
- For every X and Y, if X is an integer and Y is the value of X * X
188
- then Y is a square of X.
189
- ```
190
-
191
- Arithmetic follows LS: integer addition, subtraction and multiplication are
192
- exact; division returns a float; mixed integer/float arithmetic returns a
193
- float. Numeric equality compares values, while ordinary relation matching
194
- keeps integer and float terms distinct. Calculations belong in premises,
195
- followed by relational conclusions. These calculations do not prove arbitrary
196
- algebraic identities or supply induction.
197
-
198
- ## Alternative premises
23
+ | `the templates are:`, `the predicates are:` | Templates, separated by full stops, and by commas at the end of a line or before a place. |
24
+ | `the knowledge base NAME includes:`, `the contract NAME states that:` | Facts and rules. |
25
+ | `the ontology is:` | Facts and rules; a fact `a student is a person.` relates the kinds `student` and `person`. |
26
+ | `the constants are:` | Named values, one sentence each: `the fee is 5.` |
27
+ | `the knowledge base NAME includes these resources:` | Other files, separated by commas, whose templates, facts, rules, ontologies and constants join the document. |
28
+ | `the knowledge base NAME includes these scenarios:` | Other files, as resources, whose scenarios and queries join the document too. |
29
+ | `scenario NAME is:` | Facts and rules of one scenario, and its expected answers. |
30
+ | `query NAME is:` | One query. |
31
+
32
+ `the target language is: prolog.` is accepted and ignored, and so are LE2's
33
+ section markers, `section NAME is:` and `the annexes to the contract are:`,
34
+ and its rule labels, `rule NAME:` before a rule. The sections can come in any
35
+ order, and a template can be used before it is declared. Several `.le` files
36
+ are read as one document.
37
+
38
+ An included file is named as in LE2: a path relative to the file that
39
+ includes it, without `.le` if one likes. It is read once, and a chain of
40
+ includes stops at five. The command line reads included files; the library
41
+ reads them through `io.readFile` when `compileLe(inputs, io)` is given one.
42
+ Web addresses and Prolog resources (`.pl`) are not read.
43
+
44
+ Sentences end with a full stop followed by white space or the end of the file;
45
+ a sentence can span lines. `%` or `#` starts a comment through the end of the
46
+ line, and `/* ... */` is a block comment. Words are compared without case.
47
+
48
+ A token is a word (letters, digits and underscores, joined by hyphens or
49
+ apostrophes, as in `JE-201` and `don't`), a final `'s` as a word of its own, a
50
+ number (`42`, `3.14`, `1,000,000`), a date (`2021-10-09`), a quoted text
51
+ (`"..."` or `'...'`), or a punctuation sign. The indentation of a line counts a
52
+ space as one and a tab as four, as LE's editor shows it.
53
+
54
+ ## Templates
55
+
56
+ A template is a sentence pattern: words and places. A place is a phrase between
57
+ asterisks, such as `*a person*`; LE1 also writes templates without asterisks,
58
+ and in a template without any, `a` or `an` and the word after it make a place.
199
59
 
200
60
  ```text
201
- Every cat or dog is a pet.
202
- For every V, if V is registered or V is a provisionalVoter and V is verified
203
- then V is an eligibleVoter.
204
- For every X, it is impossible that X is a minor and X is a voter or X is barred.
61
+ the templates are:
62
+ *a person* acquires British citizenship on *a date*,
63
+ *a person* says that *a sentence*,
64
+ a person has a balance.
205
65
  ```
206
66
 
207
- `or` separates alternative premises of a rule or contradiction. `and` binds
208
- more tightly, so each alternative is a conjunction; there are no parentheses
209
- around alternatives. Each alternative compiles to its own LS clause with the
210
- same conclusion, in the order written: `Every A or B is C.` is
211
- `implies(A(X), C(X))` followed by `implies(B(X), C(X))`. The sentence's
212
- declarations are shared, and an alternative need not use every declared
213
- variable, but each conclusion variable must be supplied by every alternative
214
- or introduced with `there exists`. An existential conclusion therefore has a
215
- witness per alternative and firing. The order of premises is checked within
216
- each alternative.
67
+ Each template is a relation whose name joins its words with underscores and
68
+ whose arguments are its places in order: `acquires_British_citizenship_on/2`,
69
+ `says_that/2`, `has/2`. A name that is an LS primitive or control, or `date`,
70
+ gets the prefix `le_`. Two templates with different words for one name and
71
+ arity are an error. A place after the word `that` holds a sentence. A document
72
+ with an asterisk in any template reads `a` and `an` in its other templates as
73
+ words.
217
74
 
218
- Questions have no `or`: ask one question per alternative, or ask for a relation
219
- that an `or` rule derives. Conclusions are never disjunctive.
75
+ LE2's additions follow a template after `;`:
220
76
 
221
- ## Aggregates
222
-
223
- ```text
224
- For every M and T,
225
- if M is a member and T is the sum of F for every C and F such that charge(M, C, F)
226
- then T is an amountDue of M.
227
- For every V and N,
228
- if V is a participant and N is the number of C such that choice(V, C) and N is at least 2
229
- then V is a spoiledVoter.
230
- For every C and N,
231
- if C is a candidate and N is the number of V such that
232
- (choice(V, C) and V is an eligibleVoter and it is not known that V is a spoiledVoter)
233
- then N is a voteCount of C.
234
- ```
235
-
236
- These premise forms collect every solution of a condition:
237
-
238
- | LE form | Result |
77
+ | Addition | Meaning in eyemind |
239
78
  | --- | --- |
240
- | `N is the number of X1 and ... such that C` | The number of distinct combinations of `X1 ...` satisfying `C`. |
241
- | `S is the sum of V for every X1 and ... such that C` | The sum of `V` over those combinations; `0` when there are none. |
242
- | `M is the maximum of V for every X1 and ... such that C` | The greatest `V` over those combinations; no result when there are none. |
243
- | `M is the minimum of V for every X1 and ... such that C` | The least `V` over those combinations; no result when there are none. |
244
-
245
- The variables after `the number of` or `for every` are declared by the
246
- aggregate, must be new in the sentence, and cannot be used after it. `V` must
247
- be one of them. The condition `C` is one statement, or a conjunction in
248
- parentheses; it can use calculations, comparisons and absence tests, but no
249
- `or` and no other aggregate. Any other variable of `C` must be supplied by an earlier premise. The
250
- left-hand side is a declared variable or a number, as in the value-of form:
251
- an unbound variable receives the result and a bound one is compared with it.
252
-
253
- Each distinct combination of the declared variables' values counts once, however
254
- many derivations it has. To count distinct values of one variable when the
255
- condition needs others, derive a relation of that variable first, as
256
- `choice(V, C)` above does for ballots. Values are summed with LS arithmetic, so
257
- integers stay exact and a float makes the sum a float; maximum and minimum
258
- compare numerically.
259
-
260
- An aggregate compiles to
261
- `findall_sorted(t(V, X1, ...), C, L)`, followed by goals of backward helper
262
- relations named `le:distinct`, `le:count`, `le:sum`, `le:max` and `le:min`,
263
- which remove repeated tuples and fold the rest. The helpers are added after
264
- the program's own clauses, only when used, so they do not change the rule
265
- numbers of witnesses; their names cannot be written as LE names. Like a
266
- negation, an aggregate waits until the relations of its condition are complete,
267
- so a program cannot aggregate over a relation that depends on the aggregate's
268
- own result. Questions cannot aggregate: derive the aggregate in a rule and ask
269
- for its conclusion.
270
-
271
- ## Absence and existential conclusions
272
-
273
- An absence test has exactly this form, followed by one positive statement:
79
+ | `; synonym TEMPLATE` | A second wording of the same relation, with its places in the same order. |
80
+ | `; opposite: TEMPLATE`, `; opposite TEMPLATE` | The wording of a separate relation, concluded only by its own rules and by `only if` rules. |
81
+ | `; assumable`, `; unknown`, `; assumed`, `; judged`, `; open textured`, `; evaluative` | eyemind makes no assumptions: a sentence that is not stated or concluded is false. A negated assumable sentence is an error, because it would hold only as an assumption. |
82
+ | `; memorable`, `; memoised`, `; memoized`, `; cached`, `; undefined`, `; scenario element`, `; one value`, `; single valued`, `; image ...` | Nothing that eyemind computes changes. |
83
+
84
+ Other additions, such as `; prepositional` and `; via service NAME`, are errors.
85
+
86
+ ## Sentences
87
+
88
+ A sentence matches a template when it has the template's words in order, with
89
+ at least one token in each place and balanced brackets in each. eyemind tries
90
+ the templates with a `that` place first, as LE does, then the templates with the
91
+ most words, a declared template before a built-in one, and takes the first that
92
+ matches with a valid term in every place. A sentence that matches no template
93
+ is an error that quotes it.
94
+
95
+ The tokens in a place are a term:
96
+
97
+ - A number is an exact integer, or a float when it has a fraction or an
98
+ exponent; `-` before a number negates it. Commas may group thousands.
99
+ - A date is the compound `date(Year, Month, Day)`.
100
+ - A quoted text is a name.
101
+ - `[A, B, C]` is a list of terms.
102
+ - `a`, `an`, `some`, `each` or `which`, followed by at most six words,
103
+ introduces a variable: `a person`, `an other person`, `a second date`. The
104
+ same phrase again is the same variable.
105
+ - `the` followed by the words of a variable introduced earlier in the clause
106
+ refers to it: `the person`, `the other person`. A definite phrase that refers
107
+ to no variable is a name, written with its article: `the UK`, `the white
108
+ rabbit`. This follows LE2; the same phrase names the same thing everywhere.
109
+ - A phrase whose last word is an id names its variable by the id: `a person X`
110
+ is the variable `X`, and `X` alone then refers to it. An id is one capital
111
+ letter with optional digits, or a word of at most six capitals and digits
112
+ other than `UK`. eyemind does not read LE2's short proper names such as `Bob`
113
+ as ids: LE1 programs use them as names.
114
+ - A single capital letter with optional digits, such as `L` or `T1`, is a
115
+ variable even when no phrase introduced it. Longer ids need an introducing
116
+ phrase, because LE1 programs use acronyms such as `GST` as names.
117
+ - `*a name*` between asterisks, LE2's explicit variable, is the variable of
118
+ that phrase, introduced or referred to.
119
+ - A lone `which`, `what`, `who`, `when` or `where` introduces a variable.
120
+ - A phrase that names a constant of `the constants are:` is its value, unless a
121
+ variable of the clause has that name.
122
+ - Other words are a name, written as they are, such as `Socrates` or
123
+ `cash at bank`.
124
+
125
+ In the place of a `that`, a sentence of a template is a term: the template's
126
+ relation with its arguments, as data.
127
+
128
+ ## Facts and rules
129
+
130
+ In a knowledge base or a scenario, a sentence is a fact, or a rule
131
+ `conclusion if conditions.` The conclusion matches a declared template or the
132
+ type template `*an object* is a *type*` (the relation `is_a/2`, whose type is a
133
+ name). A fact with a variable holds for every value. In an ontology, a fact
134
+ whose subject starts with `a` or `an` is about the kind: `a student is a person.`
135
+ states `is_a('student', 'person')`. An ontology's kinds are transitive: for
136
+ each such ground fact `b is a c`, whatever is a `b` is a `c`. A fact or rule
137
+ may end with LE2's `; image ...`, which is ignored.
138
+
139
+ `Head only if Body.` makes Body necessary for Head, as in LE2: it concludes the
140
+ opposite of Head, the template's `; opposite` wording or else an internal
141
+ relation, when it is not the case that Body. The other rules of Head's relation
142
+ then conclude a base relation, and Head holds when the base holds and its
143
+ opposite does not.
144
+
145
+ The conditions are joined by `and` and `or`. Each connective has the
146
+ indentation of its line; a connective in the middle of a line has the
147
+ indentation of that line, and a line break without a connective joins the lines
148
+ with `and` where both lines are conditions. eyemind reads the connectives as
149
+ LE's indentation does: the conditions are split at the least indented
150
+ connectives, joined from the top down, and each part is read in the same way.
151
+ So a deeper indentation binds tighter:
274
152
 
275
153
  ```text
276
- For every X, if X is a person and it is not known that X is blocked
277
- then X is an applicant.
154
+ a person is eligible a person is eligible
155
+ if the person is a resident if the person is a resident
156
+ or the person is a citizen or the person is a citizen
157
+ and the person is an adult. and the person is an adult.
278
158
  ```
279
159
 
280
- It compiles to `not(blocked(X))`. Its variables must be supplied by earlier
281
- positive premises or calculations. LS stratification decides when the tested
282
- relation is complete. This means absence of a proof in this program, rather
283
- than classical mathematical negation. Ordinary `not` is rejected. Explicit
284
- negative evidence can use its own positive relation, such as `not_human`.
160
+ The left rule means *(resident or citizen) and adult*, the right one *resident
161
+ or (citizen and adult)*. LE1 rejects different connectives at one indentation;
162
+ eyemind reads them from the top down, as LE2 does. A body may start with `and`
163
+ after `if`, as some LE1 programs write it.
285
164
 
286
- ```text
287
- For every X, if X is a person then there exists Y such that
288
- Y is a record and X is an owner of Y.
289
- There exists X such that X is a record.
290
- ```
291
-
292
- `there exists` introduces fresh variables for a conclusion, after any universal
293
- declarations. Every introduced variable must occur in that conclusion. The
294
- compiler uses an ordinary LS forward rule with head-only variables; a standalone
295
- existential sentence uses premise `'true'`. LS supplies Skolem witnesses. The
296
- same variable shares one witness across the heads of that firing. A witness
297
- does not assert a distinct real-world object or a minimum number of objects.
165
+ A condition is a sentence of a template, a comparison, or one of the following,
166
+ each of which takes the lines that follow it up to the next line that starts
167
+ with a connective at the same or a lesser indentation:
298
168
 
299
- ## Questions and contradictions
300
-
301
- ```text
302
- Find every X such that X is mortal.
303
- Find every X and Y such that X is an ancestor of Y.
304
- Find whether Socrates is mortal.
305
- For every X, it is impossible that X is a person and X is blocked.
306
- It is impossible that Alice is blocked.
307
- Contradiction.
308
- ```
309
-
310
- Questions compile to `query(...)`; their declarations establish variable scope,
311
- and the answers are instances of the whole question, without a separate
312
- projection. `Find whether` introduces no variables. A question can use a
313
- conjunction, calculations and absence tests. Without questions the run reports
314
- derived conclusions, following LS's default; given facts alone are not printed.
315
-
316
- `It is impossible that` compiles to an LS contradiction with the stated body.
317
- `Contradiction.` is an unconditional contradiction, also used to serialize a
318
- run's `'false'` conclusion. Contradictions halt reasoning with exit code 65;
319
- they do not produce the continuing RDF conflict reports of `--owl2rl`.
320
-
321
- ## Examples combining features
322
-
323
- These programs use the grammar above without additional syntax:
324
-
325
- | Example | What it demonstrates |
169
+ | Condition | LS |
326
170
  | --- | --- |
327
- | [Shortest paths](https://eyereasoner.github.io/eyemind/examples/deck/shortest-path-le) | Bounded recursive histories, exact costs and minimum selection by absence, retaining ties. |
328
- | [River crossing](https://eyereasoner.github.io/eyemind/examples/deck/river-crossing-le) | Compound states, repeated-variable matching, safety constraints and complete plans within a bound. |
329
- | [Course certificates](https://eyereasoner.github.io/eyemind/examples/deck/course-certificates-le) | Recursive requirements, absence of a counterexample, shared existential witnesses and witnesses containing earlier witnesses. |
330
- | [British citizenship](https://eyereasoner.github.io/eyemind/examples/deck/british-citizenship-le) | Section 1 of the British Nationality Act 1981: alternative premises, a presumption that holds unless the contrary is shown, date comparisons and citizenship through a derived parent. |
331
- | [Library fines](https://eyereasoner.github.io/eyemind/examples/deck/library-fines-le) | Charges from alternative rules, then the sum, number and maximum per member over distinct combinations. |
332
- | [Election tally](https://eyereasoner.github.io/eyemind/examples/deck/election-tally-le) | Eligibility by alternatives, distinct choices, an absence test inside a count, winners by maximum with ties, and a quorum. |
333
- | [International data transfers](https://eyereasoner.github.io/eyemind/examples/deck/data-transfers-le) | An ODRL snapshot with rules: GDPR Chapter V observations derived with alternative premises and absence tests over DPV, location and GDPR-extension names, decided by one permission per basis and a prohibition that wins. |
334
- | [Breach notification](https://eyereasoner.github.io/eyemind/examples/deck/breach-notification-le) | An ODRL snapshot with rules: GDPR Articles 33 and 34 as permissions and prohibitions, with requests, observations and a processor's duty evidence derived from breach records by comparisons over hours. |
335
-
336
- Their decks state the modeled assumptions and what the checked proofs establish.
337
- Bounds and finite expression domains are explicit in the programs.
338
-
339
- ## DPV hierarchies
340
-
341
- ```text
342
- Use DPV hierarchy logic.
343
- Use prefix ex with namespace "https://example.org/research#".
344
- Use prefix dpv with namespace "https://w3id.org/dpv#".
345
- Use prefix skos with namespace "http://www.w3.org/2004/02/skos/core#".
346
-
347
- ex:study has dpv:hasPurpose dpv:AcademicResearch.
348
- dpv:AcademicResearch has skos:broader dpv:ResearchAndDevelopment.
349
- Find whether ex:study has purposeWithin dpv:ResearchAndDevelopment.
350
- ```
351
-
352
- The directive adds hierarchy rules to an ordinary LE program. The
353
- program supplies its observations and SKOS edges. DPV 2.3 uses SKOS
354
- broader and narrower relations for its default taxonomy representation.
355
- [DPV 2.3](https://w3id.org/dpv/2.3/dpv/)
356
-
357
- | Observation property | LE conclusion |
171
+ | `it is not the case that C`, `not the case that C` | `not(C)` |
172
+ | `for all cases in which C it is the case that D` | `not([C, not(D)])` |
173
+ | `R is the sum of each X such that C` | `findall(X, C, L)` and the sum of `L`; `0` for none |
174
+ | `R is the count of each X such that C` | the length of `L`; `0` for none |
175
+ | `R is the average of each X such that C` | the sum divided by the count; none for none |
176
+ | `R is the min of each X such that C`, `minimum`, `max`, `maximum` | the least or greatest of `L`; none for none |
177
+ | `R is the list of each X such that C` | `L` itself |
178
+ | `R is a collection of X where C` | `L` itself, as LE1 writes it |
179
+
180
+ An aggregate collects one value for every solution of its conditions, in the
181
+ order they are found, as Prolog's `findall` does: a value found twice counts
182
+ twice. The result phrase of an aggregate is the phrase before `is the`, after any
183
+ connective.
184
+
185
+ ## Negation
186
+
187
+ Variables that occur only inside a negation stand for any value there; eyemind
188
+ renames them `_0`, `_1`, ..., which LS negation treats as anonymous. LE's rules
189
+ are written for Prolog, whose negation also succeeds when no instance of its
190
+ goal holds if one of its variables is unbound. LS requires the named variables
191
+ of a negation to be bound, so a negation with a variable no earlier condition
192
+ binds, up to three such variables, tests each one at run time: while it is
193
+ unbound (`is_var`), the negation stands for any value there; once bound
194
+ (`is_nonvar`), it is that value. When a fact or rule of the document leaves a
195
+ variable of its conclusion open, no condition surely binds a variable, and
196
+ every negation tests its variables in this way.
197
+
198
+ ## Arithmetic, comparisons and built-in templates
199
+
200
+ A comparison has `=`, `==`, `!=`, `\=`, `\==`, `<`, `>`, `<=`, `=<` or `>=`
201
+ between two sides. A side is a term, or a formula of terms with `+`, `-`, `*`,
202
+ `/`, `//`, `mod`, parentheses and the functions `ceiling`, `floor`, `round`,
203
+ `truncate`, `integer`, `abs` and `sqrt`. A term in a formula is any of the terms
204
+ above, such as `the gain = the proceeds - the cost base`.
205
+
206
+ | Comparison | LS |
358
207
  | --- | --- |
359
- | `dpv:hasPurpose` | `X has purposeWithin C` |
360
- | `dpv:hasData` | `X has dataWithin C` |
361
- | `dpv:hasPersonalData` | `X has personalDataWithin C` |
362
-
363
- Each conclusion matches an observed category itself and its ancestors
364
- reached by transitively following the supplied IRI-to-IRI
365
- `skos:broader` and `skos:broaderTransitive` edges, or the inverse of
366
- `skos:narrower` and `skos:narrowerTransitive`. A snapshot uses the same
367
- hierarchy through its `withinCategory` operator.
208
+ | `A = B`, `A == B`, `A is equal to B` | `unify(A, B)` between terms; `is` when one side is a formula; `eq` between formulas |
209
+ | `A != B`, `A \= B`, `A is different from B`, `A is not equal to B` | `not_unify(A, B)` between terms; `ne` otherwise |
210
+ | `A \== B` | `not_identical(A, B)` |
211
+ | `<`, `>`, `<=` or `=<`, `>=`, and `is less than`, `is greater than`, `is less than or equal to`, `is greater than or equal to`, `is less or equal to`, `is greater or equal to` | `lt`, `gt`, `le`, `ge` |
368
212
 
369
- ## ODRL snapshots
370
-
371
- An LE file can explicitly select the existing ODRL snapshot evaluator:
372
-
373
- ```text
374
- Use ODRL snapshot logic with namespace "https://example.org/handicap-card#".
375
-
376
- evaluation is an evaluation.
377
- evaluation has policy eligibility.
378
- evaluation has request issueAlice.
379
- evaluation has conflictStrategy prohibit.
380
- ```
213
+ `/` divides as Prolog does: integers that divide give an integer, other
214
+ operands a float. `//` is floor division. LE1's `A is B` equates or evaluates
215
+ as `=` does when a side is a variable or a formula; between two names no
216
+ template matches.
381
217
 
382
- This directive must be the first sentence of one file. The remainder contains
383
- facts using the snapshot vocabulary, and rules, but no questions: the report
384
- is the answer. The compiler maps the facts to RDF and includes the
385
- validation, evaluation and reporting LS of `src/odrl.js`.
386
-
387
- A snapshot's rules derive more of its input: their class and property
388
- statements, in premises and conclusions, are statements of the snapshot's
389
- RDF graph, with names mapped as for facts. A rule typically derives a state's
390
- observations or a request's duty evidence from other facts, so the
391
- evaluator decides on what the rules establish:
392
-
393
- ```text
394
- For every S and P,
395
- if S is a state and S has subject P and P has registeredIn civicDistrict
396
- then S has residenceVerified true.
397
- ```
398
-
399
- Calculations, comparisons, absence tests and aggregates work as in ordinary
400
- LE; an absence test asks whether the graph, with the rules' conclusions,
401
- holds a statement. The rules precede the evaluator's own clauses, so they
402
- cannot read its report, and a snapshot without rules compiles to the same
403
- program as before. The evaluator validates what the rules derive as it
404
- validates stated facts: a request or state still has one type, for
405
- example. Derive an observation as both `true` and `false` where it matters,
406
- since a missing observation leaves a constraint unknown. The same
407
- [snapshot profile](https://eyereasoner.github.io/eyemind/#odrl-snapshots) applies
408
- to Turtle and LE, including missing observations, unsupported policy features
409
- and conflict strategies. Vocabulary by itself does not enable evaluation.
410
-
411
- Names expand as follows, with case preserved:
412
-
413
- | LE form or name | RDF mapping |
218
+ | Built-in template | LS |
414
219
  | --- | --- |
415
- | An ordinary individual name | An IRI formed by appending it to the declared namespace. |
416
- | Classes `evaluation`, `request`, `state` | `eval:Evaluation`, `eval:Request`, `eval:State`. |
417
- | Classes `policy`, `agreement`, `permission`, `prohibition`, `constraint`, `logicalConstraint`, `duty`, `action` | `odrl:Set`, `odrl:Agreement`, `odrl:Permission`, `odrl:Prohibition`, `odrl:Constraint`, `odrl:LogicalConstraint`, `odrl:Duty`, `odrl:Action`. |
418
- | Classes `assetCollection`, `partyCollection` | ODRL collection classes, rejected by the snapshot profile. |
419
- | Properties `policy`, `request`, `state`, `subject`, `conflictStrategy` | The corresponding `eval:` properties. |
420
- | Properties `profile`, `permission`, `prohibition`, `assignee`, `assigner`, `action`, `target`, `constraint`, `leftOperand`, `operator`, `rightOperand`, `duty` | The corresponding `odrl:` properties. |
421
- | Properties `andOperands`, `orOperands`, `xoneOperands` | `odrl:and`, `odrl:or`, `odrl:xone`. LE lists become RDF collections. |
422
- | Properties `fulfilledDuty`, `unfulfilledDuty` | The corresponding `eval:` request evidence properties. |
423
- | Property `policyConflict` | `odrl:conflict`, the policy-local strategy. |
424
- | Property `type` | `rdf:type`. |
425
- | An otherwise unknown class or property | An IRI in the declared namespace; validation still applies. |
426
- | Values `snapshotProfile`, `perm`, `prohibit`, `invalid`, `eq`, `neq`, `gt`, `gteq`, `lt`, `lteq` | `eval:SnapshotProfile` or the corresponding ODRL strategy/operator IRIs. |
427
- | Value `withinCategory` | `eval:withinCategory`, the snapshot's DPV hierarchy operator. |
428
- | Values `true`, `false` | Boolean RDF literals. Quoting does not change an LE name into an RDF string literal. |
429
- | An integer or float | An exact RDF integer or an `xsd:double` literal. |
430
-
431
- The unsupported ODRL properties `obligation`, `inheritFrom`, `includedIn`,
432
- `partOf` and `refinement` retain their ODRL IRIs so the shared validator can
433
- report them. Explicit RDF values such as `iri("https://example.org/item")` and
434
- `literal("text", datatype("http://www.w3.org/2001/XMLSchema#string"))` retain
435
- their terms. `rdf(S, P, O)` facts allow any explicit RDF predicate without an
436
- abbreviation. A snapshot still has one default graph.
437
-
438
- The [handicap-card LE example](https://eyereasoner.github.io/eyemind/examples/deck/handicap-card-le)
439
- contains the complete policies, requests and SOTW. Run it without CLI switches:
440
-
441
- ```sh
442
- eyemind examples/handicap-card-le.le
443
- eyemind --program examples/handicap-card-le.le > /tmp/handicap-card-le.js
444
- eyemind --to turtle /tmp/handicap-card-le.js
445
- ```
446
-
447
- Its default output is an LE report whose first sentence is
448
- `Use ODRL vocabulary with namespace "https://example.org/handicap-card#".`.
449
- That directive reads RDF data without evaluating policies. This makes the report
450
- readable as input again, preserving every RDF fact and witness. Report properties
451
- use `has`; for example `issueAlice has decision allowed.`. Status values
452
- `allowed`, `prohibited`, `notApplicable`, `undetermined`, `valid` and
453
- `invalidReport` name the corresponding `eval:` IRIs. Report classes include
454
- `evaluationReport`, `conflict`, `validationError` and `uncertainty`.
455
- `conflict` as a property means `eval:conflict`; `applicablePermission`,
456
- `applicableProhibition`, `reportConstraint` and `reportDuty` distinguish the
457
- report's `eval:permission`, `eval:prohibition`, `eval:constraint` and
458
- `eval:duty` links from ODRL input properties. Other report fields retain their `eval:` names. Other IRIs
459
- are written with the run's prefixes, declared after the directive: those the
460
- file declares, `odrl:` and `eval:`. Inside a witness key, where a bare name
461
- would read back as a name rather than an IRI, the snapshot namespace also
462
- needs a prefix: the file's own, or `ns` when it declares none. An IRI that no
463
- prefix abbreviates stays explicit.
464
-
465
- Prefix declarations can follow either ODRL directive, and the whole snapshot
466
- can be written with qualified names, as `ex:mayErase has odrl:action
467
- odrl:delete.` or `ex:evaluation is a eval:Evaluation.`. After an ODRL
468
- directive a qualified statement takes the subjects and values the short forms
469
- take: an ordinary name in the declared namespace, `true` and `false`, and an
470
- operand list, as `ex:scope has odrl:and [ex:purpose, ex:consent].`. A state
471
- property or value can use a DPV IRI, for example
472
- `state has dpv:hasPurpose dpv:AcademicResearch.`. An equality constraint
473
- can read `dpv:hasPurpose` as its left operand and use
474
- `dpv:AcademicResearch` as its right operand.
475
- [Right to erasure example](https://eyereasoner.github.io/eyemind/examples/deck/right-to-erasure-le)
220
+ | `*a* is after *b*`, `is before`, `is after or equal to`, `is before or equal to`, `is not before` | the standard order with `compare`, so dates compare in time order |
221
+ | `*a* is *n* days after *b*`, `*a* is *n* day after *b*` | days in the proleptic Gregorian calendar; any two of the three give the third |
222
+ | `*a* is in *b*` | `a` is a member of the list `b` |
223
+ | `*a* is known` | `is_nonvar(a)` |
224
+ | `the minimum of *a* and *b* is *c*`, `the maximum of ...` | `is(c, min(a, b))`, `max` |
225
+ | `the length of *a* is *b*` | the length of the list `a` |
226
+ | `*a* is the reverse of *b*` | `a` is the list `b` reversed |
227
+ | `appending *a* then *b* gives *c*` | `c` is `a` followed by `b` |
228
+ | `*a* has *b* as head before *c*` | `unify(a, [b, ...c])` |
229
+
230
+ ## Scenarios, queries and expected answers
231
+
232
+ A query has one sentence of conditions, read as a rule's conditions are.
233
+ `which person`, like `a person`, introduces a variable, and LE1's prefix
234
+ `for which event:` introduces one too. A scenario has facts and rules, and
235
+ expectations:
476
236
 
477
237
  ```text
478
- scope is a logicalConstraint and scope has andOperands [purpose, dataCategory].
479
- purpose is a constraint and purpose has leftOperand dpv:hasPurpose.
480
- purpose has operator withinCategory and purpose has rightOperand dpv:ResearchAndDevelopment.
481
- credit is a duty and credit has action odrl:attribute.
482
- researchUse has constraint scope and researchUse has duty credit.
483
- ready has fulfilledDuty credit.
238
+ scenario alice is:
239
+ John is born in the UK on 2021-10-09.
240
+ one expects answers ["John acquires British citizenship on 2021-10-09"].
484
241
  ```
485
242
 
486
- A logical constraint has one operator and a proper RDF list of at least two
487
- distinct atomic constraints. `andOperands` requires all members,
488
- `orOperands` at least one and `xoneOperands` exactly one. The result is
489
- unknown when treating unknown members as satisfied or unsatisfied could
490
- change the outcome. Reports cite the group for an unmet or unknown logical
491
- constraint. The snapshot rejects nested groups and `odrl:andSequence`.
492
- [ODRL Logical Constraint Class](https://www.w3.org/TR/odrl-model/#constraint-logical)
493
-
494
- A permission can require several duties. Each is typed `odrl:Duty` and
495
- has one action IRI. A request records whether it has fulfilled each duty.
496
- An `unfulfilledDuty` record makes the permission inapplicable and gives
497
- an `unmetDuty` report link. A missing record or conflicting records give
498
- an uncertainty with `reportDuty` and a reason. The snapshot takes these
499
- records as evidence of fulfillment. Duties that specify additional action
500
- refinements, roles or consequences fail validation.
501
- [ODRL Duty with a Permission](https://www.w3.org/TR/odrl-model/#duties)
502
-
503
- `withinCategory` compares a single observed IRI with a required category IRI.
504
- It accepts the three DPV observation properties in the hierarchy table.
505
- An exact match or a supplied broader path satisfies the constraint. With
506
- a known observation and no such path the constraint is unmet. The snapshot
507
- reports missing, ambiguous or mistyped observations as unknown.
508
- The research snapshot demonstrates compound scope, two DPV hierarchies and
509
- request-local duty evidence; its Turtle twin, run with `--odrl`, reaches the
510
- same decisions. [Research snapshot](https://eyereasoner.github.io/eyemind/examples/deck/research-snapshot-le) · [Turtle twin](https://eyereasoner.github.io/eyemind/examples/deck/research-snapshot-odrl)
511
-
512
- Both ODRL directives take a single LE file and reject questions; the
513
- vocabulary directive also rejects rules. `--goal` can query their compiled LS program. The
514
- `--odrl` switch selects the Turtle snapshot compiler, which can also combine
515
- with `--owl2rl`, `--skos`, `--qudt` and `--shacl`; an LE run takes none of these
516
- switches, so an LE snapshot reads only the facts it states.
517
-
518
- ## Output, compilation and checking
519
-
520
- LE inputs default to `.le` conclusions. Each answer becomes a sentence:
243
+ `NAME expects answers [...]` and `NAME expects [...]` state the answers the
244
+ query `NAME` gives in the scenario. The answers may be quoted sentences or, as
245
+ some examples write them, words up to a comma. An expectation with
246
+ `and unknowns [...]` that lists unknowns, or with `and any unknowns`, rests on
247
+ assumptions and is not compared; `and unknowns []` is.
248
+ Each query is answered in each scenario, or once when the document has none.
249
+
250
+ ## Compilation to LS
251
+
252
+ Facts and rules compile to LS facts and backward rules (`implied_by`), as LE's
253
+ Prolog target runs them; a ground fact is `fact(...)`, a fact with a variable a
254
+ backward rule with the body `'true'`.
255
+
256
+ When a document has scenarios, every relation gets the scenario as its first
257
+ argument, a scenario's clauses have the scenario's name there, and the
258
+ knowledge base's clauses have a variable there, bound by the facts
259
+ `'le:scenario'(NAME)`. A knowledge-base fact becomes a rule whose body is
260
+ `'le:scenario'(S)`. So the knowledge base holds in every scenario and a
261
+ scenario's facts in that one, and one program and one proof answer every query
262
+ in every scenario.
263
+
264
+ A query `NAME` compiles to a backward rule for `'le:answer'(NAME, S, V1, ...)`,
265
+ whose body starts with `'le:scenario'(S)` when there are scenarios, and the
266
+ statement `query('le:answer'(NAME, S, V1, ...))`. `V1, ...` are the variables of
267
+ the query outside negations and collections, in the order they appear.
268
+
269
+ Aggregates, divisions, lists and dates use backward helper rules whose names
270
+ start with `le:` (`le:sum`, `le:count`, `le:days_after`, ...); no template name
271
+ can contain `:`. The helpers follow the document's clauses. `--program` prints
272
+ the compiled program as a standalone LS script.
273
+
274
+ ## Output
275
+
276
+ The default output of an LE run is LE text: for each scenario, in the order of
277
+ the document, and each query, a heading comment and the answers as sentences.
278
+ An answer is the query's words with each variable it found a value for
279
+ written as that value; an open variable is written `_`, as LE writes it. A date
280
+ is written `YYYY-MM-DD`, a list in brackets, and a sentence term through its
281
+ template.
521
282
 
522
283
  ```text
523
- Socrates is a mortal.
524
- 16 is a square of 4.
525
- Alice is an owner of witness(rule 4, Y, Alice).
526
- ```
527
-
528
- `witness(rule 4, Y, Alice)` names the witness for existential variable `Y` of
529
- rule 4 with argument Alice. It reads back as `skolem(4, 'Y', ['Alice'])` in LS.
530
- The label `Y` in this position is a name, independent of any declared LE
531
- variable. A label outside the variable-name syntax is quoted. Additional
532
- arguments follow as more comma-separated terms; a witness without arguments
533
- is `witness(rule 4, Y)`. The rule number, label and arguments all contribute
534
- to its identity. Ordinary compounds named witness retain their quoted spelling.
535
-
536
- Unary and binary relations use the class and relation-of forms; relations with
537
- more arguments use calls. Names are quoted when required to preserve their
538
- meaning. Compound names are quoted. Variable answers use `For every X0 and X1,
539
- ...`, consistently renaming their variables while retaining sharing. A conjunctive
540
- answer uses `and`. These sentences can be loaded as facts in another `.le`
541
- program. An empty answer set is `# No conclusions.`. The writer rejects goals
542
- outside these relational forms instead of silently changing their meaning.
543
-
544
- ```sh
545
- eyemind examples/socrates-le.le
546
- eyemind --program examples/socrates-le.le > /tmp/socrates-le.js
547
- eyemind --to le /tmp/socrates-le.js
548
- eyemind --proof examples/socrates-le.le > /tmp/socrates-le-proof.js
549
- eyemind --check-proof /tmp/socrates-le-proof.js examples/socrates-le.le
284
+ % query one with scenario alice
285
+ John acquires British citizenship on 2021-10-09.
550
286
  ```
551
287
 
552
- Multiple `.le` files form one program in file order; they do not mix with other
553
- input formats or the RDF logic switches. Standard input remains LS; `--to le`
554
- can write supported LS conclusions as LE. For an N3, SRL or RDF run, IRIs are
555
- abbreviated with that run's prefixes; a prefix LE cannot spell, such as
556
- Turtle's empty one, is declared as `ns`, or `ns2` and so on when taken. `--goal` uses LS goal syntax and
557
- defaults to LS output; add `--to le` for LE output. `--all` applies to RDF and N3
558
- output, without changing LE's selected conclusions.
559
-
560
- The compiler reads data without executing it and emits standalone `.js` LS
561
- using explicit constructors to retain names and numeric types. Comments in the
562
- compiled text identify the source file and sentence line. Parser errors name
563
- that location. LE runs use LS's usual work bounds, which can be overridden by
564
- the CLI. Existential or recursive rules can still have an infinite closure.
565
-
566
- Proofs and check reports are `.js` documents and use the existing LS checker.
567
- Checking establishes the compiled LS result. It does not independently validate
568
- the English-to-LS translation; that contract is this grammar and its tests.
569
-
570
- Supported sentences have no disjunctive conclusions, pronouns, implicit
571
- assumptions, set comprehension, higher-order quantification or proof blocks.
572
- Unsupported syntax is an error, with no approximate translation.
288
+ A query without answers has the line `% no answers`. When the scenario states
289
+ expected answers for the query and they differ from the answers, a line
290
+ `% not as expected: NAME expects answers [...]` follows. LE2 writes the
291
+ underscores of names as spaces and repeats an answer for each proof, so the
292
+ comparison reads underscores as spaces, ignores spaces around hyphens, and
293
+ compares the answers as a set.
294
+
295
+ `--to le` writes the answers of an LE run only; `--to eyemind` writes the
296
+ `'le:answer'` terms. Proofs and check reports are `.js` documents of the
297
+ compiled LS program, and check against it. That the program reads the English
298
+ as intended is a matter of the compiler and its tests; a checked proof
299
+ establishes the answers under the compiled rules.
300
+
301
+ ## Not supported
302
+
303
+ These belong to Logical English 2, or to the Prolog that LE1 can embed, and
304
+ are errors: the template additions the table above leaves out,
305
+ `the functions are:`, `the fluents are:`, `the events are:` and the other
306
+ dynamic and meta sections, facts backgrounds, included web addresses and
307
+ Prolog resources, embedded `prolog` goals, numbered conditions, provenance
308
+ trailers and document locations, `it is unknown whether`,
309
+ `it must not be true that`, negated facts in scenarios, negated assumable
310
+ sentences (abduction), flip queries (`expects changes`), scenario headers with
311
+ provenance, `otherwise`, `unless`, `according to`, decision tables, services,
312
+ LPS and s(CASP). eyemind does not
313
+ check types: the head noun of a place is not a type constraint. A program whose
314
+ negation lies on a dependency cycle compiles, and the LS program is then
315
+ rejected unless it is chain-stratified (LS-SPEC Section 6.4), where Prolog would
316
+ run it.