CVC3  2.4.1
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
CVC3::Theory Class Reference

Base class for theories. More...

#include <theory.h>

Inheritance diagram for CVC3::Theory:
CVC3::TheoryArith CVC3::TheoryArray CVC3::TheoryBitvector CVC3::TheoryCore CVC3::TheoryDatatype CVC3::TheoryQuant CVC3::TheoryRecords CVC3::TheorySimulate CVC3::TheoryUF

List of all members.

Public Member Functions

Core Framework Functionality

These methods provide convenient access to core functionality for the benefit of decision procedures.

Theory Helper Methods

These methods provide basic functionality needed by all theories.

Core Testers
Common Type and Expr Methods
Commonly Used Proof Rules

Protected Attributes

Private Member Functions

Private Attributes

Friends


Detailed Description

Base class for theories.

Author: Clark Barrett

Created: Thu Jan 30 16:37:56 2003

This is an abstract class which all theories should inherit from. In addition to providing an abstract theory interface, it provides access functions to core functionality. However, in order to avoid duplicating the data structures which implement this functionality, all the functionality is stored in a separate class (which actually derives from this one) called TheoryCore. These two classes work closely together to provide the core functionality.


Constructor & Destructor Documentation

Theory::Theory ( void  ) [private]

Private default constructor.

Everyone besides TheoryCore has to use the public constructor which sets up all the provided functionality automatically.

Definition at line 33 of file theory.cpp.

Theory::Theory ( TheoryCore theoryCore,
const std::string name 
)

Whether theory has been used (for smtlib translator)

Exposed constructor.

Note that each instance of Theory must have a name (mostly for debugging purposes).

Definition at line 36 of file theory.cpp.

Theory::~Theory ( void  ) [virtual]

Destructor.

Definition at line 44 of file theory.cpp.


Member Function Documentation

ExprManager* CVC3::Theory::getEM ( ) [inline]

Access to ExprManager.

Definition at line 90 of file theory.h.

References d_em.

Referenced by CVC3::ArrayTheoremProducer::arrayNotEq(), CVC3::BitvectorTheoremProducer::bitExtractBitwise(), CVC3::BitvectorTheoremProducer::extractBitwise(), CVC3::BitvectorTheoremProducer::processExtract(), CVC3::BitvectorTheoremProducer::bvUDivTheorem(), CVC3::BitvectorTheoremProducer::solveExtractOverlap(), CVC3::ExprTransform::preprocess(), CVC3::ExprTransform::simplifyWithCare(), CVC3::SearchEngine::getConcreteModel(), registerKinds(), unregisterKinds(), theoryOf(), updateCC(), newVar(), newFunction(), lookupFunction(), addBoundVar(), lookupVar(), newTypeExpr(), CVC3::TheoryArith::rat(), CVC3::TheoryArith3::TheoryArith3(), CVC3::TheoryArith3::checkType(), CVC3::TheoryArith3::computeType(), CVC3::TheoryArith3::parseExprOp(), CVC3::TheoryArithNew::TheoryArithNew(), CVC3::TheoryArithNew::checkType(), CVC3::TheoryArithNew::computeType(), CVC3::TheoryArithNew::parseExprOp(), CVC3::TheoryArithOld::TheoryArithOld(), CVC3::TheoryArithOld::checkType(), CVC3::TheoryArithOld::computeType(), CVC3::TheoryArithOld::parseExprOp(), CVC3::TheoryArray::TheoryArray(), CVC3::TheoryArray::update(), CVC3::TheoryArray::checkType(), CVC3::TheoryArray::finiteTypeInfo(), CVC3::TheoryArray::computeType(), CVC3::TheoryArray::computeModel(), CVC3::TheoryArray::parseExprOp(), CVC3::TheoryBitvector::TheoryBitvector(), CVC3::TheoryBitvector::checkType(), CVC3::TheoryBitvector::computeType(), CVC3::TheoryBitvector::parseExprOp(), CVC3::TheoryBitvector::newBitvectorTypeExpr(), CVC3::TheoryBitvector::newBVAndExpr(), CVC3::TheoryBitvector::newBVOrExpr(), CVC3::TheoryBitvector::newBVXorExpr(), CVC3::TheoryBitvector::newBVXnorExpr(), CVC3::TheoryBitvector::newSXExpr(), CVC3::TheoryBitvector::newBVIndexExpr(), CVC3::TheoryBitvector::newBoolExtractExpr(), CVC3::TheoryBitvector::newFixedLeftShiftExpr(), CVC3::TheoryBitvector::newFixedConstWidthLeftShiftExpr(), CVC3::TheoryBitvector::newFixedRightShiftExpr(), CVC3::TheoryBitvector::newConcatExpr(), CVC3::TheoryBitvector::newBVMultExpr(), CVC3::TheoryBitvector::newBVConstExpr(), CVC3::TheoryBitvector::newBVExtractExpr(), CVC3::TheoryBitvector::newBVPlusExpr(), CVC3::TheoryBitvector::rat(), CVC3::TheoryCore::checkType(), CVC3::TheoryCore::finiteTypeInfo(), CVC3::TheoryCore::parseExprOp(), CVC3::TheoryCore::printSmtLibShared(), CVC3::TheoryCore::print(), CVC3::TheoryCore::parseExpr(), CVC3::TheoryCore::collectBasicVars(), CVC3::TheoryCore::collectModelValues(), CVC3::TheoryCore::getAssignment(), CVC3::TheoryCore::CoreNotifyObj::notify(), CVC3::TheoryDatatype::TheoryDatatype(), CVC3::TheoryDatatype::instantiate(), CVC3::TheoryDatatype::update(), CVC3::TheoryDatatype::checkType(), CVC3::TheoryDatatype::print(), CVC3::TheoryDatatype::parseExprOp(), CVC3::TheoryDatatype::dataType(), CVC3::TheoryDatatypeLazy::instantiate(), CVC3::TheoryDatatypeLazy::update(), CVC3::TheoryQuant::TheoryQuant(), CVC3::TheoryQuant::enqueueInst(), CVC3::CompleteInstPreProcessor::pullVarOut(), CVC3::CompleteInstPreProcessor::isMacro(), CVC3::CompleteInstPreProcessor::simplifyEq(), CVC3::CompleteInstPreProcessor::recInstMacros(), CVC3::CompleteInstPreProcessor::recSkolemize(), CVC3::CompleteInstPreProcessor::recRewriteNot(), CVC3::CompleteInstPreProcessor::plusOne(), CVC3::CompleteInstPreProcessor::minusOne(), CVC3::CompleteInstPreProcessor::inst(), CVC3::TheoryQuant::checkSat(), CVC3::TheoryQuant::computeTCC(), CVC3::TheoryQuant::print(), CVC3::TheoryQuant::parseExprOp(), CVC3::TheoryRecords::TheoryRecords(), CVC3::TheoryRecords::checkType(), CVC3::TheoryRecords::computeType(), CVC3::TheoryRecords::recordExpr(), CVC3::TheoryRecords::recordType(), CVC3::TheoryRecords::recordSelect(), CVC3::TheoryRecords::recordUpdate(), CVC3::TheoryRecords::tupleExpr(), CVC3::TheoryRecords::tupleType(), CVC3::TheoryRecords::tupleSelect(), CVC3::TheoryRecords::tupleUpdate(), CVC3::TheorySimulate::parseExprOp(), CVC3::TheorySimulate::computeTCC(), CVC3::TheoryUF::TheoryUF(), CVC3::TheoryUF::checkType(), CVC3::TheoryUF::computeModel(), CVC3::TheoryUF::printSmtLibShared(), CVC3::TheoryUF::print(), CVC3::TheoryUF::parseExprOp(), CVC3::TheoryUF::lambdaExpr(), and CVC3::TheoryUF::transClosureExpr().

TheoryCore* CVC3::Theory::theoryCore ( ) [inline]
CommonProofRules* CVC3::Theory::getCommonRules ( ) [inline]
const std::string& CVC3::Theory::getName ( ) const [inline]

Get the name of the theory (for debugging purposes)

Definition at line 99 of file theory.h.

References d_name.

Referenced by addSplitter(), assignValue(), getTCC(), getModelTerm(), CVC3::operator<<(), CVC3::TheoryCore::refineCounterExample(), CVC3::TheoryCore::buildModel(), and CVC3::TheoryCore::collectModelValues().

virtual void CVC3::Theory::setUsed ( ) [inline, virtual]

Set the "used" flag on this theory (for smtlib translator)

Definition at line 102 of file theory.h.

References d_theoryUsed.

Referenced by CVC3::Translator::processType().

virtual bool CVC3::Theory::theoryUsed ( ) [inline, virtual]

Get whether theory has been used (for smtlib translator)

Definition at line 104 of file theory.h.

References d_theoryUsed.

Referenced by CVC3::Translator::finish().

bool Theory::inconsistent ( ) [virtual]
void Theory::setInconsistent ( const Theorem e) [virtual]
void Theory::setIncomplete ( const std::string reason) [virtual]

Mark the current decision branch as possibly incomplete.

This should be set when a decision procedure uses an incomplete algorithm, and cannot guarantee satisfiability after the final checkSat() call with full effort. An example would be instantiation of universal quantifiers.

A decision procedure can provide a reason for incompleteness, which will be reported back to the user.

Reimplemented in CVC3::TheoryCore.

Definition at line 112 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::setIncomplete().

