SAT::DPLLTBasic Class Reference

#include <dpllt_basic.h>

Inheritance diagram for SAT::DPLLTBasic:

Inheritance graph
[legend]
Collaboration diagram for SAT::DPLLTBasic:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Private Member Functions

Private Attributes


Detailed Description

Definition at line 30 of file dpllt_basic.h.


Constructor & Destructor Documentation

DPLLTBasic::DPLLTBasic ( TheoryAPI *  theoryAPI,
Decider *  decider,
CVC3::ContextManager cm,
bool  printStats = false 
)

Definition at line 236 of file dpllt_basic.cpp.

References createManager(), d_assertions, d_cm, d_cnf, and CVC3::ContextManager::getCurrentContext().

DPLLTBasic::~DPLLTBasic (  )  [virtual]

Definition at line 251 of file dpllt_basic.cpp.

References d_assertions, d_assertionsStack, d_cnf, d_cnfStack, d_mng, and d_mngStack.


Member Function Documentation

void DPLLTBasic::createManager (  )  [private]

Definition at line 134 of file dpllt_basic.cpp.

References SatSolver::Create(), d_mng, SatSolver::RegisterAssignmentHook(), SatSolver::RegisterDecisionHook(), SatSolver::RegisterDeductionHook(), SatSolver::RegisterDLevelHook(), SATAssignmentHook(), SATDecisionHook(), SATDeductionHook(), and SATDLevelHook().

Referenced by checkSat(), continueCheck(), DPLLTBasic(), and pop().

void DPLLTBasic::generate_CDB ( CNF_Formula_Impl cnf  )  [private]

Definition at line 144 of file dpllt_basic.cpp.

References SatSolver::AddClause(), SatSolver::AddVariables(), SAT::CNF_Formula_Impl::begin(), SAT::Clause::clear(), cvc2SAT(), d_mng, SAT::CNF_Formula_Impl::end(), SatSolver::NumVariables(), SAT::CNF_Formula_Impl::numVars(), and SAT::CNF_Formula_Impl::simplify().

Referenced by addNewClauses(), checkSat(), and continueCheck().

void DPLLTBasic::handle_result ( SatSolver::SATStatus  outcome  )  [private]

Definition at line 167 of file dpllt_basic.cpp.

References SatSolver::BUDGET_EXCEEDED, d_mng, d_printStats, std::endl(), SatSolver::OUT_OF_MEMORY, SatSolver::PrintStatistics(), SatSolver::SATISFIABLE, and SatSolver::UNSATISFIABLE.

Referenced by checkSat(), and continueCheck().

void DPLLTBasic::verify_solution (  )  [private]

Definition at line 212 of file dpllt_basic.cpp.

References d_mng, DebugAssert, SatSolver::GetClauseLits(), SatSolver::GetFirstClause(), SatSolver::GetNextClause(), SatSolver::GetPhaseFromLit(), SatSolver::GetVarAssignment(), and SatSolver::GetVarFromLit().

Referenced by checkSat(), and continueCheck().

void DPLLTBasic::addNewClause ( const Clause c  ) 

Definition at line 272 of file dpllt_basic.cpp.

References SatSolver::AddClause(), SAT::Clause::begin(), cvc2SAT(), d_mng, DebugAssert, SAT::Clause::end(), SAT::Clause::getMaxVar(), SatSolver::NumVariables(), satSolver(), and SAT::Clause::size().

Referenced by SATAssignmentHook(), SATDecisionHook(), and SATDeductionHook().

void DPLLTBasic::addNewClauses ( CNF_Formula_Impl cnf  ) 

Definition at line 286 of file dpllt_basic.cpp.

References SatSolver::AddClause(), SatSolver::AddVariables(), SAT::CNF_Formula_Impl::begin(), SAT::Clause::clear(), cvc2SAT(), d_mng, SAT::CNF_Formula_Impl::end(), generate_CDB(), SatSolver::NumVariables(), SAT::CNF_Formula_Impl::numVars(), and SAT::CNF_Formula_Impl::simplify().

Referenced by SATDecisionHook(), and SATDeductionHook().

SatSolver::Lit SAT::DPLLTBasic::cvc2SAT ( Lit  l  )  [inline]

