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

&dom in body #35

Open
MaxOstrowski opened this issue Jun 10, 2020 · 3 comments
Open

&dom in body #35

MaxOstrowski opened this issue Jun 10, 2020 · 3 comments

Comments

@MaxOstrowski
Copy link
Member

I would like to allow domain constraints also in the body of a rule.
This is a convenient check if a variable is in a certain range/set of elements.
What do you think @rkaminsk ?

@MaxOstrowski
Copy link
Member Author

This would also help with the implementation of a flatzinc interface, where there exists a reified version of this constraint.

@rkaminsk
Copy link
Member

Just go ahead. If you want to have such a feature. If this really helps to make encoding easier is another question. A simple &dom constraint is quite easy to convert to a sum:

    &dom { L..R } = V is equivalent to &sum { V } >= L, &sum { V } <= R.

For general &dom constraints you will have to introduce a disjunction. You will probably have to implement something separately for the body because the current translation is specialized for the head (for better propagation).

@MaxOstrowski
Copy link
Member Author

Thanks.
I currently simply use an encoding to translate it away.
Unfortunately, my example was not about the simple L..R case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants