Skip to content

feat: improve element propagator - #130

Closed
RobbinBaauw wants to merge 3 commits into
ConSol-Lab:developfrom
RobbinBaauw:feat/improve-element-propagator
Closed

RobbinBaauw wants to merge 3 commits into
ConSol-Lab:developfrom
RobbinBaauw:feat/improve-element-propagator

Conversation

@RobbinBaauw

@RobbinBaauw RobbinBaauw commented Jan 17, 2025 •

Copy link
Copy Markdown
Contributor

The element propagator improves the bounds of the RHS based on the items in the array. For this, it takes the full array into account. However, it could be that some of these items are not possible anymore due to a (partial) assignment of the index. The propagator doesn't currently take this into account, and I believe this can be improved.

I implemented the way I think this propagator should behave, and would like to know whether you agree. If you do, I can write some tests. Note, context.assignments() is deprecated in the lazy_explanation, but I do not see any other way to implement this, so if you want to go ahead with this PR, what would you recommend there?

@ImkoMarijnissen

Copy link
Copy Markdown
Contributor

This is indeed a nice find! It would be great if you could write some tests which show why this behaviour would be wanted.

As for your comment concerning retrieving assignments() from the explanation context; I think it makes sense to add the HasAssignments trait to the explanation context such that you can just call context.contains(...).

@RobbinBaauw

Copy link
Copy Markdown
Contributor Author

Done!

@RobbinBaauw RobbinBaauw closed this by deleting the head repository Jan 29, 2025
maartenflippo pushed a commit that referenced this pull request Feb 3, 2025
Re-opening #130 due to a
change in my repository.

The `element` propagator improves the bounds of the RHS based on the
items in the array. For this, it takes the full array into account.
However, it could be that some of these items are not possible anymore
due to a (partial) assignment of the `index`. The propagator doesn't
currently take this into account, and I believe this can be improved.
maartenflippo pushed a commit that referenced this pull request Apr 11, 2025
Re-opening #130 due to a
change in my repository.

The `element` propagator improves the bounds of the RHS based on the
items in the array. For this, it takes the full array into account.
However, it could be that some of these items are not possible anymore
due to a (partial) assignment of the `index`. The propagator doesn't
currently take this into account, and I believe this can be improved.
maartenflippo pushed a commit that referenced this pull request Apr 11, 2025
Re-opening #130 due to a
change in my repository.

The `element` propagator improves the bounds of the RHS based on the
items in the array. For this, it takes the full array into account.
However, it could be that some of these items are not possible anymore
due to a (partial) assignment of the `index`. The propagator doesn't
currently take this into account, and I believe this can be improved.
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.

2 participants