Definition at line 62 of file dpllt_basic.h.

References d_mng, SAT::Lit::getVar(), SatSolver::GetVar(), SAT::Lit::isNull(), SAT::Lit::isPositive(), and SatSolver::MakeLit().

Referenced by addNewClause(), addNewClauses(), generate_CDB(), and SATDecisionHook().

Lit SAT::DPLLTBasic::SAT2cvc ( SatSolver::Lit  l  )  [inline]

Definition at line 66 of file dpllt_basic.h.

References d_mng, SatSolver::GetPhaseFromLit(), SatSolver::GetVarFromLit(), SatSolver::GetVarIndex(), and SatSolver::Lit::IsNull().

SatSolver* SAT::DPLLTBasic::satSolver (  )  [inline]

Definition at line 71 of file dpllt_basic.h.

References d_mng.

Referenced by addNewClause(), and SATAssignmentHook().

void DPLLTBasic::push (  )  [virtual]

Set a checkpoint for backtracking.

This should effectively save the current state of the solver. Note that it should also result in a call to TheoryAPI::push.

Implements SAT::DPLLT.

Definition at line 311 of file dpllt_basic.cpp.

References d_assertionsStack, d_mngStack, d_prevAStackSize, d_prevStackSize, d_pushLevel, d_ready, d_readyPrev, and SAT::DPLLT::d_theoryAPI.

void DPLLTBasic::pop (  )  [virtual]

Restore checkpoint.

This should return the state to what it was immediately before the last call to push. In particular, if one or more calls to checkSat, continueCheck, or addAssertion have been made since the last push, these should be undone. Note also that in this case, a single call to DPLLT::pop may result in multiple calls to TheoryAPI::pop.

Implements SAT::DPLLT.

Definition at line 321 of file dpllt_basic.cpp.

References createManager(), d_assertions, d_assertionsStack, d_cnf, d_cnfStack, d_mng, d_mngStack, d_prevAStackSize, d_prevStackSize, d_pushLevel, d_ready, d_readyPrev, SAT::DPLLT::d_theoryAPI, and DebugAssert.

void DPLLTBasic::addAssertion ( const CNF_Formula cnf  )  [virtual]

Add new clauses to the SAT solver.

This is used to add clauses that form a "context" for the next call to checkSat

Implements SAT::DPLLT.

Definition at line 366 of file dpllt_basic.cpp.

References SAT::CNF_Formula::begin(), SAT::DPLLT::d_theoryAPI, and SAT::CNF_Formula::end().

QueryResult DPLLTBasic::checkSat ( const CNF_Formula cnf  )  [virtual]

Check the satisfiability of a set of clauses in the current context.

If the result is SATISFIABLE, UNKNOWN, or ABORT, the DPLLT engine should remain in the state it is in until pop() is called. If the result is UNSATISFIABLE, the DPLLT engine should return to the state it was in when called. Note that it should be possible to call checkSat multiple times, even if the result is true (each additional call should use the context left by the previous call).

Implements SAT::DPLLT.

Definition at line 383 of file dpllt_basic.cpp.

References CVC3::ABORT, SatSolver::BUDGET_EXCEEDED, createManager(), d_assertions, d_assertionsStack, d_cm, d_cnf, d_cnfStack, d_mng, d_mngStack, d_ready, SAT::DPLLT::d_theoryAPI, DebugAssert, generate_CDB(), CVC3::ContextManager::getCurrentContext(), SatSolver::GetVar(), SatSolver::GetVarAssignment(), handle_result(), SAT::CD_CNF_Formula::numClauses(), SatSolver::NumVariables(), SATISFIABLE, SatSolver::SATISFIABLE, SatSolver::Satisfiable(), SAT::DPLLT::theoryAPI(), UNSATISFIABLE, SatSolver::UNSATISFIABLE, and verify_solution().

QueryResult DPLLTBasic::continueCheck ( const CNF_Formula cnf  )  [virtual]

Continue checking the last check with additional constraints.

