Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2be7381
Add MockBoundManager
AleksandarZeljic Feb 19, 2022
663aba8
Remove CBT from Engine
AleksandarZeljic Apr 8, 2022
e5a20fa
Restore registerTableau method in PiecewiseLinearConstraint
AleksandarZeljic Apr 8, 2022
63d485f
Update ReluConstraint tests
AleksandarZeljic Apr 8, 2022
59e2436
Update Sign and Abs tests
AleksandarZeljic Apr 8, 2022
1c92068
Add constraint bound tightening call
AleksandarZeljic Apr 19, 2022
576710a
Initialize CDOs in piece-wise linear constraints
AleksandarZeljic Apr 19, 2022
2bcbde5
Register BoundManager with constraints after Tableau is initialized
AleksandarZeljic Apr 26, 2022
db76c25
Revert "Add MockBoundManager"
AleksandarZeljic Feb 19, 2022
6165f8b
Update SignConstraint::notifyLower/UpperBound methods to use BoundMan…
AleksandarZeljic Apr 27, 2022
4f50e8b
Update AbsoluteValue::notifyL/UBound methods to use BoundManager corr…
AleksandarZeljic Apr 27, 2022
1c6f772
Update notify*Bound methods to maintain semantics required by tests
AleksandarZeljic Apr 28, 2022
0d4c73b
Register BoundManager with PiecewiseLinearConstraints when solving st…
AleksandarZeljic May 2, 2022
1b3a462
Fix stray search replace
AleksandarZeljic May 26, 2022
adb23cc
Revert commented out code in Test_SignConstraint
AleksandarZeljic May 26, 2022
e2570b5
Bulk test fixes
AleksandarZeljic Jun 6, 2022
5c37f03
Initialize CDOs in PiecewiseLinearConstraints
AleksandarZeljic Jun 15, 2022
599ce9d
Integrate phaseFixed and isImplication semantics
AleksandarZeljic Jun 15, 2022
6ab0458
Remove tests for Store/Clear SmtState
AleksandarZeljic Jul 1, 2022
99f6343
Fix minor issues in SmtCore
AleksandarZeljic Jul 2, 2022
1919c2a
Fix getPhaseStatus in Disjunction constraint
AleksandarZeljic Jul 2, 2022
677584a
Initialize Disjunctions introduced by DeepSoi
AleksandarZeljic Jul 18, 2022
3ff749e
Add call to preContextPushHook
AleksandarZeljic Jul 28, 2022
f61b0d7
Replace _constraintForSplitting unique_ptr with a vector
AleksandarZeljic Aug 5, 2022
398a657
Fix serializedConstructor for PiecewiseLinearConstraints
AleksandarZeljic Aug 8, 2022
dac6144
Fix Engine::restoreState()
AleksandarZeljic Aug 23, 2022
91d5aed
Fix SmtCore::reset to account for the context hook sematnics
AleksandarZeljic Aug 26, 2022
b38ed89
Remove DisjunctionConstraint::phaseFixed and update tests
AleksandarZeljic Sep 1, 2022
d92f6dc
Make PiecewiseLinearConstraint::nextFeasibleCase() const
AleksandarZeljic Sep 1, 2022
5875357
Fix DisjunctionConstraint::constraintObsolete to always return false.
AleksandarZeljic Sep 8, 2022
ff45d2f
Introduce PiecewiseLinearConstraint::getImpliedCase()
AleksandarZeljic Sep 8, 2022
d844648
Ensure DisjunctionConstraint::getPhaseStatus() meets precondition
AleksandarZeljic Sep 8, 2022
e9b1b9a
Simplify getImpliedCaseSplit()
AleksandarZeljic Sep 8, 2022
f4f9ae5
Rewrite updateFeasibleDisjuncts
AleksandarZeljic Sep 8, 2022
4a99bc4
Update class description
AleksandarZeljic Sep 8, 2022
619a909
Remove old SmtCore implementation
AleksandarZeljic Sep 13, 2022
d9774b7
Fix formatting in Constraint classes and tests
AleksandarZeljic Sep 15, 2022
6dba340
Encapsulate context push/pop to track statistics
AleksandarZeljic Sep 17, 2022
6c8759e
Update Statistics to reflect changes
AleksandarZeljic Sep 20, 2022
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
14 changes: 7 additions & 7 deletions src/common/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ void Statistics::print()
, printPercents( timeSimplexStepsMicro, timeMainLoopMicro )
, timeSimplexStepsMicro / 1000
);
unsigned long long totalTimePerformingLocalSearch =
getLongAttribute( Statistics::TOTAL_TIME_LOCAL_SEARCH_MICRO );
printf( "\t\t\t[%.2lf%%] SoI-based local search: %llu milli\n"
, printPercents( totalTimePerformingLocalSearch, timeMainLoopMicro )
, totalTimePerformingLocalSearch / 1000
);
unsigned long long totalTimeExplicitBasisBoundTighteningMicro =
getLongAttribute(TOTAL_TIME_EXPLICIT_BASIS_BOUND_TIGHTENING_MICRO );
printf( "\t\t[%.2lf%%] Explicit-basis bound tightening: %llu milli\n"
Expand Down Expand Up @@ -212,12 +218,6 @@ void Statistics::print()
, printPercents( totalTimePerformingSymbolicBoundTightening, timeMainLoopMicro )
, totalTimePerformingSymbolicBoundTightening / 1000
);
unsigned long long totalTimePerformingLocalSearch =
getLongAttribute( Statistics::TOTAL_TIME_LOCAL_SEARCH_MICRO );
printf( "\t\t[%.2lf%%] SoI-based local search: %llu milli\n"
, printPercents( totalTimePerformingLocalSearch, timeMainLoopMicro )
, totalTimePerformingLocalSearch / 1000
);
unsigned long long totalTimeAddingConstraintsToMILPSolver =
getLongAttribute( Statistics::TIME_ADDING_CONSTRAINTS_TO_MILP_SOLVER_MICRO );
printf( "\t\t[%.2lf%%] SoI-based local search: %llu milli\n"
Expand Down Expand Up @@ -326,7 +326,7 @@ void Statistics::print()
, getUnsignedAttribute( Statistics::CURRENT_DECISION_LEVEL )
, getUnsignedAttribute( Statistics::NUM_VISITED_TREE_STATES )
, getUnsignedAttribute( Statistics::NUM_SPLITS )
, getUnsignedAttribute( Statistics::NUM_POPS ) );
, getUnsignedAttribute( Statistics::NUM_CONTEXT_POPS ) );
printf( "\tMax stack depth: %u\n"
, getUnsignedAttribute( Statistics::MAX_DECISION_LEVEL ) );

Expand Down
20 changes: 9 additions & 11 deletions src/engine/AbsoluteValueConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ AbsoluteValueConstraint::AbsoluteValueConstraint( unsigned b, unsigned f )
}

AbsoluteValueConstraint::AbsoluteValueConstraint( const String &serializedAbs )
: _auxVarsInUse( false )
: PiecewiseLinearConstraint( TWO_PHASE_PIECEWISE_LINEAR_CONSTRAINT )
, _auxVarsInUse( false )
, _haveEliminatedVariables( false )
{
String constraintType = serializedAbs.substring( 0, 13 );
Expand Down Expand Up @@ -125,7 +126,7 @@ void AbsoluteValueConstraint::notifyLowerBound( unsigned variable, double bound

if ( _boundManager == nullptr && existsLowerBound( variable ) &&
!FloatUtils::gt( bound, getLowerBound( variable ) ) )
return;
return;

setLowerBound( variable, bound );

Expand Down Expand Up @@ -179,7 +180,7 @@ void AbsoluteValueConstraint::notifyUpperBound( unsigned variable, double bound
!FloatUtils::lt( bound, getUpperBound( variable ) ) )
return;

setUpperBound( variable, bound );
setUpperBound( variable, bound );
// Check whether the phase has become fixed
fixPhaseIfNeeded();

Expand Down Expand Up @@ -320,7 +321,7 @@ List<PiecewiseLinearConstraint::Fix> AbsoluteValueConstraint::getPossibleFixes()
return fixes;
}

List<PiecewiseLinearConstraint::Fix> AbsoluteValueConstraint::getSmartFixes( ITableau */* tableau */ ) const
List<PiecewiseLinearConstraint::Fix> AbsoluteValueConstraint::getSmartFixes( ITableau * /* tableau */ ) const
{
return getPossibleFixes();
}
Expand Down Expand Up @@ -395,10 +396,6 @@ PiecewiseLinearCaseSplit AbsoluteValueConstraint::getPositiveSplit() const
return positivePhase;
}

