@@ -152,7 +152,9 @@ void AbsoluteValueConstraint::notifyLowerBound( unsigned variable, double bound
152152 Tightening::UB,
153153 { variable, variable },
154154 Tightening::UB,
155- getType () );
155+ *this ,
156+ false ,
157+ fUpperBound );
156158 else if ( proofs && phaseFixed () )
157159 {
158160 std::shared_ptr<TableauRow> tighteningRow =
@@ -232,7 +234,9 @@ void AbsoluteValueConstraint::notifyUpperBound( unsigned variable, double bound
232234 Tightening::UB,
233235 { variable, variable },
234236 Tightening::UB,
235- getType () );
237+ *this ,
238+ false ,
239+ fUpperBound );
236240 else if ( proofs && phaseFixed () )
237241 {
238242 std::shared_ptr<TableauRow> tighteningRow =
@@ -406,7 +410,7 @@ AbsoluteValueConstraint::getSmartFixes( ITableau * /* tableau */ ) const
406410
407411List<PiecewiseLinearCaseSplit> AbsoluteValueConstraint::getCaseSplits () const
408412{
409- ASSERT ( _phaseStatus == PhaseStatus::PHASE_NOT_FIXED );
413+ ASSERT ( getPhaseStatus () == PhaseStatus::PHASE_NOT_FIXED );
410414
411415 List<PiecewiseLinearCaseSplit> splits;
412416 splits.append ( getNegativeSplit () );
@@ -476,14 +480,14 @@ PiecewiseLinearCaseSplit AbsoluteValueConstraint::getPositiveSplit() const
476480
477481bool AbsoluteValueConstraint::phaseFixed () const
478482{
479- return _phaseStatus != PhaseStatus::PHASE_NOT_FIXED;
483+ return getPhaseStatus () != PhaseStatus::PHASE_NOT_FIXED;
480484}
481485
482486PiecewiseLinearCaseSplit AbsoluteValueConstraint::getImpliedCaseSplit () const
483487{
484- ASSERT ( _phaseStatus != PHASE_NOT_FIXED );
488+ ASSERT ( getPhaseStatus () != PHASE_NOT_FIXED );
485489
486- if ( _phaseStatus == ABS_PHASE_POSITIVE )
490+ if ( getPhaseStatus () == ABS_PHASE_POSITIVE )
487491 return getPositiveSplit ();
488492
489493 return getNegativeSplit ();
@@ -512,8 +516,8 @@ void AbsoluteValueConstraint::dump( String &output ) const
512516 _f,
513517 _b,
514518 _constraintActive ? " Yes" : " No" ,
515- _phaseStatus ,
516- phaseToString ( _phaseStatus ).ascii () );
519+ getPhaseStatus () ,
520+ phaseToString ( getPhaseStatus () ).ascii () );
517521
518522 output +=
519523 Stringf ( " b in [%s, %s], " ,
@@ -826,7 +830,7 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
826830 setPhaseStatus ( ABS_PHASE_POSITIVE );
827831 if ( proofs )
828832 _boundManager->addLemmaExplanationAndTightenBound (
829- _posAux, 0 , Tightening::UB, { _b }, Tightening::LB, getType () );
833+ _posAux, 0 , Tightening::UB, { _b }, Tightening::LB, * this , true , 0 );
830834 return ;
831835 }
832836
@@ -836,7 +840,7 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
836840 setPhaseStatus ( ABS_PHASE_NEGATIVE );
837841 if ( proofs )
838842 _boundManager->addLemmaExplanationAndTightenBound (
839- _negAux, 0 , Tightening::UB, { _b }, Tightening::UB, getType () );
843+ _negAux, 0 , Tightening::UB, { _b }, Tightening::UB, * this , true , 0 );
840844 return ;
841845 }
842846
@@ -849,8 +853,14 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
849853 {
850854 setPhaseStatus ( ABS_PHASE_NEGATIVE );
851855 if ( proofs )
852- _boundManager->addLemmaExplanationAndTightenBound (
853- _negAux, 0 , Tightening::UB, { _b, _f }, Tightening::UB, getType () );
856+ _boundManager->addLemmaExplanationAndTightenBound ( _negAux,
857+ 0 ,
858+ Tightening::UB,
859+ { _b, _f },
860+ Tightening::UB,
861+ *this ,
862+ true ,
863+ getUpperBound ( _b ) );
854864 return ;
855865 }
856866
@@ -860,8 +870,14 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
860870 {
861871 setPhaseStatus ( ABS_PHASE_POSITIVE );
862872 if ( proofs )
863- _boundManager->addLemmaExplanationAndTightenBound (
864- _posAux, 0 , Tightening::UB, { _b, _f }, Tightening::LB, getType () );
873+ _boundManager->addLemmaExplanationAndTightenBound ( _posAux,
874+ 0 ,
875+ Tightening::UB,
876+ { _b, _f },
877+ Tightening::LB,
878+ *this ,
879+ true ,
880+ -getLowerBound ( _b ) );
865881 return ;
866882 }
867883
@@ -871,6 +887,9 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
871887 if ( existsUpperBound ( _posAux ) && FloatUtils::isZero ( getUpperBound ( _posAux ) ) )
872888 {
873889 setPhaseStatus ( ABS_PHASE_POSITIVE );
890+ if ( proofs )
891+ _boundManager->addLemmaExplanationAndTightenBound (
892+ _posAux, 0 , Tightening::UB, { _posAux }, Tightening::UB, *this , true , 0 );
874893 return ;
875894 }
876895
@@ -880,14 +899,17 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
880899 setPhaseStatus ( ABS_PHASE_NEGATIVE );
881900 if ( proofs )
882901 _boundManager->addLemmaExplanationAndTightenBound (
883- _negAux, 0 , Tightening::UB, { _posAux }, Tightening::LB, getType () );
902+ _negAux, 0 , Tightening::UB, { _posAux }, Tightening::LB, * this , true , 0 );
884903 return ;
885904 }
886905
887906 // Option 7: negAux has become zero, phase is negative
888907 if ( existsUpperBound ( _negAux ) && FloatUtils::isZero ( getUpperBound ( _negAux ) ) )
889908 {
890909 setPhaseStatus ( ABS_PHASE_NEGATIVE );
910+ if ( proofs )
911+ _boundManager->addLemmaExplanationAndTightenBound (
912+ _negAux, 0 , Tightening::UB, { _negAux }, Tightening::UB, *this , true , 0 );
891913 return ;
892914 }
893915
@@ -897,7 +919,7 @@ void AbsoluteValueConstraint::fixPhaseIfNeeded()
897919 setPhaseStatus ( ABS_PHASE_POSITIVE );
898920 if ( proofs )
899921 _boundManager->addLemmaExplanationAndTightenBound (
900- _posAux, 0 , Tightening::UB, { _negAux }, Tightening::LB, getType () );
922+ _posAux, 0 , Tightening::UB, { _negAux }, Tightening::LB, * this , true , 0 );
901923 return ;
902924 }
903925 }
0 commit comments