Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disjunctions in Rules #192

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

monsterkrampe
Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant