eyeling 1.26.4 → 1.26.6
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/dist/browser/eyeling.browser.js +5 -5
- package/examples/proof/backward.n3 +21 -0
- package/examples/proof/composition-of-injective-functions-is-injective.n3 +196 -0
- package/examples/proof/derived-backward-rule-2.n3 +80 -0
- package/examples/proof/derived-backward-rule.n3 +53 -0
- package/examples/proof/derived-rule.n3 +43 -0
- package/examples/proof/dog.n3 +41 -0
- package/examples/proof/equals.n3 +14 -0
- package/examples/proof/existential-rule.n3 +26 -0
- package/examples/proof/greatest-lower-bound-uniqueness.n3 +168 -0
- package/examples/proof/group-inverse-uniqueness.n3 +180 -0
- package/examples/proof/list-iterate.n3 +142 -0
- package/examples/proof/list-map.n3 +44 -0
- package/examples/proof/log-collect-all-in.n3 +152 -0
- package/examples/proof/log-conclusion.n3 +118 -0
- package/examples/proof/log-for-all-in.n3 +33 -0
- package/examples/proof/log-not-includes.n3 +55 -0
- package/examples/proof/log-uri.n3 +34 -0
- package/examples/proof/rule-matching.n3 +34 -0
- package/eyeling.js +5 -5
- package/lib/engine.js +5 -5
- package/package.json +1 -1
- package/test/examples.test.js +149 -46
|
@@ -6212,16 +6212,16 @@ function __computeConclusionFromFormula(formula) {
|
|
|
6212
6212
|
for (const tr of formula.triples) {
|
|
6213
6213
|
// Treat {A} => {B} as a forward rule.
|
|
6214
6214
|
if (isLogImplies(tr.p)) {
|
|
6215
|
-
fw.push(__makeRuleFromTerms(tr.s, tr.o, true));
|
|
6215
|
+
fw.push(__copyProofSource(tr, __makeRuleFromTerms(tr.s, tr.o, true)));
|
|
6216
6216
|
continue;
|
|
6217
6217
|
}
|
|
6218
6218
|
|
|
6219
6219
|
// Treat {A} <= {B} as the same rule in the other direction, i.e., {B} => {A},
|
|
6220
6220
|
// so it participates in deductive closure even if only <= is used.
|
|
6221
6221
|
if (isLogImpliedBy(tr.p)) {
|
|
6222
|
-
fw.push(__makeRuleFromTerms(tr.o, tr.s, true));
|
|
6222
|
+
fw.push(__copyProofSource(tr, __makeRuleFromTerms(tr.o, tr.s, true)));
|
|
6223
6223
|
// Also index it as a backward rule for completeness (helps proveGoals in some cases).
|
|
6224
|
-
bw.push(__makeRuleFromTerms(tr.s, tr.o, false));
|
|
6224
|
+
bw.push(__copyProofSource(tr, __makeRuleFromTerms(tr.s, tr.o, false)));
|
|
6225
6225
|
continue;
|
|
6226
6226
|
}
|
|
6227
6227
|
}
|
|
@@ -8735,7 +8735,7 @@ function forwardChain(facts, forwardRules, backRules, onDerived /* optional */,
|
|
|
8735
8735
|
// Promote rule-producing triples to live rules, treating literal true as {}
|
|
8736
8736
|
// and literal false as a fuse head.
|
|
8737
8737
|
if (isFwRuleTriple) {
|
|
8738
|
-
const newRule = __makeRuleFromTerms(subj, obj, true);
|
|
8738
|
+
const newRule = __copyProofSource(r, __makeRuleFromTerms(subj, obj, true));
|
|
8739
8739
|
__prepareForwardRule(newRule);
|
|
8740
8740
|
|
|
8741
8741
|
const key = __ruleKey(
|
|
@@ -8752,7 +8752,7 @@ function forwardChain(facts, forwardRules, backRules, onDerived /* optional */,
|
|
|
8752
8752
|
rulesChanged = true;
|
|
8753
8753
|
}
|
|
8754
8754
|
} else if (isBwRuleTriple) {
|
|
8755
|
-
const newRule = __makeRuleFromTerms(subj, obj, false);
|
|
8755
|
+
const newRule = __copyProofSource(r, __makeRuleFromTerms(subj, obj, false));
|
|
8756
8756
|
|
|
8757
8757
|
const key = __ruleKey(
|
|
8758
8758
|
newRule.isForward,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@prefix : <http://example.org/#> .
|
|
2
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
|
|
5
|
+
5 :isIndeedMoreInterestingThan 3 .
|
|
6
|
+
|
|
7
|
+
{ 5 :isIndeedMoreInterestingThan 3 . } pe:why {
|
|
8
|
+
{ 5 :isIndeedMoreInterestingThan 3 . }
|
|
9
|
+
pe:by [ pe:rule "backward.n3"; pe:line 18 ];
|
|
10
|
+
pe:uses { 5 :moreInterestingThan 3 . }.
|
|
11
|
+
|
|
12
|
+
{ 5 :moreInterestingThan 3 . }
|
|
13
|
+
pe:by [ pe:rule "backward.n3"; pe:line 11 ];
|
|
14
|
+
pe:binding
|
|
15
|
+
[ pe:var "X"; pe:value 5 ],
|
|
16
|
+
[ pe:var "Y"; pe:value 3 ];
|
|
17
|
+
pe:uses { 5 math:greaterThan 3 . }.
|
|
18
|
+
|
|
19
|
+
{ 5 math:greaterThan 3 . }
|
|
20
|
+
pe:by [ pe:builtin math:greaterThan ].
|
|
21
|
+
}.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
@prefix : <http://examples.org/#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
|
|
5
|
+
:result :sameInputByCompositeInjectivity (:h :a :b) .
|
|
6
|
+
:result :sameInputByCompositeInjectivity (:h :b :a) .
|
|
7
|
+
|
|
8
|
+
{ :result :sameInputByCompositeInjectivity (:h :a :b) . } pe:why {
|
|
9
|
+
{ :result :sameInputByCompositeInjectivity (:h :a :b) . }
|
|
10
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 234 ];
|
|
11
|
+
pe:binding
|
|
12
|
+
[ pe:var "h"; pe:value :h ],
|
|
13
|
+
[ pe:var "x"; pe:value :a ],
|
|
14
|
+
[ pe:var "y"; pe:value :b ];
|
|
15
|
+
pe:uses
|
|
16
|
+
{ (:h :a :b) :sameInputUnderEqualCompositeOutput true . },
|
|
17
|
+
{ :a log:notEqualTo :b . }.
|
|
18
|
+
|
|
19
|
+
{ (:h :a :b) :sameInputUnderEqualCompositeOutput true . }
|
|
20
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 169 ];
|
|
21
|
+
pe:binding
|
|
22
|
+
[ pe:var "f"; pe:value :f ],
|
|
23
|
+
[ pe:var "fx"; pe:value :p ],
|
|
24
|
+
[ pe:var "fy"; pe:value :q ],
|
|
25
|
+
[ pe:var "g"; pe:value :g ],
|
|
26
|
+
[ pe:var "h"; pe:value :h ],
|
|
27
|
+
[ pe:var "u"; pe:value :r ],
|
|
28
|
+
[ pe:var "v"; pe:value :r ],
|
|
29
|
+
[ pe:var "x"; pe:value :a ],
|
|
30
|
+
[ pe:var "y"; pe:value :b ];
|
|
31
|
+
pe:uses
|
|
32
|
+
{ :h :compositeOf (:g :f) . },
|
|
33
|
+
{ :f :injective true . },
|
|
34
|
+
{ :g :injective true . },
|
|
35
|
+
{ (:f :a) :app :p . },
|
|
36
|
+
{ (:f :b) :app :q . },
|
|
37
|
+
{ (:g :p) :app :r . },
|
|
38
|
+
{ (:g :q) :app :r . },
|
|
39
|
+
{ (:r :r) :sameTerm true . },
|
|
40
|
+
{ (:a :b) :sameTerm true . }.
|
|
41
|
+
|
|
42
|
+
{ :h :compositeOf (:g :f) . }
|
|
43
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 219 ].
|
|
44
|
+
|
|
45
|
+
{ :f :injective true . }
|
|
46
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 216 ].
|
|
47
|
+
|
|
48
|
+
{ :g :injective true . }
|
|
49
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 217 ].
|
|
50
|
+
|
|
51
|
+
{ (:f :a) :app :p . }
|
|
52
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 221 ].
|
|
53
|
+
|
|
54
|
+
{ (:f :b) :app :q . }
|
|
55
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 222 ].
|
|
56
|
+
|
|
57
|
+
{ (:g :p) :app :r . }
|
|
58
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 224 ].
|
|
59
|
+
|
|
60
|
+
{ (:g :q) :app :r . }
|
|
61
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 225 ].
|
|
62
|
+
|
|
63
|
+
{ (:r :r) :sameTerm true . }
|
|
64
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 77 ];
|
|
65
|
+
pe:binding [ pe:var "z"; pe:value :r ];
|
|
66
|
+
pe:uses { :r :inZ true . }.
|
|
67
|
+
|
|
68
|
+
{ :r :inZ true . }
|
|
69
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 214 ].
|
|
70
|
+
|
|
71
|
+
{ (:a :b) :sameTerm true . }
|
|
72
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 117 ];
|
|
73
|
+
pe:binding
|
|
74
|
+
[ pe:var "f"; pe:value :f ],
|
|
75
|
+
[ pe:var "u"; pe:value :p ],
|
|
76
|
+
[ pe:var "v"; pe:value :q ],
|
|
77
|
+
[ pe:var "x"; pe:value :a ],
|
|
78
|
+
[ pe:var "y"; pe:value :b ];
|
|
79
|
+
pe:uses
|
|
80
|
+
{ :f :injective true . },
|
|
81
|
+
{ (:f :a) :app :p . },
|
|
82
|
+
{ (:f :b) :app :q . },
|
|
83
|
+
{ (:p :q) :sameTerm true . }.
|
|
84
|
+
|
|
85
|
+
{ (:p :q) :sameTerm true . }
|
|
86
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 117 ];
|
|
87
|
+
pe:binding
|
|
88
|
+
[ pe:var "f"; pe:value :g ],
|
|
89
|
+
[ pe:var "u"; pe:value :r ],
|
|
90
|
+
[ pe:var "v"; pe:value :r ],
|
|
91
|
+
[ pe:var "x"; pe:value :p ],
|
|
92
|
+
[ pe:var "y"; pe:value :q ];
|
|
93
|
+
pe:uses
|
|
94
|
+
{ :g :injective true . },
|
|
95
|
+
{ (:g :p) :app :r . },
|
|
96
|
+
{ (:g :q) :app :r . },
|
|
97
|
+
{ (:r :r) :sameTerm true . }.
|
|
98
|
+
|
|
99
|
+
{ :a log:notEqualTo :b . }
|
|
100
|
+
pe:by [ pe:builtin log:notEqualTo ].
|
|
101
|
+
}.
|
|
102
|
+
|
|
103
|
+
{ :result :sameInputByCompositeInjectivity (:h :b :a) . } pe:why {
|
|
104
|
+
{ :result :sameInputByCompositeInjectivity (:h :b :a) . }
|
|
105
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 234 ];
|
|
106
|
+
pe:binding
|
|
107
|
+
[ pe:var "h"; pe:value :h ],
|
|
108
|
+
[ pe:var "x"; pe:value :b ],
|
|
109
|
+
[ pe:var "y"; pe:value :a ];
|
|
110
|
+
pe:uses
|
|
111
|
+
{ (:h :b :a) :sameInputUnderEqualCompositeOutput true . },
|
|
112
|
+
{ :b log:notEqualTo :a . }.
|
|
113
|
+
|
|
114
|
+
{ (:h :b :a) :sameInputUnderEqualCompositeOutput true . }
|
|
115
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 169 ];
|
|
116
|
+
pe:binding
|
|
117
|
+
[ pe:var "f"; pe:value :f ],
|
|
118
|
+
[ pe:var "fx"; pe:value :q ],
|
|
119
|
+
[ pe:var "fy"; pe:value :p ],
|
|
120
|
+
[ pe:var "g"; pe:value :g ],
|
|
121
|
+
[ pe:var "h"; pe:value :h ],
|
|
122
|
+
[ pe:var "u"; pe:value :r ],
|
|
123
|
+
[ pe:var "v"; pe:value :r ],
|
|
124
|
+
[ pe:var "x"; pe:value :b ],
|
|
125
|
+
[ pe:var "y"; pe:value :a ];
|
|
126
|
+
pe:uses
|
|
127
|
+
{ :h :compositeOf (:g :f) . },
|
|
128
|
+
{ :f :injective true . },
|
|
129
|
+
{ :g :injective true . },
|
|
130
|
+
{ (:f :b) :app :q . },
|
|
131
|
+
{ (:f :a) :app :p . },
|
|
132
|
+
{ (:g :q) :app :r . },
|
|
133
|
+
{ (:g :p) :app :r . },
|
|
134
|
+
{ (:r :r) :sameTerm true . },
|
|
135
|
+
{ (:b :a) :sameTerm true . }.
|
|
136
|
+
|
|
137
|
+
{ :h :compositeOf (:g :f) . }
|
|
138
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 219 ].
|
|
139
|
+
|
|
140
|
+
{ :f :injective true . }
|
|
141
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 216 ].
|
|
142
|
+
|
|
143
|
+
{ :g :injective true . }
|
|
144
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 217 ].
|
|
145
|
+
|
|
146
|
+
{ (:f :b) :app :q . }
|
|
147
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 222 ].
|
|
148
|
+
|
|
149
|
+
{ (:f :a) :app :p . }
|
|
150
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 221 ].
|
|
151
|
+
|
|
152
|
+
{ (:g :q) :app :r . }
|
|
153
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 225 ].
|
|
154
|
+
|
|
155
|
+
{ (:g :p) :app :r . }
|
|
156
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 224 ].
|
|
157
|
+
|
|
158
|
+
{ (:r :r) :sameTerm true . }
|
|
159
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 77 ];
|
|
160
|
+
pe:binding [ pe:var "z"; pe:value :r ];
|
|
161
|
+
pe:uses { :r :inZ true . }.
|
|
162
|
+
|
|
163
|
+
{ :r :inZ true . }
|
|
164
|
+
pe:by [ pe:fact "composition-of-injective-functions-is-injective.n3"; pe:line 214 ].
|
|
165
|
+
|
|
166
|
+
{ (:b :a) :sameTerm true . }
|
|
167
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 117 ];
|
|
168
|
+
pe:binding
|
|
169
|
+
[ pe:var "f"; pe:value :f ],
|
|
170
|
+
[ pe:var "u"; pe:value :q ],
|
|
171
|
+
[ pe:var "v"; pe:value :p ],
|
|
172
|
+
[ pe:var "x"; pe:value :b ],
|
|
173
|
+
[ pe:var "y"; pe:value :a ];
|
|
174
|
+
pe:uses
|
|
175
|
+
{ :f :injective true . },
|
|
176
|
+
{ (:f :b) :app :q . },
|
|
177
|
+
{ (:f :a) :app :p . },
|
|
178
|
+
{ (:q :p) :sameTerm true . }.
|
|
179
|
+
|
|
180
|
+
{ (:q :p) :sameTerm true . }
|
|
181
|
+
pe:by [ pe:rule "composition-of-injective-functions-is-injective.n3"; pe:line 117 ];
|
|
182
|
+
pe:binding
|
|
183
|
+
[ pe:var "f"; pe:value :g ],
|
|
184
|
+
[ pe:var "u"; pe:value :r ],
|
|
185
|
+
[ pe:var "v"; pe:value :r ],
|
|
186
|
+
[ pe:var "x"; pe:value :q ],
|
|
187
|
+
[ pe:var "y"; pe:value :p ];
|
|
188
|
+
pe:uses
|
|
189
|
+
{ :g :injective true . },
|
|
190
|
+
{ (:g :q) :app :r . },
|
|
191
|
+
{ (:g :p) :app :r . },
|
|
192
|
+
{ (:r :r) :sameTerm true . }.
|
|
193
|
+
|
|
194
|
+
{ :b log:notEqualTo :a . }
|
|
195
|
+
pe:by [ pe:builtin log:notEqualTo ].
|
|
196
|
+
}.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@prefix : <http://example.org/socrates#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
5
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
:Socrates a :Human .
|
|
9
|
+
} <= true .
|
|
10
|
+
{
|
|
11
|
+
:Human rdfs:subClassOf :Mortal .
|
|
12
|
+
} <= true .
|
|
13
|
+
:Socrates a :Mortal .
|
|
14
|
+
:test :is true .
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
{
|
|
18
|
+
:Socrates a :Human .
|
|
19
|
+
} <= true .
|
|
20
|
+
} pe:why {
|
|
21
|
+
{
|
|
22
|
+
{
|
|
23
|
+
:Socrates a :Human .
|
|
24
|
+
} <= true .
|
|
25
|
+
}
|
|
26
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 9 ].
|
|
27
|
+
}.
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
{
|
|
31
|
+
:Human rdfs:subClassOf :Mortal .
|
|
32
|
+
} <= true .
|
|
33
|
+
} pe:why {
|
|
34
|
+
{
|
|
35
|
+
{
|
|
36
|
+
:Human rdfs:subClassOf :Mortal .
|
|
37
|
+
} <= true .
|
|
38
|
+
}
|
|
39
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 9 ].
|
|
40
|
+
}.
|
|
41
|
+
|
|
42
|
+
{ :Socrates a :Mortal . } pe:why {
|
|
43
|
+
{ :Socrates a :Mortal . }
|
|
44
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 14 ];
|
|
45
|
+
pe:binding
|
|
46
|
+
[ pe:var "A"; pe:value :Human ],
|
|
47
|
+
[ pe:var "B"; pe:value :Mortal ],
|
|
48
|
+
[ pe:var "S"; pe:value :Socrates ];
|
|
49
|
+
pe:uses
|
|
50
|
+
{ :Socrates a :Human . },
|
|
51
|
+
{ :Human rdfs:subClassOf :Mortal . }.
|
|
52
|
+
|
|
53
|
+
{ :Socrates a :Human . }
|
|
54
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 9 ].
|
|
55
|
+
|
|
56
|
+
{ :Human rdfs:subClassOf :Mortal . }
|
|
57
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 9 ].
|
|
58
|
+
}.
|
|
59
|
+
|
|
60
|
+
{ :test :is true . } pe:why {
|
|
61
|
+
{ :test :is true . }
|
|
62
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 21 ];
|
|
63
|
+
pe:uses { :Socrates a :Mortal . }.
|
|
64
|
+
|
|
65
|
+
{ :Socrates a :Mortal . }
|
|
66
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 14 ];
|
|
67
|
+
pe:binding
|
|
68
|
+
[ pe:var "A"; pe:value :Human ],
|
|
69
|
+
[ pe:var "B"; pe:value :Mortal ],
|
|
70
|
+
[ pe:var "S"; pe:value :Socrates ];
|
|
71
|
+
pe:uses
|
|
72
|
+
{ :Socrates a :Human . },
|
|
73
|
+
{ :Human rdfs:subClassOf :Mortal . }.
|
|
74
|
+
|
|
75
|
+
{ :Socrates a :Human . }
|
|
76
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 9 ].
|
|
77
|
+
|
|
78
|
+
{ :Human rdfs:subClassOf :Mortal . }
|
|
79
|
+
pe:by [ pe:rule "derived-backward-rule-2.n3"; pe:line 9 ].
|
|
80
|
+
}.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@prefix : <https://eyereasoner.github.io/ns#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
|
|
5
|
+
{
|
|
6
|
+
?x :childOf ?y .
|
|
7
|
+
} <= {
|
|
8
|
+
?y :parentOf ?x .
|
|
9
|
+
} .
|
|
10
|
+
:bob :hasParent :alice .
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
{
|
|
14
|
+
?x :childOf ?y .
|
|
15
|
+
} <= {
|
|
16
|
+
?y :parentOf ?x .
|
|
17
|
+
} .
|
|
18
|
+
} pe:why {
|
|
19
|
+
{
|
|
20
|
+
{
|
|
21
|
+
?x :childOf ?y .
|
|
22
|
+
} <= {
|
|
23
|
+
?y :parentOf ?x .
|
|
24
|
+
} .
|
|
25
|
+
}
|
|
26
|
+
pe:by [ pe:rule "derived-backward-rule.n3"; pe:line 16 ];
|
|
27
|
+
pe:binding
|
|
28
|
+
[ pe:var "p"; pe:value :parentOf ],
|
|
29
|
+
[ pe:var "q"; pe:value :childOf ];
|
|
30
|
+
pe:uses { :parentOf :invOf :childOf . }.
|
|
31
|
+
|
|
32
|
+
{ :parentOf :invOf :childOf . }
|
|
33
|
+
pe:by [ pe:fact "derived-backward-rule.n3"; pe:line 8 ].
|
|
34
|
+
}.
|
|
35
|
+
|
|
36
|
+
{ :bob :hasParent :alice . } pe:why {
|
|
37
|
+
{ :bob :hasParent :alice . }
|
|
38
|
+
pe:by [ pe:rule "derived-backward-rule.n3"; pe:line 27 ];
|
|
39
|
+
pe:binding
|
|
40
|
+
[ pe:var "x"; pe:value :bob ],
|
|
41
|
+
[ pe:var "y"; pe:value :alice ];
|
|
42
|
+
pe:uses { :bob :childOf :alice . }.
|
|
43
|
+
|
|
44
|
+
{ :bob :childOf :alice . }
|
|
45
|
+
pe:by [ pe:rule "derived-backward-rule.n3"; pe:line 16 ];
|
|
46
|
+
pe:binding
|
|
47
|
+
[ pe:var "x"; pe:value :bob ],
|
|
48
|
+
[ pe:var "y"; pe:value :alice ];
|
|
49
|
+
pe:uses { :alice :parentOf :bob . }.
|
|
50
|
+
|
|
51
|
+
{ :alice :parentOf :bob . }
|
|
52
|
+
pe:by [ pe:fact "derived-backward-rule.n3"; pe:line 10 ].
|
|
53
|
+
}.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@prefix : <https://eyereasoner.github.io/ns#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
?y a :Dog .
|
|
8
|
+
} => {
|
|
9
|
+
:test :is true .
|
|
10
|
+
} .
|
|
11
|
+
:test :is true .
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
{
|
|
15
|
+
?y a :Dog .
|
|
16
|
+
} => {
|
|
17
|
+
:test :is true .
|
|
18
|
+
} .
|
|
19
|
+
} pe:why {
|
|
20
|
+
{
|
|
21
|
+
{
|
|
22
|
+
?y a :Dog .
|
|
23
|
+
} => {
|
|
24
|
+
:test :is true .
|
|
25
|
+
} .
|
|
26
|
+
}
|
|
27
|
+
pe:by [ pe:rule "derived-rule.n3"; pe:line 11 ];
|
|
28
|
+
pe:binding [ pe:var "x"; pe:value :Minka ];
|
|
29
|
+
pe:uses { :Minka a :Cat . }.
|
|
30
|
+
|
|
31
|
+
{ :Minka a :Cat . }
|
|
32
|
+
pe:by [ pe:fact "derived-rule.n3"; pe:line 8 ].
|
|
33
|
+
}.
|
|
34
|
+
|
|
35
|
+
{ :test :is true . } pe:why {
|
|
36
|
+
{ :test :is true . }
|
|
37
|
+
pe:by [ pe:rule "derived-rule.n3"; pe:line 11 ];
|
|
38
|
+
pe:binding [ pe:var "y"; pe:value :Charly ];
|
|
39
|
+
pe:uses { :Charly a :Dog . }.
|
|
40
|
+
|
|
41
|
+
{ :Charly a :Dog . }
|
|
42
|
+
pe:by [ pe:fact "derived-rule.n3"; pe:line 9 ].
|
|
43
|
+
}.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@prefix : <https://eyereasoner.github.io/ns#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
4
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
5
|
+
|
|
6
|
+
:alice :mustHave :dogLicense .
|
|
7
|
+
|
|
8
|
+
{ :alice :mustHave :dogLicense . } pe:why {
|
|
9
|
+
{ :alice :mustHave :dogLicense . }
|
|
10
|
+
pe:by [ pe:rule "dog.n3"; pe:line 13 ];
|
|
11
|
+
pe:binding
|
|
12
|
+
[ pe:var "Any"; pe:value :dog1 ],
|
|
13
|
+
[ pe:var "Count"; pe:value 5 ],
|
|
14
|
+
[ pe:var "List"; pe:value (1 1 1 1 1) ],
|
|
15
|
+
[ pe:var "Subject"; pe:value :alice ];
|
|
16
|
+
pe:uses
|
|
17
|
+
{ :alice :hasDog :dog1 . },
|
|
18
|
+
{
|
|
19
|
+
(1 {
|
|
20
|
+
:alice :hasDog ?Dog .
|
|
21
|
+
} (1 1 1 1 1)) log:collectAllIn ?Scope .
|
|
22
|
+
},
|
|
23
|
+
{ (1 1 1 1 1) math:sum 5 . },
|
|
24
|
+
{ 5 math:greaterThan 4 . }.
|
|
25
|
+
|
|
26
|
+
{ :alice :hasDog :dog1 . }
|
|
27
|
+
pe:by [ pe:fact "dog.n3"; pe:line 10 ].
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
(1 {
|
|
31
|
+
:alice :hasDog ?Dog .
|
|
32
|
+
} (1 1 1 1 1)) log:collectAllIn ?Scope .
|
|
33
|
+
}
|
|
34
|
+
pe:by [ pe:builtin log:collectAllIn ].
|
|
35
|
+
|
|
36
|
+
{ (1 1 1 1 1) math:sum 5 . }
|
|
37
|
+
pe:by [ pe:builtin math:sum ].
|
|
38
|
+
|
|
39
|
+
{ 5 math:greaterThan 4 . }
|
|
40
|
+
pe:by [ pe:builtin math:greaterThan ].
|
|
41
|
+
}.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@prefix : <http://example.org/socrates#> .
|
|
2
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
|
|
5
|
+
:test :is true .
|
|
6
|
+
|
|
7
|
+
{ :test :is true . } pe:why {
|
|
8
|
+
{ :test :is true . }
|
|
9
|
+
pe:by [ pe:rule "equals.n3"; pe:line 11 ];
|
|
10
|
+
pe:uses { :X = :Y . }.
|
|
11
|
+
|
|
12
|
+
{ :X = :Y . }
|
|
13
|
+
pe:by [ pe:fact "equals.n3"; pe:line 9 ].
|
|
14
|
+
}.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@prefix : <http://example.org/socrates#> .
|
|
2
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
3
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
4
|
+
|
|
5
|
+
:Socrates :is _:sk_0 .
|
|
6
|
+
:Plato :is _:sk_1 .
|
|
7
|
+
|
|
8
|
+
{ :Socrates :is _:sk_0 . } pe:why {
|
|
9
|
+
{ :Socrates :is _:sk_0 . }
|
|
10
|
+
pe:by [ pe:rule "existential-rule.n3"; pe:line 13 ];
|
|
11
|
+
pe:binding [ pe:var "S"; pe:value :Socrates ];
|
|
12
|
+
pe:uses { :Socrates a :Human . }.
|
|
13
|
+
|
|
14
|
+
{ :Socrates a :Human . }
|
|
15
|
+
pe:by [ pe:fact "existential-rule.n3"; pe:line 9 ].
|
|
16
|
+
}.
|
|
17
|
+
|
|
18
|
+
{ :Plato :is _:sk_1 . } pe:why {
|
|
19
|
+
{ :Plato :is _:sk_1 . }
|
|
20
|
+
pe:by [ pe:rule "existential-rule.n3"; pe:line 13 ];
|
|
21
|
+
pe:binding [ pe:var "S"; pe:value :Plato ];
|
|
22
|
+
pe:uses { :Plato a :Human . }.
|
|
23
|
+
|
|
24
|
+
{ :Plato a :Human . }
|
|
25
|
+
pe:by [ pe:fact "existential-rule.n3"; pe:line 10 ].
|
|
26
|
+
}.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
@prefix : <http://example.org/#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix pe: <https://eyereasoner.github.io/pe#> .
|
|
4
|
+
|
|
5
|
+
:result :sameGreatestLowerBound (:a :b :g1 :g2) .
|
|
6
|
+
:result :sameGreatestLowerBound (:a :b :g2 :g1) .
|
|
7
|
+
|
|
8
|
+
{ :result :sameGreatestLowerBound (:a :b :g1 :g2) . } pe:why {
|
|
9
|
+
{ :result :sameGreatestLowerBound (:a :b :g1 :g2) . }
|
|
10
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 195 ];
|
|
11
|
+
pe:binding
|
|
12
|
+
[ pe:var "a"; pe:value :a ],
|
|
13
|
+
[ pe:var "b"; pe:value :b ],
|
|
14
|
+
[ pe:var "m"; pe:value :g1 ],
|
|
15
|
+
[ pe:var "n"; pe:value :g2 ];
|
|
16
|
+
pe:uses
|
|
17
|
+
{ (:a :b :g1 :g2) :sameGlb true . },
|
|
18
|
+
{ :g1 log:notEqualTo :g2 . }.
|
|
19
|
+
|
|
20
|
+
{ (:a :b :g1 :g2) :sameGlb true . }
|
|
21
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 161 ];
|
|
22
|
+
pe:binding
|
|
23
|
+
[ pe:var "a"; pe:value :a ],
|
|
24
|
+
[ pe:var "b"; pe:value :b ],
|
|
25
|
+
[ pe:var "m"; pe:value :g1 ],
|
|
26
|
+
[ pe:var "n"; pe:value :g2 ];
|
|
27
|
+
pe:uses
|
|
28
|
+
{ :g1 :glbOf (:a :b) . },
|
|
29
|
+
{ :g2 :glbOf (:a :b) . },
|
|
30
|
+
{ (:g1 :g2) :sameTerm true . }.
|
|
31
|
+
|
|
32
|
+
{ :g1 :glbOf (:a :b) . }
|
|
33
|
+
pe:by [ pe:fact "greatest-lower-bound-uniqueness.n3"; pe:line 185 ].
|
|
34
|
+
|
|
35
|
+
{ :g2 :glbOf (:a :b) . }
|
|
36
|
+
pe:by [ pe:fact "greatest-lower-bound-uniqueness.n3"; pe:line 186 ].
|
|
37
|
+
|
|
38
|
+
{ (:g1 :g2) :sameTerm true . }
|
|
39
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 85 ];
|
|
40
|
+
pe:binding
|
|
41
|
+
[ pe:var "x"; pe:value :g1 ],
|
|
42
|
+
[ pe:var "y"; pe:value :g2 ];
|
|
43
|
+
pe:uses
|
|
44
|
+
{ :g1 :leq :g2 . },
|
|
45
|
+
{ :g2 :leq :g1 . }.
|
|
46
|
+
|
|
47
|
+
{ :g1 :leq :g2 . }
|
|
48
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 126 ];
|
|
49
|
+
pe:binding
|
|
50
|
+
[ pe:var "a"; pe:value :a ],
|
|
51
|
+
[ pe:var "b"; pe:value :b ],
|
|
52
|
+
[ pe:var "l"; pe:value :g1 ],
|
|
53
|
+
[ pe:var "m"; pe:value :g2 ];
|
|
54
|
+
pe:uses
|
|
55
|
+
{ :g2 :glbOf (:a :b) . },
|
|
56
|
+
{ :g1 :lowerBoundOf (:a :b) . }.
|
|
57
|
+
|
|
58
|
+
{ :g1 :lowerBoundOf (:a :b) . }
|
|
59
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 112 ];
|
|
60
|
+
pe:binding
|
|
61
|
+
[ pe:var "a"; pe:value :a ],
|
|
62
|
+
[ pe:var "b"; pe:value :b ],
|
|
63
|
+
[ pe:var "m"; pe:value :g1 ];
|
|
64
|
+
pe:uses { :g1 :glbOf (:a :b) . }.
|
|
65
|
+
|
|
66
|
+
{ :g2 :leq :g1 . }
|
|
67
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 126 ];
|
|
68
|
+
pe:binding
|
|
69
|
+
[ pe:var "a"; pe:value :a ],
|
|
70
|
+
[ pe:var "b"; pe:value :b ],
|
|
71
|
+
[ pe:var "l"; pe:value :g2 ],
|
|
72
|
+
[ pe:var "m"; pe:value :g1 ];
|
|
73
|
+
pe:uses
|
|
74
|
+
{ :g1 :glbOf (:a :b) . },
|
|
75
|
+
{ :g2 :lowerBoundOf (:a :b) . }.
|
|
76
|
+
|
|
77
|
+
{ :g2 :lowerBoundOf (:a :b) . }
|
|
78
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 112 ];
|
|
79
|
+
pe:binding
|
|
80
|
+
[ pe:var "a"; pe:value :a ],
|
|
81
|
+
[ pe:var "b"; pe:value :b ],
|
|
82
|
+
[ pe:var "m"; pe:value :g2 ];
|
|
83
|
+
pe:uses { :g2 :glbOf (:a :b) . }.
|
|
84
|
+
|
|
85
|
+
{ :g1 log:notEqualTo :g2 . }
|
|
86
|
+
pe:by [ pe:builtin log:notEqualTo ].
|
|
87
|
+
}.
|
|
88
|
+
|
|
89
|
+
{ :result :sameGreatestLowerBound (:a :b :g2 :g1) . } pe:why {
|
|
90
|
+
{ :result :sameGreatestLowerBound (:a :b :g2 :g1) . }
|
|
91
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 195 ];
|
|
92
|
+
pe:binding
|
|
93
|
+
[ pe:var "a"; pe:value :a ],
|
|
94
|
+
[ pe:var "b"; pe:value :b ],
|
|
95
|
+
[ pe:var "m"; pe:value :g2 ],
|
|
96
|
+
[ pe:var "n"; pe:value :g1 ];
|
|
97
|
+
pe:uses
|
|
98
|
+
{ (:a :b :g2 :g1) :sameGlb true . },
|
|
99
|
+
{ :g2 log:notEqualTo :g1 . }.
|
|
100
|
+
|
|
101
|
+
{ (:a :b :g2 :g1) :sameGlb true . }
|
|
102
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 161 ];
|
|
103
|
+
pe:binding
|
|
104
|
+
[ pe:var "a"; pe:value :a ],
|
|
105
|
+
[ pe:var "b"; pe:value :b ],
|
|
106
|
+
[ pe:var "m"; pe:value :g2 ],
|
|
107
|
+
[ pe:var "n"; pe:value :g1 ];
|
|
108
|
+
pe:uses
|
|
109
|
+
{ :g2 :glbOf (:a :b) . },
|
|
110
|
+
{ :g1 :glbOf (:a :b) . },
|
|
111
|
+
{ (:g2 :g1) :sameTerm true . }.
|
|
112
|
+
|
|
113
|
+
{ :g2 :glbOf (:a :b) . }
|
|
114
|
+
pe:by [ pe:fact "greatest-lower-bound-uniqueness.n3"; pe:line 186 ].
|
|
115
|
+
|
|
116
|
+
{ :g1 :glbOf (:a :b) . }
|
|
117
|
+
pe:by [ pe:fact "greatest-lower-bound-uniqueness.n3"; pe:line 185 ].
|
|
118
|
+
|
|
119
|
+
{ (:g2 :g1) :sameTerm true . }
|
|
120
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 85 ];
|
|
121
|
+
pe:binding
|
|
122
|
+
[ pe:var "x"; pe:value :g2 ],
|
|
123
|
+
[ pe:var "y"; pe:value :g1 ];
|
|
124
|
+
pe:uses
|
|
125
|
+
{ :g2 :leq :g1 . },
|
|
126
|
+
{ :g1 :leq :g2 . }.
|
|
127
|
+
|
|
128
|
+
{ :g2 :leq :g1 . }
|
|
129
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 126 ];
|
|
130
|
+
pe:binding
|
|
131
|
+
[ pe:var "a"; pe:value :a ],
|
|
132
|
+
[ pe:var "b"; pe:value :b ],
|
|
133
|
+
[ pe:var "l"; pe:value :g2 ],
|
|
134
|
+
[ pe:var "m"; pe:value :g1 ];
|
|
135
|
+
pe:uses
|
|
136
|
+
{ :g1 :glbOf (:a :b) . },
|
|
137
|
+
{ :g2 :lowerBoundOf (:a :b) . }.
|
|
138
|
+
|
|
139
|
+
{ :g2 :lowerBoundOf (:a :b) . }
|
|
140
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 112 ];
|
|
141
|
+
pe:binding
|
|
142
|
+
[ pe:var "a"; pe:value :a ],
|
|
143
|
+
[ pe:var "b"; pe:value :b ],
|
|
144
|
+
[ pe:var "m"; pe:value :g2 ];
|
|
145
|
+
pe:uses { :g2 :glbOf (:a :b) . }.
|
|
146
|
+
|
|
147
|
+
{ :g1 :leq :g2 . }
|
|
148
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 126 ];
|
|
149
|
+
pe:binding
|
|
150
|
+
[ pe:var "a"; pe:value :a ],
|
|
151
|
+
[ pe:var "b"; pe:value :b ],
|
|
152
|
+
[ pe:var "l"; pe:value :g1 ],
|
|
153
|
+
[ pe:var "m"; pe:value :g2 ];
|
|
154
|
+
pe:uses
|
|
155
|
+
{ :g2 :glbOf (:a :b) . },
|
|
156
|
+
{ :g1 :lowerBoundOf (:a :b) . }.
|
|
157
|
+
|
|
158
|
+
{ :g1 :lowerBoundOf (:a :b) . }
|
|
159
|
+
pe:by [ pe:rule "greatest-lower-bound-uniqueness.n3"; pe:line 112 ];
|
|
160
|
+
pe:binding
|
|
161
|
+
[ pe:var "a"; pe:value :a ],
|
|
162
|
+
[ pe:var "b"; pe:value :b ],
|
|
163
|
+
[ pe:var "m"; pe:value :g1 ];
|
|
164
|
+
pe:uses { :g1 :glbOf (:a :b) . }.
|
|
165
|
+
|
|
166
|
+
{ :g2 log:notEqualTo :g1 . }
|
|
167
|
+
pe:by [ pe:builtin log:notEqualTo ].
|
|
168
|
+
}.
|