This PR adds support for Disjunctions in Rule heads and bodies within the rulewerk-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:
Disjunction <-- Conjunction <-- Literal
In this sense, a Conjunction can implicitly be treated as a singleton Disjunction and a Literal can implicitly be treated as a singleton Conjunction (and in turn as a Disjunction). A Rule then just consists of two Disjunctions of Conjunctions of (Positive)Literals.
The three interfaces also expect generic type arguments to clarify the concrete types of Conjunctions and Literals 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 :)
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 ofConjunctions
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 :)