Referenced by CVC3::TheoryArithOld::assertFact(), CVC3::TheoryQuant::synCheckSat(), and CVC3::TheoryQuant::naiveCheckSat().

Theorem Theory::simplify ( const Expr e) [virtual]
Expr CVC3::Theory::simplifyExpr ( const Expr e) [inline]
void Theory::enqueueFact ( const Theorem e) [virtual]
void Theory::enqueueSE ( const Theorem e) [virtual]

Check if the current context is inconsistent.

Reimplemented in CVC3::TheoryCore.

Definition at line 134 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::enqueueSE().

void Theory::assertEqualities ( const Theorem e) [virtual]

Handle new equalities (usually asserted through addFact)

INVARIANT: the Theorem 'e' is an equality e1==e2, where e2 is i-leaf simplified in the current context, or a conjunction of such equalities.

Reimplemented in CVC3::TheoryCore.

Definition at line 142 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::assertEqualities().

Referenced by CVC3::TheoryArith3::update(), CVC3::TheoryArithNew::update(), CVC3::TheoryArithOld::update(), CVC3::TheoryArray::checkSat(), CVC3::TheoryArray::update(), CVC3::TheoryBitvector::comparebv(), CVC3::TheoryBitvector::update(), CVC3::TheoryRecords::setup(), and CVC3::TheoryRecords::update().

Expr Theory::parseExpr ( const Expr e) [virtual]
void Theory::assignValue ( const Expr t,
const Expr val 
) [virtual]
void Theory::assignValue ( const Theorem thm) [virtual]

Record a derived assignment to a variable (LHS).

Reimplemented in CVC3::TheoryCore.

Definition at line 170 of file theory.cpp.

References TRACE, getName(), d_theoryCore, and CVC3::TheoryCore::assignValue().

void Theory::registerKinds ( Theory theory,
std::vector< int > &  kinds 
)

Register new kinds with the given theory.

Definition at line 177 of file theory.cpp.

References DebugAssert, d_theoryCore, CVC3::TheoryCore::d_theoryMap, Hash::hash_map::count(), getEM(), CVC3::ExprManager::getKindName(), and CVC3::int2string().

Referenced by registerTheory().

void Theory::unregisterKinds ( Theory theory,
std::vector< int > &  kinds 
)

Unregister kinds for a theory.

Definition at line 190 of file theory.cpp.

References DebugAssert, d_theoryCore, CVC3::TheoryCore::d_theoryMap, getEM(), CVC3::int2string(), and Hash::hash_map::erase().

Referenced by unregisterTheory().

void Theory::registerTheory ( Theory theory,
std::vector< int > &  kinds,
bool  hasSolver = false 
)
void Theory::unregisterTheory ( Theory theory,
std::vector< int > &  kinds,
bool  hasSolver 
)
int Theory::getNumTheories ( )

Return the number of registered theories.

Definition at line 241 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::d_theories.

Referenced by CVC3::TheoryCore::refineCounterExample(), and CVC3::TheoryCore::buildModel().

bool Theory::hasTheory ( int  kind)

Test whether a kind maps to any theory.

Definition at line 247 of file theory.cpp.

References d_theoryCore, CVC3::TheoryCore::d_theoryMap, and Hash::hash_map::count().

Referenced by CVC3::TheoryCore::parseExpr().

Theory * Theory::theoryOf ( int  kind)
Theory * Theory::theoryOf ( const Type e)
Theory * Theory::theoryOf ( const Expr e)
Theorem Theory::find ( const Expr e)

Return the theorem that e is equal to its find.

Definition at line 310 of file theory.cpp.

References CVC3::Expr::hasFind(), reflexivityRule(), CVC3::Expr::getFind(), CVC3::Theorem::isRefl(), CVC3::Theorem::getRHS(), DebugAssert, CVC3::Theorem::getLHS(), transitivityRule(), and CVC3::Expr::setFind().

Referenced by findReduce(), computeModel(), findExpr(), CVC3::TheoryArith3::update(), CVC3::TheoryArithNew::update(), CVC3::TheoryArithNew::getLowerBound(), CVC3::TheoryArithNew::getUpperBound(), CVC3::TheoryArithNew::getLowerBoundThm(), CVC3::TheoryArithNew::getUpperBoundThm(), CVC3::TheoryArithNew::getBeta(), CVC3::TheoryArithNew::getVariableIntroThm(), CVC3::TheoryArithNew::substAndCanonizeModTableaux(), CVC3::TheoryArithNew::substAndCanonizeTableaux(), CVC3::TheoryArithNew::propagateTheory(), CVC3::TheoryArithOld::checkSat(), CVC3::TheoryArithOld::update(), CVC3::TheoryArithOld::tryPropagate(), CVC3::TheoryArithOld::computeTermBounds(), CVC3::TheoryArray::checkSat(), CVC3::TheoryArray::update(), CVC3::TheoryBitvector::simplifyPendingEq(), CVC3::TheoryBitvector::generalBitBlast(), CVC3::TheoryBitvector::update(), CVC3::TheoryBitvector::updateSubterms(), CVC3::TheoryCore::rewrite(), CVC3::TheoryCore::update(), CVC3::TheoryCore::computeModelBasic(), CVC3::TheoryCore::assignValue(), CVC3::TheoryCore::collectBasicVars(), CVC3::TheoryCore::buildModel(), CVC3::TheoryCore::assertEqualities(), CVC3::TheoryDatatypeLazy::mergeLabels(), CVC3::TheoryRecords::setup(), CVC3::TheoryRecords::update(), CVC3::TheoryUF::checkSat(), and CVC3::TheoryUF::update().

