MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / eliminateVariable

Method eliminateVariable

src/engine/SignConstraint.cpp:562–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void SignConstraint::eliminateVariable( __attribute__( ( unused ) ) unsigned variable,
563 __attribute__( ( unused ) ) double fixedValue )
564{
565 ASSERT( variable == _b || variable == _f );
566
567 DEBUG( {
568 if ( variable == _f )
569 {
570 ASSERT( ( FloatUtils::areEqual( fixedValue, 1 ) ) ||
571 ( FloatUtils::areEqual( fixedValue, -1 ) ) );
572
573 if ( FloatUtils::areEqual( fixedValue, 1 ) )
574 {
575 ASSERT( _phaseStatus != SIGN_PHASE_NEGATIVE );
576 }
577 else if ( FloatUtils::areEqual( fixedValue, -1 ) )
578 {
579 ASSERT( _phaseStatus != SIGN_PHASE_POSITIVE );
580 }
581 }
582 else if ( variable == _b )
583 {
584 if ( FloatUtils::gte( fixedValue, 0 ) )
585 {
586 ASSERT( _phaseStatus != SIGN_PHASE_NEGATIVE );
587 }
588 else if ( FloatUtils::lt( fixedValue, 0 ) )
589 {
590 ASSERT( _phaseStatus != SIGN_PHASE_POSITIVE );
591 }
592 }
593 } );
594
595 // In a Sign constraint, if a variable is removed the entire constraint can be discarded.
596 _haveEliminatedVariables = true;
597}
598
599unsigned SignConstraint::getB() const
600{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected