Skip to content

Redefinition context #248

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

Open
2 of 5 tasks
glebbelov opened this issue Jan 17, 2025 · 0 comments
Open
2 of 5 tasks

Redefinition context #248

glebbelov opened this issue Jan 17, 2025 · 0 comments
Assignees

Comments

@glebbelov
Copy link
Contributor

glebbelov commented Jan 17, 2025

This issue tracks implementation of checks ensuring that redefinitions consider expression context. Related: #153 #201.
Example:

minimize Obj:
   if x==1 then 1;

s.t. Con:
   numberof 1 in (x) >= 1;

When IfThen is flattened, it produces conditional expression for x==1 in negative context. Then, only when numberof is redefined, it adds positive context to x==1. Make sure this happens before x==1 is redefined.

Tasks.

  1. Implement checks that context is not extended beyond that used for redefinition.
  2. Or, alternatively, enable redefinition context extension. This is likely not necessary as long as we don't support model modification.
  3. Partial topological sorting of the redefinition graph to stay correct. UnaryEncodings are redefined last, and then their CondLinConEQs; to avoid adding new context to previously redefined CondLinConEQ's. However they are now redefined straight into indicators, to avoid adding new context to Or.
  4. Full topological redefinition graph sorting.
  5. Refactor to only pass the graph once and implement (redundant) checks that no constraints are added whose reformulation is finished
@glebbelov glebbelov self-assigned this Jan 17, 2025
glebbelov added a commit that referenced this issue Jan 17, 2025
glebbelov referenced this issue Jan 23, 2025
Restore context-unaware redef of !=, fixing redef in int_ne_05.mod

Fix context check after redef
glebbelov added a commit that referenced this issue Jan 23, 2025
glebbelov added a commit that referenced this issue Feb 7, 2025
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

1 participant