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

hacky bug fix in max constraint #84

Merged
merged 1 commit into from
Aug 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/engine/MaxConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,24 @@ void MaxConstraint::getEntailedTightenings( List<Tightening> &tightenings ) cons
// fLB cannot be smaller than maxElementLB
if ( FloatUtils::lt( fLB, maxElementLB ) )
tightenings.append( Tightening( _f, maxElementLB, Tightening::LB ) );
else if ( _elements.size() == 1 )
{
// Special case: there is only one element. In that case, the tighter lower
// bound (in this case, f's) wins.
tightenings.append( Tightening( *_elements.begin(), fLB, Tightening::LB ) );
}

// Hack:
// MaxConstraint currently does some 'illegal' internal bound propgation
// (in eliminateVariable()) due to bound notifications, and doesn't bother
// informing the outside world. To work around this, we report the tighest
// internal bounds known for f (knowing that these will be ignored by the
// outside world if tighter bounds are already known).

if ( _lowerBounds.exists( _f ) )
tightenings.append( Tightening( _f, _lowerBounds[_f], Tightening::LB ) );
if ( _upperBounds.exists( _f ) )
tightenings.append( Tightening( _f, _upperBounds[_f], Tightening::UB ) );

// TODO: can we derive additional bounds?
}
Expand Down