Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for
Disjunction
s inRule
heads and bodies within therulewerk-core
package.The changes in the other packages were necessary to fit the adjustments in
rulewerk-core
.To maintain a certain flexibility especially in existing code and also to achieve a pleasant usage of the
Rule
interface, the following basic inheritance structure is introduced:In this sense, a
Conjunction
can implicitly be treated as a singletonDisjunction
and aLiteral
can implicitly be treated as a singletonConjunction
(and in turn as aDisjunction
). ARule
then just consists of twoDisjunctions
ofConjunctions
of(Positive)Literals
.The three interfaces also expect generic type arguments to clarify the concrete types of
Conjunctions
andLiterals
especially. Because of that, the structure may seem a bit complicated in the source code but from a usage point of view I guess that this would be convenient.Note that this is currently still WIP and I'm am going to evaluate how the current implementation suits the needs of an application I'm currently developing using the
rulewerk
library. Also, I still need to implement some tests.Any kind of feedback is very much appreciated and I'm happy to discuss the design decisions :)