bool AbsoluteValueConstraint::phaseFixed() const
{
return _phaseStatus != PhaseStatus::PHASE_NOT_FIXED;
}

PiecewiseLinearCaseSplit AbsoluteValueConstraint::getImpliedCaseSplit() const
{
Expand Down Expand Up @@ -454,6 +451,8 @@ void AbsoluteValueConstraint::dump( String &output ) const
existsLowerBound( _negAux ) ? Stringf( "%lf", getLowerBound( _negAux ) ).ascii() : "-inf",
existsUpperBound( _negAux ) ? Stringf( "%lf", getUpperBound( _negAux ) ).ascii() : "inf" );
}

serializeInfeasibleCases( output );
}

void AbsoluteValueConstraint::updateVariableIndex( unsigned oldIndex, unsigned newIndex )
Expand Down Expand Up @@ -602,8 +601,7 @@ void AbsoluteValueConstraint::getEntailedTightenings( List<Tightening> &tighteni
}
}

void AbsoluteValueConstraint::transformToUseAuxVariables( InputQuery
&inputQuery )
void AbsoluteValueConstraint::transformToUseAuxVariables( InputQuery &inputQuery )
{
/*
We want to add the two equations
Expand Down Expand Up @@ -662,7 +660,7 @@ void AbsoluteValueConstraint::getCostFunctionComponent( LinearExpression &cost,
PhaseStatus phase ) const
{
// If the constraint is not active or is fixed, it contributes nothing
if( !isActive() || phaseFixed() )
if ( !isActive() || phaseFixed() )
return;

ASSERT( phase == ABS_PHASE_NEGATIVE || phase == ABS_PHASE_POSITIVE );
Expand Down
15 changes: 6 additions & 9 deletions src/engine/AbsoluteValueConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
** * context dependent mode, used during the search.
**
** Invoking initializeCDOs method activates the context dependent mode, and the
** AbsoluteValueConstraint object synchronizes its state automatically with the central
** Context object.
** AbsoluteValueConstraint object synchronizes its state automatically with the
** central Context object.
**/

#ifndef __AbsoluteValueConstraint_h__
Expand All @@ -34,7 +34,6 @@

class AbsoluteValueConstraint : public PiecewiseLinearConstraint
{

public:
/*
The f variable is the absolute value of the b variable:
Expand All @@ -61,8 +60,8 @@ class AbsoluteValueConstraint : public PiecewiseLinearConstraint
/*
Register/unregister the constraint with a talbeau.
*/
void registerAsWatcher( ITableau *tableau) override;
void unregisterAsWatcher( ITableau *tableau) override;
void registerAsWatcher( ITableau *tableau ) override;
void unregisterAsWatcher( ITableau *tableau ) override;

/*
These callbacks are invoked when a watched variable's value
Expand Down Expand Up @@ -114,8 +113,8 @@ class AbsoluteValueConstraint : public PiecewiseLinearConstraint

/*
Returns a list of all cases - { ABS_POSITIVE, ABS_NEGATIVE }
The order of returned cases affects the search, and this method is where related
heuristics should be implemented.
The order of returned cases affects the search, and this method is where
related heuristics should be implemented.
*/
List<PhaseStatus> getAllCases() const override;

Expand All @@ -133,7 +132,6 @@ class AbsoluteValueConstraint : public PiecewiseLinearConstraint
Check whether the constraint's phase has been fixed.
*/
void fixPhaseIfNeeded();
bool phaseFixed() const override;

/*
Preprocessing related functions, to inform that a variable has
Expand Down Expand Up @@ -233,4 +231,3 @@ class AbsoluteValueConstraint : public PiecewiseLinearConstraint
};

#endif // __AbsoluteValueConstraint_h__

Loading