Should only be called after a previous call to checkSat (or continueCheck) that returned SATISFIABLE. It should add the clauses in cnf to the existing clause database and search for a satisfying assignment. As with checkSat, if the result is not UNSATISFIABLE, the DPLLT engine should remain in the state containing the satisfiable assignment until pop() is called. Similarly, if the result is UNSATISFIABLE, the DPLLT engine should return to the state it was in when checkSat was last called.

Implements SAT::DPLLT.

Definition at line 459 of file dpllt_basic.cpp.

References CVC3::ABORT, SatSolver::BUDGET_EXCEEDED, SatSolver::Continue(), createManager(), d_assertions, d_cnf, d_cnfStack, d_mng, d_mngStack, d_ready, SAT::DPLLT::d_theoryAPI, DebugAssert, generate_CDB(), handle_result(), SAT::CD_CNF_Formula::numClauses(), SATISFIABLE, SatSolver::SATISFIABLE, SAT::DPLLT::theoryAPI(), UNSATISFIABLE, SatSolver::UNSATISFIABLE, and verify_solution().

Var::Val SAT::DPLLTBasic::getValue ( Var  v  )  [inline, virtual]

Get value of variable: unassigned, false, or true.

Implements SAT::DPLLT.

Definition at line 80 of file dpllt_basic.h.

References d_mng, SatSolver::GetVar(), and SatSolver::GetVarAssignment().


Member Data Documentation

CVC3::ContextManager* SAT::DPLLTBasic::d_cm [private]

Definition at line 32 of file dpllt_basic.h.

Referenced by checkSat(), and DPLLTBasic().

bool SAT::DPLLTBasic::d_ready [private]

Definition at line 34 of file dpllt_basic.h.

Referenced by checkSat(), continueCheck(), pop(), and push().

SatSolver* SAT::DPLLTBasic::d_mng [private]

Definition at line 35 of file dpllt_basic.h.

Referenced by addNewClause(), addNewClauses(), checkSat(), continueCheck(), createManager(), cvc2SAT(), generate_CDB(), getValue(), handle_result(), pop(), SAT2cvc(), satSolver(), verify_solution(), and ~DPLLTBasic().

CNF_Formula_Impl* SAT::DPLLTBasic::d_cnf [private]

Definition at line 36 of file dpllt_basic.h.

Referenced by checkSat(), continueCheck(), DPLLTBasic(), pop(), and ~DPLLTBasic().

CD_CNF_Formula* SAT::DPLLTBasic::d_assertions [private]

Definition at line 37 of file dpllt_basic.h.

Referenced by checkSat(), continueCheck(), DPLLTBasic(), pop(), and ~DPLLTBasic().

std::vector<SatSolver*> SAT::DPLLTBasic::d_mngStack [private]

Definition at line 39 of file dpllt_basic.h.

Referenced by checkSat(), continueCheck(), pop(), push(), and ~DPLLTBasic().

std::vector<CNF_Formula_Impl*> SAT::DPLLTBasic::d_cnfStack [private]

Definition at line 40 of file dpllt_basic.h.

Referenced by checkSat(), continueCheck(), pop(), and ~DPLLTBasic().

std::vector<CD_CNF_Formula*> SAT::DPLLTBasic::d_assertionsStack [private]

Definition at line 41 of file dpllt_basic.h.

Referenced by checkSat(), pop(), push(), and ~DPLLTBasic().

bool SAT::DPLLTBasic::d_printStats [private]

Definition at line 42 of file dpllt_basic.h.

Referenced by handle_result().

CVC3::CDO<unsigned> SAT::DPLLTBasic::d_pushLevel [private]

Definition at line 44 of file dpllt_basic.h.

Referenced by pop(), and push().

CVC3::CDO<bool> SAT::DPLLTBasic::d_readyPrev [private]

Definition at line 45 of file dpllt_basic.h.

Referenced by pop(), and push().

CVC3::CDO<unsigned> SAT::DPLLTBasic::d_prevStackSize [private]

Definition at line 46 of file dpllt_basic.h.

Referenced by pop(), and push().

CVC3::CDO<unsigned> SAT::DPLLTBasic::d_prevAStackSize [private]

Definition at line 47 of file dpllt_basic.h.

Referenced by pop(), and push().


The documentation for this class was generated from the following files:
Generated on Tue Jul 3 14:42:30 2007 for CVC3 by  doxygen 1.5.1