const Theorem & Theory::findRef ( const Expr e)

Return the find as a reference: expr must have a find.

Definition at line 295 of file theory.cpp.

References DebugAssert, CVC3::Expr::hasFind(), CVC3::Expr::getFind(), CVC3::Theorem::getRHS(), CVC3::Theorem::getLHS(), CVC3::Expr::setFind(), and transitivityRule().

Referenced by updateHelper(), and CVC3::TheoryArray::update().

Theorem Theory::findReduce ( const Expr e)
bool Theory::findReduced ( const Expr e)

Return true iff e is find-reduced.

Definition at line 357 of file theory.cpp.

References CVC3::Expr::hasFind(), CVC3::Expr::getFind(), CVC3::Theorem::getRHS(), CVC3::Expr::begin(), and CVC3::Expr::end().

Referenced by CVC3::TheoryCore::assertEqualities().

Expr CVC3::Theory::findExpr ( const Expr e) [inline]

Return the find of e, or e if it has no find.

Definition at line 503 of file theory.h.

References CVC3::Expr::hasFind(), find(), and CVC3::Theorem::getRHS().

Referenced by CVC3::DecisionEngine::findSplitterRec(), CVC3::TheoryArith3::refineCounterExample(), CVC3::TheoryArith3::findRationalBound(), CVC3::TheoryArith3::assignVariables(), CVC3::TheoryArith3::computeModelBasic(), CVC3::TheoryArith3::computeModel(), CVC3::TheoryArith3::computeModelTerm(), CVC3::TheoryArithNew::refineCounterExample(), CVC3::TheoryArithNew::findRationalBound(), CVC3::TheoryArithNew::assignVariables(), CVC3::TheoryArithNew::computeModelBasic(), CVC3::TheoryArithNew::computeModel(), CVC3::TheoryArithNew::computeModelTerm(), CVC3::TheoryArithNew::propagateTheory(), CVC3::TheoryArithOld::refineCounterExample(), CVC3::TheoryArithOld::findRationalBound(), CVC3::TheoryArithOld::assignVariables(), CVC3::TheoryArithOld::computeModelBasic(), CVC3::TheoryArithOld::computeModel(), CVC3::TheoryArithOld::update(), CVC3::TheoryArithOld::computeModelTerm(), CVC3::TheoryArray::checkSat(), CVC3::TheoryArray::rewrite(), CVC3::TheoryArray::setup(), CVC3::TheoryDatatype::instantiate(), CVC3::TheoryDatatype::initializeLabels(), CVC3::TheoryDatatype::mergeLabels(), CVC3::TheoryDatatype::checkSat(), CVC3::TheoryDatatype::canCollapse(), CVC3::TheoryDatatypeLazy::instantiate(), CVC3::TheoryDatatypeLazy::initializeLabels(), CVC3::TheoryDatatypeLazy::checkSat(), CVC3::TheoryQuant::newTopMatchNoSig(), CVC3::TheoryQuant::newTopMatchSig(), CVC3::TheoryQuant::checkSat(), and CVC3::TheoryUF::update().

Expr Theory::getTCC ( const Expr e)
Type Theory::getBaseType ( const Expr e)

Compute (or look up in cache) the base type of e and return the result.

Definition at line 383 of file theory.cpp.

References CVC3::Expr::getType().

Referenced by CVC3::ArrayTheoremProducer::arrayNotEq(), CVC3::BitvectorTheoremProducer::bitExtractConcatenation(), CVC3::BitvectorTheoremProducer::zeroPaddingRule(), CVC3::BitvectorTheoremProducer::eqToBits(), CVC3::BitvectorTheoremProducer::typePredBit(), theoryOf(), getModelTerm(), newVar(), CVC3::TheoryArith3::refineCounterExample(), CVC3::TheoryArith3::computeType(), CVC3::TheoryArithNew::refineCounterExample(), CVC3::TheoryArithNew::computeType(), CVC3::TheoryArithOld::refineCounterExample(), CVC3::TheoryArithOld::computeType(), CVC3::TheoryArray::assertFact(), CVC3::TheoryArray::rewrite(), CVC3::TheoryArray::computeType(), CVC3::TheoryArray::computeBaseType(), CVC3::TheoryArray::computeModel(), CVC3::TheoryBitvector::computeType(), CVC3::TheoryBitvector::parseExprOp(), CVC3::TheoryCore::solve(), CVC3::TheoryCore::computeType(), CVC3::TheoryCore::computeBaseType(), CVC3::TheoryCore::print(), CVC3::TheoryCore::collectBasicVars(), CVC3::TheoryCore::buildModel(), CVC3::TheoryCore::collectModelValues(), CVC3::TheoryCore::rewriteLiteral(), CVC3::TheoryDatatype::instantiate(), CVC3::TheoryDatatype::mergeLabels(), CVC3::TheoryDatatype::addSharedTerm(), CVC3::TheoryDatatype::assertFact(), CVC3::TheoryDatatype::checkSat(), CVC3::TheoryDatatype::setup(), CVC3::TheoryDatatype::update(), CVC3::TheoryDatatype::computeType(), CVC3::TheoryDatatype::dataType(), CVC3::TheoryDatatype::getConsPos(), CVC3::TheoryDatatype::getConstant(), CVC3::TheoryQuant::canMatch(), CVC3::TheoryQuant::recGoodSemMatch(), CVC3::TheoryQuant::newTopMatchNoSig(), CVC3::TheoryQuant::newTopMatchSig(), CVC3::TheoryQuant::recInstantiate(), CVC3::TheoryQuant::recursiveMap(), CVC3::TheoryQuant::findInstAssumptions(), CVC3::TheoryRecords::assertFact(), CVC3::TheoryRecords::computeModel(), CVC3::TheoryRecords::computeType(), CVC3::TheoryRecords::computeBaseType(), CVC3::TheoryRecords::setup(), CVC3::TheorySimulate::computeType(), CVC3::TheoryUF::computeBaseType(), and CVC3::Translator::finish().

Type Theory::getBaseType ( const Type tp)

Compute the base type from an arbitrary type.

Definition at line 389 of file theory.cpp.

References CVC3::Type::getExpr(), DebugAssert, CVC3::Expr::isNull(), CVC3::Expr::lookupType(), theoryOf(), CVC3::Type::toString(), computeBaseType(), and CVC3::Expr::setType().

Expr Theory::getTypePred ( const Type t,
const Expr e 
)
Theorem Theory::updateHelper ( const Expr e)

Update the children of the term e.

When a decision procedure receives a call to update() because a child of a term 'e' has changed, this method can be called to compute the new value of 'e'.

See also:
update

Definition at line 417 of file theory.cpp.

References CVC3::Expr::arity(), findRef(), CVC3::Theorem::getLHS(), CVC3::Theorem::getRHS(), d_commonRules, CVC3::CommonProofRules::substitutivityRule(), and reflexivityRule().

Referenced by updateCC(), CVC3::TheoryArray::update(), CVC3::TheoryDatatype::update(), CVC3::TheoryDatatypeLazy::update(), CVC3::TheoryRecords::update(), and CVC3::TheoryUF::update().

void Theory::setupCC ( const Expr e)
void Theory::updateCC ( const Theorem e,
const Expr d 
)
Theorem Theory::rewriteCC ( const Expr e)

Rewrite a term w.r.t. congruence closure (must be setup with setupCC())

Definition at line 512 of file theory.cpp.

References CVC3::Expr::getRep(), CVC3::Theorem::isNull(), reflexivityRule(), and symmetryRule().

Referenced by CVC3::TheoryRecords::rewrite(), and CVC3::TheoryUF::rewrite().

void Theory::getModelTerm ( const Expr e,
std::vector< Expr > &  v 
)

Calls the correct theory to get all of the terms that need to be assigned values in the concrete model.

Definition at line 527 of file theory.cpp.

References theoryOf(), getBaseType(), TRACE, getName(), IF_DEBUG, computeModelTerm(), DebugAssert, and CVC3::Expr::toString().

Referenced by CVC3::TheoryCore::collectBasicVars().

Theorem Theory::getModelValue ( const Expr e)

Fetch the concrete assignment to the variable during model generation.

Reimplemented in CVC3::TheoryCore.

Definition at line 541 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::getModelValue().

Referenced by CVC3::TheoryArray::computeModel(), CVC3::TheoryBitvector::computeModel(), CVC3::TheoryRecords::computeModel(), and CVC3::TheoryUF::computeModel().

void Theory::addSplitter ( const Expr e,
int  priority = 0 
)
void Theory::addGlobalLemma ( const Theorem thm,
int  priority = 0 
)

Add a global lemma.

Definition at line 157 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::d_coreSatAPI.

bool CVC3::Theory::isLeaf ( const Expr e) [inline]

