Refactoring: Decouple API implementation from config structures #336
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.
The aim of this PR is to get rid of all dependencies between
SystemConfigand API implementations (likeAlphaImpl,NaiveGrounder,DefaultSolveretc).The idea is that these objects should get their dependencies at the time of construction from an external source (
AlphaFactoryas it is implemented now) and not need to be aware of any configuration mechanisms or structures themselves.The same mechanism of obtaining
Alphainstances (only throughAlphaFactory) has been applied to all tests that test complete workflows (i.e. tests constituting end-to-end-tests in that they test the complete system rather than a single unit of code) as well. These tests (everything annotatedRegressionTestorAggregateRegressionTest) have been moved to thealpha-solvermodule and adapted to be parameterized using aSystemConfigwhich is used to obtain anAlphainstance from the factory.Additional changes:
ASPCore2ProgramtoInputProgramalpha-core/src/testFixturesthat can be shared between modulesStratifiedEvaluation: Avoid generating duplicate facts by using aSetrather thanListas intermediate storage for newly derived rule heads