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

Preprocessing #337

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

Preprocessing #337

wants to merge 63 commits into from

Conversation

mschmutzhart
Copy link
Collaborator

@mschmutzhart mschmutzhart commented Feb 14, 2022

This PR aims to implement the preprocessing techniques suggested in #114 .

So far only elementary simplifications have been added as a program transformation, with a command line option to disable them (dpp).

The viability of more sophisticated simplifications, using equivalence classes, in a lazy grounding setting is still being explored.

@codecov
Copy link

codecov bot commented Feb 14, 2022

Codecov Report

Attention: 41 lines in your changes are missing coverage. Please review.

Comparison is base (d42818a) 70.23% compared to head (9aa03ea) 71.01%.
Report is 95 commits behind head on master.

Files Patch % Lines
...e/programs/transformation/SimplePreprocessing.java 86.17% 6 Missing and 7 partials ⚠️
...ava/at/ac/tuwien/kr/alpha/commons/terms/Terms.java 7.69% 12 Missing ⚠️
...ac/tuwien/kr/alpha/core/atoms/IntervalLiteral.java 37.50% 2 Missing and 3 partials ⚠️
.../kr/alpha/core/grounder/FactIntervalEvaluator.java 44.44% 2 Missing and 3 partials ⚠️
...uwien/kr/alpha/commons/terms/IntervalTermImpl.java 71.42% 2 Missing ⚠️
...c/tuwien/kr/alpha/core/solver/TrailAssignment.java 0.00% 2 Missing ⚠️
...grams/transformation/ArithmeticTermsRewriting.java 0.00% 0 Missing and 1 partial ⚠️
...re/programs/transformation/ChoiceHeadToNormal.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #337      +/-   ##
============================================
+ Coverage     70.23%   71.01%   +0.78%     
- Complexity     2123     2192      +69     
============================================
  Files           182      183       +1     
  Lines          8023     8132     +109     
  Branches       1423     1455      +32     
============================================
+ Hits           5635     5775     +140     
+ Misses         2028     1976      -52     
- Partials        360      381      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* Gebser, M., Kaufmann, B., Neumann, A., & Schaub, T. (2008, June). Advanced Preprocessing for Answer Set Solving.
* In ECAI (Vol. 178, pp. 15-19).
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

* solvers, as seen in:
* Gebser, M., Kaufmann, B., Neumann, A., & Schaub, T. (2008, June). Advanced Preprocessing for Answer Set Solving.
* In ECAI (Vol. 178, pp. 15-19).
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*/
* @see <a href="https://doi.org/10.3233/978-1-58603-891-5-15">doi:10.3233/978-1-58603-891-5-15</a>
*/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, I changed the reference to the link.

* Returns a copy of the rule with the specified literal removed, or null if the new rule would have an empty body.
* @return the rule without the specified literal, null if no body remains.
*/
public InternalRule returnCopyWithoutLiteral(Literal literal) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason to stress "return" here?

Suggested change
public InternalRule returnCopyWithoutLiteral(Literal literal) {
public InternalRule copyWithoutLiteral(Literal literal) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real reason, so it could be changed. But more importantly this is one of a few changes that I meant to revert but overlooked. Now this method is implemented within the SimplePreprocessing class.
I have now looked over all changed files and hopefully removed all unnecessary changes.

madmike200590 and others added 30 commits August 30, 2022 15:44
Link to "A coder's guide to answer set programming" from README.md
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.

5 participants