Test if e is an i-leaf term for the current theory.

A term 'e' is an i-leaf for a theory 'i', if it is a variable, or 'e' belongs to a different theory. This definition makes sense for a larger term which by itself belongs to the current theory 'i', but (some of) its children are variables or belong to different theories.

Definition at line 556 of file theory.h.

References CVC3::Expr::isVar(), and theoryOf().

Referenced by CVC3::BitvectorTheoremProducer::isolate_var(), CVC3::BitvectorTheoremProducer::processExtract(), CVC3::BitvectorTheoremProducer::okToSplit(), CVC3::BitvectorTheoremProducer::canonBVEQ(), isLeafIn(), leavesAreSimp(), CVC3::TheoryArith3::collectVars(), CVC3::TheoryArith3::rewrite(), CVC3::TheoryArith3::solve(), CVC3::TheoryArith3::checkAssertEqInvariant(), CVC3::TheoryArithNew::collectVars(), CVC3::TheoryArithNew::solve(), CVC3::TheoryArithNew::assertUpper(), CVC3::TheoryArithNew::assertLower(), CVC3::TheoryArithNew::assertFact(), CVC3::TheoryArithNew::pivotRule(), CVC3::TheoryArithOld::collectVars(), CVC3::TheoryArithOld::rewrite(), CVC3::TheoryArithOld::solve(), CVC3::TheoryArithOld::checkAssertEqInvariant(), CVC3::TheoryArithOld::isNonlinearSumTerm(), CVC3::TheoryArithOld::termDegree(), CVC3::TheoryArithOld::canPickEqMonomial(), CVC3::TheoryArithOld::getUpperBound(), CVC3::TheoryArithOld::getLowerBound(), CVC3::TheoryArithOld::isConstrainedAbove(), CVC3::TheoryArithOld::isConstrainedBelow(), CVC3::TheoryBitvector::assertFact(), CVC3::TheoryBitvector::multiply_coeff(), CVC3::TheoryBitvector::Odd_coeff(), CVC3::TheoryBitvector::canSolveFor(), CVC3::TheoryBitvector::isLinearTerm(), CVC3::TheoryBitvector::simplifyPendingEq(), CVC3::TheoryBitvector::updateSubterms(), and CVC3::TheoryBitvector::solve().

bool Theory::isLeafIn ( const Expr e1,
const Expr e2 
)
bool Theory::leavesAreSimp ( const Expr e)
Type CVC3::Theory::boolType ( ) [inline]
const Expr& CVC3::Theory::falseExpr ( ) [inline]
const Expr& CVC3::Theory::trueExpr ( ) [inline]
Expr Theory::newVar ( const std::string name,
const Type type 
)
Expr Theory::newVar ( const std::string name,
const Type type,
const Expr def 
)

Create a new named expression given its name, type, and definition.

Add the definition to the database for resolving IDs in parseExpr

Definition at line 610 of file theory.cpp.

References DebugAssert, CVC3::Type::isNull(), resolveID(), CVC3::Expr::isNull(), TYPEDEF, getBaseType(), CVC3::Expr::getType(), CVC3::Type::toString(), ARROW, and installID().

Op Theory::newFunction ( const std::string name,
const Type type,
bool  computeTransClosure 
)
Op Theory::lookupFunction ( const std::string name,
Type type 
)

Look up a function by name.

Returns the function and sets type to the type of the function if it exists. If not, returns a NULL Op object.

Definition at line 697 of file theory.cpp.

References getEM(), CVC3::ExprManager::newSymbolExpr(), UFUNC, CVC3::Expr::lookupType(), and CVC3::Expr::mkOp().

Op Theory::newFunction ( const std::string name,
const Type type,
const Expr def 
)

Create a new defined function.

Add the definition to the database for resolving IDs in parseExpr

Definition at line 678 of file theory.cpp.

References DebugAssert, CVC3::Type::isNull(), resolveID(), CVC3::Type::toString(), installID(), and CVC3::Expr::mkOp().

Expr Theory::addBoundVar ( const std::string name,
const Type type 
)
Expr Theory::addBoundVar ( const std::string name,
const Type type,
const Expr def 
)

Create and add a new bound named def to the stack, for parseExprOp().

The stack is popped automatically upon return from the parseExprOp() which used this method.

Bound variable names may repeat, in which case the latest declaration takes precedence.

The type may be Null, but 'def' must always be a valid Expr

Definition at line 738 of file theory.cpp.

References CVC3::Type::isNull(), boundVarCount, LETDECL, getEM(), d_theoryCore, CVC3::TheoryCore::d_boundVarStack, DebugAssert, CVC3::TheoryCore::d_parseCache, CVC3::TheoryCore::d_parseCacheTop, CVC3::TheoryCore::d_parseCacheOther, CVC3::ExprMap::empty(), CVC3::ExprMap::clear(), CVC3::Expr::getKind(), RAW_LIST, CVC3::TheoryCore::d_boundVarMap, Hash::hash_map::find(), Hash::hash_map::end(), TRACE, CVC3::Type::toString(), and CVC3::Expr::toString().

