#include <translator.h>
Definition at line 58 of file translator.h.
Translator::Translator | ( | ExprManager * | em, | |
const bool & | translate, | |||
const bool & | real2int, | |||
const bool & | convertArith, | |||
const std::string & | convertToDiff, | |||
bool | iteLiftArith, | |||
const std::string & | expResult, | |||
const std::string & | category, | |||
bool | convertArray, | |||
bool | combineAssump, | |||
int | convertToBV | |||
) |
Translator::~Translator | ( | ) |
string Translator::fileToSMTLIBIdentifier | ( | const std::string & | filename | ) | [private] |
Definition at line 70 of file translator.cpp.
References CVC3::APPLY, CVC3::Expr::arity(), CVC3::Expr::begin(), CVC3::BVMULT, CVC3::BVPLUS, CVC3::BVSLE, CVC3::BVSLT, CVC3::BVSUB, CVC3::BVUMINUS, d_arrayConvertMap, d_convertArith, d_convertToBV, d_convertToDiff, d_elementType, d_em, d_equalities, d_indexType, d_intConstUsed, d_iteLiftArith, d_langUsed, d_realUsed, d_theoryArith, d_theoryBitvector, d_theoryCore, d_UFIDL_ok, d_unknown, DebugAssert, CVC3::DIFF_ONLY, CVC3::DIVIDE, CVC3::Expr::end(), CVC3::ExprMap< Data >::end(), CVC3::EQ, FatalAssert, CVC3::ExprMap< Data >::find(), CVC3::GE, CVC3::Theory::getBaseType(), CVC3::Expr::getBody(), CVC3::TheoryCore::getFlags(), CVC3::Expr::getKids(), CVC3::Expr::getKind(), CVC3::Expr::getName(), CVC3::Rational::getNumerator(), CVC3::Expr::getOp(), CVC3::Expr::getOpExpr(), CVC3::Expr::getOpKind(), CVC3::Expr::getRational(), CVC3::Expr::getType(), CVC3::Expr::getVars(), CVC3::GT, CVC3::INTDIV, CVC3::TheoryArith::intType(), CVC3::IS_INTEGER, CVC3::TheoryArith::isAtomicArithFormula(), CVC3::Expr::isClosure(), CVC3::isInt(), CVC3::Rational::isInteger(), CVC3::Theory::isLeaf(), CVC3::Expr::isRational(), CVC3::isRational(), CVC3::TheoryArith::isSyntacticRational(), CVC3::Expr::isVar(), CVC3::ITE, CVC3::Expr::iteExpr(), CVC3::LAMBDA, CVC3::LE, CVC3::LINEAR, CVC3::LT, CVC3::MINUS, CVC3::MOD, CVC3::MULT, CVC3::TheoryBitvector::newBitvectorType(), CVC3::ExprManager::newClosureExpr(), CVC3::ExprManager::newRatExpr(), CVC3::Theory::newVar(), CVC3::NONLINEAR, CVC3::NOT, CVC3::NOT_USED, CVC3::PLUS, CVC3::POW, CVC3::pow(), CVC3::RATIONAL_EXPR, CVC3::READ, CVC3::TheoryArith::realType(), CVC3::TheoryArith::rewriteToDiff(), CVC3::Theory::setUsed(), CVC3::TheoryBitvector::signed_newBVConstExpr(), CVC3::TERMS_ONLY, CVC3::Theory::theoryOf(), CVC3::UCONST, CVC3::UMINUS, and CVC3::WRITE.
Referenced by preprocess().
Definition at line 540 of file translator.cpp.
References std::endl(), preprocessRec(), and CVC3::Expr::toString().
Referenced by finish().
Expr Translator::preprocess2Rec | ( | const Expr & | e, | |
ExprMap< Expr > & | cache, | |||
Type | desiredType | |||
) | [private] |
Definition at line 554 of file translator.cpp.
References CVC3::ANY_TYPE, CVC3::Expr::arity(), d_em, d_theoryArith, d_unknown, CVC3::DIVIDE, CVC3::ExprMap< Data >::end(), CVC3::EQ, CVC3::ExprMap< Data >::find(), CVC3::GE, CVC3::Expr::getBody(), CVC3::Type::getExpr(), CVC3::Expr::getKind(), CVC3::Expr::getOp(), CVC3::Expr::getOpExpr(), CVC3::Expr::getType(), CVC3::Expr::getVars(), CVC3::GT, CVC3::TheoryArith::intType(), CVC3::Expr::isApply(), CVC3::Expr::isClosure(), CVC3::Type::isNull(), CVC3::ITE, CVC3::LE, CVC3::LT, CVC3::MINUS, CVC3::MULT, CVC3::ExprManager::newClosureExpr(), CVC3::PLUS, CVC3::RATIONAL_EXPR, CVC3::REAL_CONST, CVC3::TheoryArith::realType(), CVC3::Expr::toString(), and CVC3::UMINUS.
Referenced by preprocess2().
Definition at line 664 of file translator.cpp.
References std::endl(), preprocess2Rec(), and CVC3::Expr::toString().
Referenced by finish().
bool Translator::containsArray | ( | const Expr & | e | ) | [private] |
Definition at line 680 of file translator.cpp.
References CVC3::ARRAY, CVC3::Expr::begin(), CVC3::Expr::end(), and CVC3::Expr::getKind().
Referenced by dump().
Definition at line 878 of file translator.cpp.
References CVC3::Expr::arity(), CVC3::ARRAY, CVC3::BITVECTOR, d_arrayType, d_ax, d_convertToBV, d_elementType, d_intIntArray, d_intIntRealArray, d_intRealArray, d_intUsed, d_real2int, d_realUsed, d_theoryArith, d_theoryBitvector, d_theoryCore, d_unknown, DebugAssert, CVC3::Type::getExpr(), CVC3::TheoryCore::getFlags(), CVC3::Expr::getKind(), CVC3::Expr::getOp(), CVC3::INT, CVC3::TheoryArith::intType(), CVC3::isArray(), CVC3::isInt(), CVC3::isReal(), CVC3::TheoryBitvector::newBitvectorType(), CVC3::REAL, CVC3::Theory::setUsed(), CVC3::SUBRANGE, CVC3::Theory::theoryOf(), and CVC3::TYPEDECL.
Referenced by finish().
bool Translator::start | ( | const std::string & | dumpFile | ) |
Definition at line 726 of file translator.cpp.
References d_dump, d_dumpFileOpen, d_em, d_osdump, d_osdumpFile, d_tmpFile, d_translate, std::endl(), fileToSMTLIBIdentifier(), CVC3::ExprManager::getOutputLang(), and CVC3::SMTLIB_LANG.
Referenced by CVC3::VCL::init().
void Translator::dump | ( | const Expr & | e, | |
bool | dumpOnly = false | |||
) |
Dump the expression in the current output language
dumpOnly | When false, the expression is output both when translating and when producing a trace of commands. When true, the expression is only output when producing a trace of commands (i.e. ignored during translation). |
Definition at line 795 of file translator.cpp.
References CVC3::Expr::arity(), CVC3::ARRAY, CVC3::ARROW, CVC3::CONST, containsArray(), d_convertArray, d_dump, d_dumpExprs, d_em, d_osdump, d_translate, DebugAssert, std::endl(), CVC3::Expr::getKind(), CVC3::ExprManager::getOutputLang(), and CVC3::SMTLIB_LANG.
Referenced by CVC3::VCL::addPairToArithOrder(), CVC3::VCL::checkContinue(), CVC3::VCL::createOp(), CVC3::VCL::createType(), CVC3::VCL::dataType(), CVC3::VCL::getAssumptions(), CVC3::VCL::getAssumptionsTCC(), CVC3::VCL::getAssumptionsUsed(), CVC3::VCL::getClosure(), CVC3::VCL::getConcreteModel(), CVC3::VCL::getCounterExample(), CVC3::VCL::getProof(), CVC3::VCL::getProofClosure(), CVC3::VCL::getProofTCC(), CVC3::VCL::getTCC(), CVC3::VCL::pop(), CVC3::VCL::popScope(), CVC3::VCL::popto(), CVC3::VCL::poptoScope(), CVC3::VCL::push(), CVC3::VCL::pushScope(), CVC3::VCL::restart(), and CVC3::VCL::varExpr().
bool Translator::dumpAssertion | ( | const Expr & | e | ) |
Definition at line 833 of file translator.cpp.
References CVC3::ASSERT, d_dumpExprs, d_em, d_osdump, d_translate, std::endl(), CVC3::ExprManager::getOutputLang(), and CVC3::SMTLIB_LANG.
Referenced by CVC3::VCL::assertFormula().
bool Translator::dumpQuery | ( | const Expr & | e | ) |
Definition at line 846 of file translator.cpp.
References d_dumpExprs, d_em, d_osdump, d_translate, std::endl(), CVC3::ExprManager::getOutputLang(), CVC3::QUERY, and CVC3::SMTLIB_LANG.
Referenced by CVC3::VCL::query().
void Translator::dumpQueryResult | ( | QueryResult | qres | ) |
Definition at line 859 of file translator.cpp.
References d_em, d_osdump, d_translate, std::endl(), CVC3::ExprManager::getOutputLang(), CVC3::SATISFIABLE, CVC3::SMTLIB_LANG, and CVC3::UNSATISFIABLE.
Referenced by CVC3::VCL::query().
void Translator::finish | ( | ) |
Definition at line 960 of file translator.cpp.
References CVC3::AND, CVC3::Expr::arity(), CVC3::arrayType(), CVC3::ASSERT, CVC3::CONST, d_arithUsed, d_arrayConvertMap, d_arrayType, d_ax, d_category, d_combineAssump, d_convertArray, d_convertToBV, d_dumpExprs, d_dumpFileOpen, d_elementType, d_em, d_equalities, d_expResult, d_indexType, d_intConstUsed, d_intIntArray, d_intUsed, d_langUsed, d_osdump, d_osdumpFile, d_realUsed, d_theoryArray, d_theoryBitvector, d_theoryCore, d_theoryDatatype, d_theoryQuant, d_theoryRecords, d_theorySimulate, d_theoryUF, d_translate, d_UFIDL_ok, d_unknown, d_zeroVar, DebugAssert, CVC3::DIFF_ONLY, std::endl(), CVC3::Type::getExpr(), CVC3::TheoryCore::getFlags(), CVC3::Expr::getKind(), CVC3::ExprManager::getOutputLang(), CVC3::Expr::getString(), CVC3::Expr::getType(), CVC3::ID, CVC3::LINEAR, CVC3::Expr::negate(), CVC3::ExprManager::newStringExpr(), CVC3::Theory::newTypeExpr(), CVC3::NONLINEAR, CVC3::NOT_USED, preprocess(), preprocess2(), processType(), CVC3::QUERY, CVC3::RAW_LIST, CVC3::READ, CVC3::SMTLIB_LANG, CVC3::STRING_EXPR, CVC3::Theory::theoryUsed(), CVC3::TYPE, and CVC3::UCONST.
Referenced by CVC3::VCL::destroy().
void CVC3::Translator::setTheoryCore | ( | TheoryCore * | theoryCore | ) | [inline] |
Definition at line 141 of file translator.h.
References d_theoryCore.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheoryUF | ( | TheoryUF * | theoryUF | ) | [inline] |
Definition at line 142 of file translator.h.
References d_theoryUF.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheoryArith | ( | TheoryArith * | theoryArith | ) | [inline] |
Definition at line 143 of file translator.h.
References d_theoryArith.
Referenced by CVC3::VCL::init(), and CVC3::VCL::reprocessFlags().
void CVC3::Translator::setTheoryArray | ( | TheoryArray * | theoryArray | ) | [inline] |
Definition at line 144 of file translator.h.
References d_theoryArray.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheoryQuant | ( | TheoryQuant * | theoryQuant | ) | [inline] |
Definition at line 145 of file translator.h.
References d_theoryQuant.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheoryRecords | ( | TheoryRecords * | theoryRecords | ) | [inline] |
Definition at line 146 of file translator.h.
References d_theoryRecords.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheorySimulate | ( | TheorySimulate * | theorySimulate | ) | [inline] |
Definition at line 147 of file translator.h.
References d_theorySimulate.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheoryBitvector | ( | TheoryBitvector * | theoryBitvector | ) | [inline] |
Definition at line 148 of file translator.h.
References d_theoryBitvector.
Referenced by CVC3::VCL::init().
void CVC3::Translator::setTheoryDatatype | ( | TheoryDatatype * | theoryDatatype | ) | [inline] |
Definition at line 149 of file translator.h.
References d_theoryDatatype.
Referenced by CVC3::VCL::init().
const string Translator::fixConstName | ( | const std::string & | s | ) |
Definition at line 1338 of file translator.cpp.
References d_em, CVC3::ExprManager::getOutputLang(), and CVC3::SMTLIB_LANG.
Referenced by CVC3::TheoryUF::print(), and CVC3::TheoryCore::print().
bool Translator::printArrayExpr | ( | ExprStream & | os, | |
const Expr & | e | |||
) |
Returns true if expression has been printed.
If false is returned, array theory should print expression as usual
Definition at line 1349 of file translator.cpp.
References CVC3::ARRAY, CVC3::ARRAY_LITERAL, CVC3::ARROW, CVC3::BITVECTOR, d_convertArray, d_em, d_intIntArray, d_intIntRealArray, d_intRealArray, d_theoryBitvector, d_unknown, DebugAssert, CVC3::TheoryBitvector::getBitvectorTypeParam(), CVC3::Expr::getKind(), CVC3::Expr::getName(), CVC3::ExprManager::getOutputLang(), CVC3::isArray(), CVC3::isInt(), CVC3::isReal(), CVC3::ExprManager::newSymbolExpr(), CVC3::READ, CVC3::SMTLIB_LANG, CVC3::TYPEDECL, CVC3::UCONST, CVC3::UFUNC, and CVC3::WRITE.
Expr Translator::zeroVar | ( | ) |
Definition at line 1437 of file translator.cpp.
References d_convertToDiff, d_theoryArith, d_theoryCore, d_zeroVar, CVC3::Type::getExpr(), CVC3::TheoryArith::intType(), CVC3::Theory::newVar(), and CVC3::TheoryArith::realType().
Referenced by CVC3::TheoryArith::rewriteToDiff().
ExprManager* CVC3::Translator::d_em [private] |
Definition at line 59 of file translator.h.
Referenced by dump(), dumpAssertion(), dumpQuery(), dumpQueryResult(), finish(), fixConstName(), preprocess2Rec(), preprocessRec(), printArrayExpr(), and start().
const bool& CVC3::Translator::d_translate [private] |
Definition at line 60 of file translator.h.
Referenced by dump(), dumpAssertion(), dumpQuery(), dumpQueryResult(), finish(), and start().
const bool& CVC3::Translator::d_real2int [private] |
const bool& CVC3::Translator::d_convertArith [private] |
const std::string& CVC3::Translator::d_convertToDiff [private] |
bool CVC3::Translator::d_iteLiftArith [private] |
const std::string& CVC3::Translator::d_expResult [private] |
const std::string& CVC3::Translator::d_category [private] |
bool CVC3::Translator::d_convertArray [private] |
bool CVC3::Translator::d_combineAssump [private] |
std::ostream* CVC3::Translator::d_osdump [private] |
The log file for top-level API calls in the CVC3 input language.
Definition at line 71 of file translator.h.
Referenced by dump(), dumpAssertion(), dumpQuery(), dumpQueryResult(), finish(), and start().
std::ofstream CVC3::Translator::d_osdumpFile [private] |
std::ifstream CVC3::Translator::d_tmpFile [private] |
bool CVC3::Translator::d_dump [private] |
bool CVC3::Translator::d_dumpFileOpen [private] |
bool CVC3::Translator::d_intIntArray [private] |
Definition at line 76 of file translator.h.
Referenced by finish(), printArrayExpr(), and processType().
bool CVC3::Translator::d_intRealArray [private] |
bool CVC3::Translator::d_intIntRealArray [private] |
bool CVC3::Translator::d_ax [private] |
bool CVC3::Translator::d_unknown [private] |
Definition at line 76 of file translator.h.
Referenced by finish(), preprocess2Rec(), preprocessRec(), printArrayExpr(), and processType().
bool CVC3::Translator::d_realUsed [private] |
Definition at line 77 of file translator.h.
Referenced by finish(), preprocessRec(), and processType().
bool CVC3::Translator::d_intUsed [private] |
bool CVC3::Translator::d_intConstUsed [private] |
ArithLang CVC3::Translator::d_langUsed [private] |
bool CVC3::Translator::d_UFIDL_ok [private] |
bool CVC3::Translator::d_arithUsed [private] |
Expr* CVC3::Translator::d_zeroVar [private] |
int CVC3::Translator::d_convertToBV [private] |
Definition at line 85 of file translator.h.
Referenced by finish(), preprocessRec(), and processType().
TheoryCore* CVC3::Translator::d_theoryCore [private] |
Definition at line 87 of file translator.h.
Referenced by finish(), preprocessRec(), processType(), setTheoryCore(), and zeroVar().
TheoryUF* CVC3::Translator::d_theoryUF [private] |
TheoryArith* CVC3::Translator::d_theoryArith [private] |
Definition at line 89 of file translator.h.
Referenced by preprocess2Rec(), preprocessRec(), processType(), setTheoryArith(), and zeroVar().
TheoryArray* CVC3::Translator::d_theoryArray [private] |
TheoryQuant* CVC3::Translator::d_theoryQuant [private] |
TheoryRecords* CVC3::Translator::d_theoryRecords [private] |
TheorySimulate* CVC3::Translator::d_theorySimulate [private] |
Definition at line 94 of file translator.h.
Referenced by finish(), preprocessRec(), printArrayExpr(), processType(), and setTheoryBitvector().
TheoryDatatype* CVC3::Translator::d_theoryDatatype [private] |
std::vector<Expr> CVC3::Translator::d_dumpExprs [private] |
Definition at line 97 of file translator.h.
Referenced by dump(), dumpAssertion(), dumpQuery(), and finish().
std::map<std::string, Type>* CVC3::Translator::d_arrayConvertMap [private] |
Definition at line 99 of file translator.h.
Referenced by finish(), preprocessRec(), Translator(), and ~Translator().
Type* CVC3::Translator::d_indexType [private] |
Type* CVC3::Translator::d_elementType [private] |
Definition at line 101 of file translator.h.
Referenced by finish(), preprocessRec(), and processType().
Type* CVC3::Translator::d_arrayType [private] |
std::vector<Expr> CVC3::Translator::d_equalities [private] |