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

WIP: Grounding strategies and phase saving and restarts #206

Closed

Conversation

rtaupe
Copy link
Collaborator

@rtaupe rtaupe commented Nov 12, 2019

This is the union of #192 and #202. Instead of merging this pull request, the other two should be merged to master. This is just to see if CI gets through.

rtaupe and others added 30 commits January 7, 2019 11:36
(i.e. heuristics that allow to ground more rules than just those whose
positive body is satisfied)
 * removed NaiveGrounder.predicatesDefinedOnlyByFacts again, because it
does not provide additional benefit over ProgramAnalysis
 * comments on design decisions in NaiveGrounder.bindNextAtomInRule
 * bugfix in NaiveGrounder.storeAtomAndTerminateIfAtomDoesNotHold
The issue here is that it is possible that atoms have been grounded by
bootstrap() and are not yet known to the assignment. The computation of
maxAtomIdBeforeGroundingNewNoGoods happened therefore too late (after
bootstrap()), but we can do without maxAtomIdBeforeGroundingNewNoGoods
anyway.
i.e. a situation in which it has to terminate binding, but where it
could (potentially) continue if the grounding order were different
terminate binding if more than N positive body literals are unassigned
# Conflicts:
#	src/main/java/at/ac/tuwien/kr/alpha/Main.java
#	src/main/java/at/ac/tuwien/kr/alpha/grounder/GrounderFactory.java
#	src/main/java/at/ac/tuwien/kr/alpha/grounder/NaiveGrounder.java
#	src/test/java/at/ac/tuwien/kr/alpha/solver/AggregatesTest.java
because this might lead to necessary rules not being grounded at all
rtaupe and others added 24 commits October 3, 2019 13:41
# Conflicts:
#	src/main/java/at/ac/tuwien/kr/alpha/config/CommandLineParser.java
#	src/main/java/at/ac/tuwien/kr/alpha/config/SystemConfig.java
#	src/main/java/at/ac/tuwien/kr/alpha/solver/NaiveNoGoodStore.java
#	src/main/java/at/ac/tuwien/kr/alpha/solver/NoGoodStore.java
#	src/main/java/at/ac/tuwien/kr/alpha/solver/NoGoodStoreAlphaRoaming.java
- CommandLineParser and SystemConfig have option to enable restarts.
- DefaultSolver runs restarts if enabled.
- Add MixedRestartStrategy combining Luby and dynamic (EMA) restarts.
- Enhanced performance logs for conflicts and restarts
- ChainedBranchingHeuristics gives access to first-run heuristics.
- HeapOfActiveAtoms reports activity increment for normalization.
- VSIDSWithPhaseSaving logs
  * the overall, normalized decrease in activity of the seelected atoms,
  * the number of most-active choices thrown away because they were not
    active choice points at the time.
- PerformanceLog prints heuristics information if DefaultSolver is
  runnning with VSIDSWithPhaseSaving
that is apparently not necessary.
with phase saving.

- CommandLineParser and SystemConfig accept initial phase settings.
- AtomChoiceRelation stores relation between ordinary atoms and the
  choice points that influence them.
- NaiveGrounder and ProgramAnalyzingGrounder provide AtomChoiceRelation.
- NoGoodGenerator fills AtomChoiceRelation.
- BranchingHeuristicFactory sets AtomChoiceRelation for
  VSIDSWithPhaseSaving.
- PhaseInitializerFactory provides different initial phase settings.
- VSIDSWithPhaseSaving uses AtomChoiceRelation for activity increments.
- SolverFactory sets chosen phase initializer.
- TrailAssignment considers initial phase value, if phase was not set.
- Tests set a phase initializer if needed.
- In HeapOfActiveAtoms several members/methods package-private now to
  allow overriding.
- Add HeapOfRelatedChoiceAtoms using AtomChoiceRelation to only record
  and initialize choice points.
- Moved ChoiceManager update in DefaultSolver to correctly know which
  atoms are choice points.
- Improved logging in VSIDSWithPhaseSaving and PerformanceLog.
- Move getAtomChoiceRelation() from NaiveGrounder to Grounder, implement
  method also in DummyGrounder and ChoiceGrounder.
- HeapOfActiveAtoms keeps track of literals occurring in the heap.
- More logging stats from VSIDSWithPhaseSaving.
- ChoiceInfluenceManager: simplified callbackOnChange
…d_phase_saving_and_restarts

# Conflicts:
#	src/main/java/at/ac/tuwien/kr/alpha/config/CommandLineParser.java
#	src/main/java/at/ac/tuwien/kr/alpha/config/SystemConfig.java
#	src/main/java/at/ac/tuwien/kr/alpha/grounder/NaiveGrounder.java
#	src/test/java/at/ac/tuwien/kr/alpha/grounder/NaiveGrounderTest.java
@rtaupe rtaupe added the blocked label Nov 12, 2019
@codecov
Copy link

codecov bot commented Nov 13, 2019

Codecov Report

Merging #206 into master will increase coverage by 0.54%.
The diff coverage is 80%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #206      +/-   ##
============================================
+ Coverage     78.64%   79.19%   +0.54%     
- Complexity     1990     2156     +166     
============================================
  Files           141      149       +8     
  Lines          6373     6829     +456     
  Branches       1129     1187      +58     
============================================
+ Hits           5012     5408     +396     
- Misses          964     1015      +51     
- Partials        397      406       +9
Impacted Files Coverage Δ Complexity Δ
.../java/at/ac/tuwien/kr/alpha/common/Assignment.java 86.66% <ø> (ø) 10 <0> (ø) ⬇️
...va/at/ac/tuwien/kr/alpha/solver/WatchedNoGood.java 66.66% <ø> (ø) 30 <0> (ø) ⬇️
...n/kr/alpha/solver/SolverMaintainingStatistics.java 37.5% <ø> (ø) 1 <0> (ø) ⬇️
...r/alpha/grounder/structure/AnalyzeUnjustified.java 92.27% <ø> (ø) 50 <0> (ø) ⬇️
...c/tuwien/kr/alpha/solver/MixedRestartStrategy.java 0% <0%> (ø) 0 <0> (?)
...at/ac/tuwien/kr/alpha/grounder/ChoiceRecorder.java 79.54% <0%> (ø) 10 <0> (ø) ⬇️
.../tuwien/kr/alpha/solver/LearnedNoGoodDeletion.java 88.13% <100%> (+0.63%) 18 <8> (+1) ⬆️
...olver/heuristics/AlphaHeadMustBeTrueHeuristic.java 83.33% <100%> (+33.33%) 5 <0> (+3) ⬆️
.../at/ac/tuwien/kr/alpha/grounder/NonGroundRule.java 95.55% <100%> (ø) 22 <1> (ø) ⬇️
...a/at/ac/tuwien/kr/alpha/grounder/Substitution.java 75.94% <100%> (+1.26%) 30 <0> (ø) ⬇️
... and 52 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3fb4dc...14dfbf4. Read the comment docs.

@rtaupe rtaupe closed this Jan 10, 2020
@rtaupe rtaupe deleted the grounding_strategies_and_phase_saving_and_restarts branch January 10, 2020 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants