-
Notifications
You must be signed in to change notification settings - Fork 95
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
Incremental solving infrastructure #831
Incremental solving infrastructure #831
Conversation
wu-haoze
commented
Aug 22, 2024
•
edited
Loading
edited
- Old InputQuery class renamed to "Query"
- New InputQuery class introduced which allows pushing/popping constraints incrementally. Keep naming the outward-facing query class InputQuery makes the API backward compatible.
- InputQuery and Query both inherits an IQuery abstract class. QueryLoaders, different parsers, and methods like preprocessQuery now operate on IQuery.
- Update incremental-solving example in maraboupy/example
@@ -347,39 +329,23 @@ void DnCManager::printResult() | |||
{ | |||
std::cout << "sat\n" << std::endl; | |||
|
|||
extractSolution( *_baseInputQuery ); | |||
|
|||
Vector<double> inputVector( _baseInputQuery->getNumInputVariables() ); |
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.
There is a danger that the network-level reasoner's output variable is different from the actual output variable. Also, the output assignment might be inconsistent with the satisfying assignment returned by the API call. Disabling this re-computation with NLR for now and left a TODO.
@@ -918,19 +918,18 @@ void Engine::fixViolatedPlConstraintIfPossible() | |||
_tableau->setNonBasicAssignment( fix._variable, fix._value, true ); | |||
} | |||
|
|||
bool Engine::processInputQuery( InputQuery &inputQuery ) | |||
bool Engine::processInputQuery( const IQuery &inputQuery ) |
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.
Making this const so that we know processInputQuery does not change the InputQuery, which will be "re-processed" later during incremental solving.
@@ -973,35 +972,12 @@ bool Engine::calculateBounds( InputQuery &inputQuery ) | |||
return true; | |||
} | |||
|
|||
void Engine::informConstraintsOfInitialBounds( InputQuery &inputQuery ) const |
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.
Moving this to Preprocessor. This is the first thing we do now in the Preprocessor.
@@ -376,42 +376,6 @@ struct MarabouOptions | |||
}; | |||
|
|||
|
|||
/* The default parameters here are just for readability, you should specify |
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.
I believe this method is not needed given that we already have calculuateBounds(). Writing a deep-copy constructor for the context dependent InputQuery class just for this seems a bit unncessary.
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.
Otherwise, the bits that I understand look good! Obviously can't comment on the alterations to the preprocessing.
Fix documentation in PropertyParser; Add documentation for IQuery, InputQuery, and Query; Add CDMap class which inherits from CVC4's cdhashmap class.
…cted (#829) * fix unit test * Change initialization strategy in DeepSoI if NLR is not fully constructed * Drop support for Tensorflow and fix MacOS bug in unit test to pass CI tests (#827) * fix unit test and CI * bump python version * test * remove test * test_sub * add network * add a test for Sub * remove local robustness method * Incremental solving infrastructure (#831) * fix unit test * update python requirement * test requirement * cdhasmap * add IInputQuery * rename * progress * seems to work * add test * make input query const * incremental * new incremental solving * add python test * update change log * fix format * test cd hasmap * add todos * revert ci.yml * rename ipq to query * Addressing Matthew's comments: Fix documentation in PropertyParser; Add documentation for IQuery, InputQuery, and Query; Add CDMap class which inherits from CVC4's cdhashmap class. * revert cdhashmap * Update Test_InputQuery.h * Update Test_InputQuery.h * Update test_query.py * Update Marabou.py * Update test_query.py * Update Test_InputQuery.h * Update Test_Engine.h * Update Test_Engine.h * Change initialization strategy in DeepSoI if NLR is not fully constructed