#include <search_impl_base.h>
Inheritance diagram for CVCL::SearchImplBase:
Definition at line 52 of file search_impl_base.h.
|
Constructor.
Definition at line 102 of file search_impl_base.cpp. References d_assumptions, d_coreSatAPI_implBase, CVCL::SearchEngine::d_rules, d_vm, CVCL::TheoryCore::getCM(), CVCL::TheoryCore::getFlags(), IF_DEBUG(), and CVCL::TheoryCore::registerCoreSatAPI(). |
|
Destructor.
Definition at line 127 of file search_impl_base.cpp. References d_coreSatAPI_implBase, and d_vm. |
|
Construct a Literal out of an Expr or return an existing one.
Definition at line 135 of file search_impl_base.h. References d_vm. Referenced by CVCL::SearchEngineFast::addLiteralFact(), CVCL::SearchEngineFast::addNonLiteralFact(), addSplitter(), CVCL::SearchEngineFast::addSplitter(), CVCL::SearchEngineFast::newIntAssumption(), CVCL::Circuit::propagate(), CVCL::SearchEngineFast::recordFact(), CVCL::SearchEngineFast::split(), CVCL::SearchEngineFast::traceConflict(), and CVCL::SearchEngineFast::unitPropagation(). |
|
Our version of simplifier: take Theorem(e), apply simplifier to get Theorem(e==e'), return Theorem(e').
Definition at line 139 of file search_impl_base.h. References CVCL::SearchEngine::d_core, CVCL::Theorem::getExpr(), CVCL::Theory::iffMP(), and CVCL::TheoryCore::simplify(). Referenced by CVCL::SearchEngineFast::bcp(), CVCL::SearchEngineFast::checkValidMain(), and CVCL::SearchSimple::checkValidRec(). |
|
Notify the search engine about a new literal fact. It should be called by SearchEngine::addFact() only. Must be implemented by the subclasses of SearchEngine. IMPORTANT: do not call addFact() from this function; use enqueueFact() or setInconsistent() instead. Implemented in CVCL::SearchEngineFast, and CVCL::SearchSimple. Referenced by addCNFFact(), and CVCL::DecisionEngine::pushDecision(). |
|
Notify the search engine about a new non-literal fact. It should be called by SearchEngine::addFact() only. Must be implemented by the subclasses of SearchEngine. IMPORTANT: do not call addFact() from this function; use enqueueFact() or setInconsistent() instead. Implemented in CVCL::SearchEngineFast, and CVCL::SearchSimple. Referenced by addCNFFact(). |
|
Add a new fact to the search engine bypassing CNF converter. Calls either addLiteralFact() or addNonLiteralFact() appropriately, and converts to CNF when d_cnfOption is set. If fromCore==true, this fact already comes from the core, and doesn't need to be reported back to the core. Definition at line 212 of file search_impl_base.cpp. References addLiteralFact(), addNonLiteralFact(), CVCL::SearchEngine::d_core, CVCL::TheoryCore::enqueueFact(), CVCL::Theorem::getExpr(), CVCL::Theorem::isAbsLiteral(), and CVCL::TRACE. Referenced by addFact(), applyCNFRules(), enqueueCNF(), and enqueueCNFrec(). |
|
Definition at line 168 of file search_impl_base.h. References d_bottomScope. Referenced by CVCL::CoreSatAPI_implBase::getBottomScope(). |
|
Check if e is a clause (a literal, or a disjunction of literals).
Definition at line 677 of file search_impl_base.cpp. References CVCL::Expr::begin(), CVCL::Expr::end(), CVCL::Expr::isAbsLiteral(), and CVCL::Expr::isOr(). |
|
Check if e is a propositional clause.
Definition at line 689 of file search_impl_base.cpp. References CVCL::Expr::begin(), CVCL::Expr::end(), CVCL::Expr::isOr(), and CVCL::Expr::isPropLiteral(). |
|
Check whether e is a fresh variable introduced by the CNF converter. Search engines do not need to split on those variables in order to be complete Definition at line 180 of file search_impl_base.h. References CVCL::CDMap< Key, Data, HashFcn >::count(), and d_cnfVars. Referenced by isGoodSplitter(). |
|
Check if a splitter is required for completeness. Currently, it checks that 'e' is not an auxiliary CNF variable Definition at line 701 of file search_impl_base.cpp. References d_ignoreCnfVarsOption, isCNFVar(), CVCL::Expr::isNot(), and CVCL::TRACE. Referenced by CVCL::SearchEngineFast::findSplitter(), and CVCL::DecisionEngine::findSplitterRec(). |
|
Translate theta to CNF and enqueue the new clauses.
Definition at line 350 of file search_impl_base.cpp. References addCNFFact(), enqueueCNFrec(), and CVCL::TRACE. Referenced by addFact(). |
|
|
|
Cache a theorem phi <=> v by phi, where v is a literal.
Definition at line 713 of file search_impl_base.cpp. References CVCL::CDMap< Key, Data, HashFcn >::count(), CVCL::Statistics::counter(), d_bottomScope, d_cnfCache, d_cnfVars, CVCL::SearchEngine::d_commonRules, CVCL::SearchEngine::d_core, CVCL::Theorem::getExpr(), CVCL::Theorem::getLHS(), CVCL::Theorem::getRHS(), CVCL::TheoryCore::getStatistics(), CVCL::CommonProofRules::iffContrapositive(), CVCL::CDMap< Key, Data, HashFcn >::insert(), CVCL::Expr::isNot(), CVCL::Theorem::isRewrite(), CVCL::Expr::toString(), and CVCL::TRACE. Referenced by applyCNFRules(), enqueueCNFrec(), and replaceITE(). |
|
Find a theorem phi <=> v by phi, where v is a literal.
Definition at line 740 of file search_impl_base.cpp. References CVCL::Statistics::counter(), d_cnfCache, CVCL::SearchEngine::d_commonRules, CVCL::SearchEngine::d_core, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Theorem::getExpr(), CVCL::Theorem::getLHS(), CVCL::TheoryCore::getStatistics(), CVCL::CommonProofRules::iffContrapositive(), CVCL::int2string(), CVCL::Expr::isNot(), CVCL::Theorem::isRewrite(), CVCL::CommonProofRules::rewriteNotNot(), CVCL::Expr::toString(), CVCL::TRACE, and CVCL::CommonProofRules::transitivityRule(). Referenced by applyCNFRules(), enqueueCNFrec(), and replaceITE(). |
|
Replaces ITE subexpressions in e with variables. Strategy: For a given atomic formula phi(ite(c, t1, t2)) which depends on a term ITE, generate an equisatisfiable formula: phi(x) & ite(c, t1=x, t2=x), where x is a new variable. The phi(x) part will be generated by the caller, and our job is to assert the 'ite(c, t1=x, t2=x)', and return a rewrite theorem phi(ite(c, t1, t2)) <=> phi(x). Definition at line 794 of file search_impl_base.cpp. References addToCNFCache(), applyCNFRules(), CVCL::SearchEngine::d_commonRules, CVCL::SearchEngine::d_core, d_replaceITECache, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::CDMap< Key, Data, HashFcn >::find(), findInCNFCache(), CVCL::Theorem::getRHS(), CVCL::CommonProofRules::iffMP(), CVCL::Expr::isAbsLiteral(), CVCL::Theorem::isNull(), CVCL::Expr::isPropLiteral(), CVCL::Theorem::isRewrite(), CVCL::CommonProofRules::reflexivityRule(), CVCL::TheoryCore::rewriteLiteral(), CVCL::TRACE, CVCL::CommonProofRules::transitivityRule(), and CVCL::CommonProofRules::varIntroSkolem(). Referenced by applyCNFRules(), and enqueueCNFrec(). |
|
Return the current scope level (for convenience).
Definition at line 207 of file search_impl_base.h. References CVCL::SearchEngine::d_core, CVCL::TheoryCore::getCM(), and CVCL::ContextManager::scopeLevel(). Referenced by CVCL::SearchEngineFast::addLiteralFact(), CVCL::SearchEngineFast::addNonLiteralFact(), CVCL::SearchEngineFast::bcp(), CVCL::SearchSimple::checkValidInternal(), CVCL::SearchEngineFast::checkValidInternal(), enqueueCNFrec(), CVCL::SearchEngineFast::fixConflict(), CVCL::SearchEngineFast::newIntAssumption(), CVCL::SearchEngineFast::ConflictClauseManager::notify(), CVCL::SearchEngineFast::ConflictClauseManager::setRestorePoint(), and CVCL::SearchEngineFast::traceConflict(). |
|
Register an atomic formula of interest. Registered atoms are tracked by the decision procedures. If one of them is deduced to be true or false, it is added to a list of implied literals. Implied literals can be retrieved with the getImpliedLiteral function Implements CVCL::SearchEngine. Definition at line 215 of file search_impl_base.h. References CVCL::SearchEngine::d_core, and CVCL::TheoryCore::registerAtom(). |
|
Return next literal implied by last assertion. Null Expr if none. Returned literals are either registered atomic formulas or their negation Implements CVCL::SearchEngine. Definition at line 216 of file search_impl_base.h. References CVCL::SearchEngine::d_core, and CVCL::TheoryCore::getImpliedLiteral(). |
|
Checks the validity of a formula in the current context. The method that actually calls the SAT solver (implemented in a subclass). It should maintain d_assumptions (add all asserted splitters to it), and set d_lastValid and d_lastCounterExample appropriately before exiting. Implemented in CVCL::SearchEngineFast, and CVCL::SearchSimple. Referenced by checkValid(). |
|
Similar to checkValid(), only returns Theorem(e) or Null.
Implements CVCL::SearchEngine. Definition at line 336 of file search_impl_base.cpp. References checkValidInternal(), CVCL::CommonProofRules::clearSkolemAxioms(), CVCL::SearchEngine::d_commonRules, and d_lastValid. |
|
Reruns last check with e as an additional assumption.
Implemented in CVCL::SearchEngineFast, and CVCL::SearchSimple. Referenced by restart(). |
|
Reruns last check with e as an additional assumption.
Implements CVCL::SearchEngine. Definition at line 343 of file search_impl_base.cpp. References d_lastValid, and restartInternal(). Referenced by returnFromCheck(). |
|
Returns to context immediately before last call to checkValid. This method should only be called after a query which is invalid. Implements CVCL::SearchEngine. Definition at line 234 of file search_impl_base.h. References CVCL::SearchEngine::d_core, CVCL::Theory::falseExpr(), and restart(). |
|
Returns the result of the most recent valid theorem. Returns Null Theorem if last call was not valid Implements CVCL::SearchEngine. Definition at line 235 of file search_impl_base.h. References d_lastValid. |
|
Generate and add a new assertion to the set of assertions in the current context. This should only be used by class VCL in assertFormula().
Implements CVCL::SearchEngine. Definition at line 136 of file search_impl_base.cpp. References CVCL::TheoryCore::addFact(), CVCL::CommonProofRules::assumpRule(), CVCL::CDMap< Key, Data, HashFcn >::begin(), d_assumptions, CVCL::SearchEngine::d_commonRules, CVCL::SearchEngine::d_core, CVCL::debugger, CVCL::CDMap< Key, Data, HashFcn >::end(), std::endl(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::TheoryCore::getExprTrans(), CVCL::Debug::getOS(), IF_DEBUG(), CVCL::Theorem::isNull(), CVCL::ExprTransform::preprocess(), CVCL::Expr::setUserAssumption(), CVCL::TRACE, and CVCL::Debug::trace(). Referenced by CVCL::SearchSimple::checkValidInternal(), CVCL::SearchEngineFast::checkValidInternal(), CVCL::SearchSimple::restartInternal(), and CVCL::SearchEngineFast::restartInternal(). |
|
Add a new internal asserion.
Reimplemented in CVCL::SearchEngineFast. Definition at line 166 of file search_impl_base.cpp. References CVCL::CommonProofRules::assumpRule(), and CVCL::SearchEngine::d_commonRules. Referenced by CVCL::CoreSatAPI_implBase::addAssumption(), CVCL::SearchEngineFast::newIntAssumption(), and CVCL::DecisionEngine::pushDecision(). |
|
Helper for above function.
Definition at line 173 of file search_impl_base.cpp. References CVCL::CDMap< Key, Data, HashFcn >::count(), d_assumptions, CVCL::Theorem::getExpr(), CVCL::Expr::setIntAssumption(), CVCL::Expr::toString(), and CVCL::TRACE. |
|
Get all assertions made in this and all previous contexts.
Implements CVCL::SearchEngine. |
|
Get assumptions made internally in this and all previous contexts. Internal assumptions are literals assumed by the sat solver.
Implements CVCL::SearchEngine. Definition at line 191 of file search_impl_base.cpp. References d_assumptions, CVCL::CDMap< Key, Data, HashFcn >::orderedBegin(), and CVCL::CDMap< Key, Data, HashFcn >::orderedEnd(). |
|
Get all assumptions made in this and all previous contexts.
Implements CVCL::SearchEngine. Definition at line 199 of file search_impl_base.cpp. References d_assumptions, CVCL::CDMap< Key, Data, HashFcn >::orderedBegin(), and CVCL::CDMap< Key, Data, HashFcn >::orderedEnd(). Referenced by CVCL::SearchEngineFast::getCounterExample(). |
|
Check if the formula has been assumed.
Implements CVCL::SearchEngine. Reimplemented in CVCL::SearchEngineFast. Definition at line 207 of file search_impl_base.cpp. References CVCL::CDMap< Key, Data, HashFcn >::count(), and d_assumptions. Referenced by CVCL::SearchEngineFast::isAssumption(). |
|
Add a new fact to the search engine from the core. It should be called by TheoryCore::assertFactCore(). Definition at line 225 of file search_impl_base.cpp. References addCNFFact(), enqueueCNF(), CVCL::Theorem::getExpr(), and CVCL::TRACE. Referenced by CVCL::CoreSatAPI_implBase::addLemma(). |
|
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 in CVCL::SearchEngineFast. Definition at line 235 of file search_impl_base.cpp. References d_dpSplitters, CVCL::Expr::isAbsLiteral(), newLiteral(), CVCL::CDList< T >::push_back(), and CVCL::Expr::toString(). Referenced by CVCL::CoreSatAPI_implBase::addSplitter(). |
|
Will return the set of assertions which make the queried formula false. This method should only be called after an invalid query It will try to return the simplest possible set of assertions which are sufficient to make the queried expression false.
Implements CVCL::SearchEngine. Referenced by CVCL::SearchEngineFast::getCounterExample(). |
|
Returns the proof term for the last proven query. It should be called only after a checkValid which returns true. In any other case, it returns Null. Implements CVCL::SearchEngine. Definition at line 272 of file search_impl_base.cpp. References CVCL::SearchEngine::d_core, d_lastValid, CVCL::Theorem::getProof(), CVCL::TheoryCore::getTM(), CVCL::Theorem::isNull(), and CVCL::TheoremManager::withProof(). |
|
Returns the set of assumptions used in the proof. It should be a subset of getAssumptions(). It should be called only after a checkValid which returns true. In any other case, it returns Null. Definition at line 287 of file search_impl_base.cpp. References CVCL::SearchEngine::d_core, d_lastValid, CVCL::Theorem::getAssumptions(), CVCL::TheoryCore::getTM(), CVCL::Theorem::isNull(), and CVCL::TheoremManager::withAssumptions(). |
|
Process result of checkValid. Given a proof of FALSE ('res') from an assumption 'e', derive the proof of the inverse of e.
Definition at line 307 of file search_impl_base.cpp. References CVCL::ExprHashMap< Data >::clear(), CVCL::SearchEngine::d_commonRules, d_lastCounterExample, d_lastValid, CVCL::SearchEngine::d_rules, CVCL::SearchEngineRules::eliminateSkolemAxioms(), CVCL::ExprHashMap< Data >::erase(), CVCL::Theorem::getExpr(), CVCL::CommonProofRules::getSkolemAxioms(), CVCL::Expr::isFalse(), CVCL::Expr::isNot(), CVCL::Theorem::isNull(), CVCL::SearchEngineRules::negIntro(), CVCL::SearchEngineRules::proofByContradiction(), and CVCL::Theorem::toString(). Referenced by CVCL::SearchSimple::checkValidMain(), and CVCL::SearchEngineFast::checkValidMain(). |
|
Definition at line 53 of file search_impl_base.h. |
|
Cache for enqueueCNF().
Definition at line 127 of file search_impl_base.h. Referenced by enqueueCNFrec(). |
|
Cache for applyCNFRules().
Definition at line 129 of file search_impl_base.h. Referenced by applyCNFRules(). |
|
Cache for replaceITE().
Definition at line 131 of file search_impl_base.h. Referenced by replaceITE(). |