eyeling 1.16.2 → 1.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HANDBOOK.md +4 -0
- package/examples/ershov-mixed-computation.n3 +106 -0
- package/examples/output/ershov-mixed-computation.n3 +15 -0
- package/eyeling.js +510 -263
- package/lib/cli.js +22 -12
- package/lib/engine.js +488 -251
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -188,10 +188,12 @@ function main() {
|
|
|
188
188
|
// collect log:outputString triples from the instantiated query conclusions.
|
|
189
189
|
let outTriples;
|
|
190
190
|
if (hasQueries) {
|
|
191
|
-
const res = engine.forwardChainAndCollectLogQueryConclusions(facts, frules, brules, qrules
|
|
191
|
+
const res = engine.forwardChainAndCollectLogQueryConclusions(facts, frules, brules, qrules, null, {
|
|
192
|
+
captureExplanations: engine.getProofCommentsEnabled(),
|
|
193
|
+
});
|
|
192
194
|
outTriples = res.queryTriples;
|
|
193
195
|
} else {
|
|
194
|
-
engine.forwardChain(facts, frules, brules);
|
|
196
|
+
engine.forwardChain(facts, frules, brules, null, { captureExplanations: false });
|
|
195
197
|
outTriples = facts;
|
|
196
198
|
}
|
|
197
199
|
|
|
@@ -302,15 +304,21 @@ function main() {
|
|
|
302
304
|
}
|
|
303
305
|
if (entries.length) console.log();
|
|
304
306
|
|
|
305
|
-
engine.forwardChain(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
307
|
+
engine.forwardChain(
|
|
308
|
+
facts,
|
|
309
|
+
frules,
|
|
310
|
+
brules,
|
|
311
|
+
(df) => {
|
|
312
|
+
if (engine.getProofCommentsEnabled()) {
|
|
313
|
+
engine.printExplanation(df, outPrefixes);
|
|
314
|
+
console.log(engine.tripleToN3(df.fact, outPrefixes));
|
|
315
|
+
console.log();
|
|
316
|
+
} else {
|
|
317
|
+
console.log(engine.tripleToN3(df.fact, outPrefixes));
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
{ captureExplanations: engine.getProofCommentsEnabled() },
|
|
321
|
+
);
|
|
314
322
|
return;
|
|
315
323
|
}
|
|
316
324
|
|
|
@@ -330,7 +338,9 @@ function main() {
|
|
|
330
338
|
outTriples = res.queryTriples;
|
|
331
339
|
outDerived = res.queryDerived;
|
|
332
340
|
} else {
|
|
333
|
-
derived = engine.forwardChain(facts, frules, brules
|
|
341
|
+
derived = engine.forwardChain(facts, frules, brules, null, {
|
|
342
|
+
captureExplanations: engine.getProofCommentsEnabled(),
|
|
343
|
+
});
|
|
334
344
|
outDerived = derived;
|
|
335
345
|
outTriples = derived.map((df) => df.fact);
|
|
336
346
|
}
|