forked from vprover/vampire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vutil tool for generation claims to discover predicate equivalences by consequence_elimination plugging sat equivalence discovery into the system
- Loading branch information
Showing
26 changed files
with
643 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* @file MinimizingSolver.cpp | ||
* Implements class MinimizingSolver. | ||
*/ | ||
|
||
#include "MinimizingSolver.hpp" | ||
|
||
namespace SAT | ||
{ | ||
|
||
MinimizingSolver::MinimizingSolver(SATSolver* inner) | ||
: _inner(inner), | ||
_assignmentValid(false) | ||
{ | ||
CALL("MinimizingSolver::MinimizingSolver"); | ||
|
||
_assignmentValid = false; | ||
} | ||
|
||
void MinimizingSolver::ensureVarCnt(unsigned newVarCnt) | ||
{ | ||
CALL("MinimizingSolver::ensureVarCnt"); | ||
|
||
_inner->ensureVarCnt(newVarCnt); | ||
_asgn.expand(newVarCnt); | ||
_watcher.expand(newVarCnt); | ||
_assignmentValid = false; | ||
} | ||
|
||
void MinimizingSolver::addClauses(SATClauseIterator cit, bool onlyPropagate) | ||
{ | ||
CALL("MinimizingSolver::addClauses"); | ||
|
||
static SATClauseStack newClauses; | ||
newClauses.reset(); | ||
newClauses.loadFromIterator(cit); | ||
_unprocessed.loadFromIterator(SATClauseStack::BottomFirstIterator(newClauses)); | ||
|
||
_inner->addClauses(pvi(SATClauseStack::BottomFirstIterator(newClauses)), onlyPropagate); | ||
_assignmentValid = false; | ||
} | ||
|
||
SATSolver::VarAssignment MinimizingSolver::getAssignment(unsigned var) | ||
{ | ||
CALL("MinimizingSolver::getAssignment"); | ||
ASS_EQ(_inner->getStatus(), SATISFIABLE); | ||
|
||
if(!_assignmentValid) { | ||
updateAssignment(); | ||
} | ||
|
||
if(!_assumptions.isEmpty() && _assumptions.find(var)) { | ||
return _assumptions.get(var) ? SATSolver::TRUE : SATSolver::FALSE; | ||
} | ||
|
||
if(_watcher[var].isEmpty()) { | ||
return SATSolver::DONT_CARE; | ||
} | ||
return _asgn[var] ? SATSolver::TRUE : SATSolver::FALSE; | ||
} | ||
|
||
void MinimizingSolver::updateAssignment() | ||
{ | ||
CALL("MinimizingSolver::updateAssignment"); | ||
|
||
NOT_IMPLEMENTED; | ||
} | ||
|
||
|
||
void MinimizingSolver::addAssumption(SATLiteral lit, bool onlyPropagate) | ||
{ | ||
CALL("MinimizingSolver::addAssumption"); | ||
|
||
_assumptions.insert(lit.var(), lit.polarity()); | ||
_inner->addAssumption(lit, onlyPropagate); | ||
_assignmentValid = false; | ||
} | ||
|
||
void MinimizingSolver::retractAllAssumptions() | ||
{ | ||
CALL("MinimizingSolver::retractAllAssumptions"); | ||
|
||
_assumptions.reset(); | ||
_inner->retractAllAssumptions(); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.