Expr Theory::lookupVar ( const std::string name,
Type type 
)

Lookup variable and return it and its type. Return NULL Expr if it doesn't exist yet.

Definition at line 776 of file theory.cpp.

References getEM(), CVC3::ExprManager::newVarExpr(), and CVC3::Expr::lookupType().

Type Theory::newTypeExpr ( const std::string name)

Create a new uninterpreted type with the given name.

Add the name to the global variable database d_globals

Definition at line 790 of file theory.cpp.

References resolveID(), CVC3::Expr::isNull(), TYPEDECL, getEM(), and installID().

Referenced by CVC3::Translator::finish().

Type Theory::lookupTypeExpr ( const std::string name)

Lookup type by name. Return Null if no such type exists.

Definition at line 805 of file theory.cpp.

References resolveID(), CVC3::Expr::isNull(), CVC3::Expr::getKind(), TYPEDECL, and CVC3::Expr::isType().

Type Theory::newTypeExpr ( const std::string name,
const Type def 
)

Create a new type abbreviation with the given name.

Definition at line 872 of file theory.cpp.

References resolveID(), CVC3::Expr::isNull(), CVC3::Type::getExpr(), and installID().

Type Theory::newSubtypeExpr ( const Expr pred,
const Expr witness 
)
Expr Theory::resolveID ( const std::string name)
void Theory::installID ( const std::string name,
const Expr e 
)

Install name as a new identifier associated with Expr e.

Definition at line 910 of file theory.cpp.

References DebugAssert, resolveID(), d_theoryCore, and CVC3::TheoryCore::d_globals.

Referenced by newVar(), newFunction(), newTypeExpr(), and CVC3::TheoryDatatype::dataType().

Theorem Theory::typePred ( const Expr e)

Return BOOLEAN type.

Reimplemented in CVC3::TheoryCore.

Definition at line 918 of file theory.cpp.

References d_theoryCore, and CVC3::TheoryCore::typePred().

Referenced by CVC3::TheoryArith3::rewrite(), CVC3::TheoryArithOld::rewrite(), and CVC3::TheoryBitvector::assertFact().

Theorem CVC3::Theory::reflexivityRule ( const Expr a) [inline]

==> a == a

Definition at line 673 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::reflexivityRule().

Referenced by CVC3::BitvectorTheoremProducer::bvplusZeroConcatRule(), CVC3::BitvectorTheoremProducer::bitwiseConcat(), CVC3::BitvectorTheoremProducer::extractBVPlus(), CVC3::BitvectorTheoremProducer::MarkNonSolvableEq(), CVC3::BitvectorTheoremProducer::liftConcatBVMult(), CVC3::BitvectorTheoremProducer::liftConcatBVPlus(), CVC3::ExprTransform::pushNegationRec(), simplifyOp(), find(), findReduce(), updateHelper(), setupCC(), rewriteCC(), rewriteIte(), rewrite(), theoryPreprocess(), rewriteAtomic(), CVC3::TheoryArith3::setupRec(), CVC3::TheoryArith3::normalize(), CVC3::TheoryArith3::rewrite(), CVC3::TheoryArithNew::setupRec(), CVC3::TheoryArithNew::normalize(), CVC3::TheoryArithNew::rewrite(), CVC3::TheoryArithNew::assertFact(), CVC3::TheoryArithNew::substAndCanonizeModTableaux(), CVC3::TheoryArithOld::setupRec(), CVC3::TheoryArithOld::normalize(), CVC3::TheoryArithOld::rewrite(), CVC3::TheoryArray::pullIndex(), CVC3::TheoryArray::rewrite(), CVC3::TheoryArray::setup(), CVC3::TheoryArray::computeModel(), CVC3::TheoryBitvector::generalBitBlast(), CVC3::TheoryBitvector::rewriteAtomic(), CVC3::TheoryCore::callTheoryPreprocess(), CVC3::TheoryCore::rewrite(), CVC3::TheoryCore::simplifyOp(), CVC3::TheoryCore::collectModelValues(), CVC3::TheoryCore::setupTerm(), CVC3::TheoryDatatype::rewrite(), CVC3::TheoryDatatypeLazy::setup(), CVC3::TheoryQuant::rewrite(), CVC3::TheoryQuant::theoryPreprocess(), CVC3::TheoryRecords::rewrite(), CVC3::TheorySimulate::rewrite(), CVC3::TheoryUF::rewrite(), and CVC3::TheoryUF::computeModel().

