ASP-based solver: rework version facts#25585
Merged
tgamblin merged 1 commit intospack:developfrom Aug 24, 2021
Merged
Conversation
This commit rework version facts so that: 1. All the information on versions is collected before emitting the facts 2. The same kind of atom is emitted for versions stemming from different origins (package.py vs. packages.yaml) In the end all the possible versions for a given package are totally ordered and they are given different and increasing weights staring from zero. This refactor allow us to avoid using negative weights, which in some configurations may make parent node score "better" and lead to unexpected "optimal" results.
tgamblin
reviewed
Aug 24, 2021
| 1 { version(Package, Version): external_version_declared(Package, Version, _, _) } 1 :- external(Package). | ||
| 1 { external_version(Package, Version, Weight): | ||
| version_declared(Package, Version, Weight, "external") } 1 | ||
| :- external(Package). |
Member
There was a problem hiding this comment.
Nice. This is much more consistent.
tgamblin
approved these changes
Aug 24, 2021
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR reworks version facts so that:
package.pyvs.packages.yaml)In the end all the possible versions for a given package have a total order and they are given different and increasing weights starting from zero. This refactor allows us to avoid using negative weights, which in some configurations might make parent node score "better" and lead to unexpected "optimal" results.
The facts emitted for versions look like:
for the following
packages.yaml: