CVCL::TheoryArith Class Reference
[Theories]

This theory handles basic linear arithmetic. More...

#include <theory_arith.h>

Inheritance diagram for CVCL::TheoryArith:

CVCL::Theory List of all members.

Public Member Functions

Private Member Functions

Private Attributes

Friends


Detailed Description

This theory handles basic linear arithmetic.

Author: Clark Barrett

Created: Sat Feb 8 14:44:32 2003

Definition at line 87 of file theory_arith.h.


Constructor & Destructor Documentation

TheoryArith::TheoryArith VCL vcl  ) 
 

Definition at line 1558 of file theory_arith.cpp.

References createProofRules(), d_buffer, d_bufferIdx, d_bufferThres, d_countLeft, d_countRight, d_diseq, d_diseqIdx, d_freeConstDB, d_grayShadowMMIndex, d_inModelCreation, d_intConstUsed, d_intType, d_intUsed, d_langUsed, d_realType, d_realUsed, d_rules, d_sharedTerms, d_sharedVars, d_vcl, CVCL::DARK_SHADOW, CVCL::DIVIDE, CVCL::GE, CVCL::Theory::getEM(), CVCL::GRAY_SHADOW, CVCL::GT, IF_DEBUG(), CVCL::INT, CVCL::INTDIV, CVCL::IS_INTEGER, CVCL::LE, CVCL::LT, CVCL::MINUS, CVCL::MOD, CVCL::MULT, CVCL::NEGINF, CVCL::newExpr(), CVCL::ExprManager::newKind(), CVCL::NOT_USED, CVCL::PLUS, CVCL::POSINF, CVCL::POW, CVCL::RATIONAL_EXPR, CVCL::REAL, CVCL::ExprManager::registerSubclass(), CVCL::Theory::registerTheory(), CVCL::SUBRANGE, and CVCL::UMINUS.

TheoryArith::~TheoryArith  ) 
 

Definition at line 1634 of file theory_arith.cpp.

References CVCL::ExprMap< Data >::begin(), d_inequalitiesLeftDB, d_inequalitiesRightDB, d_rules, and CVCL::ExprMap< Data >::end().


Member Function Documentation

Theorem TheoryArith::isIntegerThm const Expr e  )  [private]
 

Check the term t for integrality.

Returns:
a theorem of IS_INTEGER(t) or Null.

Definition at line 74 of file theory_arith.cpp.

References CVCL::Theory::getEM(), CVCL::Theory::getType(), CVCL::IS_INTEGER, isIntegerDerive(), CVCL::isReal(), CVCL::newExpr(), and CVCL::Theory::typePred().

Referenced by normalizeProjectIneqs(), processFiniteInterval(), processSimpleIntEq(), and projectInequalities().

Theorem TheoryArith::isIntegerDerive const Expr isIntE,
const Theorem thm
[private]
 

A helper method for isIntegerThm().

Check if IS_INTEGER(e) is easily derivable from the given 'thm'

Definition at line 82 of file theory_arith.cpp.

References CVCL::Theory::andElim(), CVCL::Expr::arity(), CVCL::Theorem::getExpr(), CVCL::Expr::isAnd(), and CVCL::Theorem::isNull().

Referenced by isIntegerThm(), and rewrite().

bool CVCL::TheoryArith::isInteger const Expr e  )  [inline, private]
 

Check the term t for integrality (return bool).

Definition at line 195 of file theory_arith.h.

Referenced by assignVariables(), computeType(), doSolve(), pickIntEqMonomial(), processFiniteInterval(), processFiniteIntervals(), processRealEq(), and solve().

const Rational & TheoryArith::freeConstIneq const Expr ineq,
bool  varOnRHS
[private]
 

Extract the free constant from an inequality.

Definition at line 99 of file theory_arith.cpp.

References CVCL::Expr::getKind(), CVCL::Expr::getRational(), CVCL::isIneq(), CVCL::PLUS, CVCL::RATIONAL_EXPR, and CVCL::Expr::toString().

Referenced by isStale().

const TheoryArith::FreeConst & TheoryArith::updateSubsumptionDB const Expr ineq,
bool  varOnRHS,
bool &  subsumed
[private]
 

Update the free constant subsumption database with new inequality.

Returns:
a reference to the max/min constant.
Also, sets 'subsumed' argument to true if the inequality is subsumed by an existing inequality.

Definition at line 117 of file theory_arith.cpp.

References CVCL::Expr::arity(), CVCL::Expr::begin(), d_freeConstDB, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::Expr::end(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::CDOmap< Key, Data, HashFcn >::get(), CVCL::TheoryArith::FreeConst::getConst(), CVCL::Expr::getRational(), int2string(), CVCL::isLE(), CVCL::isLT(), CVCL::isPlus(), CVCL::isRational(), CVCL::leExpr(), CVCL::plusExpr(), rat(), CVCL::TheoryArith::FreeConst::strict(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by projectInequalities().

bool TheoryArith::kidsCanonical const Expr e  )  [private]
 

Check if the kids of e are fully simplified and canonized (for debugging).

Definition at line 186 of file theory_arith.cpp.

References CVCL::Expr::arity(), canon(), CVCL::debugger, CVCL::Debug::getOS(), IF_DEBUG(), and CVCL::Theory::isLeaf().

Referenced by canon(), and canonSimplify().

Theorem TheoryArith::canon const Expr e  )  [private]
 

Canonize the expression e, assuming all children are canonical.

Definition at line 218 of file theory_arith.cpp.

References CVCL::Expr::arity(), CVCL::ArithProofRules::canonDivide(), CVCL::ArithProofRules::canonMult(), CVCL::ArithProofRules::canonPlus(), CVCL::ArithProofRules::canonPowConst(), d_rules, CVCL::DIVIDE, CVCL::Expr::getKind(), CVCL::Theorem::getLHS(), CVCL::Theorem::getRHS(), CVCL::Expr::isRational(), kidsCanonical(), CVCL::MINUS, CVCL::ArithProofRules::minusToPlus(), CVCL::MULT, CVCL::PLUS, CVCL::POW, CVCL::Theory::reflexivityRule(), CVCL::Theory::substitutivityRule(), CVCL::Expr::toString(), CVCL::TRACE, CVCL::Theory::transitivityRule(), CVCL::UMINUS, and CVCL::ArithProofRules::uMinusToMult().

Referenced by canonSimplify(), isolateVariable(), kidsCanonical(), processFiniteInterval(), rewrite(), and substAndCanonize().

Theorem CVCL::TheoryArith::canon const Theorem thm  )  [inline, private]
 

Composition of canon(const Expr&) by transitivity: take e0 = e1, canonize e1 to e2, return e0 = e2.

Definition at line 212 of file theory_arith.h.

References CVCL::Theorem::getRHS().

Theorem TheoryArith::canonSimplify const Expr e  )  [private]
 

Canonize and reduce e w.r.t. union-find database; assume all children are canonical.

Definition at line 366 of file theory_arith.cpp.

References canon(), CVCL::Theory::find(), CVCL::Theorem::getRHS(), CVCL::Expr::hasFind(), kidsCanonical(), CVCL::Theory::simplifyExpr(), CVCL::Expr::toString(), CVCL::TRACE, and CVCL::Theory::transitivityRule().

Referenced by canonPred(), and canonPredEquiv().

Theorem CVCL::TheoryArith::canonSimplify const Theorem thm  )  [inline, private]
 

Composition of canonSimplify(const Expr&) by transitivity: take e0 = e1, canonize and simplify e1 to e2, return e0 = e2.

Definition at line 221 of file theory_arith.h.

References CVCL::Theorem::getRHS().

Theorem TheoryArith::canonPred const Theorem thm  )  [private]
 

Canonize predicate (x = y, x < y, etc.).

accepts a theorem, canonizes it, applies iffMP and substituvity to derive the canonized thm

Definition at line 395 of file theory_arith.cpp.

References CVCL::Expr::arity(), canonSimplify(), CVCL::Theorem::getExpr(), CVCL::getOp(), CVCL::Theory::iffMP(), CVCL::Theory::substitutivityRule(), and CVCL::Theorem::toString().

Referenced by addToBuffer(), doSolve(), isolateVariable(), normalizeProjectIneqs(), processFiniteInterval(), processRealEq(), processSimpleIntEq(), and projectInequalities().

Theorem TheoryArith::canonPredEquiv const Theorem thm  )  [private]
 

Canonize predicate like canonPred except that the input theorem is an equivalent transformation.

Definition at line 409 of file theory_arith.cpp.

References CVCL::Expr::arity(), canonSimplify(), CVCL::getOp(), CVCL::Theorem::getRHS(), CVCL::Theory::substitutivityRule(), CVCL::Theorem::toString(), and CVCL::Theory::transitivityRule().

Referenced by normalize(), and rewrite().

Theorem TheoryArith::doSolve const Theorem thm  )  [private]
 

Solve an equation and return an equivalent Theorem in the solved form.

Psuedo-code for doSolve. (Input is an equation) (output is a Theorem)

  1. translate e to the form e' = 0
  2. if (e'.isRational()) then {if e' != 0 return false else true}
  3. a for loop checks if all the variables are integers.
    • if not isolate a suitable real variable and call processRealEq().
    • if all variables are integers then isolate suitable variable and call processIntEq().

Definition at line 437 of file theory_arith.cpp.

References canonPred(), CVCL::ArithProofRules::constPredicate(), CVCL::Debug::counter(), d_rules, CVCL::debugger, CVCL::Theorem::getExpr(), CVCL::Expr::getRational(), CVCL::Theorem::getRHS(), IF_DEBUG(), CVCL::Theory::iffMP(), isInteger(), CVCL::Expr::isRational(), CVCL::Theorem::isRewrite(), normalize(), processIntEq(), processRealEq(), CVCL::ArithProofRules::rightMinusLeft(), CVCL::Theory::setIncomplete(), CVCL::Theory::symmetryRule(), CVCL::Theorem::toString(), and CVCL::TRACE.

Referenced by solve().

Theorem TheoryArith::canonConjunctionEquiv const Theorem thm  )  [private]
 

takes in a conjunction equivalence Thm and canonizes it.

accepts an equivalence theorem whose RHS is a conjunction, canonizes it, applies iffMP and substituvity to derive the canonized thm

Definition at line 424 of file theory_arith.cpp.

Expr TheoryArith::pickIntEqMonomial const Expr right  )  [private]
 

picks the monomial with the smallest abs(coeff) from the input

pick a monomial for the input equation. This function is used only if the equation is an integer equation. Choose the monomial with the smallest absolute value of coefficient.

Definition at line 494 of file theory_arith.cpp.

References CVCL::abs(), CVCL::Expr::arity(), CVCL::Expr::begin(), CVCL::Expr::end(), isInteger(), CVCL::isMult(), CVCL::isPlus(), CVCL::isRational(), and CVCL::Expr::toString().

Referenced by processSimpleIntEq().

Theorem TheoryArith::processRealEq const Theorem eqn  )  [private]
 

processes equalities with 1 or more vars of type REAL

input is e1=e2<==>0=e' Theorem and some of the vars in e' are of type REAL. isolate one of them and send back to framework. output is "e1=e2 <==> var = e''" Theorem.

Definition at line 526 of file theory_arith.cpp.

References CVCL::Expr::arity(), canonPred(), d_rules, CVCL::Theory::getBaseType(), CVCL::Theorem::getLHS(), CVCL::Expr::getRational(), CVCL::Theorem::getRHS(), CVCL::Theory::iffMP(), isInteger(), CVCL::Theory::isLeaf(), CVCL::Theory::isLeafIn(), CVCL::isMult(), CVCL::isPlus(), CVCL::isRational(), CVCL::isReal(), CVCL::ArithProofRules::multEqn(), CVCL::ArithProofRules::plusPredicate(), rat(), CVCL::Expr::toString(), CVCL::Theorem::toString(), and CVCL::TRACE.

Referenced by doSolve().

Theorem TheoryArith::processIntEq const Theorem eqn  )  [private]
 

processes equalities whose vars are all of type INT

input is e1=e2<==>0=e' Theorem and all of the vars in e' are of type INT. isolate one of them and send back to framework. output is "e1=e2 <==> var = e''" Theorem and some associated equations in solved form.

Definition at line 748 of file theory_arith.cpp.

References CVCL::Theory::andElim(), CVCL::Expr::arity(), CVCL::Theorem::getExpr(), CVCL::Expr::isAnd(), CVCL::Expr::isFalse(), CVCL::Theorem::isRewrite(), processSimpleIntEq(), solvedForm(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by doSolve().

Theorem TheoryArith::processSimpleIntEq const Theorem eqn  )  [private]
 

One step of INT equality processing (aux. method for processIntEq()).

Parameters:
eqn is a single equation 0 = e
Returns:
an equivalent Theorem (x = t AND 0 = e'), or just x = t

Definition at line 613 of file theory_arith.cpp.

References CVCL::Theory::andElim(), CVCL::Theory::andIntro(), CVCL::Expr::arity(), CVCL::Expr::begin(), canonPred(), d_rules, CVCL::Expr::end(), CVCL::ArithProofRules::eqElimIntRule(), CVCL::Theorem::getExpr(), CVCL::Theorem::getLHS(), CVCL::Expr::getRational(), CVCL::Theorem::getRHS(), CVCL::Theory::iffMP(), CVCL::ArithProofRules::intVarEqnConst(), CVCL::Expr::isAnd(), isIntegerThm(), CVCL::isMult(), CVCL::Theorem::isNull(), CVCL::isPlus(), CVCL::Expr::isRational(), CVCL::Theorem::isRewrite(), CVCL::ArithProofRules::multEqn(), pickIntEqMonomial(), CVCL::ArithProofRules::plusPredicate(), rat(), separateMonomial(), CVCL::Theory::skolemize(), CVCL::Theory::symmetryRule(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by processIntEq().

void TheoryArith::processBuffer  )  [private]
 

Process inequalities in the buffer.

Definition at line 911 of file theory_arith.cpp.

References d_buffer, d_bufferIdx, CVCL::Theorem::getExpr(), CVCL::Theory::inconsistent(), isolateVariable(), CVCL::isPlus(), isStale(), CVCL::Expr::isTrue(), projectInequalities(), CVCL::Theory::setInconsistent(), and CVCL::CDList< T >::size().

Referenced by assertFact(), and checkSat().

Theorem TheoryArith::isolateVariable const Theorem inputThm,
bool &  e1
[private]
 

Take an inequality and isolate a variable.

Definition at line 981 of file theory_arith.cpp.

References canon(), canonPred(), computeNormalFactor(), CVCL::ArithProofRules::constPredicate(), d_rules, CVCL::Theorem::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getRational(), CVCL::Theorem::getRHS(), CVCL::Theory::iffMP(), CVCL::isLE(), CVCL::isLT(), CVCL::isMult(), CVCL::isPlus(), CVCL::Expr::isRational(), CVCL::isRational(), CVCL::ArithProofRules::multIneqn(), pickMonomial(), CVCL::ArithProofRules::plusPredicate(), rat(), CVCL::Expr::toString(), CVCL::Theorem::toString(), and CVCL::TRACE.

Referenced by processBuffer().

void TheoryArith::updateStats const Rational c,
const Expr var
[private]
 

Update the statistics counters for the variable with a coeff. c.

Definition at line 936 of file theory_arith.cpp.

References CVCL::CDMap< Key, Data, HashFcn >::count(), d_countLeft, d_countRight, CVCL::Rational::toString(), and CVCL::TRACE.

Referenced by addToBuffer(), and updateStats().

void TheoryArith::updateStats const Expr monomial  )  [private]
 

Update the statistics counters for the monomial.

Definition at line 949 of file theory_arith.cpp.

References CVCL::Expr::getRational(), separateMonomial(), and updateStats().

void TheoryArith::addToBuffer const Theorem thm  )  [private]
 

Add an inequality to the input buffer. See also d_buffer.

Definition at line 957 of file theory_arith.cpp.

References CVCL::Expr::begin(), canonPred(), d_buffer, d_rules, CVCL::Expr::end(), CVCL::Theorem::getExpr(), CVCL::Expr::getRational(), CVCL::Theory::iffMP(), CVCL::isPlus(), CVCL::Expr::isRational(), CVCL::CDList< T >::push_back(), CVCL::ArithProofRules::rightMinusLeft(), CVCL::TRACE, and updateStats().

Referenced by assertFact(), and projectInequalities().

Expr TheoryArith::computeNormalFactor const Expr rhs  )  [private]
 

Given a canonized term, compute a factor to make all coefficients integer and relatively prime.

Definition at line 1051 of file theory_arith.cpp.

References CVCL::abs(), CVCL::Expr::arity(), CVCL::gcd(), CVCL::Rational::getDenominator(), CVCL::Expr::getKind(), CVCL::Rational::getNumerator(), CVCL::Expr::getRational(), CVCL::isMult(), CVCL::isPlus(), CVCL::lcm(), CVCL::MULT, rat(), and CVCL::RATIONAL_EXPR.

Referenced by isolateVariable(), and normalize().

Theorem TheoryArith::normalize const Expr e  )  [private]
 

Normalize an equation (make all coefficients rel. prime integers).

accepts a rewrite theorem over eqn|ineqn and normalizes it and returns a theorem to that effect. assumes e is non-trivial i.e. e is not '0=const' or 'const=0' or '0 <= const' etc.

Definition at line 2069 of file theory_arith.cpp.

References canonPredEquiv(), computeNormalFactor(), d_rules, CVCL::EQ, CVCL::GE, CVCL::Expr::getKind(), CVCL::Expr::getRational(), CVCL::GT, CVCL::Expr::isEq(), CVCL::isIneq(), CVCL::isRational(), CVCL::LE, CVCL::LT, CVCL::ArithProofRules::multEqn(), CVCL::ArithProofRules::multIneqn(), CVCL::Theory::reflexivityRule(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by doSolve(), normalize(), and rewrite().

Theorem TheoryArith::normalize const Theorem thm  )  [private]
 

Normalize an equation (make all coefficients rel. prime integers).

accepts a rewrite theorem over eqn|ineqn and normalizes it and returns a theorem to that effect.

Definition at line 2130 of file theory_arith.cpp.

References CVCL::Theorem::getRHS(), normalize(), and CVCL::Theory::transitivityRule().

Expr TheoryArith::pickMonomial const Expr right  )  [private]
 

Definition at line 1399 of file theory_arith.cpp.

References CVCL::TheoryArith::VarOrderGraph::addEdge(), CVCL::Expr::begin(), CVCL::CDMap< Key, Data, HashFcn >::count(), d_countLeft, d_countRight, d_graph, d_vcl, CVCL::Expr::end(), CVCL::VCL::getFlags(), int2string(), CVCL::isPlus(), lessThanVar(), CVCL::TheoryArith::VarOrderGraph::selectLargest(), separateMonomial(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by isolateVariable().

void TheoryArith::separateMonomial const Expr e,
Expr c,
Expr var
 

Separate monomial e = c*p1*...*pn into c and 1*p1*...*pn.

Definition at line 1151 of file theory_arith.cpp.

References CVCL::Expr::arity(), CVCL::Expr::getKids(), CVCL::isMult(), CVCL::isPlus(), CVCL::isRational(), CVCL::Expr::isRational(), CVCL::multExpr(), rat(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by CVCL::ArithTheoremProducer::eqElimIntRule(), findRationalBound(), CVCL::ArithTheoremProducer::grayShadowConst(), CVCL::ArithTheoremProducer::intVarEqnConst(), lessThanVar(), normalizeProjectIneqs(), pickMonomial(), processSimpleIntEq(), projectInequalities(), and updateStats().

bool TheoryArith::lessThanVar const Expr isolatedVar,
const Expr var2
[private]
 

Definition at line 1093 of file theory_arith.cpp.

References CVCL::isRational(), and separateMonomial().

Referenced by pickMonomial().

bool TheoryArith::isStale const Expr e  )  [private]
 

Check if the term expression is "stale".

"Stale" means it contains non-simplified subexpressions. For terms, it checks the expression's find pointer; for formulas it checks the children recursively (no caching!). So, apply it with caution, and only to simple atomic formulas (like inequality).

Definition at line 1109 of file theory_arith.cpp.

References CVCL::Expr::begin(), CVCL::Expr::end(), CVCL::Theory::find(), CVCL::Theorem::getRHS(), and CVCL::Theory::isTerm().

Referenced by isStale(), processBuffer(), and projectInequalities().

bool TheoryArith::isStale const Ineq ineq  )  [private]
 

Check if the inequality is "stale" or subsumed.

Definition at line 1121 of file theory_arith.cpp.

References freeConstIneq(), CVCL::TheoryArith::FreeConst::getConst(), CVCL::TheoryArith::Ineq::getConst(), CVCL::Theorem::getExpr(), CVCL::TheoryArith::Ineq::ineq(), CVCL::isLT(), isStale(), CVCL::TheoryArith::FreeConst::strict(), CVCL::TRACE, and CVCL::TheoryArith::Ineq::varOnRHS().

void TheoryArith::projectInequalities const Theorem theInequality,
bool  isolatedVarOnRHS
[private]
 

Definition at line 1177 of file theory_arith.cpp.

References addToBuffer(), canonPred(), CVCL::Debug::counter(), d_inequalitiesLeftDB, d_inequalitiesRightDB, d_rules, d_vcl, CVCL::debugger, CVCL::ExprMap< Data >::end(), CVCL::Theory::enqueueFact(), CVCL::ExprMap< Data >::find(), CVCL::VCL::getCurrentContext(), CVCL::Theorem::getExpr(), IF_DEBUG(), CVCL::Theory::iffMP(), CVCL::TheoryArith::Ineq::ineq(), CVCL::isInt(), isIntegerThm(), CVCL::isLE(), CVCL::isLT(), CVCL::isMult(), CVCL::Theorem::isNull(), isStale(), CVCL::ArithProofRules::lessThanToLE(), normalizeProjectIneqs(), CVCL::CDList< T >::push_back(), separateMonomial(), CVCL::Theory::setIncomplete(), CVCL::Theory::setInconsistent(), setupRec(), CVCL::CDList< T >::size(), CVCL::Theorem::toString(), CVCL::TRACE, and updateSubsumptionDB().

Referenced by processBuffer().

void TheoryArith::assignVariables std::vector< Expr > &  v  )  [private]
 

Definition at line 1998 of file theory_arith.cpp.

References CVCL::Theory::assignValue(), CVCL::ceil(), d_graph, findBounds(), CVCL::Theory::findExpr(), CVCL::Theory::inconsistent(), CVCL::Rational::isInteger(), isInteger(), CVCL::Expr::isRational(), rat(), CVCL::TheoryArith::VarOrderGraph::selectSmallest(), and CVCL::TRACE.

Referenced by computeModelBasic().

void TheoryArith::findRationalBound const Expr varSide,
const Expr ratSide,
const Expr var,
Rational r
[private]
 

Definition at line 1929 of file theory_arith.cpp.

References CVCL::Theory::findExpr(), CVCL::Expr::getRational(), CVCL::isRational(), separateMonomial(), and CVCL::Expr::toString().

Referenced by findBounds().

bool TheoryArith::findBounds const Expr e,
Rational lub,
Rational glb
[private]
 

Definition at line 1947 of file theory_arith.cpp.

References CVCL::ExprMap< Data >::count(), d_inequalitiesLeftDB, d_inequalitiesRightDB, findRationalBound(), CVCL::isLT(), CVCL::CDList< T >::size(), CVCL::ExprMap< Data >::size(), CVCL::Rational::toString(), and CVCL::TRACE.

Referenced by assignVariables().

Theorem TheoryArith::normalizeProjectIneqs const Theorem ineqThm1,
const Theorem ineqThm2
[private]
 

Definition at line 1278 of file theory_arith.cpp.

References CVCL::Theory::addSplitter(), CVCL::Expr::arity(), canonPred(), CVCL::ArithProofRules::constPredicate(), CVCL::Debug::counter(), d_rules, CVCL::ArithProofRules::darkGrayShadow2ab(), CVCL::ArithProofRules::darkGrayShadow2ba(), CVCL::debugger, CVCL::Theory::enqueueFact(), CVCL::Theorem::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getRational(), IF_DEBUG(), CVCL::Theory::iffMP(), CVCL::Expr::isAnd(), CVCL::isInt(), isIntegerThm(), CVCL::isLE(), CVCL::isLT(), CVCL::isMult(), CVCL::Theorem::isNull(), CVCL::Expr::isOr(), CVCL::isPlus(), CVCL::Expr::isRational(), CVCL::ArithProofRules::multIneqn(), processFiniteInterval(), rat(), CVCL::ArithProofRules::realShadow(), CVCL::ArithProofRules::realShadowEq(), CVCL::ArithProofRules::rightMinusLeft(), separateMonomial(), CVCL::Expr::toString(), and CVCL::TRACE.

Referenced by projectInequalities().

Theorem TheoryArith::solvedForm const std::vector< Theorem > &  solvedEqs  )  [private]
 

Take a system of equations and turn it into a solved form.

Takes a vector of equations and for every equation x_i=t_i substitutes t_j for x_j in t_i for all j>i. This turns the system of equations into a solved form.

Assumption: variables x_j may appear in the RHS terms t_i ONLY for i<j, but not for i>=j.

Definition at line 787 of file theory_arith.cpp.

References CVCL::Theory::andIntro(), CVCL::ExprMap< Data >::begin(), CVCL::debugger, CVCL::ExprMap< Data >::end(), CVCL::Theorem::getExpr(), IF_DEBUG(), substAndCanonize(), CVCL::TRACE, and CVCL::Debug::trace().

Referenced by processIntEq().

Theorem TheoryArith::substAndCanonize const Expr t,
ExprMap< Theorem > &  subst
[private]
 

Substitute all vars in term 't' according to the substitution 'subst' and canonize the result.

ASSUMPTION: 't' is a fully canonized arithmetic term, and every element of subst is a fully canonized equation of the form x=e, indexed by the LHS variable.

Definition at line 839 of file theory_arith.cpp.

References CVCL::Expr::arity(), canon(), CVCL::ExprMap< Data >::empty(), CVCL::ExprMap< Data >::end(), CVCL::ExprMap< Data >::find(), CVCL::Theorem::getRHS(), CVCL::Theory::isLeaf(), CVCL::Theory::reflexivityRule(), CVCL::Theory::substitutivityRule(), and CVCL::TRACE.

Referenced by solvedForm(), and substAndCanonize().

Theorem TheoryArith::substAndCanonize const Theorem eq,
ExprMap< Theorem > &  subst
[private]
 

Substitute all vars in the RHS of the equation 'eq' of the form (x = t) according to the substitution 'subst', and canonize the result.

ASSUMPTION: 't' is a fully canonized equation of the form x = t, and so is every element of subst, indexed by the LHS variable.

Definition at line 890 of file theory_arith.cpp.

References CVCL::ExprMap< Data >::empty(), CVCL::Theorem::getExpr(), CVCL::Theorem::getRHS(), CVCL::Theory::iffMP(), CVCL::Theorem::isRewrite(), substAndCanonize(), CVCL::Theory::substitutivityRule(), and CVCL::Expr::toString().

void TheoryArith::collectVars const Expr e,
std::vector< Expr > &  vars,
std::set< Expr > &  cache
[private]
 

Traverse 'e' and push all the i-leaves into 'vars' vector.

Definition at line 1645 of file theory_arith.cpp.

References CVCL::Expr::begin(), CVCL::Expr::end(), CVCL::ExprMap< Data >::insert(), and CVCL::Theory::isLeaf().

void TheoryArith::processFiniteInterval const Theorem alphaLEax,
const Theorem bxLEbeta
[private]
 

Check if alpha <= ax & bx <= beta is a finite interval for integer var 'x', and assert the corresponding constraint.

Definition at line 1658 of file theory_arith.cpp.

References canon(), canonPred(), d_rules, CVCL::Theory::enqueueFact(), CVCL::ArithProofRules::finiteInterval(), CVCL::Theorem::getExpr(), CVCL::Expr::getRational(), CVCL::Theorem::getRHS(), CVCL::Theory::iffMP(), isInteger(), isIntegerThm(), CVCL::isLE(), CVCL::isMult(), CVCL::isPlus(), CVCL::Expr::isRational(), CVCL::isRational(), CVCL::ArithProofRules::multIneqn(), rat(), CVCL::Theory::substitutivityRule(), and CVCL::Theory::symmetryRule().

Referenced by normalizeProjectIneqs(), and processFiniteIntervals().

void TheoryArith::processFiniteIntervals const Expr x  )  [private]
 

For an integer var 'x', find and process all constraints A <= ax <= A+c.

Definition at line 1716 of file theory_arith.cpp.

References d_inequalitiesLeftDB, d_inequalitiesRightDB, CVCL::ExprMap< Data >::end(), CVCL::ExprMap< Data >::find(), isInteger(), processFiniteInterval(), and CVCL::CDList< T >::size().

void TheoryArith::setupRec const Expr e  )  [private]
 

Recursive setup for isolated inequalities (and other new expressions).

This function recursively decends expression tree without caching until it hits a node that is already setup. Be careful on what expressions you are calling it.

Definition at line 1742 of file theory_arith.cpp.

References CVCL::Expr::arity(), CVCL::Expr::hasFind(), CVCL::Theory::reflexivityRule(), CVCL::Expr::setFind(), and setup().

Referenced by projectInequalities().

bool TheoryArith::isSyntacticRational const Expr e  )  [private]
 

Return whether e is syntactically identical to a rational constant.

Definition at line 2598 of file theory_arith.cpp.

References CVCL::isDivide(), CVCL::Expr::isRational(), and CVCL::isUMinus().

Referenced by print().

bool TheoryArith::isSyntacticUMinusVar const Expr e,
Expr var
[private]
 

Return whether e is syntactically identical to unary minus of a var.

Definition at line 2608 of file theory_arith.cpp.

References CVCL::Expr::getRational(), CVCL::isMult(), CVCL::Expr::isRational(), CVCL::isUMinus(), and CVCL::Expr::isVar().

Referenced by print().

bool CVCL::TheoryArith::realUsed  )  [inline]
 

Return whether Reals are used.

Definition at line 313 of file theory_arith.h.

Referenced by CVCL::VCL::~VCL().

bool CVCL::TheoryArith::intUsed  )  [inline]
 

Return whether Ints are used.

Definition at line 315 of file theory_arith.h.

Referenced by CVCL::VCL::~VCL().

ArithLang CVCL::TheoryArith::getLangUsed  )  [inline]
 

Return which subset of arithmetic is used.

Definition at line 317 of file theory_arith.h.

References CVCL::ArithLang.

Referenced by CVCL::VCL::~VCL().

bool CVCL::TheoryArith::theoryUsed  )  [inline, virtual]
 

Theory is used if any component is used.

Reimplemented from CVCL::Theory.

Definition at line 319 of file theory_arith.h.

Referenced by CVCL::VCL::~VCL().

ArithProofRules * TheoryArith::createProofRules VCL vcl  ) 
 

Definition at line 56 of file arith_theorem_producer.cpp.

Referenced by TheoryArith().

void TheoryArith::addSharedTerm const Expr e  )  [virtual]
 

Keep track of all finitely bounded integer variables in shared terms.

When a new shared term t is reported, all of its variables x1...xn are added to the set d_sharedVars.

For each newly added variable x, check all of its opposing inequalities, find out all the finite bounds and assert the corresponding GRAY_SHADOW constraints.

When projecting integer inequalities, the database d_sharedVars is consulted, and if the variable is in it, check the shadows for being a finite interval, and produce the additional GRAY_SHADOW constraints.

Reimplemented from CVCL::Theory.

Definition at line 1771 of file theory_arith.cpp.

References d_sharedTerms.

void TheoryArith::assertFact const Theorem e  )  [virtual]
 

Assert a new fact to the decision procedure.

Each fact that makes it into the core framework is assigned to exactly one theory: the theory associated with that fact. assertFact is called to inform the theory that a new fact has been assigned to the theory.

Implements CVCL::Theory.

Definition at line 1788 of file theory_arith.cpp.

References CVCL::Theory::addSplitter(), addToBuffer(), CVCL::Expr::arity(), CVCL::Debug::counter(), d_buffer, d_bufferIdx, d_bufferThres, d_diseq, d_rules, CVCL::debugger, CVCL::Theory::enqueueFact(), CVCL::ArithProofRules::expandDarkShadow(), CVCL::ArithProofRules::expandGrayShadow(), CVCL::ArithProofRules::expandGrayShadow0(), getC1(), getC2(), getE(), CVCL::Theorem::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getRational(), getV(), CVCL::ArithProofRules::grayShadowConst(), IF_DEBUG(), int2string(), CVCL::Expr::isAnd(), CVCL::isDarkShadow(), CVCL::Expr::isEq(), CVCL::Expr::isFalse(), isGrayShadow(), CVCL::isIntPred(), CVCL::isLE(), CVCL::isLT(), CVCL::isMult(), CVCL::Expr::isNot(), CVCL::Expr::isOr(), CVCL::Expr::isRational(), processBuffer(), CVCL::CDList< T >::push_back(), CVCL::Theory::setInconsistent(), CVCL::CDList< T >::size(), CVCL::ArithProofRules::splitGrayShadow(), CVCL::Expr::toString(), and CVCL::TRACE.

void TheoryArith::refineCounterExample  )  [virtual]
 

Process disequalities from the arrangement for model generation.

Reimplemented from CVCL::Theory.

Definition at line 1898 of file theory_arith.cpp.

References CVCL::Theory::addSplitter(), CVCL::CDMap< Key, Data, HashFcn >::begin(), d_inModelCreation, d_sharedTerms, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::Expr::eqExpr(), CVCL::Theory::findExpr(), CVCL::Theory::getBaseType(), CVCL::Theory::getType(), CVCL::isReal(), CVCL::Type::toString(), CVCL::Expr::toString(), and CVCL::TRACE.

void TheoryArith::computeModelBasic const std::vector< Expr > &  v  )  [virtual]
 

Assign concrete values to basic-type variables in v.

Reimplemented from CVCL::Theory.

Definition at line 2032 of file theory_arith.cpp.

References assignVariables(), d_inModelCreation, CVCL::Theory::findExpr(), and CVCL::TRACE.

void TheoryArith::computeModel const Expr e,
std::vector< Expr > &  vars
[virtual]
 

Compute the value of a compound variable from the more primitive ones.

The more primitive variables for e are already assigned concrete values, and are available through getModelValue().

The new value for e must be assigned using assignValue() method.

Parameters:
e is the compound type expression to assign a value;
vars are the variables actually assigned. Normally, 'e' is the only element of vars. However, e.g. in the case of uninterpreted functions, assigning 'f' means assigning all relevant applications of 'f' to constant values (f(0), f(5), etc.). Such applications might not be known before the model is constructed (they may be of the form f(x), f(y+z), etc., where x,y,z are still unassigned).
Populating 'vars' is an opportunity for a DP to change the set of top-level "variables" to assign, if needed. In particular, it may drop 'e' from the model entirely, if it is already a concrete value by itself.

Reimplemented from CVCL::Theory.

Definition at line 2055 of file theory_arith.cpp.

References CVCL::Theory::assignValue(), CVCL::Theory::findExpr(), CVCL::isRational(), CVCL::Theory::simplifyThm(), and CVCL::Expr::toString().

void TheoryArith::checkSat bool  fullEffort  )  [virtual]
 

Check for satisfiability in the theory.

Parameters:
fullEffort when it is false, checkSat can do as much or as little work as it likes, though simple inferences and checks for consistency should be done to increase efficiency. If fullEffort is true, checkSat must check whether the set of facts given by assertFact together with the arrangement of shared terms (provided by addSharedTerm) induced by the global find database equivalence relation are satisfiable. If satisfiable, checkSat does nothing.
If satisfiability can be acheived by merging some of the shared terms, a new fact must be enqueued using enqueueFact (this fact need not be a literal). If there is no way to make things satisfiable, setInconsistent must be called.

Implements CVCL::Theory.

Definition at line 1876 of file theory_arith.cpp.

References d_buffer, d_bufferIdx, d_diseq, d_diseqIdx, d_rules, CVCL::ArithProofRules::diseqToIneq(), CVCL::Theory::enqueueFact(), CVCL::Theory::inconsistent(), processBuffer(), CVCL::CDList< T >::size(), and CVCL::TRACE.

Theorem TheoryArith::rewrite const Expr e  )  [virtual]
 

Theory-specific rewrite rules.

By default, rewrite just returns a reflexive theorem stating that the input expression is equivalent to itself. However, rewrite is allowed to return any theorem which describes how the input expression is equivalent to some new expression. rewrite should be used to perform simplifications, normalization, and any other preprocessing on theory-specific expressions that needs to be done.

Reimplemented from CVCL::Theory.

Definition at line 2135 of file theory_arith.cpp.

References canon(), canonPredEquiv(), CVCL::ArithProofRules::constPredicate(), d_rules, CVCL::DARK_SHADOW, CVCL::EQ, CVCL::ArithProofRules::flipInequality(), CVCL::GE, CVCL::Expr::getKind(), CVCL::Expr::getRational(), CVCL::Theorem::getRHS(), CVCL::GRAY_SHADOW, CVCL::GT, CVCL::Theory::iffTrue(), CVCL::IS_INTEGER, CVCL::Theory::isAtomic(), CVCL::Expr::isEq(), CVCL::isGE(), CVCL::isGT(), CVCL::isIneq(), isIntegerDerive(), CVCL::Theory::isLeaf(), CVCL::Theory::isLiteral(), CVCL::Theorem::isNull(), CVCL::Expr::isRational(), CVCL::Theory::isTerm(), CVCL::LE, CVCL::LT, CVCL::ArithProofRules::negatedInequality(), normalize(), CVCL::NOT, CVCL::Theory::reflexivityRule(), CVCL::Theory::rewriteUsingSymmetry(), CVCL::ArithProofRules::rightMinusLeft(), CVCL::Expr::setRewriteNormal(), CVCL::TRACE, CVCL::Theory::transitivityRule(), and CVCL::Theory::typePred().

Referenced by update().

void TheoryArith::setup const Expr e  )  [virtual]
 

Set up the term e for call-backs when e or its children change.

setup is called once for each expression associated with the theory. It is typically used to setup theory-specific data for an expression and to add call-back information for use with update.

See also:
update

Reimplemented from CVCL::Theory.

Definition at line 2263 of file theory_arith.cpp.

References CVCL::Expr::addToNotify(), CVCL::Expr::arity(), CVCL::Expr::getKind(), int2string(), CVCL::isDarkShadow(), CVCL::Expr::isEq(), isGrayShadow(), CVCL::isLE(), CVCL::isLT(), CVCL::Expr::isNot(), CVCL::isRational(), CVCL::Theory::isTerm(), and CVCL::TRACE.

Referenced by setupRec().

void TheoryArith::update const Theorem e,
const Expr d
[virtual]
 

Notify a theory of a new equality.

update is a call-back used by the notify mechanism of the core theory. It works as follows. When an equation t1 = t2 makes it into the core framework, the two find equivalence classes for t1 and t2 are merged. The result is that t2 is the new equivalence class representative and t1 is no longer an equivalence class representative. When this happens, the notify list of t1 is traversed. Notify list entries consist of a theory and an expression d. For each entry (i,d), i->update(e, d) is called, where e is the theorem corresponding to the equality t1=t2.

To add the entry (i,d) to a term t1's notify list, a call must be made to t1.addNotify(i,d). This is typically done in setup.

See also:
setup

Reimplemented from CVCL::Theory.

Definition at line 2285 of file theory_arith.cpp.

References CVCL::Debug::counter(), CVCL::debugger, CVCL::Theory::enqueueEquality(), CVCL::Theory::enqueueFact(), CVCL::Theory::find(), CVCL::Theorem::getLHS(), CVCL::Theorem::getRHS(), CVCL::Expr::hasFind(), IF_DEBUG(), CVCL::Theory::iffMP(), CVCL::Theory::iffTrueElim(), CVCL::Theory::inconsistent(), CVCL::isIneq(), rewrite(), CVCL::Theory::rewriteCore(), CVCL::Theory::substitutivityRule(), CVCL::Expr::toString(), CVCL::TRACE, CVCL::Theory::transitivityRule(), CVCL::Theory::trueExpr(), and CVCL::Theory::updateHelper().

Theorem TheoryArith::solve const Theorem thm  )  [virtual]
 

An optional solver.

The solve method can be used to implement a Shostak-style solver. Since solvers do not in general combine, the following technique is used. One theory is designated as the primary solver (in our case, it is the theory of arithmetic). For each equation that enters the core framework, the primary solver is called to ensure that the equation is in solved form with respect to the primary theory.

After the primary solver, the solver for the theory associated with the equation is called. This solver can do whatever it likes, as long as the result is still in solved form with respect to the primary solver. This is a slight generalization of what is described in my (Clark)'s PhD thesis.

Reimplemented from CVCL::Theory.

Definition at line 2330 of file theory_arith.cpp.

References doSolve(), CVCL::Theorem::getExpr(), CVCL::Expr::isEq(), isInteger(), CVCL::Theory::isLeaf(), CVCL::Theory::isLeafIn(), and CVCL::Theory::symmetryRule().

void TheoryArith::computeType const Expr e  )  [virtual]
 

Compute and store the type of e.

Parameters:
e is the expression whose type is computed.
This function computes the type of the top-level operator of e, and recurses into children using getType(), if necessary.

Reimplemented from CVCL::Theory.

Definition at line 2402 of file theory_arith.cpp.

References CVCL::Expr::arity(), CVCL::Theory::boolType(), d_intType, d_realType, CVCL::DARK_SHADOW, CVCL::DIVIDE, CVCL::GE, CVCL::Theory::getBaseType(), CVCL::Expr::getKind(), CVCL::Expr::getRational(), CVCL::Theory::getType(), CVCL::GRAY_SHADOW, CVCL::GT, CVCL::IS_INTEGER, CVCL::isInt(), isInteger(), CVCL::Rational::isInteger(), CVCL::Expr::isRational(), CVCL::LE, CVCL::LT, CVCL::MINUS, CVCL::MULT, CVCL::PLUS, CVCL::POW, CVCL::RATIONAL_EXPR, CVCL::Expr::setType(), CVCL::Expr::toString(), and CVCL::UMINUS.

Type TheoryArith::computeBaseType const Type t  )  [virtual]
 

Compute the base type of the top-level operator of an arbitrary type.

Reimplemented from CVCL::Theory.

Definition at line 2468 of file theory_arith.cpp.

References CVCL::Type::getExpr(), CVCL::Expr::getKind(), IF_DEBUG(), CVCL::INT, CVCL::REAL, realType(), CVCL::SUBRANGE, and CVCL::Type::toString().

void TheoryArith::computeModelTerm const Expr e,
std::vector< Expr > &  v
[virtual]
 

Add variables from 'e' to 'v' for constructing a concrete model.

If e is already of primitive type, do NOT add it to v.

Reimplemented from CVCL::Theory.

Definition at line 2357 of file theory_arith.cpp.

References CVCL::Expr::begin(), CVCL::DIVIDE, CVCL::Expr::end(), CVCL::Theory::findExpr(), CVCL::Expr::getKind(), CVCL::MULT, CVCL::PLUS, CVCL::POW, CVCL::RATIONAL_EXPR, CVCL::Expr::toString(), and CVCL::TRACE.

Expr TheoryArith::computeTypePred const Type t,
const Expr e
[virtual]
 

Theory specific computation of the subtyping predicate for type t applied to the expression e.

By default returns true. Each theory needs to compute subtype predicates for the types associated with it. So, for example, the theory of records will take a record type [# f1: T1, f2: T2 #] and an expression e and will return the subtyping predicate for e, namely: computeTypePred(T1, e.f1) AND computeTypePred(T2, e.f2)

Reimplemented from CVCL::Theory.

Definition at line 2385 of file theory_arith.cpp.

References CVCL::andExpr(), CVCL::Expr::getEM(), CVCL::Theory::getEM(), CVCL::Type::getExpr(), CVCL::Expr::getKind(), CVCL::INT, CVCL::IS_INTEGER, CVCL::leExpr(), CVCL::newExpr(), CVCL::SUBRANGE, and CVCL::ExprManager::trueExpr().

Expr TheoryArith::computeTCC const Expr e  )  [virtual]
 

Compute and cache the TCC of e.

Parameters:
e is an expression (term or formula). This function computes the TCC of e which is true iff the expression is defined.
This function computes the TCC or predicate of the top-level operator of e, and recurses into children using getTCC(), if necessary.

The default implementation is to compute TCCs recursively for all children, and return their conjunction.

Reimplemented from CVCL::Theory.

Definition at line 2477 of file theory_arith.cpp.

References CVCL::Expr::andExpr(), CVCL::DIVIDE, and rat().

ExprStream & TheoryArith::print ExprStream os,
const Expr e
[virtual]
 

Theory-specific pretty-printing.

By default, print the top node in AST, and resume pretty-printing the children. The same call e.print(os) can be used in DP-specific printers to use AST printing for the given node. In fact, it is strongly recommended to add e.print(os) as the default for all the cases/kinds that are not handled by the particular pretty-printer.

Reimplemented from CVCL::Theory.

Definition at line 2640 of file theory_arith.cpp.

References CVCL::Expr::arity(), d_intConstUsed, d_intUsed, d_langUsed, d_realUsed, d_vcl, CVCL::DARK_SHADOW, CVCL::DIVIDE, CVCL::GE, getC1(), getC2(), getE(), CVCL::VCL::getFlags(), CVCL::Expr::getKind(), CVCL::ExprStream::getParent(), CVCL::Expr::getRational(), CVCL::Theory::getType(), getV(), CVCL::GRAY_SHADOW, CVCL::GT, CVCL::INT, CVCL::IS_INTEGER, CVCL::Expr::isEq(), CVCL::isIneq(), CVCL::isInt(), CVCL::isMinus(), CVCL::Expr::isNull(), CVCL::isPlus(), isSyntacticRational(), isSyntacticUMinusVar(), CVCL::Expr::isVar(), CVCL::ExprStream::lang(), CVCL::LE, CVCL::LISP_LANG, CVCL::LT, CVCL::MINUS, CVCL::MULT, CVCL::PLUS, CVCL::POW, CVCL::PRESENTATION_LANG, CVCL::Expr::print(), CVCL::push(), CVCL::RATIONAL_EXPR, CVCL::REAL, CVCL::SMTLIB_LANG, CVCL::space(), CVCL::SUBRANGE, and CVCL::UMINUS.

Expr TheoryArith::parseExprOp const Expr e  )  [virtual]
 

Theory-specific parsing implemented by the DP.

Reimplemented from CVCL::Theory.

Definition at line 2493 of file theory_arith.cpp.

References CVCL::Expr::arity(), CVCL::Expr::begin(), CVCL::DIVIDE, CVCL::divideExpr(), CVCL::Expr::end(), CVCL::GE, CVCL::geExpr(), CVCL::Expr::getEM(), CVCL::Theory::getEM(), CVCL::ExprManager::getKind(), CVCL::Expr::getKind(), CVCL::Expr::getString(), CVCL::GT, CVCL::gtExpr(), CVCL::ID, CVCL::INT, CVCL::INTDIV, CVCL::LE, CVCL::leExpr(), CVCL::LT, CVCL::ltExpr(), CVCL::MINUS, CVCL::minusExpr(), CVCL::MOD, CVCL::MULT, CVCL::multExpr(), CVCL::NEGINF, CVCL::newExpr(), CVCL::NULL_KIND, CVCL::Theory::parseExpr(), CVCL::PLUS, CVCL::plusExpr(), CVCL::POSINF, CVCL::POW, CVCL::powExpr(), CVCL::RAW_LIST, CVCL::REAL, CVCL::SUBRANGE, CVCL::Expr::toString(), CVCL::TRACE, CVCL::UMINUS, and CVCL::uminusExpr().

Type CVCL::TheoryArith::realType  )  [inline]
 

Definition at line 347 of file theory_arith.h.

Referenced by computeBaseType(), and CVCL::VCL::realType().

Type CVCL::TheoryArith::intType  )  [inline]
 

Definition at line 348 of file theory_arith.h.

Referenced by CVCL::VCL::intType().

Type CVCL::TheoryArith::subrangeType const Expr l,
const Expr r
[inline]
 

Definition at line 349 of file theory_arith.h.

References CVCL::newExpr(), and CVCL::SUBRANGE.

Referenced by CVCL::VCL::subrangeType().

Expr CVCL::TheoryArith::rat Rational  r  )  [inline]
 

Definition at line 351 of file theory_arith.h.

References CVCL::newRatExpr().

Referenced by assignVariables(), computeNormalFactor(), computeTCC(), isolateVariable(), normalizeProjectIneqs(), processFiniteInterval(), processRealEq(), processSimpleIntEq(), separateMonomial(), and updateSubsumptionDB().

Expr CVCL::TheoryArith::darkShadow const Expr lhs,
const Expr rhs
[inline]
 

Construct the dark shadow expression representing lhs <= rhs.

Definition at line 354 of file theory_arith.h.

References CVCL::DARK_SHADOW, and CVCL::newExpr().

Expr TheoryArith::grayShadow const Expr v,
const Expr e,
const Rational c1,
const Rational c2
 

Construct the gray shadow expression representing c1 <= v - e <= c2.

Alternatively, v = e + i for some i s.t. c1 <= i <= c2

Definition at line 3016 of file theory_arith.cpp.

References d_grayShadowMMIndex, CVCL::Theory::getEM(), and CVCL::newExpr().

const Rational & TheoryArith::getC1 const Expr grayShadow  ) 
 

Access lhs constant in gray shadow.

Definition at line 3024 of file theory_arith.cpp.

References CVCL::Expr::getRatValue(), isGrayShadow(), and CVCL::Expr::toString().

Referenced by assertFact(), and print().

const Rational & TheoryArith::getC2 const Expr grayShadow  ) 
 

Access rhs constant in gray shadow.

Definition at line 3033 of file theory_arith.cpp.

References CVCL::Expr::getRatValue(), isGrayShadow(), and CVCL::Expr::toString().

Referenced by assertFact(), and print().

const Expr & TheoryArith::getV const Expr grayShadow  ) 
 

Access the monomial in gray shadow.

Definition at line 3042 of file theory_arith.cpp.

References CVCL::Expr::getExprValue(), isGrayShadow(), and CVCL::Expr::toString().

Referenced by assertFact(), and print().

const Expr & TheoryArith::getE const Expr grayShadow  ) 
 

Access the expression in gray shadow.

Definition at line 3050 of file theory_arith.cpp.

References CVCL::Expr::getExprValue(), isGrayShadow(), and CVCL::Expr::toString().

Referenced by assertFact(), and print().

bool CVCL::TheoryArith::isGrayShadow const Expr e  )  [inline]
 

Check for gray shadow.

Definition at line 371 of file theory_arith.h.

References CVCL::Expr::getMMIndex().

Referenced by assertFact(), getC1(), getC2(), getE(), getV(), and setup().


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const FreeConst fc
[friend]
 

Printing.

std::ostream& operator<< std::ostream &  os,
const Ineq ineq
[friend]
 

Printing.


Member Data Documentation

VCL* CVCL::TheoryArith::d_vcl [private]
 

Definition at line 88 of file theory_arith.h.

Referenced by pickMonomial(), print(), projectInequalities(), and TheoryArith().

size_t CVCL::TheoryArith::d_grayShadowMMIndex [private]
 

Definition at line 89 of file theory_arith.h.

Referenced by grayShadow(), and TheoryArith().

Type CVCL::TheoryArith::d_realType [private]
 

Definition at line 90 of file theory_arith.h.

Referenced by computeType(), and TheoryArith().

Type CVCL::TheoryArith::d_intType [private]
 

Definition at line 91 of file theory_arith.h.

Referenced by computeType(), and TheoryArith().

CDList<Theorem> CVCL::TheoryArith::d_diseq [private]
 

Definition at line 92 of file theory_arith.h.

Referenced by assertFact(), checkSat(), and TheoryArith().

CDO<size_t> CVCL::TheoryArith::d_diseqIdx [private]
 

Definition at line 93 of file theory_arith.h.

Referenced by checkSat(), and TheoryArith().

ArithProofRules* CVCL::TheoryArith::d_rules [private]
 

Definition at line 94 of file theory_arith.h.

Referenced by addToBuffer(), assertFact(), canon(), checkSat(), doSolve(), isolateVariable(), normalize(), normalizeProjectIneqs(), processFiniteInterval(), processRealEq(), processSimpleIntEq(), projectInequalities(), rewrite(), TheoryArith(), and ~TheoryArith().

CDO<bool> CVCL::TheoryArith::d_inModelCreation [private]
 

Definition at line 95 of file theory_arith.h.

Referenced by computeModelBasic(), refineCounterExample(), and TheoryArith().

bool CVCL::TheoryArith::d_realUsed [private]
 

Definition at line 96 of file theory_arith.h.

Referenced by print(), and TheoryArith().

bool CVCL::TheoryArith::d_intUsed [private]
 

Definition at line 97 of file theory_arith.h.

Referenced by print(), and TheoryArith().

bool CVCL::TheoryArith::d_intConstUsed [private]
 

Definition at line 98 of file theory_arith.h.

Referenced by print(), and TheoryArith().

ArithLang CVCL::TheoryArith::d_langUsed [private]
 

Definition at line 99 of file theory_arith.h.

Referenced by print(), and TheoryArith().

ExprMap<CDList<Ineq> *> CVCL::TheoryArith::d_inequalitiesRightDB [private]
 

Database of inequalities with a variable isolated on the right.

Definition at line 139 of file theory_arith.h.

Referenced by findBounds(), processFiniteIntervals(), projectInequalities(), and ~TheoryArith().

ExprMap<CDList<Ineq> *> CVCL::TheoryArith::d_inequalitiesLeftDB [private]
 

Database of inequalities with a variable isolated on the left.

Definition at line 141 of file theory_arith.h.

Referenced by findBounds(), processFiniteIntervals(), projectInequalities(), and ~TheoryArith().

CDMap<Expr, FreeConst> CVCL::TheoryArith::d_freeConstDB [private]
 

Mapping of inequalities to the largest/smallest free constant.

The Expr is the original inequality with the free constant removed and inequality converted to non-strict (for indexing purposes). I.e. ax<c+t becomes ax<=t. This inequality is mapped to a pair<c,strict>, the smallest (largest for c+t<ax) constant among inequalities with the same 'a', 'x', and 't', and a boolean flag indicating whether the strongest inequality is strict.

Definition at line 150 of file theory_arith.h.

Referenced by TheoryArith(), and updateSubsumptionDB().

CDList<Theorem> CVCL::TheoryArith::d_buffer [private]
 

Buffer of input inequalities.

Definition at line 152 of file theory_arith.h.

Referenced by addToBuffer(), assertFact(), checkSat(), processBuffer(), and TheoryArith().

CDO<size_t> CVCL::TheoryArith::d_bufferIdx [private]
 

Buffer index of the next unprocessed inequality.

Definition at line 153 of file theory_arith.h.

Referenced by assertFact(), checkSat(), processBuffer(), and TheoryArith().

const int* CVCL::TheoryArith::d_bufferThres [private]
 

Threshold when the buffer must be processed.

Definition at line 154 of file theory_arith.h.

Referenced by assertFact(), and TheoryArith().

CDMap<Expr, int> CVCL::TheoryArith::d_countRight [private]
 

Mapping of a variable to the number of inequalities where the variable would be isolated on the right.

Definition at line 158 of file theory_arith.h.

Referenced by pickMonomial(), TheoryArith(), and updateStats().

CDMap<Expr, int> CVCL::TheoryArith::d_countLeft [private]
 

Mapping of a variable to the number of inequalities where the variable would be isolated on the left.

Definition at line 161 of file theory_arith.h.

Referenced by pickMonomial(), TheoryArith(), and updateStats().

CDMap<Expr, bool> CVCL::TheoryArith::d_sharedTerms [private]
 

Set of shared terms (for counterexample generation).

Definition at line 163 of file theory_arith.h.

Referenced by addSharedTerm(), refineCounterExample(), and TheoryArith().

CDMap<Expr, bool> CVCL::TheoryArith::d_sharedVars [private]
 

Set of shared integer variables (i-leaves).

Definition at line 165 of file theory_arith.h.

Referenced by TheoryArith().

VarOrderGraph CVCL::TheoryArith::d_graph [private]
 

Definition at line 185 of file theory_arith.h.

Referenced by assignVariables(), and pickMonomial().


The documentation for this class was generated from the following files:
Generated on Fri May 20 13:14:17 2005 for CVC Lite by  doxygen 1.3.9.1