knowsys / rulewerk

Java library based on the VLog rule engine
Apache License 2.0
32 stars 13 forks source link

Core: get chase result as a stream/iterator/collection of Facts/PositiveLiterals #167

Closed irina-dragoste closed 4 years ago

irina-dragoste commented 4 years ago

Reasonershould expose a getInferences method that returns a stream/iterator/collection of Java objects representing all (explicit and implicit) facts in the result of the chase, as well as the correctness (see Reasoner#writeInferences).

-[ ] have a general forEachInference(BiConsumer<Predicate, List<Term>>), in the style of Iterator#forEachRemaining, to keep the common parts of the implementation of writeInferencesand getInferencesin a single place

-[ ] move writeInferencesand getInferencesto Reasonerinterface as default methods, since they would no longer be specific to VLog

-[ ] round-tripping for writeInferences can now be tested, as the Parser accepts facts with nulls.

mmarx commented 4 years ago

This has landed on master.