-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add absolute values and convert to Minion #583
Conversation
@ozgurakgun I have added a bug-fix for division domains to this commit. This fixes abs-03 giving different solutions with Oxide and Conjure Updated commit message:
|
conjure_oxide/tests/integration/basic/abs/04-bounds/input.eprime
Outdated
Show resolved
Hide resolved
9a78d1e
to
bc88505
Compare
Add support for absolute values, in particular: * Parsing from JSON. * The `Abs` expression variant. * The `FlatAbsEq` Minion constraint. * Flattening and conversion to Minion. As part of this change, a division domain bug is fixed. In our domain calculation we use truncating division, the default Rust integer division operator. However, the semantics of Essence Prime specify floor division. Truncating division has the effect of rounding towards 0. Truncating division does `-5 / 2 =-2` and `5/2 = 2`. However, we want `-5/2 = -3` and `5/2 = 2`. This caused the domains of variables containing negative divisions to sometimes be one too high. For abs-03, this caused Oxide to give different solutions than Conjure.
bc88505
to
eaf65ad
Compare
Add support for absolute values, in particular:
Abs
expression variant.FlatAbsEq
Minion constraint.