Conversation
|
Later on, we could add the syntax: @variable(model, Y1, Logical)
@variable(model, Y2 == ¬Y1, Logical) to make it more symbolic, but that can wait for another PR. |
hdavid16
left a comment
There was a problem hiding this comment.
Looks great. Thanks for putting this together. Added some minor comments. We can merge after they are addressed.
|
Thanks, I have addressed the comments. The restriction on not specifying the fix or start value is to avoid conflicts with the variable it is the complement of. |
hdavid16
left a comment
There was a problem hiding this comment.
I think it would be better to say "Fix its logical complement instead". Using "Try" makes it sound like that might not work. Also complement should be spelled with an e everywhere (not an i...we don't like compliments XD)
Done. |
This PR closes #106. It does so by adding the
logical_complementkeyword argument when creating logical variables. For instance, we can have:These logical variables can then be used as normal to build disjunctions, but the underlying binary expressions avoid adding an unnecessary variable.
This works with all reformulations, but currently has the limitation that logical variables used inside nested disjunctions cannot be logical complements.