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 +287 -543
- package/LS-SPEC.md +1 -1
- package/README.md +73 -67
- package/package.json +1 -1
- package/src/formats.js +6 -8
- package/src/le.js +1289 -581
- package/src/version.js +1 -1
- package/src/le-odrl.js +0 -213
package/LE-SPEC.md
CHANGED
|
@@ -1,572 +1,316 @@
|
|
|
1
1
|
# Logical English
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
| `
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
`
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
219
|
-
that an `or` rule derives. Conclusions are never disjunctive.
|
|
75
|
+
LE2's additions follow a template after `;`:
|
|
220
76
|
|
|
221
|
-
|
|
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
|
-
|
|
|
241
|
-
|
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
277
|
-
|
|
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
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
|
|
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
|
-
|
|
|
328
|
-
|
|
|
329
|
-
|
|
|
330
|
-
|
|
|
331
|
-
|
|
|
332
|
-
|
|
|
333
|
-
|
|
|
334
|
-
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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
|
-
| `
|
|
360
|
-
| `
|
|
361
|
-
| `
|
|
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
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
-
|
|
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
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
419
|
-
|
|
|
420
|
-
|
|
|
421
|
-
|
|
|
422
|
-
|
|
|
423
|
-
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
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
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
`
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
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
|
-
|
|
524
|
-
|
|
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
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
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.
|