-
Notifications
You must be signed in to change notification settings - Fork 22
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
[HOTFIX] Constraints Any semantics should preserve false #373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically approved due to detection of the following labels: hotfix
You're definitely right. As an edge case, consider Any over the empty list of constraints. Producing NULL makes no sense, because we definitely know that no constraint in the list (all zero of them) is true -- there is nothing that could change, no missing input we lack to give a more precise answer. |
I have these changes in my branch for gaps in external profiles. There's a couple erroneous |
What I mean to say is, if you could take all of those changes and use them in this PR, that would be great. Then I can drop that commit from my branch, cuz it should've been a separate PR to begin with, like this. Thanks! |
EDIT: Nevermind! It was a mistake on my end. Comment below. |
9ab38e9
to
ca6038e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically approved due to detection of the following labels: hotfix
Force push replaces |
Nevermind! I had neglected to extend the bounds of the simulation results. |
If an interval is associated with false in all inputs to Any, it should continue to be associated with false in the result.
ca6038e
to
c921246
Compare
Done 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This brings up a bit of future work, where I'd like to stop using select(bounds)
so aggressively after every operation, because it will lose any information that should get shiftBy
'ed into the plan bounds.
i.e. don't do an activity for an hour after a certain resource condition that occurred before plan start. But that's a different task.
Description
This case was discovered by @camargo in preparation for a demo. A constraint similar to the following was never returning violations:
As a reminder, the
x.if(y)
is syntactic sugar forAny(not y, x)
.I stepped through the debugger and found that the
Any
node was convertingfalse
intonull
in the following case:(Assume that
/flag
is never equal to "B")(Duration.MIN, start time, FALSE)
,(start time, end time, TRUE)
, and(end time, Duration.MAX, FALSE)
(I'm being imprecise with my 'clusivity because it's irrelevant to my point)Invert
correctly swapsTRUE
withFALSE
and vice versa above, resulting in(Duration.MIN, start time, TRUE)
,(start time, end time, FALSE)
, and(end time, Duration.MAX, TRUE)
Any
node, and we immediately OR these three intervals with the emptyWindows
object (which isnull
everywhere). This drops theFALSE
interval, losing the crucial information we needed to check this constraint.Any
with(Duration.MIN, start time, TRUE)
,(end time, Duration.MAX, TRUE)
and we say that there are no violations, since there are no FALSE intervals.The change I'm proposing is that the
Any
node should start with the intervalFOREVER, FALSE
(the identity value for "OR"). This seems reasonable to me, but I'd like feedback from people who have spent more time thinking about this @JoelCourtney @Twisol .Verification
I updated
testOr
to check that a false interval in bothleft
andright
should be preserved byAny(left, right)
. This test fails until the next commit, after which it passes.Documentation
Do we have documentation for how nullable windows behave?
Future work
None