#include <theory_arith.h>
Inheritance diagram for CVCL::TheoryArith:

Author: Clark Barrett
Created: Sat Feb 8 14:44:32 2003
Definition at line 87 of file theory_arith.h.
|
|
|
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(). |
|
|
Check the term t for integrality.
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(). |
|
||||||||||||
|
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(). |
|
|
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(). |
|
||||||||||||
|
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(). |
|
||||||||||||||||
|
Update the free constant subsumption database with new 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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
Solve an equation and return an equivalent Theorem in the solved form. Psuedo-code for doSolve. (Input is an equation) (output is a Theorem)
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(). |
|
|
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. |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
One step of INT equality processing (aux. method for processIntEq()).
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(). |
|
|
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(). |
|
||||||||||||
|
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(). |
|
||||||||||||
|
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(). |
|
|
Update the statistics counters for the monomial.
Definition at line 949 of file theory_arith.cpp. References CVCL::Expr::getRational(), separateMonomial(), and updateStats(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
||||||||||||||||
|
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(). |
|
||||||||||||
|
Definition at line 1093 of file theory_arith.cpp. References CVCL::isRational(), and separateMonomial(). Referenced by pickMonomial(). |
|
|
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(). |
|
|
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(). |
|
||||||||||||
|
|
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(). |
|
||||||||||||||||||||
|
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(). |
|
||||||||||||||||
|
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(). |
|
||||||||||||
|
|
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(). |
|
||||||||||||
|
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(). |
|
||||||||||||
|
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(). |
|
||||||||||||||||
|
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(). |
|
||||||||||||
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
||||||||||||
|
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(). |
|
|
Return whether Reals are used.
Definition at line 313 of file theory_arith.h. Referenced by CVCL::VCL::~VCL(). |
|
|
Return whether Ints are used.
Definition at line 315 of file theory_arith.h. Referenced by CVCL::VCL::~VCL(). |
|
|
Return which subset of arithmetic is used.
Definition at line 317 of file theory_arith.h. References CVCL::ArithLang. Referenced by CVCL::VCL::~VCL(). |
|
|
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(). |
|
|
Definition at line 56 of file arith_theorem_producer.cpp. Referenced by TheoryArith(). |
|
|
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. |
|
|
|
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. |
|
|
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. |
|
||||||||||||
|
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.
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(). |
|
|
Check for satisfiability in the theory.
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. |
|
|
|
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.
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(). |
|
||||||||||||
|
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.
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(). |
|
|
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(). |
|
|
Compute and store the type of e.
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. |
|
|
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(). |
|
||||||||||||
|
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. |
|
||||||||||||
|
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(). |
|
|
Compute and cache the TCC of e.
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(). |
|
||||||||||||
|
|
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(). |
|
|
Definition at line 347 of file theory_arith.h. Referenced by computeBaseType(), and CVCL::VCL::realType(). |
|
|
Definition at line 348 of file theory_arith.h. Referenced by CVCL::VCL::intType(). |
|
||||||||||||
|
Definition at line 349 of file theory_arith.h. References CVCL::newExpr(), and CVCL::SUBRANGE. Referenced by CVCL::VCL::subrangeType(). |
|
|
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(). |
|
||||||||||||
|
Construct the dark shadow expression representing lhs <= rhs.
Definition at line 354 of file theory_arith.h. References CVCL::DARK_SHADOW, and CVCL::newExpr(). |
|
||||||||||||||||||||
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
||||||||||||
|
Printing.
|
|
||||||||||||
|
Printing.
|
|
|
Definition at line 88 of file theory_arith.h. Referenced by pickMonomial(), print(), projectInequalities(), and TheoryArith(). |
|
|
Definition at line 89 of file theory_arith.h. Referenced by grayShadow(), and TheoryArith(). |
|
|
Definition at line 90 of file theory_arith.h. Referenced by computeType(), and TheoryArith(). |
|
|
Definition at line 91 of file theory_arith.h. Referenced by computeType(), and TheoryArith(). |
|
|
Definition at line 92 of file theory_arith.h. Referenced by assertFact(), checkSat(), and TheoryArith(). |
|
|
Definition at line 93 of file theory_arith.h. Referenced by checkSat(), and TheoryArith(). |
|
|
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(). |
|
|
Definition at line 95 of file theory_arith.h. Referenced by computeModelBasic(), refineCounterExample(), and TheoryArith(). |
|
|
Definition at line 96 of file theory_arith.h. Referenced by print(), and TheoryArith(). |
|
|
Definition at line 97 of file theory_arith.h. Referenced by print(), and TheoryArith(). |
|
|
Definition at line 98 of file theory_arith.h. Referenced by print(), and TheoryArith(). |
|
|
Definition at line 99 of file theory_arith.h. Referenced by print(), and TheoryArith(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
Buffer of input inequalities.
Definition at line 152 of file theory_arith.h. Referenced by addToBuffer(), assertFact(), checkSat(), processBuffer(), and TheoryArith(). |
|
|
Buffer index of the next unprocessed inequality.
Definition at line 153 of file theory_arith.h. Referenced by assertFact(), checkSat(), processBuffer(), and TheoryArith(). |
|
|
Threshold when the buffer must be processed.
Definition at line 154 of file theory_arith.h. Referenced by assertFact(), and TheoryArith(). |
|
|
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(). |
|
|
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(). |
|
|
Set of shared terms (for counterexample generation).
Definition at line 163 of file theory_arith.h. Referenced by addSharedTerm(), refineCounterExample(), and TheoryArith(). |
|
|
Set of shared integer variables (i-leaves).
Definition at line 165 of file theory_arith.h. Referenced by TheoryArith(). |
|
|
Definition at line 185 of file theory_arith.h. Referenced by assignVariables(), and pickMonomial(). |
1.3.9.1