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

Incremental solving infrastructure #831

Merged
merged 30 commits into from
Aug 24, 2024

Conversation

wu-haoze
Copy link
Collaborator

@wu-haoze wu-haoze commented Aug 22, 2024

  1. Old InputQuery class renamed to "Query"
  2. New InputQuery class introduced which allows pushing/popping constraints incrementally. Keep naming the outward-facing query class InputQuery makes the API backward compatible.
  3. InputQuery and Query both inherits an IQuery abstract class. QueryLoaders, different parsers, and methods like preprocessQuery now operate on IQuery.
  4. 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() );
Copy link
Collaborator Author

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 )
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

Copy link
Collaborator

@MatthewDaggitt MatthewDaggitt left a 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.
@wu-haoze wu-haoze merged commit 93cbbcf into NeuralNetworkVerification:master Aug 24, 2024
12 checks passed
wu-haoze added a commit that referenced this pull request Sep 11, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants