vector< std::pair< Clause, int > > & SearchEngineFast::wp | ( | const Literal & | literal | ) | [private, inherited] |
Return a ref to the vector of watched literals. If no such vector exists, create it.
Return a ref to the vector of watched literals. If no such vector exists, create it.
This function is normally used when the value of 'literal' becomes false. The vector contains pointers to all clauses where this literal occurs, and therefore, these clauses may cause unit propagation. In any case, the watch pointers in these clauses need to be updated.
Definition at line 136 of file search_fast.cpp.
References CVC3::Literal::wp().
Referenced by CVC3::SearchEngineFast::addNewClause(), CVC3::SearchEngineFast::analyzeUIPs(), CVC3::SearchEngineFast::bcp(), and CVC3::SearchEngineFast::propagate().
QueryResult SearchEngineFast::checkSAT | ( | ) | [private, inherited] |
Definition at line 186 of file search_fast.cpp.
References CVC3::ABORT, CVC3::SearchEngineFast::bcp(), CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_decisionEngine, CVC3::SearchEngineFast::d_factQueue, CVC3::SearchEngineFast::d_inCheckSAT, DebugAssert, CVC3::SearchEngineFast::fixConflict(), CVC3::DecisionEngine::goalSatisfied(), CVC3::TheoryCore::incomplete(), CVC3::TheoryCore::outOfResources(), CVC3::SATISFIABLE, CVC3::SearchEngineFast::split(), CVC3::UNKNOWN, and CVC3::UNSATISFIABLE.
Referenced by CVC3::SearchEngineFast::checkValidMain().
bool SearchEngineFast::split | ( | ) | [private, inherited] |
Choose a splitter.
Preconditions: The current context is consistent.
false if no splitters are available, which means the context is SAT.
Definition at line 254 of file search_fast.cpp.
References CVC3::TheoryCore::addFact(), CVC3::SearchEngineFast::addLiteralFact(), CVC3::SearchEngineFast::bcp(), CVC3::TheoryCore::checkSATCore(), CVC3::Statistics::counter(), CVC3::SearchEngine::d_commonRules, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_decisionEngine, CVC3::SearchEngineFast::d_literals, CVC3::SearchEngineFast::d_splitterCount, DebugAssert, CVC3::Literal::deriveTheorem(), CVC3::SearchEngineFast::findSplitter(), CVC3::Theorem::getExpr(), CVC3::Theorem::getRHS(), CVC3::TheoryCore::getStatistics(), CVC3::Literal::getValue(), IF_DEBUG, CVC3::CommonProofRules::iffFalseElim(), CVC3::CommonProofRules::iffTrueElim(), CVC3::TheoryCore::inconsistent(), CVC3::int2string(), CVC3::Expr::isBoolConst(), CVC3::Expr::isNot(), CVC3::Expr::isNull(), CVC3::Expr::isTrue(), CVC3::SearchImplBase::newLiteral(), CVC3::CommonProofRules::notNotElim(), CVC3::DecisionEngine::pushDecision(), CVC3::TheoryCore::simplify(), CVC3::Literal::toString(), CVC3::Expr::toString(), CVC3::TRACE, and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::checkSAT().
Expr SearchEngineFast::findSplitter | ( | ) | [private, inherited] |
Returns a splitter.
Definition at line 438 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_berkminFlag, CVC3::SearchEngineFast::d_conflictClauses, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_decisionEngine, CVC3::SearchEngineFast::d_litsByScores, CVC3::SearchEngineFast::d_litsMaxScorePos, CVC3::SearchEngineFast::d_nonLiterals, CVC3::SearchEngineFast::d_splitterCount, DebugAssert, CVC3::DecisionEngine::findSplitter(), CVC3::Literal::getExpr(), CVC3::Literal::getValue(), IF_DEBUG, CVC3::int2string(), CVC3::Expr::isBoolConst(), CVC3::SearchImplBase::isGoodSplitter(), CVC3::Expr::isTrue(), CVC3::Literal::score(), CVC3::Theory::simplifyExpr(), CVC3::CDList< T >::size(), CVC3::Clause::size(), CVC3::Expr::toString(), CVC3::TRACE, TRACE_MSG, and CVC3::SearchEngineFast::updateLitScores().
Referenced by CVC3::SearchEngineFast::split().
void SearchEngineFast::clearLiterals | ( | ) | [private, inherited] |
Clear the list of asserted literals (d_literals).
Definition at line 631 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_literals, and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::bcp(), CVC3::SearchEngineFast::checkValidMain(), and CVC3::SearchEngineFast::fixConflict().
void CVC3::SearchEngineFast::updateLitScores | ( | bool | firstTime | ) | [private, inherited] |
Referenced by CVC3::SearchEngineFast::findSplitter().
void SearchEngineFast::updateLitCounts | ( | const Clause & | c | ) | [private, inherited] |
Add the literals of a new clause to d_litsByScores.
Definition at line 412 of file search_fast.cpp.
References CVC3::Literal::added(), compareLits(), CVC3::SearchEngineFast::d_litsByScores, CVC3::SearchEngineFast::d_litSortCount, DebugAssert, CVC3::Literal::getExpr(), CVC3::Expr::isAbsLiteral(), CVC3::Clause::size(), CVC3::TRACE, and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::addNewClause(), and CVC3::SearchEngineFast::analyzeUIPs().
bool SearchEngineFast::bcp | ( | ) | [private, inherited] |
Boolean constraint propagation.
Preconditions: On every run besides the first, the CNF clause database must not have any unit or unsat clauses, and there must be a literal queued up for processing. The current context must be consistent. Any and all assertions and assignments must actually be made within the bcp loop. Other parts of the solver may queue new facts with addLiteralFact() and addNonLiteralFact(). bcp() will either process them, or it will find a conflict, in which case they will no longer be valid and will be dumped. Any nonLiterals must already be simplified.
Description: BCP will systematically work through all the literals and nonliterals, using boolean constraint propagation by detecting unit clauses and using addLiteralFact() on the unit literal while also marking the clause as SAT. Any clauses marked SAT are guaranteed to be SAT, but clauses not marked SAT are not guaranteed to be unsat.
True indicates success. All literals and nonLiterals have been processed without causing a conflict. Processing nonliterals implies running simplify on them, immediately asserting any simplifications back to the core, and marking the original nonLiteral as simplified, to be ignored by all future (this context or deeper) splitters and bcp runs. Therefore, there will be no unsimplified nonliterals remaining.
Definition at line 637 of file search_fast.cpp.
References CVC3::SearchEngineFast::clearFacts(), CVC3::SearchEngineFast::clearLiterals(), CVC3::SearchEngineFast::commitFacts(), CVC3::SearchEngineFast::d_circuitsByExpr, CVC3::SearchEngine::d_commonRules, CVC3::SearchEngineFast::d_conflictTheorem, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_factQueue, CVC3::SearchEngineFast::d_literals, CVC3::SearchEngineFast::d_litsAlive, CVC3::SearchEngineFast::d_nonLiterals, DebugAssert, CVC3::Clause::deleted(), CVC3::SearchEngineFast::enqueueFact(), CVC3::Theorem::getExpr(), CVC3::Literal::getExpr(), CVC3::TheoryCore::getFlags(), CVC3::Literal::getValue(), IF_DEBUG, CVC3::TheoryCore::inconsistent(), CVC3::TheoryCore::inconsistentThm(), CVC3::int2string(), CVC3::Expr::isAbsLiteral(), CVC3::Expr::isExists(), CVC3::Expr::isFalse(), CVC3::Expr::isTrue(), CVC3::SearchEngineFast::propagate(), CVC3::CDList< T >::push_back(), CVC3::Clause::sat(), CVC3::SearchImplBase::scopeLevel(), CVC3::SearchEngineFast::setInconsistent(), CVC3::SearchImplBase::simplify(), CVC3::CDList< T >::size(), CVC3::CommonProofRules::skolemize(), CVC3::Literal::toString(), CVC3::TRACE, TRACE_MSG, CVC3::Clause::watched(), and CVC3::SearchEngineFast::wp().
Referenced by CVC3::SearchEngineFast::addLiteralFact(), CVC3::SearchEngineFast::checkSAT(), and CVC3::SearchEngineFast::split().
bool SearchEngineFast::fixConflict | ( | ) | [private, inherited] |
Determines backtracking level and adds conflict clauses.
Preconditions: The current context is inconsistent. If it resulted from a conflictRule() application, then the theorem is stored inside d_lastConflictTheorem.
If this was caused from bcp, we obtain the conflictRule() theorem from the d_lastConflictTheorem instance variable. From here we build conflict clauses and determine the correct backtracking level, at which point we actually backtrack there. Finally, we also call addLiteralFact() on the "failure driven assertion" literal so that bcp has some place to begin (and it satisfies the bcp preconditions)
Postconditions: If True is returned: The current context is consistent, and a literal is queued up for bcp to process. If False is returned: The context cannot be made consistent without backtracking past the original one, so the formula is unsat.
Definition at line 939 of file search_fast.cpp.
References CVC3::SearchEngineFast::clearLiterals(), CVC3::SearchEngineFast::commitFacts(), CVC3::SearchImplBase::d_bottomScope, CVC3::SearchEngine::d_commonRules, CVC3::SearchEngineFast::d_conflictCount, CVC3::SearchEngineFast::d_conflictTheorem, CVC3::SearchEngineFast::d_decisionEngine, CVC3::SearchEngineFast::d_lastConflictClause, CVC3::SearchEngineFast::d_lastConflictScope, CVC3::SearchEngineFast::d_litsMaxScorePos, CVC3::SearchEngineFast::d_unitConflictClauses, DebugAssert, CVC3::SearchEngineFast::enqueueFact(), CVC3::Literal::getExpr(), CVC3::Theorem::getExpr(), CVC3::Theorem::getScope(), CVC3::Clause::getTheorem(), IF_DEBUG, CVC3::CommonProofRules::iffMP(), CVC3::int2string(), CVC3::Expr::isNull(), CVC3::Clause::isNull(), CVC3::Expr::isOr(), CVC3::DecisionEngine::popTo(), CVC3::Theorem::printDebug(), CVC3::CommonProofRules::rewriteOr(), CVC3::SearchImplBase::scopeLevel(), CVC3::Clause::size(), CVC3::Literal::toString(), CVC3::TRACE, TRACE_MSG, CVC3::SearchEngineFast::traceConflict(), and CVC3::SearchEngineFast::unitPropagation().
Referenced by CVC3::SearchEngineFast::checkSAT().
void CVC3::SearchEngineFast::assertAssumptions | ( | ) | [private, inherited] |
FIXME: document this.
void SearchEngineFast::enqueueFact | ( | const Theorem & | thm | ) | [private, inherited] |
Queue up a fact to assert to the DPs later.
Definition at line 1031 of file search_fast.cpp.
References CVC3::SearchEngineFast::addLiteralFact(), CVC3::SearchEngineFast::d_factQueue, CVC3::Theorem::getExpr(), CVC3::Theorem::isAbsLiteral(), CVC3::TRACE, and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::bcp(), CVC3::SearchEngineFast::fixConflict(), and CVC3::SearchEngineFast::unitPropagation().
void SearchEngineFast::setInconsistent | ( | const Theorem & | thm | ) | [private, inherited] |
Set the context inconsistent. Takes Theorem(FALSE).
Definition at line 1043 of file search_fast.cpp.
References CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_factQueue, IF_DEBUG, CVC3::TheoryCore::setInconsistent(), and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::addLiteralFact(), CVC3::SearchEngineFast::addNonLiteralFact(), CVC3::SearchEngineFast::bcp(), and CVC3::SearchEngineFast::recordFact().
void SearchEngineFast::commitFacts | ( | ) | [private, inherited] |
Commit all the enqueued facts to the DPs.
Definition at line 1050 of file search_fast.cpp.
References CVC3::TheoryCore::addFact(), CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_factQueue, CVC3::SearchEngineFast::d_useEnqueueFact, CVC3::TheoryCore::enqueueFact(), and CVC3::TRACE.
Referenced by CVC3::SearchEngineFast::bcp(), and CVC3::SearchEngineFast::fixConflict().
void SearchEngineFast::clearFacts | ( | ) | [private, inherited] |
Clear the local fact queue.
Definition at line 1063 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_factQueue, and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::bcp(), and CVC3::SearchEngineFast::checkValidMain().
Theorem CVC3::SearchEngineFast::processConflict | ( | const Literal & | l | ) | [private, inherited] |
Theorem CVC3::SearchEngineFast::processConflict | ( | const Theorem & | thm | ) | [private, inherited] |
bool SearchEngineFast::propagate | ( | const Clause & | c, | |
int | idx, | |||
bool & | wpUpdated | |||
) | [private, inherited] |
Auxiliary function for unit propagation.
Definition at line 816 of file search_fast.cpp.
References CVC3::SearchEngineRules::conflictRule(), CVC3::SearchEngineFast::d_conflictTheorem, CVC3::SearchEngine::d_rules, CVC3::SearchEngineFast::d_unitPropCount, DebugAssert, CVC3::Clause::dir(), CVC3::Literal::getExpr(), CVC3::Clause::getTheorem(), CVC3::Literal::getValue(), CVC3::int2string(), CVC3::Expr::isAbsLiteral(), CVC3::Clause::markSat(), CVC3::Clause::size(), CVC3::Clause::toString(), CVC3::TRACE, TRACE_MSG, CVC3::SearchEngineFast::unitPropagation(), CVC3::Clause::watched(), CVC3::SearchEngineFast::wp(), and CVC3::Clause::wp().
Referenced by CVC3::SearchEngineFast::bcp().
void SearchEngineFast::unitPropagation | ( | const Clause & | c, | |
unsigned | idx | |||
) | [private, inherited] |
Do the unit propagation for the clause.
Definition at line 915 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_literals, CVC3::SearchEngine::d_rules, DebugAssert, CVC3::SearchEngineFast::enqueueFact(), CVC3::Theorem::getExpr(), CVC3::Clause::getTheorem(), CVC3::int2string(), CVC3::Theorem::isAbsLiteral(), CVC3::SearchImplBase::newLiteral(), CVC3::Clause::size(), CVC3::Expr::toString(), CVC3::Clause::toString(), and CVC3::SearchEngineRules::unitProp().
Referenced by CVC3::SearchEngineFast::fixConflict(), and CVC3::SearchEngineFast::propagate().
void SearchEngineFast::analyzeUIPs | ( | const Theorem & | falseThm, | |
int | conflictScope | |||
) | [private, inherited] |
Analyse the conflict, find the UIPs, etc.
Finding UIPs (Unique Implication Pointers)
This is basically the same as finding hammocks of the subset of the implication graph composed of only the nodes from the current scope. A hammock is a portion of the graph which has a single source and/or sink such that removing that single node makes the graph disconnected.
Conceptually, the algorithm maintains four sets of nodes: literals (named lits), gamma, fringe, and pending. Literals are nodes whose expressions will become literals in the conflict clause of the current hammock, and the nodes in gamma are assumptions from which such conflict clause theorem is derived. Nodes in fringe are intermediate nodes which are ready to be "expanded" (see the algorithm description below). The pending nodes are those which are not yet ready to be processed (they later become literal or fringe nodes).
These sets are maintained as vectors, and are updated in such a way that the nodes in the vectors never repeat. The exception is the pending set, for which only a size counter is maintained. A node belongs to the pending set if it has been visited (isFlagged() method), and its fan-out count is non-zero (stored in the cache, getCachedValue()). In other words, pending nodes are those that have been visited, but not sufficient number of times.
Also, fringe is maintained as a pair of vectors. One vector is always the current fringe, and the other one is built when the current is processed. When processing of the current fringe is finished, it is cleared, and the other vector becomes the current fringe (that is, they swap roles).
A node is expanded if it is marked for expansion (getExpandFlag()). If its fan-out count is not yet zero, it is added to the set of pending nodes.
If a node has a literal flag (getLitFlag()), it goes into literals when its fan-out count reaches zero. Since this will be the last time the node is visited, it is added to the vector only once.
A node neither marked for expansion nor with the literal flag goes into the gamma set. It is added the first time the node is visited (isFlagged() returns false), and therefore, is added to the vector only once. This is an important distinction from the other sets, since a gamma-node may be used by several conflict clauses.
Clearing the gamma set after each UIP requires both clearing the vector and resetting all flags (clearAllFlags()).
The algorithm
The important exception: if the only element in the fringe is marked for expansion, then this is a false UIP (the SAT solver doesn't know about this node), and it should not appear in the conflict clause. In this case, simply proceed to step 3 as if nothing happened.
Definition at line 1266 of file search_fast.cpp.
References CVC3::Assumptions::begin(), CVC3::Theorem::clearAllFlags(), CVC3::SearchEngineRules::conflictClause(), CVC3::SearchImplBase::d_bottomScope, CVC3::SearchEngineFast::d_conflictClauseCount, CVC3::SearchEngineFast::d_conflictClauses, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_lastConflictClause, CVC3::SearchEngineFast::d_lastConflictScope, CVC3::SearchEngine::d_rules, CVC3::SearchEngineFast::d_unitConflictClauses, CVC3::SearchImplBase::d_vm, DebugAssert, CVC3::Assumptions::end(), std::endl(), CVC3::Theorem::getAssumptionsRef(), CVC3::Theorem::getExpr(), CVC3::Clause::getScope(), IF_DEBUG, CVC3::int2string(), CVC3::Clause::isNull(), CVC3::Theorem::printDebug(), processNode(), CVC3::Clause::size(), CVC3::TRACE, TRACE_MSG, CVC3::SearchEngineFast::updateLitCounts(), CVC3::Clause::watched(), CVC3::SearchEngineFast::wp(), and CVC3::Clause::wp().
Referenced by CVC3::SearchEngineFast::traceConflict().
void SearchEngineFast::addNewClause | ( | Clause & | c | ) | [private, inherited] |
Go through all the clauses and check the watch pointers (for debugging).
Set up the watch pointers for the new clause
Definition at line 1069 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_clauses, DebugAssert, CVC3::CDList< T >::push_back(), CVC3::Clause::size(), CVC3::SearchEngineFast::updateLitCounts(), CVC3::Clause::watched(), CVC3::SearchEngineFast::wp(), and CVC3::Clause::wp().
Referenced by CVC3::SearchEngineFast::addNonLiteralFact().
void SearchEngineFast::recordFact | ( | const Theorem & | thm | ) | [private, inherited] |
Process a new derived fact (auxiliary function).
Definition at line 549 of file search_fast.cpp.
References CVC3::CommonProofRules::contradictionRule(), CVC3::SearchEngine::d_commonRules, CVC3::SearchEngineFast::d_unreportedLits, CVC3::Literal::deriveTheorem(), CVC3::Literal::getExpr(), CVC3::Theorem::getExpr(), CVC3::Literal::getScope(), CVC3::Theorem::getScope(), CVC3::Literal::getValue(), IF_DEBUG, CVC3::CDMap< Key, Data, HashFcn >::insert(), CVC3::Literal::isNegative(), CVC3::SearchImplBase::newLiteral(), CVC3::SearchEngineFast::setInconsistent(), and CVC3::Literal::setValue().
Referenced by CVC3::Circuit::propagate().
void SearchEngineFast::traceConflict | ( | const Theorem & | conflictThm | ) | [private, inherited] |
First pass in conflict analysis; takes a theorem of FALSE.
The purpose of this method is to mark up the assumption graph of the FALSE Theorem (conflictThm) for the later UIP analysis. The required flags for each assumption in the graph are:
ExpandFlag: whether to "expand" the node or not; that is, whether to consider the current node as a final assumption (either as a conflict clause literal, or a context assumption from )
LitFlag: the node (actually, its inverse) is a literal of the conflict clause
CachedValue: the "fanout" count, how many nodes in the assumption graph are derived from the current node.
INVARIANTS (after the method returns):
ASSUMPTIONS:
Algorithm:
First, backtrack to the scope level of the conflict. Then, traverse the implication graph until we either hit a literal known to the SAT solver at a lower scope: newLiteral(e).getScope()<scopeLevel(), or a splitter (assumption), or a fact from the bottom scope. The literals from the first two categories are marked with LitFlag (they'll comprise the conflict clause), and the bottom scope facts will be the assumptions in the conflict clause's theorem.
The traversed nodes are cached by the .isFlagged() flag, and subsequent hits only increase the fanout count of the node.
Notice, that there can only be one literal in the conflict clause from the current scope. Also, even if some intermediate literals were delayed by the DPs and reported to the SAT solver at or below the conflict scope (which may be below their "true" Theorem scope), they will be skipped, and their assumptions will be used.
In other words, it is safe to backtrack to the "true" conflict level, since, in the worst case, we traverse the graph all the way to the splitters, and make a conflict clause out of those. The hope is, however, that this wouldn't happen too often.
Definition at line 1837 of file search_fast.cpp.
References CVC3::SearchEngineFast::analyzeUIPs(), CVC3::Assumptions::begin(), CVC3::Theorem::clearAllFlags(), CVC3::SearchImplBase::d_bottomScope, CVC3::SearchEngineFast::d_decisionEngine, CVC3::SearchEngineFast::d_lastConflictScope, DebugAssert, CVC3::Assumptions::end(), std::endl(), CVC3::Theorem::getAssumptionsRef(), CVC3::Theorem::getExpr(), CVC3::Literal::getScope(), CVC3::Theorem::getScope(), CVC3::Literal::getValue(), IF_DEBUG, CVC3::int2string(), CVC3::SearchImplBase::newLiteral(), CVC3::DecisionEngine::popTo(), CVC3::Theorem::printDebug(), CVC3::SearchImplBase::scopeLevel(), CVC3::Theorem::setCachedValue(), CVC3::Theorem::setExpandFlag(), CVC3::Clause::size(), CVC3::TRACE, and TRACE_MSG.
Referenced by CVC3::SearchEngineFast::fixConflict().
QueryResult SearchEngineFast::checkValidMain | ( | const Expr & | e2 | ) | [private, inherited] |
Private helper function for checkValid and restart.
Definition at line 1624 of file search_fast.cpp.
References CVC3::CDMap< Key, Data, HashFcn >::begin(), CVC3::SearchEngineFast::checkSAT(), CVC3::ExprHashMap< Data >::clear(), CVC3::SearchEngineFast::clearFacts(), CVC3::SearchEngineFast::clearLiterals(), CVC3::SearchImplBase::d_assumptions, CVC3::SearchImplBase::d_bottomScope, CVC3::SearchEngineFast::d_clauses, CVC3::SearchEngineFast::d_clausesQueryEnd, CVC3::SearchEngineFast::d_clausesQueryStart, CVC3::SearchEngine::d_commonRules, CVC3::SearchEngineFast::d_conflictTheorem, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_factQueue, CVC3::SearchImplBase::d_lastCounterExample, CVC3::SearchImplBase::d_lastValid, CVC3::SearchEngineFast::d_literals, CVC3::SearchEngineFast::d_literalSet, CVC3::SearchEngineFast::d_litsMaxScorePos, CVC3::SearchEngineFast::d_nonLiterals, CVC3::SearchEngineFast::d_nonlitQueryEnd, CVC3::SearchEngineFast::d_nonlitQueryStart, CVC3::SearchEngineFast::d_simplifiedThm, CVC3::SearchEngineFast::d_unitConflictClauses, DebugAssert, CVC3::CDMap< Key, Data, HashFcn >::end(), CVC3::TheoryCore::getCM(), CVC3::Theorem::getExpr(), CVC3::Theorem::getLeafAssumptions(), IF_DEBUG, CVC3::CommonProofRules::iffContrapositive(), CVC3::CommonProofRules::iffMP(), CVC3::Expr::isTrue(), CVC3::ContextManager::pop(), CVC3::ContextManager::popto(), CVC3::SearchImplBase::processResult(), CVC3::SATISFIABLE, CVC3::SearchImplBase::simplify(), CVC3::CommonProofRules::symmetryRule(), CVC3::TRACE, TRACE_MSG, and CVC3::UNSATISFIABLE.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), and CVC3::SearchEngineFast::restartInternal().
SearchEngineFast::SearchEngineFast | ( | TheoryCore * | core | ) | [inherited] |
The main Constructor.
Constructor.
Definition at line 72 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_clauses, CVC3::SearchEngineFast::d_conflictClauses, CVC3::SearchEngineFast::d_conflictClauseStack, CVC3::SearchEngineFast::d_decisionEngine, CVC3::SearchEngineFast::d_nonLiterals, and IF_DEBUG.
SearchEngineFast::~SearchEngineFast | ( | ) | [virtual, inherited] |
Destructor.
We own the proof rules (d_rules) and the variable manager (d_vm); delete them.
Definition at line 118 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_circuits, CVC3::SearchEngineFast::d_conflictClauseStack, and CVC3::SearchEngineFast::d_decisionEngine.
const std::string& CVC3::SearchEngineFast::getName | ( | ) | [inline, virtual, inherited] |
Name of this search engine.
Implements CVC3::SearchEngine.
Definition at line 390 of file search_fast.h.
References CVC3::SearchEngineFast::d_name.
QueryResult SearchEngineFast::checkValidInternal | ( | const Expr & | e | ) | [virtual, inherited] |
Implementation of the API call.
Implements CVC3::SearchImplBase.
Definition at line 1697 of file search_fast.cpp.
References CVC3::SearchEngineFast::checkValidMain(), CVC3::CDMap< Key, Data, HashFcn >::count(), CVC3::SearchImplBase::d_assumptions, CVC3::SearchImplBase::d_bottomScope, CVC3::SearchEngineFast::d_clauses, CVC3::SearchEngineFast::d_clausesQueryEnd, CVC3::SearchEngineFast::d_clausesQueryStart, CVC3::SearchEngineFast::d_conflictClauseManager, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_factQueue, CVC3::SearchEngineFast::d_nonLiterals, CVC3::SearchEngineFast::d_nonlitQueryEnd, CVC3::SearchEngineFast::d_nonlitQueryStart, CVC3::SearchEngineFast::d_simplifiedThm, CVC3::SearchEngineFast::d_splitterCount, CVC3::SearchEngineFast::d_unitConflictClauses, DebugAssert, CVC3::CDO< T >::get(), CVC3::TheoryCore::getCM(), CVC3::TheoryCore::getExprTrans(), CVC3::Theorem::getRHS(), CVC3::Expr::getType(), CVC3::Type::isBool(), CVC3::Expr::negate(), CVC3::SearchImplBase::newUserAssumption(), CVC3::ExprTransform::preprocess(), CVC3::ContextManager::push(), CVC3::SearchImplBase::scopeLevel(), CVC3::SearchEngineFast::SearchEngineFast::ConflictClauseManager::setRestorePoint(), CVC3::CDList< T >::size(), CVC3::Type::toString(), CVC3::Expr::toString(), CVC3::TRACE, and TRACE_MSG.
QueryResult SearchEngineFast::restartInternal | ( | const Expr & | e | ) | [virtual, inherited] |
Reruns last check with e as an additional assumption.
Implements CVC3::SearchImplBase.
Definition at line 1750 of file search_fast.cpp.
References CVC3::TheoryCore::addFact(), CVC3::SearchEngineFast::checkValidMain(), CVC3::CDMap< Key, Data, HashFcn >::count(), CVC3::SearchImplBase::d_assumptions, CVC3::SearchImplBase::d_bottomScope, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_factQueue, CVC3::SearchEngineFast::d_simplifiedThm, CVC3::SearchEngineFast::d_unitConflictClauses, DebugAssert, CVC3::CDO< T >::get(), CVC3::TheoryCore::getCM(), CVC3::Theorem::getRHS(), CVC3::Expr::getType(), CVC3::Type::isBool(), CVC3::Expr::negate(), CVC3::SearchImplBase::newUserAssumption(), CVC3::ContextManager::popto(), CVC3::Type::toString(), CVC3::Expr::toString(), CVC3::TRACE, and TRACE_MSG.
void SearchEngineFast::getCounterExample | ( | std::vector< Expr > & | assertions | ) | [virtual, inherited] |
Redefine the counterexample generation.
FIXME: for now, it just dumps all the assumptions (same as getAssumptions()). Eventually, it will simplify the related formulas to TRUE, merge all the generated assumptions into d_lastCounterExample, and call the parent's method.
Definition at line 1424 of file search_fast.cpp.
References CVC3::SearchImplBase::getAssumptions().
void SearchEngineFast::addLiteralFact | ( | const Theorem & | thm | ) | [virtual, inherited] |
Notify the search engine about a new literal fact.
It should be called by TheoryCore::assertFactCore()
Implements CVC3::SearchImplBase.
Definition at line 1530 of file search_fast.cpp.
References CVC3::SearchEngineFast::bcp(), CVC3::CommonProofRules::contradictionRule(), CVC3::SearchEngine::d_commonRules, CVC3::SearchEngineFast::d_inCheckSAT, CVC3::SearchEngineFast::d_literals, CVC3::SearchEngineFast::d_literalSet, CVC3::SearchEngineFast::d_useEnqueueFact, DebugAssert, CVC3::Theorem::getExpr(), CVC3::CDMap< Key, Data, HashFcn >::insert(), CVC3::Theorem::isAbsLiteral(), CVC3::SearchImplBase::newLiteral(), CVC3::SearchImplBase::scopeLevel(), CVC3::SearchEngineFast::setInconsistent(), CVC3::Theorem::toString(), and CVC3::TRACE.
Referenced by CVC3::SearchEngineFast::enqueueFact(), and CVC3::SearchEngineFast::split().
void SearchEngineFast::addNonLiteralFact | ( | const Theorem & | thm | ) | [virtual, inherited] |
Notify the search engine about a new non-literal fact.
It should be called by TheoryCore::assertFactCore().
If the fact is an AND, we split it into individual conjuncts and add them individually.
If the fact is an OR, we check whether it's a CNF clause; that is, whether all disjuncts are literals. If they are, we add it as a CNF clause.
Otherwise add the fact to d_nonLiterals as it is.
Implements CVC3::SearchImplBase.
Definition at line 1445 of file search_fast.cpp.
References CVC3::SearchEngineFast::addNewClause(), CVC3::AND_R, CVC3::CommonProofRules::andElim(), CVC3::SearchEngineFast::Circuit, CVC3::SearchEngineRules::conflictRule(), CVC3::CDMap< Key, Data, HashFcn >::count(), CVC3::SearchEngineFast::d_circuits, CVC3::SearchEngine::d_commonRules, CVC3::SearchEngine::d_core, CVC3::SearchEngineFast::d_nonLiterals, CVC3::SearchEngineFast::d_nonLiteralsSaved, CVC3::SearchEngine::d_rules, CVC3::SearchImplBase::d_vm, DebugAssert, CVC3::Literal::deriveTheorem(), CVC3::TheoryCore::enqueueFact(), CVC3::TheoryCore::getCM(), CVC3::ContextManager::getCurrentContext(), CVC3::Theorem::getExpr(), CVC3::Literal::getValue(), IF_DEBUG, CVC3::IFF_R, CVC3::int2string(), CVC3::ITE_R, CVC3::SearchImplBase::newLiteral(), CVC3::CDList< T >::push_back(), CVC3::SearchImplBase::scopeLevel(), CVC3::SearchEngineFast::setInconsistent(), CVC3::CDMap< Key, Data, HashFcn >::size(), CVC3::TRACE, TRACE_MSG, and CVC3::SearchEngineRules::unitProp().
Redefine newIntAssumption(): we need to add the new theorem to the appropriate Literal.
Redefine newIntAssumption(): we need to add the new theorem to the appropriate Literal.
Reimplemented from CVC3::SearchImplBase.
Definition at line 1573 of file search_fast.cpp.
References CVC3::SearchEngineFast::d_literals, CVC3::SearchEngineFast::d_litsAlive, DebugAssert, CVC3::Literal::getExpr(), CVC3::Theorem::getExpr(), CVC3::Literal::getValue(), CVC3::Expr::isAbsLiteral(), CVC3::Theorem::isAssump(), CVC3::SearchImplBase::newIntAssumption(), CVC3::SearchImplBase::newLiteral(), CVC3::CDList< T >::push_back(), CVC3::SearchImplBase::scopeLevel(), CVC3::Literal::setValue(), CVC3::Literal::toString(), CVC3::Theorem::toString(), and CVC3::TRACE.
bool SearchEngineFast::isAssumption | ( | const Expr & | e | ) | [virtual, inherited] |
Check if the formula has been assumed.
Reimplemented from CVC3::SearchImplBase.
Definition at line 1594 of file search_fast.cpp.
References CVC3::CDMap< Key, Data, HashFcn >::count(), CVC3::SearchEngineFast::d_nonLiteralsSaved, and CVC3::SearchImplBase::isAssumption().
void SearchEngineFast::addSplitter | ( | const Expr & | e, | |
int | priority | |||
) | [virtual, inherited] |
Suggest a splitter to the SearchEngine.
The higher is the priority, the sooner the SAT solver will split on it. It can be positive or negative (default is 0).
The set of suggested splitters is backtracking; that is, a splitter is "forgotten" once the scope is backtracked.
This method can be used either to change the priority of existing splitters, or to introduce new splitters that DPs consider relevant, even though they do not appear in existing formulas.
Reimplemented from CVC3::SearchImplBase.
Definition at line 1601 of file search_fast.cpp.
References compareLits(), CVC3::SearchImplBase::d_dpSplitters, CVC3::SearchEngineFast::d_litsByScores, CVC3::SearchEngineFast::d_litSortCount, DebugAssert, CVC3::Expr::isAbsLiteral(), CVC3::SearchImplBase::newLiteral(), CVC3::CDList< T >::push_back(), CVC3::Expr::toString(), and CVC3::TRACE.
std::string CVC3::SearchEngineFast::d_name [private, inherited] |
DecisionEngine* CVC3::SearchEngineFast::d_decisionEngine [private, inherited] |
Decision Engine.
Definition at line 97 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkSAT(), CVC3::SearchEngineFast::findSplitter(), CVC3::SearchEngineFast::fixConflict(), CVC3::SearchEngineFast::SearchEngineFast(), CVC3::SearchEngineFast::split(), CVC3::SearchEngineFast::traceConflict(), and CVC3::SearchEngineFast::~SearchEngineFast().
StatCounter CVC3::SearchEngineFast::d_unitPropCount [private, inherited] |
Total number of unit propagations.
Definition at line 99 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::propagate().
StatCounter CVC3::SearchEngineFast::d_circuitPropCount [private, inherited] |
Total number of circuit propagations.
Definition at line 101 of file search_fast.h.
Referenced by CVC3::Circuit::propagate().
StatCounter CVC3::SearchEngineFast::d_conflictCount [private, inherited] |
Total number of conflicts.
Definition at line 103 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::fixConflict().
StatCounter CVC3::SearchEngineFast::d_conflictClauseCount [private, inherited] |
Total number of conflict clauses generated (not all may be active).
Definition at line 105 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::analyzeUIPs().
CDList<ClauseOwner> CVC3::SearchEngineFast::d_clauses [private, inherited] |
Backtrackable list of clauses.
New clauses may come into play from the decision procedures that are context dependent.
Definition at line 110 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addNewClause(), CVC3::SearchEngineFast::checkValidInternal(), CVC3::SearchEngineFast::checkValidMain(), and CVC3::SearchEngineFast::SearchEngineFast().
CDMap<Expr,Theorem> CVC3::SearchEngineFast::d_unreportedLits [private, inherited] |
Backtrackable set of pending unprocessed literals.
These can be discovered at any scope level during conflict analysis.
Definition at line 115 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::recordFact().
CDMap<Expr,bool> CVC3::SearchEngineFast::d_unreportedLitsHandled [private, inherited] |
Definition at line 116 of file search_fast.h.
CDList<SmartCDO<Theorem> > CVC3::SearchEngineFast::d_nonLiterals [private, inherited] |
Backtrackable list of non-literals (non-CNF formulas).
We treat nonliterals like clauses, because they are a superset of clauses. We stick the real clauses into d_clauses, but all the rest have to be stored elsewhere.
Definition at line 122 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addNonLiteralFact(), CVC3::SearchEngineFast::bcp(), CVC3::SearchEngineFast::checkValidInternal(), CVC3::SearchEngineFast::checkValidMain(), CVC3::SearchEngineFast::findSplitter(), and CVC3::SearchEngineFast::SearchEngineFast().
CDMap<Expr,Theorem> CVC3::SearchEngineFast::d_nonLiteralsSaved [private, inherited] |
prevent reprocessing
Definition at line 123 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addNonLiteralFact(), and CVC3::SearchEngineFast::isAssumption().
CDO<Theorem> CVC3::SearchEngineFast::d_simplifiedThm [private, inherited] |
Theorem which records simplification of the last query.
Definition at line 127 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), CVC3::SearchEngineFast::checkValidMain(), and CVC3::SearchEngineFast::restartInternal().
CDO<unsigned> CVC3::SearchEngineFast::d_nonlitQueryStart [private, inherited] |
Size of d_nonLiterals before most recent query.
Definition at line 130 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), and CVC3::SearchEngineFast::checkValidMain().
CDO<unsigned> CVC3::SearchEngineFast::d_nonlitQueryEnd [private, inherited] |
Size of d_nonLiterals after query (not including DP-generated non-literals).
Definition at line 132 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), and CVC3::SearchEngineFast::checkValidMain().
CDO<unsigned> CVC3::SearchEngineFast::d_clausesQueryStart [private, inherited] |
Size of d_clauses before most recent query.
Definition at line 134 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), and CVC3::SearchEngineFast::checkValidMain().
CDO<unsigned> CVC3::SearchEngineFast::d_clausesQueryEnd [private, inherited] |
Size of d_clauses after query.
Definition at line 136 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), and CVC3::SearchEngineFast::checkValidMain().
std::vector<std::deque<ClauseOwner>* > CVC3::SearchEngineFast::d_conflictClauseStack [private, inherited] |
Array of conflict clauses: one deque for each outstanding query.
Definition at line 139 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::SearchEngineFast::ConflictClauseManager::notify(), CVC3::SearchEngineFast::SearchEngineFast(), CVC3::SearchEngineFast::SearchEngineFast::ConflictClauseManager::setRestorePoint(), and CVC3::SearchEngineFast::~SearchEngineFast().
std::deque<ClauseOwner>* CVC3::SearchEngineFast::d_conflictClauses [private, inherited] |
Reference to top deque of conflict clauses.
Definition at line 141 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::analyzeUIPs(), CVC3::SearchEngineFast::findSplitter(), CVC3::SearchEngineFast::SearchEngineFast::ConflictClauseManager::notify(), CVC3::SearchEngineFast::SearchEngineFast(), and CVC3::SearchEngineFast::SearchEngineFast::ConflictClauseManager::setRestorePoint().
ConflictClauseManager CVC3::SearchEngineFast::d_conflictClauseManager [private, inherited] |
Definition at line 159 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal().
std::vector<Clause> CVC3::SearchEngineFast::d_unitConflictClauses [private, inherited] |
Unprocessed unit conflict clauses.
When we find unit conflict clauses, we are automatically going to jump back to the original scope. Hopefully we won't find multiple ones, but you never know with those wacky decision procedures just spitting new information out. These are then directly asserted then promptly forgotten about. Chaff keeps them around (for correctness maybe), but we already have the proofs stored in the literals themselves.
Definition at line 169 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::analyzeUIPs(), CVC3::SearchEngineFast::checkValidInternal(), CVC3::SearchEngineFast::checkValidMain(), CVC3::SearchEngineFast::fixConflict(), and CVC3::SearchEngineFast::restartInternal().
std::vector<Literal> CVC3::SearchEngineFast::d_literals [private, inherited] |
Set of literals to be processed by bcp.
These are emptied out upon backtracking, because they can only be valid if they were already all processed without conflicts. Therefore, they don't need to be context dependent.
Definition at line 176 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addLiteralFact(), CVC3::SearchEngineFast::bcp(), CVC3::SearchEngineFast::checkValidMain(), CVC3::SearchEngineFast::clearLiterals(), CVC3::SearchEngineFast::newIntAssumption(), CVC3::Circuit::propagate(), CVC3::SearchEngineFast::split(), and CVC3::SearchEngineFast::unitPropagation().
CDMap<Expr,Literal> CVC3::SearchEngineFast::d_literalSet [private, inherited] |
Set of asserted literals which may survive accross checkValid() calls.
When a literal is asserted outside of checkValid() call, its value is remembered in a Literal database, but the literal queue for BCP is cleared. We add literals to this set at the proper scope levels, and propagate them at the beginning of a checkValid() call.
Definition at line 185 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addLiteralFact(), and CVC3::SearchEngineFast::checkValidMain().
std::vector<Theorem> CVC3::SearchEngineFast::d_factQueue [private, inherited] |
Queue of derived facts to be sent to DPs.
Definition at line 189 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::bcp(), CVC3::SearchEngineFast::checkSAT(), CVC3::SearchEngineFast::checkValidInternal(), CVC3::SearchEngineFast::checkValidMain(), CVC3::SearchEngineFast::clearFacts(), CVC3::SearchEngineFast::commitFacts(), CVC3::SearchEngineFast::enqueueFact(), CVC3::SearchEngineFast::restartInternal(), and CVC3::SearchEngineFast::setInconsistent().
bool CVC3::SearchEngineFast::d_useEnqueueFact [private, inherited] |
When true, use TheoryCore::enqueueFact() instead of addFact() in commitFacts().
Definition at line 193 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addLiteralFact(), and CVC3::SearchEngineFast::commitFacts().
bool CVC3::SearchEngineFast::d_inCheckSAT [private, inherited] |
True when checkSAT() is running.
Used by addLiteralFact() to determine whether to BCP the literals immediately (outside of checkSAT()) or not.
Definition at line 198 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addLiteralFact(), and CVC3::SearchEngineFast::checkSAT().
CDList<Literal> CVC3::SearchEngineFast::d_litsAlive [private, inherited] |
Set of alive literals that shouldn't be garbage-collected.
Unfortunately, I have a keep-alive issue. I think literals actually have to hang around, so I assert them to a separate d_litsAlive CDList.
Definition at line 205 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::bcp(), and CVC3::SearchEngineFast::newIntAssumption().
std::vector<Circuit*> CVC3::SearchEngineFast::d_circuits [private, inherited] |
Mappings of literals to vectors of pointers to the corresponding watched literals.
A pointer is a pair (clause,i), where 'i' in {0,1} is the index of the watch pointer in the clause.
Definition at line 214 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addNonLiteralFact(), and CVC3::SearchEngineFast::~SearchEngineFast().
ExprHashMap<std::vector<Circuit*> > CVC3::SearchEngineFast::d_circuitsByExpr [private, inherited] |
Definition at line 215 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::bcp(), and CVC3::Circuit::Circuit().
int CVC3::SearchEngineFast::d_lastConflictScope [private, inherited] |
The scope of the last conflict.
This is the true scope of the conflict, not necessarily the scope where the conflict was detected.
Definition at line 220 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::analyzeUIPs(), CVC3::SearchEngineFast::fixConflict(), and CVC3::SearchEngineFast::traceConflict().
Clause CVC3::SearchEngineFast::d_lastConflictClause [private, inherited] |
The last conflict clause (for checkSAT()). May be Null.
It records which conflict clause must be processed by BCP after backtracking from a conflict. A conflict may generate several conflict clauses, but only one of them will cause a unit propagation.
Definition at line 227 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::analyzeUIPs(), and CVC3::SearchEngineFast::fixConflict().
Theorem CVC3::SearchEngineFast::d_conflictTheorem [private, inherited] |
Theorem(FALSE) which generated a conflict.
Definition at line 229 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::bcp(), CVC3::SearchEngineFast::checkValidMain(), CVC3::SearchEngineFast::fixConflict(), CVC3::SearchEngineFast::propagate(), and CVC3::Circuit::propagate().
unsigned CVC3::SearchEngineFast::d_litsMaxScorePos [private, inherited] |
Position of a literal with max score in d_litsByScores.
Definition at line 258 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidMain(), CVC3::SearchEngineFast::findSplitter(), and CVC3::SearchEngineFast::fixConflict().
std::vector<Literal> CVC3::SearchEngineFast::d_litsByScores [private, inherited] |
Vector of literals sorted by score.
Definition at line 260 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addSplitter(), CVC3::SearchEngineFast::findSplitter(), and CVC3::SearchEngineFast::updateLitCounts().
int CVC3::SearchEngineFast::d_splitterCount [private, inherited] |
Internal splitter counter for delaying updateLitScores().
Definition at line 270 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::checkValidInternal(), CVC3::SearchEngineFast::findSplitter(), and CVC3::SearchEngineFast::split().
int CVC3::SearchEngineFast::d_litSortCount [private, inherited] |
Internal (decrementing) count of added splitters, to sort d_litByScores.
Definition at line 272 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::addSplitter(), and CVC3::SearchEngineFast::updateLitCounts().
const bool CVC3::SearchEngineFast::d_berkminFlag [private, inherited] |
Flag to switch on/off the berkmin heuristic.
Definition at line 275 of file search_fast.h.
Referenced by CVC3::SearchEngineFast::findSplitter().
friend class ConflictClauseManager [friend, inherited] |
Helper class for managing conflict clauses.
Conflict clauses should only get popped when the context in which a call to checkValid originates is popped. This helper class checks every time there's a pop to see if the conflict clauses need to be restored.
Definition at line 149 of file search_fast.h.