Theorem CVC3::Theory::symmetryRule ( const Theorem a1_eq_a2) [inline]
Theorem CVC3::Theory::transitivityRule ( const Theorem a1_eq_a2,
const Theorem a2_eq_a3 
) [inline]

(a1 == a2) & (a2 == a3) ==> (a1 == a3)

Definition at line 681 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::transitivityRule().

Referenced by findRef(), find(), updateCC(), CVC3::TheoryArith::canonThm(), CVC3::TheoryArith3::assertFact(), CVC3::TheoryArith3::normalize(), CVC3::TheoryArith3::rewrite(), CVC3::TheoryArith3::update(), CVC3::TheoryArith3::canonSimplify(), CVC3::TheoryArithNew::normalize(), CVC3::TheoryArithNew::rafineIntegerConstraints(), CVC3::TheoryArithNew::rewrite(), CVC3::TheoryArithNew::update(), CVC3::TheoryArithNew::pivotRule(), CVC3::TheoryArithNew::canonSimplify(), CVC3::TheoryArithOld::checkIntegerEquality(), CVC3::TheoryArithOld::rafineInequalityToInteger(), CVC3::TheoryArithOld::normalize(), CVC3::TheoryArithOld::rewrite(), CVC3::TheoryArithOld::update(), CVC3::TheoryArithOld::inequalityToFind(), CVC3::TheoryArithOld::canonSimplify(), CVC3::TheoryArray::checkSat(), CVC3::TheoryArray::pullIndex(), CVC3::TheoryArray::rewrite(), CVC3::TheoryArray::update(), CVC3::TheoryArray::computeModel(), CVC3::TheoryBitvector::simplifyPendingEq(), CVC3::TheoryBitvector::generalBitBlast(), CVC3::TheoryBitvector::comparebv(), CVC3::TheoryBitvector::update(), CVC3::TheoryBitvector::updateSubterms(), CVC3::TheoryBitvector::rewriteBV(), CVC3::TheoryCore::callTheoryPreprocess(), CVC3::TheoryCore::rewrite(), CVC3::TheoryCore::update(), CVC3::TheoryCore::simplifyOp(), CVC3::TheoryCore::assignValue(), CVC3::TheoryCore::buildModel(), CVC3::TheoryCore::collectModelValues(), CVC3::TheoryCore::assertEqualities(), CVC3::TheoryDatatype::rewrite(), CVC3::TheoryDatatype::update(), CVC3::TheoryDatatypeLazy::update(), CVC3::TheoryRecords::rewrite(), CVC3::TheoryRecords::computeModel(), CVC3::TheoryRecords::setup(), CVC3::TheoryRecords::update(), CVC3::TheoryUF::rewrite(), CVC3::TheoryUF::update(), and CVC3::TheoryUF::computeModel().

Theorem CVC3::Theory::substitutivityRule ( const Op op,
const std::vector< Theorem > &  thms 
) [inline]
Theorem CVC3::Theory::substitutivityRule ( const Expr e,
const Theorem t 
) [inline]

Special case for unary operators.

Definition at line 691 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::substitutivityRule().

Theorem CVC3::Theory::substitutivityRule ( const Expr e,
const Theorem t1,
const Theorem t2 
) [inline]

Special case for binary operators.

Definition at line 696 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::substitutivityRule().

Theorem CVC3::Theory::substitutivityRule ( const Expr e,
const std::vector< unsigned > &  changed,
const std::vector< Theorem > &  thms 
) [inline]

Optimized: only positions which changed are included.

Definition at line 702 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::substitutivityRule().

Theorem CVC3::Theory::substitutivityRule ( const Expr e,
int  changed,
const Theorem thm 
) [inline]

Optimized: only a single position changed.

Definition at line 708 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::substitutivityRule().

Theorem CVC3::Theory::iffMP ( const Theorem e1,
const Theorem e1_iff_e2 
) [inline]
Theorem CVC3::Theory::rewriteAnd ( const Expr e) [inline]
Theorem CVC3::Theory::rewriteOr ( const Expr e) [inline]

==> OR(e1,...,en) IFF [simplified expr]

Definition at line 724 of file theory.h.

References d_commonRules, and CVC3::CommonProofRules::rewriteOr().

Referenced by CVC3::TheoryCore::rewrite(), CVC3::TheoryCore::simplifyOp(), and CVC3::TheoryCore::computeTCC().

Theorem Theory::rewriteIte ( const Expr e)
Theorem Theory::renameExpr ( const Expr e)

Friends And Related Function Documentation

friend class TheoryCore [friend]

Definition at line 65 of file theory.h.


Member Data Documentation

Name of the theory (for debugging)

Definition at line 70 of file theory.h.

Referenced by getName(), and CVC3::TheoryCore::TheoryCore().

bool CVC3::Theory::d_theoryUsed [protected]

The documentation for this class was generated from the following files: