CVC3
2.4.1
|
#include <theory_arith_old.h>
Classes | |
class | DifferenceLogicGraph |
class | FreeConst |
Data class for the strongest free constant in separation inqualities. More... | |
struct | GraphEdge |
class | Ineq |
Private class for an inequality in the Fourier-Motzkin database. More... | |
class | VarOrderGraph |
Public Member Functions | |
void | separateMonomial (const Expr &e, Expr &c, Expr &var) |
Separate monomial e = c*p1*...*pn into c and 1*p1*...*pn. More... | |
bool | isInteger (const Expr &e) |
Check the term t for integrality (return bool) More... | |
TheoryArithOld (TheoryCore *core) | |
~TheoryArithOld () | |
ArithProofRules * | createProofRulesOld () |
void | addSharedTerm (const Expr &e) |
Notify theory of a new shared term. More... | |
void | assertFact (const Theorem &e) |
Assert a new fact to the decision procedure. More... | |
void | refineCounterExample () |
Process disequalities from the arrangement for model generation. More... | |
void | computeModelBasic (const std::vector< Expr > &v) |
Assign concrete values to basic-type variables in v. More... | |
void | computeModel (const Expr &e, std::vector< Expr > &vars) |
Compute the value of a compound variable from the more primitive ones. More... | |
void | checkSat (bool fullEffort) |
Check for satisfiability in the theory. More... | |
Theorem | rewrite (const Expr &e) |
Theory-specific rewrite rules. More... | |
void | setup (const Expr &e) |
Set up the term e for call-backs when e or its children change. More... | |
void | update (const Theorem &e, const Expr &d) |
Notify a theory of a new equality. More... | |
Theorem | solve (const Theorem &e) |
An optional solver. More... | |
void | checkAssertEqInvariant (const Theorem &e) |
A debug check used by the primary solver. More... | |
void | checkType (const Expr &e) |
Check that e is a valid Type expr. More... | |
Cardinality | finiteTypeInfo (Expr &e, Unsigned &n, bool enumerate, bool computeSize) |
Compute information related to finiteness of types. More... | |
void | computeType (const Expr &e) |
Compute and store the type of e. More... | |
Type | computeBaseType (const Type &t) |
Compute the base type of the top-level operator of an arbitrary type. More... | |
void | computeModelTerm (const Expr &e, std::vector< Expr > &v) |
Add variables from 'e' to 'v' for constructing a concrete model. More... | |
Expr | computeTypePred (const Type &t, const Expr &e) |
Theory specific computation of the subtyping predicate for type t applied to the expression e. More... | |
Expr | computeTCC (const Expr &e) |
Compute and cache the TCC of e. More... | |
ExprStream & | print (ExprStream &os, const Expr &e) |
Theory-specific pretty-printing. More... | |
Expr | parseExprOp (const Expr &e) |
Theory-specific parsing implemented by the DP. More... | |
void | updateConstrained (const Expr &t) |
bool | isUnconstrained (const Expr &t) |
void | tryPropagate (const Expr &x, const Expr &y, const DifferenceLogicGraph::EdgeInfo &x_y_edge, int kind) |
void | addMultiplicativeSignSplit (const Theorem &case_split_thm) |
bool | addPairToArithOrder (const Expr &smaller, const Expr &bigger) |
bool | nonlinearSignSplit () const |
bool | isNonlinearEq (const Expr &e) |
bool | isNonlinearSumTerm (const Expr &term) |
bool | isPowersEquality (const Expr &nonlinearEq, Expr &power1, Expr &power2) |
bool | isPowerEquality (const Expr &nonlinearEq, Rational &constant, Expr &power1) |
![]() | |
TheoryArith (TheoryCore *core, const std::string &name) | |
~TheoryArith () | |
bool | isSyntacticRational (const Expr &e, Rational &r) |
Return whether e is syntactically identical to a rational constant. More... | |
bool | isAtomicArithFormula (const Expr &e) |
Whether any ite's appear in the arithmetic part of the formula e. More... | |
Expr | rewriteToDiff (const Expr &e) |
Rewrite an atom to look like x - y op c if possible–for smtlib translation. More... | |
Theorem | canonThm (const Theorem &thm) |
Composition of canon(const Expr&) by transitivity: take e0 = e1, canonize e1 to e2, return e0 = e2. More... | |
Type | realType () |
Type | intType () |
Type | subrangeType (const Expr &l, const Expr &r) |
Expr | rat (Rational r) |
Expr | darkShadow (const Expr &lhs, const Expr &rhs) |
Construct the dark shadow expression representing lhs <= rhs. More... | |
Expr | grayShadow (const Expr &v, const Expr &e, const Rational &c1, const Rational &c2) |
Construct the gray shadow expression representing c1 <= v - e <= c2. More... | |
bool | leavesAreNumConst (const Expr &e) |
![]() | |
Theory (TheoryCore *theoryCore, const std::string &name) | |
Whether theory has been used (for smtlib translator) More... | |
virtual | ~Theory (void) |
Destructor. More... | |
ExprManager * | getEM () |
Access to ExprManager. More... | |
TheoryCore * | theoryCore () |
Get a pointer to theoryCore. More... | |
CommonProofRules * | getCommonRules () |
Get a pointer to common proof rules. More... | |
const std::string & | getName () const |
Get the name of the theory (for debugging purposes) More... | |
virtual void | setUsed () |
Set the "used" flag on this theory (for smtlib translator) More... | |
virtual bool | theoryUsed () |
Get whether theory has been used (for smtlib translator) More... | |
virtual Theorem | theoryPreprocess (const Expr &e) |
Theory-specific preprocessing. More... | |
virtual Theorem | simplifyOp (const Expr &e) |
Recursive simplification step. More... | |
virtual void | assertTypePred (const Expr &e, const Theorem &pred) |
Receives all the type predicates for the types of the given theory. More... | |
virtual Theorem | rewriteAtomic (const Expr &e) |
Theory-specific rewrites for atomic formulas. More... | |
virtual void | notifyInconsistent (const Theorem &thm) |
Notification of conflict. More... | |
virtual void | registerAtom (const Expr &e, const Theorem &thm) |
virtual bool | inconsistent () |
Check if the current context is inconsistent. More... | |
virtual void | setInconsistent (const Theorem &e) |
Make the context inconsistent; The formula proved by e must FALSE. More... | |
virtual void | setIncomplete (const std::string &reason) |
Mark the current decision branch as possibly incomplete. More... | |
virtual Theorem | simplify (const Expr &e) |
Simplify a term e and return a Theorem(e==e') More... | |
Expr | simplifyExpr (const Expr &e) |
Simplify a term e w.r.t. the current context. More... | |
virtual void | enqueueFact (const Theorem &e) |
Submit a derived fact to the core from a decision procedure. More... | |
virtual void | enqueueSE (const Theorem &e) |
Check if the current context is inconsistent. More... | |
virtual void | assertEqualities (const Theorem &e) |
Handle new equalities (usually asserted through addFact) More... | |
virtual Expr | parseExpr (const Expr &e) |
Parse the generic expression. More... | |
virtual void | assignValue (const Expr &t, const Expr &val) |
Assigns t a concrete value val. Used in model generation. More... | |
virtual void | assignValue (const Theorem &thm) |
Record a derived assignment to a variable (LHS). More... | |
void | registerKinds (Theory *theory, std::vector< int > &kinds) |
Register new kinds with the given theory. More... | |
void | unregisterKinds (Theory *theory, std::vector< int > &kinds) |
Unregister kinds for a theory. More... | |
void | registerTheory (Theory *theory, std::vector< int > &kinds, bool hasSolver=false) |
Register a new theory. More... | |
void | unregisterTheory (Theory *theory, std::vector< int > &kinds, bool hasSolver) |
Unregister a theory. More... | |
int | getNumTheories () |
Return the number of registered theories. More... | |
bool | hasTheory (int kind) |
Test whether a kind maps to any theory. More... | |
Theory * | theoryOf (int kind) |
Return the theory associated with a kind. More... | |
Theory * | theoryOf (const Type &e) |
Return the theory associated with a type. More... | |
Theory * | theoryOf (const Expr &e) |
Return the theory associated with an Expr. More... | |
Theorem | find (const Expr &e) |
Return the theorem that e is equal to its find. More... | |
const Theorem & | findRef (const Expr &e) |
Return the find as a reference: expr must have a find. More... | |
Theorem | findReduce (const Expr &e) |
Return find-reduced version of e. More... | |
bool | findReduced (const Expr &e) |
Return true iff e is find-reduced. More... | |
Expr | findExpr (const Expr &e) |
Return the find of e, or e if it has no find. More... | |
Expr | getTCC (const Expr &e) |
Compute the TCC of e, or the subtyping predicate, if e is a type. More... | |
Type | getBaseType (const Expr &e) |
Compute (or look up in cache) the base type of e and return the result. More... | |
Type | getBaseType (const Type &tp) |
Compute the base type from an arbitrary type. More... | |
Expr | getTypePred (const Type &t, const Expr &e) |
Calls the correct theory to compute a type predicate. More... | |
Theorem | updateHelper (const Expr &e) |
Update the children of the term e. More... | |
void | setupCC (const Expr &e) |
Setup a term for congruence closure (must have sig and rep attributes) More... | |
void | updateCC (const Theorem &e, const Expr &d) |
Update a term w.r.t. congruence closure (must be setup with setupCC()) More... | |
Theorem | rewriteCC (const Expr &e) |
Rewrite a term w.r.t. congruence closure (must be setup with setupCC()) More... | |
void | getModelTerm (const Expr &e, std::vector< Expr > &v) |
Calls the correct theory to get all of the terms that need to be assigned values in the concrete model. More... | |
Theorem | getModelValue (const Expr &e) |
Fetch the concrete assignment to the variable during model generation. More... | |
void | addSplitter (const Expr &e, int priority=0) |
Suggest a splitter to the SearchEngine. More... | |
void | addGlobalLemma (const Theorem &thm, int priority=0) |
Add a global lemma. More... | |
bool | isLeaf (const Expr &e) |
Test if e is an i-leaf term for the current theory. More... | |
bool | isLeafIn (const Expr &e1, const Expr &e2) |
Test if e1 is an i-leaf in e2. More... | |
bool | leavesAreSimp (const Expr &e) |
Test if all i-leaves of e are simplified. More... | |
Type | boolType () |
Return BOOLEAN type. More... | |
const Expr & | falseExpr () |
Return FALSE Expr. More... | |
const Expr & | trueExpr () |
Return TRUE Expr. More... | |
Expr | newVar (const std::string &name, const Type &type) |
Create a new variable given its name and type. More... | |
Expr | newVar (const std::string &name, const Type &type, const Expr &def) |
Create a new named expression given its name, type, and definition. More... | |
Op | newFunction (const std::string &name, const Type &type, bool computeTransClosure) |
Create a new uninterpreted function. More... | |
Op | lookupFunction (const std::string &name, Type *type) |
Look up a function by name. More... | |
Op | newFunction (const std::string &name, const Type &type, const Expr &def) |
Create a new defined function. More... | |
Expr | addBoundVar (const std::string &name, const Type &type) |
Create and add a new bound variable to the stack, for parseExprOp(). More... | |
Expr | addBoundVar (const std::string &name, const Type &type, const Expr &def) |
Create and add a new bound named def to the stack, for parseExprOp(). More... | |
Expr | lookupVar (const std::string &name, Type *type) |
Lookup variable and return it and its type. Return NULL Expr if it doesn't exist yet. More... | |
Type | newTypeExpr (const std::string &name) |
Create a new uninterpreted type with the given name. More... | |
Type | lookupTypeExpr (const std::string &name) |
Lookup type by name. Return Null if no such type exists. More... | |
Type | newTypeExpr (const std::string &name, const Type &def) |
Create a new type abbreviation with the given name. More... | |
Type | newSubtypeExpr (const Expr &pred, const Expr &witness) |
Create a new subtype expression. More... | |
Expr | resolveID (const std::string &name) |
Resolve an identifier, for use in parseExprOp() More... | |
void | installID (const std::string &name, const Expr &e) |
Install name as a new identifier associated with Expr e. More... | |
Theorem | typePred (const Expr &e) |
Return BOOLEAN type. More... | |
Theorem | reflexivityRule (const Expr &a) |
==> a == a More... | |
Theorem | symmetryRule (const Theorem &a1_eq_a2) |
a1 == a2 ==> a2 == a1 More... | |
Theorem | transitivityRule (const Theorem &a1_eq_a2, const Theorem &a2_eq_a3) |
(a1 == a2) & (a2 == a3) ==> (a1 == a3) More... | |
Theorem | substitutivityRule (const Op &op, const std::vector< Theorem > &thms) |
(c_1 == d_1) & ... & (c_n == d_n) ==> op(c_1,...,c_n) == op(d_1,...,d_n) More... | |
Theorem | substitutivityRule (const Expr &e, const Theorem &t) |
Special case for unary operators. More... | |
Theorem | substitutivityRule (const Expr &e, const Theorem &t1, const Theorem &t2) |
Special case for binary operators. More... | |
Theorem | substitutivityRule (const Expr &e, const std::vector< unsigned > &changed, const std::vector< Theorem > &thms) |
Optimized: only positions which changed are included. More... | |
Theorem | substitutivityRule (const Expr &e, int changed, const Theorem &thm) |
Optimized: only a single position changed. More... | |
Theorem | iffMP (const Theorem &e1, const Theorem &e1_iff_e2) |
e1 AND (e1 IFF e2) ==> e2 More... | |
Theorem | rewriteAnd (const Expr &e) |
==> AND(e1,e2) IFF [simplified expr] More... | |
Theorem | rewriteOr (const Expr &e) |
==> OR(e1,...,en) IFF [simplified expr] More... | |
Theorem | rewriteIte (const Expr &e) |
Derived rule for rewriting ITE. More... | |
Theorem | renameExpr (const Expr &e) |
Derived rule to create a new name for an expression. More... | |
Private Types | |
enum | BoundsQueryType { QueryWithCacheLeaves, QueryWithCacheLeavesAndConstrainedComputation, QueryWithCacheAll } |
typedef ExprMap< std::set < std::pair< Rational, Expr > > > | AtomsMap |
Private Member Functions | |
Theorem | isIntegerThm (const Expr &e) |
Check the term t for integrality. More... | |
Theorem | isIntegerDerive (const Expr &isIntE, const Theorem &thm) |
A helper method for isIntegerThm() More... | |
const Rational & | freeConstIneq (const Expr &ineq, bool varOnRHS) |
Extract the free constant from an inequality. More... | |
const FreeConst & | updateSubsumptionDB (const Expr &ineq, bool varOnRHS, bool &subsumed) |
Update the free constant subsumption database with new inequality. More... | |
bool | kidsCanonical (const Expr &e) |
Check if the kids of e are fully simplified and canonized (for debugging) More... | |
Theorem | canon (const Expr &e) |
Canonize the expression e, assuming, all children are canonical. More... | |
Theorem | canonSimplify (const Expr &e) |
Canonize and reduce e w.r.t. union-find database; assume all children are canonical. More... | |
Theorem | canonSimplify (const Theorem &thm) |
Composition of canonSimplify(const Expr&) by transitivity: take e0 = e1, canonize and simplify e1 to e2, return e0 = e2. More... | |
Theorem | canonPred (const Theorem &thm) |
Canonize predicate (x = y, x < y, etc.) More... | |
Theorem | canonPredEquiv (const Theorem &thm) |
Theorem | doSolve (const Theorem &e) |
Solve an equation and return an equivalent Theorem in the solved form. More... | |
Theorem | canonConjunctionEquiv (const Theorem &thm) |
takes in a conjunction equivalence Thm and canonizes it. More... | |
bool | pickIntEqMonomial (const Expr &right, Expr &isolated, bool &nonlin) |
picks the monomial with the smallest abs(coeff) from the input More... | |
Theorem | processRealEq (const Theorem &eqn) |
processes equalities with 1 or more vars of type REAL More... | |
Theorem | processIntEq (const Theorem &eqn) |
processes equalities whose vars are all of type INT More... | |
Theorem | processSimpleIntEq (const Theorem &eqn) |
One step of INT equality processing (aux. method for processIntEq()) More... | |
void | processBuffer () |
Process inequalities in the buffer. More... | |
Theorem | isolateVariable (const Theorem &inputThm, bool &e1) |
Take an inequality and isolate a variable. More... | |
void | updateStats (const Rational &c, const Expr &var) |
Update the statistics counters for the variable with a coeff. c. More... | |
void | updateStats (const Expr &monomial) |
Update the statistics counters for the monomial. More... | |
bool | addToBuffer (const Theorem &thm, bool priority=false) |
Add an inequality to the input buffer. See also d_buffer. More... | |
Expr | computeNormalFactor (const Expr &rhs, bool normalizeConstants) |
Given a canonized term, compute a factor to make all coefficients integer and relatively prime. More... | |
Theorem | normalize (const Expr &e) |
Normalize an equation (make all coefficients rel. prime integers) More... | |
Theorem | normalize (const Theorem &thm) |
Normalize an equation (make all coefficients rel. prime integers) More... | |
Expr | pickMonomial (const Expr &right) |
void | getFactors (const Expr &e, std::set< Expr > &factors) |
bool | lessThanVar (const Expr &isolatedVar, const Expr &var2) |
bool | isStale (const Expr &e) |
Check if the term expression is "stale". More... | |
bool | isStale (const Ineq &ineq) |
Check if the inequality is "stale" or subsumed. More... | |
void | projectInequalities (const Theorem &theInequality, bool isolatedVarOnRHS) |
void | assignVariables (std::vector< Expr > &v) |
void | findRationalBound (const Expr &varSide, const Expr &ratSide, const Expr &var, Rational &r) |
bool | findBounds (const Expr &e, Rational &lub, Rational &glb) |
Theorem | normalizeProjectIneqs (const Theorem &ineqThm1, const Theorem &ineqThm2) |
Theorem | solvedForm (const std::vector< Theorem > &solvedEqs) |
Take a system of equations and turn it into a solved form. More... | |
Theorem | substAndCanonize (const Expr &t, ExprMap< Theorem > &subst) |
Substitute all vars in term 't' according to the substitution 'subst' and canonize the result. More... | |
Theorem | substAndCanonize (const Theorem &eq, ExprMap< Theorem > &subst) |
Substitute all vars in the RHS of the equation 'eq' of the form (x = t) according to the substitution 'subst', and canonize the result. More... | |
void | collectVars (const Expr &e, std::vector< Expr > &vars, std::set< Expr > &cache) |
Traverse 'e' and push all the i-leaves into 'vars' vector. More... | |
void | processFiniteInterval (const Theorem &alphaLEax, const Theorem &bxLEbeta) |
Check if alpha <= ax & bx <= beta is a finite interval for integer var 'x', and assert the corresponding constraint. More... | |
void | processFiniteIntervals (const Expr &x) |
For an integer var 'x', find and process all constraints A <= ax <= A+c. More... | |
void | setupRec (const Expr &e) |
Recursive setup for isolated inequalities (and other new expressions) More... | |
Rational | currentMaxCoefficient (Expr var) |
void | fixCurrentMaxCoefficient (Expr variable, Rational max) |
void | selectSmallestByCoefficient (const std::vector< Expr > &input, std::vector< Expr > &output) |
Theorem | rafineInequalityToInteger (const Theorem &thm) |
Theorem | checkIntegerEquality (const Theorem &thm) |
Theorem | inequalityToFind (const Theorem &inequalityThm, bool normalizeRHS) |
int | extractTermsFromInequality (const Expr &inequality, Rational &c1, Expr &t1, Rational &c2, Expr &t2) |
void | registerAtom (const Expr &e) |
Theory-specific registration of atoms. More... | |
int | termDegree (const Expr &e) |
bool | canPickEqMonomial (const Expr &right) |
bool | isBounded (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
bool | hasLowerBound (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
bool | hasUpperBound (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
bool | isConstrained (const Expr &t, bool intOnly=true, BoundsQueryType queryType=QueryWithCacheLeaves) |
bool | isConstrainedAbove (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
bool | isConstrainedBelow (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
DifferenceLogicGraph::EpsRational | getUpperBound (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
DifferenceLogicGraph::EpsRational | getLowerBound (const Expr &t, BoundsQueryType queryType=QueryWithCacheLeaves) |
int | computeTermBounds () |
Private Attributes | |
CDList< Theorem > | d_diseq |
CDO< size_t > | d_diseqIdx |
CDMap< Expr, bool > | diseqSplitAlready |
ArithProofRules * | d_rules |
CDO< bool > | d_inModelCreation |
ExprMap< CDList< Ineq > * > | d_inequalitiesRightDB |
Database of inequalities with a variable isolated on the right. More... | |
ExprMap< CDList< Ineq > * > | d_inequalitiesLeftDB |
Database of inequalities with a variable isolated on the left. More... | |
CDMap< Expr, FreeConst > | d_freeConstDB |
Mapping of inequalities to the largest/smallest free constant. More... | |
CDList< Theorem > | d_buffer_0 |
Buffer of input inequalities (high priority) More... | |
CDList< Theorem > | d_buffer_1 |
Buffer of input inequalities (one variable) More... | |
CDList< Theorem > | d_buffer_2 |
Buffer of input inequalities (small constraints) More... | |
CDList< Theorem > | d_buffer_3 |
Buffer of input inequalities (big constraint) More... | |
CDO< size_t > | d_bufferIdx_0 |
Buffer index of the next unprocessed inequality. More... | |
CDO< size_t > | d_bufferIdx_1 |
Buffer index of the next unprocessed inequality. More... | |
CDO< size_t > | d_bufferIdx_2 |
Buffer index of the next unprocessed inequality. More... | |
CDO< size_t > | d_bufferIdx_3 |
Buffer index of the next unprocessed inequality. More... | |
CDO< size_t > | diff_logic_size |
Number of queries that are just difference logic. More... | |
const int * | d_bufferThres |
Threshold when the buffer must be processed. More... | |
const bool * | d_splitSign |
const int * | d_grayShadowThres |
Threshold on gray shadow size (ignore it and set incomplete) More... | |
CDMap< Expr, int > | d_countRight |
Mapping of a variable to the number of inequalities where the variable would be isolated on the right. More... | |
CDMap< Expr, int > | d_countLeft |
Mapping of a variable to the number of inequalities where the variable would be isolated on the left. More... | |
CDMap< Expr, bool > | d_sharedTerms |
Set of shared terms (for counterexample generation) More... | |
CDList< Expr > | d_sharedTermsList |
CDMap< Expr, bool > | d_sharedVars |
Set of shared integer variables (i-leaves) More... | |
VarOrderGraph | d_graph |
ExprMap< Rational > | maxCoefficientLeft |
ExprMap< Rational > | maxCoefficientRight |
ExprMap< Rational > | fixedMaxCoefficient |
CDMap< Expr, Theorem > | bufferedInequalities |
CDMap< Expr, Rational > | termLowerBound |
CDMap< Expr, Theorem > | termLowerBoundThm |
CDMap< Expr, Rational > | termUpperBound |
CDMap< Expr, Theorem > | termUpperBoundThm |
CDMap< Expr, Expr > | alreadyProjected |
CDMap< Expr, bool > | dontBuffer |
CDO< bool > | diffLogicOnly |
AtomsMap | formulaAtomLowerBound |
AtomsMap | formulaAtomUpperBound |
ExprMap< bool > | formulaAtoms |
DifferenceLogicGraph | diffLogicGraph |
Expr | zero |
CDO< unsigned > | shared_index_1 |
CDO< unsigned > | shared_index_2 |
std::vector< Theorem > | multiplicativeSignSplits |
CDMap< Expr, DifferenceLogicGraph::EpsRational > | termUpperBounded |
CDMap< Expr, DifferenceLogicGraph::EpsRational > | termLowerBounded |
CDMap< Expr, bool > | d_varConstrainedPlus |
CDMap< Expr, bool > | d_varConstrainedMinus |
CDMap< Expr, bool > | termConstrainedBelow |
CDMap< Expr, bool > | termConstrainedAbove |
Friends | |
std::ostream & | operator<< (std::ostream &os, const FreeConst &fc) |
Printing. More... | |
std::ostream & | operator<< (std::ostream &os, const Ineq &ineq) |
Printing. More... | |
Additional Inherited Members | |
![]() | |
Theorem | canonRec (const Expr &e) |
Canonize the expression e recursively. More... | |
void | printRational (ExprStream &os, const Rational &r, bool printAsReal=false) |
Print a rational in SMT-LIB format. More... | |
bool | isAtomicArithTerm (const Expr &e) |
Whether any ite's appear in the arithmetic part of the term e. More... | |
Theorem | canonSimp (const Expr &e) |
simplify leaves and then canonize More... | |
bool | recursiveCanonSimpCheck (const Expr &e) |
helper for checkAssertEqInvariant More... | |
![]() | |
Type | d_realType |
Type | d_intType |
std::vector< int > | d_kinds |
Definition at line 30 of file theory_arith_old.h.
|
private |
Definition at line 445 of file theory_arith_old.h.
|
private |
Definition at line 913 of file theory_arith_old.h.
TheoryArithOld::TheoryArithOld | ( | TheoryCore * | core) |
Definition at line 2227 of file theory_arith_old.cpp.
References createProofRulesOld(), d_buffer_0, d_buffer_1, d_buffer_2, d_buffer_3, d_bufferIdx_1, d_bufferIdx_2, d_bufferIdx_3, d_diseq, CVC3::TheoryArith::d_intType, CVC3::TheoryArith::d_kinds, CVC3::TheoryArith::d_realType, d_rules, CVC3::DARK_SHADOW, diffLogicGraph, CVC3::DIVIDE, CVC3::GE, CVC3::Theory::getCommonRules(), CVC3::Theory::getEM(), CVC3::Theorem::getExpr(), CVC3::GRAY_SHADOW, CVC3::GT, IF_DEBUG, CVC3::INT, CVC3::INTDIV, CVC3::IS_INTEGER, CVC3::LE, CVC3::LT, CVC3::MINUS, CVC3::MOD, CVC3::MULT, CVC3::NEGINF, CVC3::ExprManager::newKind(), CVC3::PLUS, CVC3::POSINF, CVC3::POW, CVC3::TheoryArith::rat(), RATIONAL_EXPR, CVC3::REAL, CVC3::REAL_CONST, CVC3::Theory::registerTheory(), CVC3::TheoryArithOld::DifferenceLogicGraph::setArith(), CVC3::TheoryArithOld::DifferenceLogicGraph::setRules(), CVC3::SUBRANGE, CVC3::UMINUS, CVC3::CommonProofRules::varIntroSkolem(), and zero.
TheoryArithOld::~TheoryArithOld | ( | ) |
Definition at line 2343 of file theory_arith_old.cpp.
References d_inequalitiesLeftDB, d_inequalitiesRightDB, CVC3::TheoryArith::d_kinds, d_rules, and CVC3::Theory::unregisterTheory().
Check the term t for integrality.
Definition at line 70 of file theory_arith_old.cpp.
References CVC3::Expr::getType(), CVC3::IS_INTEGER, CVC3::isInt(), and CVC3::isReal().
Referenced by canPickEqMonomial(), checkIntegerEquality(), checkSat(), computeTermBounds(), isConstrained(), isInteger(), rafineInequalityToInteger(), and rewrite().
A helper method for isIntegerThm()
Check if IS_INTEGER(e) is easily derivable from the given 'thm'
Definition at line 81 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Theorem::getExpr(), CVC3::Expr::isAnd(), and CVC3::Theorem::isNull().
Referenced by rewrite().
Extract the free constant from an inequality.
Definition at line 98 of file theory_arith_old.cpp.
References DebugAssert, CVC3::isIneq(), CVC3::PLUS, RATIONAL_EXPR, and CVC3::Expr::toString().
|
private |
Update the free constant subsumption database with new inequality.
Also, sets 'subsumed' argument to true if the inequality is subsumed by an existing inequality.
Definition at line 116 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), CVC3::CDOmap< Key, Data, HashFcn >::get(), CVC3::TheoryArithOld::FreeConst::getConst(), CVC3::Expr::getRational(), CVC3::int2string(), CVC3::isLE(), CVC3::isLT(), CVC3::isPlus(), CVC3::isRational(), CVC3::leExpr(), CVC3::plusExpr(), CVC3::TheoryArithOld::FreeConst::strict(), CVC3::Expr::toString(), and TRACE.
|
private |
Check if the kids of e are fully simplified and canonized (for debugging)
Definition at line 186 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), std::endl(), and IF_DEBUG.
Canonize the expression e, assuming, all children are canonical.
Implements CVC3::TheoryArith.
Definition at line 218 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::DIVIDE, CVC3::Expr::getKind(), CVC3::Theorem::getRHS(), CVC3::isRational(), CVC3::MINUS, CVC3::MULT, CVC3::PLUS, CVC3::POW, CVC3::Expr::toString(), TRACE, and CVC3::UMINUS.
Referenced by rewrite(), and tryPropagate().
Canonize and reduce e w.r.t. union-find database; assume all children are canonical.
Definition at line 371 of file theory_arith_old.cpp.
References DebugAssert, CVC3::Theorem::getRHS(), CVC3::Expr::hasFind(), CVC3::Expr::toString(), and TRACE.
Referenced by canonSimplify().
Composition of canonSimplify(const Expr&) by transitivity: take e0 = e1, canonize and simplify e1 to e2, return e0 = e2.
Definition at line 191 of file theory_arith_old.h.
References canonSimplify(), CVC3::Theorem::getRHS(), and CVC3::Theory::transitivityRule().
Canonize predicate (x = y, x < y, etc.)
accepts a theorem, canonizes it, applies iffMP and substituvity to derive the canonized thm
Definition at line 401 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Theorem::getExpr(), CVC3::Expr::getOp(), and CVC3::Theorem::toString().
Referenced by rafineInequalityToInteger().
Canonize predicate like canonPred except that the input theorem is an equivalent transformation.
accepts an equivalence theorem, canonizes it, applies iffMP and substituvity to derive the canonized thm
Definition at line 417 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Expr::getOp(), CVC3::Theorem::getRHS(), and CVC3::Theorem::toString().
Referenced by normalize(), rafineInequalityToInteger(), and rewrite().
Solve an equation and return an equivalent Theorem in the solved form.
Pseudo-code for doSolve. (Input is an equation) (output is a Theorem)
Definition at line 447 of file theory_arith_old.cpp.
References DebugAssert, FatalAssert, CVC3::Theorem::getExpr(), CVC3::Expr::getRational(), CVC3::Expr::isFalse(), CVC3::isMult(), CVC3::isPow(), CVC3::isRational(), CVC3::Expr::isRational(), CVC3::Theorem::isRewrite(), CVC3::Expr::isTrue(), MiniSat::right(), CVC3::ArithException::toString(), CVC3::Theorem::toString(), and 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 434 of file theory_arith_old.cpp.
|
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 563 of file theory_arith_old.cpp.
References CVC3::abs(), CVC3::Expr::arity(), CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), CVC3::isMult(), CVC3::isPlus(), CVC3::isRational(), MiniSat::min(), and CVC3::Expr::toString().
processes equalities with 1 or more vars of type REAL
input is 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 "var = e''" Theorem.
Definition at line 615 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, EQ, CVC3::Theorem::getExpr(), CVC3::Theorem::getLHS(), CVC3::Expr::getRational(), CVC3::Theorem::getRHS(), CVC3::isMult(), CVC3::isPlus(), CVC3::isRational(), CVC3::Expr::isRational(), CVC3::isReal(), MiniSat::left(), MiniSat::right(), CVC3::Theorem::toString(), CVC3::Expr::toString(), and TRACE.
processes equalities whose vars are all of type INT
input is 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 "var = e''" Theorem and some associated equations in solved form.
Definition at line 869 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Theorem::getExpr(), CVC3::Expr::isAnd(), CVC3::Expr::isBoolConst(), CVC3::Expr::isFalse(), CVC3::Theorem::isRewrite(), CVC3::Expr::toString(), and TRACE.
One step of INT equality processing (aux. method for processIntEq())
eqn | is a single equation 0 = e |
Definition at line 739 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), EQ, CVC3::Theorem::getExpr(), CVC3::Theorem::getLHS(), CVC3::Expr::getRational(), CVC3::Theorem::getRHS(), CVC3::Expr::isAnd(), isIntx(), CVC3::isMult(), CVC3::Theorem::isNull(), CVC3::isPlus(), CVC3::isPow(), CVC3::Expr::isRational(), CVC3::Theorem::isRewrite(), MiniSat::right(), CVC3::Theorem::toString(), CVC3::Expr::toString(), and TRACE.
|
private |
Process inequalities in the buffer.
Definition at line 1037 of file theory_arith_old.cpp.
References CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), CVC3::Theorem::getExpr(), CVC3::Expr::isFalse(), CVC3::isIneq(), CVC3::isPlus(), CVC3::Expr::isTrue(), CVC3::Expr::toString(), and TRACE.
Referenced by assertFact(), and checkSat().
Take an inequality and isolate a variable.
Definition at line 1499 of file theory_arith_old.cpp.
References DebugAssert, CVC3::Theorem::getExpr(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::isLE(), CVC3::isLT(), CVC3::isMult(), CVC3::isPlus(), CVC3::isRational(), CVC3::Expr::isRational(), MiniSat::right(), CVC3::Theorem::toString(), CVC3::Expr::toString(), and TRACE.
Update the statistics counters for the variable with a coeff. c.
Definition at line 1143 of file theory_arith_old.cpp.
References CVC3::Expr::getType(), CVC3::Expr::isRational(), CVC3::Rational::toString(), and TRACE.
|
private |
Update the statistics counters for the monomial.
Definition at line 1189 of file theory_arith_old.cpp.
References CVC3::Expr::getRational().
|
private |
Add an inequality to the input buffer. See also d_buffer.
Definition at line 1241 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), CVC3::Expr::end(), CVC3::Theorem::getExpr(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::Theorem::getRHS(), CVC3::isMult(), CVC3::isPlus(), CVC3::isPow(), CVC3::isRational(), CVC3::LE, CVC3::LT, CVC3::Expr::toString(), and TRACE.
Referenced by assertFact().
Given a canonized term, compute a factor to make all coefficients integer and relatively prime.
Definition at line 1579 of file theory_arith_old.cpp.
References CVC3::abs(), CVC3::Expr::arity(), CVC3::Rational::getDenominator(), CVC3::Rational::getNumerator(), CVC3::Expr::getRational(), CVC3::isMult(), CVC3::isPlus(), CVC3::MULT, and RATIONAL_EXPR.
Referenced by 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 2994 of file theory_arith_old.cpp.
References canonPredEquiv(), checkIntegerEquality(), computeNormalFactor(), d_rules, DebugAssert, EQ, CVC3::GE, CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::GT, CVC3::Expr::isEq(), CVC3::isIneq(), CVC3::isRational(), CVC3::LE, CVC3::LT, CVC3::ArithProofRules::multEqn(), CVC3::ArithProofRules::multIneqn(), rafineInequalityToInteger(), CVC3::Theory::reflexivityRule(), CVC3::Expr::toString(), and TRACE.
Referenced by inequalityToFind(), 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 3070 of file theory_arith_old.cpp.
References CVC3::Theorem::getExpr(), CVC3::Theorem::getRHS(), CVC3::Theory::iffMP(), CVC3::Theorem::isRewrite(), normalize(), and CVC3::Theory::transitivityRule().
Definition at line 2017 of file theory_arith_old.cpp.
References CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), CVC3::int2string(), CVC3::isPlus(), CVC3::Expr::isRational(), CVC3::Expr::toString(), and TRACE.
Definition at line 705 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::isIntegerConst(), CVC3::MULT, CVC3::POW, RATIONAL_EXPR, and CVC3::Expr::toString().
Referenced by rewrite().
Separate monomial e = c*p1*...*pn into c and 1*p1*...*pn.
Implements CVC3::TheoryArith.
Definition at line 1684 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Expr::getKids(), CVC3::isMult(), CVC3::isPlus(), CVC3::isRational(), CVC3::Expr::isRational(), CVC3::multExpr(), CVC3::Expr::toString(), and TRACE.
Referenced by findRationalBound(), getLowerBound(), getUpperBound(), isConstrainedAbove(), isConstrainedBelow(), isUnconstrained(), and updateConstrained().
|
inline |
Check the term t for integrality (return bool)
Definition at line 258 of file theory_arith_old.h.
References CVC3::Expr::getType(), CVC3::isInt(), isIntegerThm(), CVC3::Theorem::isNull(), and CVC3::isReal().
Referenced by assertFact(), assignVariables(), computeType(), isPowerEquality(), print(), processFiniteIntervals(), solve(), and update().
Definition at line 1623 of file theory_arith_old.cpp.
References DebugAssert, CVC3::isRational(), and CVC3::Expr::toString().
|
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 1639 of file theory_arith_old.cpp.
References CVC3::Expr::begin(), CVC3::Expr::end(), and CVC3::Expr::isTerm().
|
private |
Check if the inequality is "stale" or subsumed.
Definition at line 1651 of file theory_arith_old.cpp.
References CVC3::TheoryArithOld::FreeConst::getConst(), CVC3::TheoryArithOld::Ineq::getConst(), CVC3::Theorem::getExpr(), CVC3::Expr::hasFind(), CVC3::TheoryArithOld::Ineq::ineq(), CVC3::isLT(), CVC3::TheoryArithOld::FreeConst::strict(), TRACE, and CVC3::TheoryArithOld::Ineq::varOnRHS().
|
private |
Definition at line 1710 of file theory_arith_old.cpp.
References DebugAssert, CVC3::ExprMap< Data >::end(), CVC3::ExprMap< Data >::find(), CVC3::Theorem::getExpr(), IF_DEBUG, CVC3::TheoryArithOld::Ineq::ineq(), CVC3::Expr::isEq(), CVC3::Expr::isFalse(), CVC3::isLE(), CVC3::isLT(), CVC3::isMult(), CVC3::Theorem::isNull(), CVC3::isPow(), CVC3::Expr::isTrue(), CVC3::CDList< T >::push_back(), CVC3::CDList< T >::size(), CVC3::Theorem::toString(), TRACE, and TRACE_MSG.
|
private |
Definition at line 2831 of file theory_arith_old.cpp.
References CVC3::Theory::assignValue(), CVC3::TheoryArithOld::DifferenceLogicGraph::computeModel(), d_graph, diffLogicGraph, diffLogicOnly, findBounds(), CVC3::Theory::findExpr(), CVC3::TheoryArithOld::DifferenceLogicGraph::getValuation(), CVC3::Theory::inconsistent(), CVC3::Rational::isInteger(), isInteger(), CVC3::Expr::isRational(), CVC3::TheoryArith::rat(), CVC3::TheoryArithOld::VarOrderGraph::selectSmallest(), and TRACE.
Referenced by computeModelBasic().
|
private |
Definition at line 2759 of file theory_arith_old.cpp.
References DebugAssert, CVC3::Expr::eqExpr(), CVC3::Theory::findExpr(), CVC3::Expr::getRational(), isNonlinearEq(), CVC3::isRational(), CVC3::TheoryArith::rat(), separateMonomial(), and CVC3::Expr::toString().
Referenced by findBounds().
Definition at line 2780 of file theory_arith_old.cpp.
References d_inequalitiesLeftDB, d_inequalitiesRightDB, DebugAssert, findRationalBound(), CVC3::isLT(), MiniSat::left(), MiniSat::right(), CVC3::CDList< T >::size(), CVC3::Rational::toString(), and TRACE.
Referenced by assignVariables().
|
private |
Definition at line 1822 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Theorem::getExpr(), CVC3::GRAY_SHADOW, IF_DEBUG, CVC3::isInt(), isIntx(), CVC3::isLE(), CVC3::isLT(), CVC3::isMult(), CVC3::Theorem::isNull(), CVC3::Expr::isOr(), CVC3::isPlus(), CVC3::isRational(), CVC3::Expr::isRational(), MiniSat::right(), CVC3::Expr::toString(), and TRACE.
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 912 of file theory_arith_old.cpp.
References CVC3::ExprMap< Data >::begin(), DebugAssert, CVC3::ExprMap< Data >::end(), CVC3::Theorem::getExpr(), IF_DEBUG, TRACE, and TRACE_MSG.
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 966 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::ExprMap< Data >::empty(), CVC3::ExprMap< Data >::end(), CVC3::ExprMap< Data >::find(), CVC3::Theorem::getRHS(), and TRACE.
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 1017 of file theory_arith_old.cpp.
References DebugAssert, CVC3::ExprMap< Data >::empty(), CVC3::Theorem::getExpr(), CVC3::Theorem::getRHS(), CVC3::Theorem::isRewrite(), and CVC3::Expr::toString().
|
private |
Traverse 'e' and push all the i-leaves into 'vars' vector.
Definition at line 2359 of file theory_arith_old.cpp.
References CVC3::Expr::begin(), CVC3::Expr::end(), and CVC3::Theory::isLeaf().
|
private |
Check if alpha <= ax & bx <= beta is a finite interval for integer var 'x', and assert the corresponding constraint.
Definition at line 2373 of file theory_arith_old.cpp.
References DebugAssert, CVC3::Theorem::getExpr(), CVC3::Expr::getRational(), CVC3::isLE(), CVC3::isMult(), CVC3::isPlus(), CVC3::isRational(), CVC3::Expr::isRational(), and CVC3::Expr::toString().
Referenced by processFiniteIntervals().
|
private |
For an integer var 'x', find and process all constraints A <= ax <= A+c.
Definition at line 2432 of file theory_arith_old.cpp.
References d_inequalitiesLeftDB, d_inequalitiesRightDB, isInteger(), processFiniteInterval(), and CVC3::CDList< T >::size().
|
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 2458 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::hasFind(), CVC3::Theory::reflexivityRule(), CVC3::Expr::setEqNext(), CVC3::Expr::setFind(), and setup().
ArithProofRules * TheoryArithOld::createProofRulesOld | ( | ) |
Definition at line 44 of file arith_theorem_producer_old.cpp.
Referenced by TheoryArithOld().
|
virtual |
Notify theory of a new shared term.
When a term e associated with theory i occurs as a child of an expression associated with theory j, the framework calls i->addSharedTerm(e) and j->addSharedTerm(e)
Implements CVC3::TheoryArith.
Definition at line 2472 of file theory_arith_old.cpp.
References d_sharedTerms, d_sharedTermsList, and CVC3::CDList< T >::push_back().
Referenced by update().
|
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 CVC3::TheoryArith.
Definition at line 2481 of file theory_arith_old.cpp.
References addToBuffer(), CVC3::Expr::addToNotify(), d_buffer_0, d_buffer_1, d_buffer_2, d_buffer_3, d_bufferIdx_0, d_bufferIdx_1, d_bufferIdx_2, d_bufferIdx_3, d_bufferThres, d_diseq, d_grayShadowThres, d_inModelCreation, d_rules, DebugAssert, diffLogicOnly, CVC3::Theory::enqueueFact(), CVC3::ArithProofRules::expandDarkShadow(), CVC3::ArithProofRules::expandGrayShadow(), CVC3::ArithProofRules::expandGrayShadow0(), CVC3::Theorem::getExpr(), CVC3::Expr::getRational(), CVC3::ArithProofRules::grayShadowConst(), IF_DEBUG, CVC3::int2string(), CVC3::IS_INTEGER, CVC3::isDarkShadow(), CVC3::Expr::isEq(), CVC3::Expr::isFalse(), CVC3::isGrayShadow(), isInteger(), CVC3::ArithProofRules::IsIntegerElim(), CVC3::isIntPred(), CVC3::isLE(), CVC3::isLT(), CVC3::isMult(), CVC3::Expr::isNot(), CVC3::Expr::isRational(), multiplicativeSignSplits, processBuffer(), CVC3::Theory::setIncomplete(), CVC3::Theory::setInconsistent(), CVC3::ArithProofRules::splitGrayShadow(), CVC3::ArithProofRules::splitGrayShadowSmall(), CVC3::Expr::toString(), and TRACE.
|
virtual |
Process disequalities from the arrangement for model generation.
Implements CVC3::TheoryArith.
Definition at line 2726 of file theory_arith_old.cpp.
References CVC3::Theory::addSplitter(), d_inModelCreation, d_sharedTerms, DebugAssert, CVC3::Expr::eqExpr(), CVC3::Theory::findExpr(), CVC3::Theory::getBaseType(), CVC3::Expr::getType(), CVC3::isReal(), CVC3::Theory::simplifyExpr(), CVC3::Type::toString(), CVC3::Expr::toString(), and TRACE.
|
virtual |
Assign concrete values to basic-type variables in v.
Implements CVC3::TheoryArith.
Definition at line 2882 of file theory_arith_old.cpp.
References assignVariables(), d_inModelCreation, CVC3::Theory::findExpr(), and 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.
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.
Implements CVC3::TheoryArith.
Definition at line 2905 of file theory_arith_old.cpp.
References CVC3::Theory::assignValue(), DebugAssert, CVC3::Theory::findExpr(), CVC3::isRational(), CVC3::Theory::simplify(), and CVC3::Expr::toString().
|
virtual |
Check for satisfiability in the theory.
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 CVC3::TheoryArith.
Definition at line 2606 of file theory_arith_old.cpp.
References d_buffer_0, d_buffer_1, d_buffer_2, d_buffer_3, d_diseq, d_diseqIdx, d_inModelCreation, d_rules, DebugAssert, diseqSplitAlready, CVC3::ArithProofRules::diseqToIneq(), std::endl(), CVC3::Theory::enqueueFact(), CVC3::Expr::eqExpr(), CVC3::Theory::find(), CVC3::Theorem::getExpr(), CVC3::Theorem::getRHS(), CVC3::Expr::hasFind(), IF_DEBUG, CVC3::Theory::inconsistent(), isIntegerThm(), CVC3::Theorem::isNull(), CVC3::Expr::isRational(), isUnconstrained(), processBuffer(), CVC3::Expr::toString(), and TRACE.
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.
Implements CVC3::TheoryArith.
Definition at line 3076 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), canon(), canonPredEquiv(), canPickEqMonomial(), CVC3::ArithProofRules::constPredicate(), CVC3::Expr::containsTermITE(), d_rules, CVC3::DARK_SHADOW, DebugAssert, CVC3::ArithProofRules::divideEqnNonConst(), CVC3::ArithProofRules::elimPower(), CVC3::ArithProofRules::elimPowerConst(), CVC3::Expr::end(), EQ, CVC3::ArithProofRules::eqToIneq(), CVC3::ArithProofRules::evenPowerEqNegConst(), CVC3::ArithProofRules::flipInequality(), CVC3::GE, CVC3::Theory::getCommonRules(), getFactors(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::Theorem::getRHS(), CVC3::Expr::getSize(), CVC3::Rational::getUnsigned(), CVC3::GRAY_SHADOW, CVC3::GT, CVC3::CommonProofRules::iffTrue(), CVC3::ArithProofRules::intEqIrrational(), CVC3::IS_INTEGER, CVC3::Expr::isAbsLiteral(), CVC3::Expr::isAtomic(), CVC3::Expr::isBoolConst(), CVC3::Expr::isEq(), CVC3::isGE(), CVC3::isGT(), CVC3::isIneq(), isIntegerDerive(), isIntegerThm(), CVC3::Theory::isLeaf(), CVC3::isLT(), isNonlinearEq(), isNonlinearSumTerm(), CVC3::Theorem::isNull(), CVC3::isPlus(), isPowerEquality(), isPowersEquality(), CVC3::Expr::isPropAtom(), CVC3::isRational(), CVC3::Expr::isRational(), CVC3::Theorem::isRefl(), CVC3::Expr::isTerm(), CVC3::LE, CVC3::TheoryArith::leavesAreNumConst(), CVC3::Theory::leavesAreSimp(), MiniSat::left(), CVC3::ArithProofRules::lessThanToLERewrite(), CVC3::LT, CVC3::ArithProofRules::multEqZero(), CVC3::ArithProofRules::negatedInequality(), normalize(), NOT, CVC3::TheoryArith::rat(), CVC3::ratRoot(), CVC3::Theory::reflexivityRule(), CVC3::ArithProofRules::rewriteLeavesConst(), CVC3::CommonProofRules::rewriteUsingSymmetry(), MiniSat::right(), CVC3::ArithProofRules::rightMinusLeft(), CVC3::Expr::setRewriteNormal(), CVC3::Theory::simplify(), CVC3::Theory::theoryCore(), CVC3::Theory::theoryOf(), TRACE, CVC3::Theory::transitivityRule(), and CVC3::Theory::typePred().
Referenced by checkIntegerEquality(), and rafineInequalityToInteger().
|
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.
Implements CVC3::TheoryArith.
Definition at line 3355 of file theory_arith_old.cpp.
References CVC3::Expr::addToNotify(), CVC3::Expr::arity(), DebugAssert, CVC3::int2string(), CVC3::isIneq(), CVC3::isLE(), CVC3::isLT(), CVC3::Expr::isNot(), CVC3::isRational(), CVC3::Expr::isTerm(), CVC3::Expr::toString(), and 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.
Implements CVC3::TheoryArith.
Definition at line 3390 of file theory_arith_old.cpp.
References addSharedTerm(), CVC3::Expr::addToNotify(), alreadyProjected, CVC3::Theory::assertEqualities(), bufferedInequalities, d_sharedTerms, DebugAssert, dontBuffer, CVC3::Theory::enqueueFact(), CVC3::Theory::falseExpr(), CVC3::Theory::find(), CVC3::Theory::findExpr(), CVC3::Theory::getCommonRules(), CVC3::Theorem::getExpr(), CVC3::Expr::getKind(), CVC3::Theorem::getLHS(), CVC3::Expr::getRational(), CVC3::Theorem::getRHS(), CVC3::Expr::hasFind(), IF_DEBUG, CVC3::Theory::iffMP(), CVC3::Theory::inconsistent(), CVC3::IS_INTEGER, CVC3::Expr::isAtomic(), CVC3::Expr::isEq(), CVC3::isIneq(), isInteger(), CVC3::isRational(), CVC3::Expr::isRational(), CVC3::Theory::setInconsistent(), CVC3::Theory::simplify(), CVC3::Theory::substitutivityRule(), CVC3::Theory::symmetryRule(), CVC3::Expr::toString(), TRACE, CVC3::Theory::transitivityRule(), and CVC3::Theory::trueExpr().
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.
Implements CVC3::TheoryArith.
Definition at line 3547 of file theory_arith_old.cpp.
References DebugAssert, doSolve(), CVC3::Theorem::getLHS(), CVC3::Theorem::getRHS(), isInteger(), CVC3::Theory::isLeaf(), CVC3::Theory::isLeafIn(), CVC3::Theorem::isRewrite(), CVC3::Expr::isTerm(), and CVC3::Theory::symmetryRule().
|
virtual |
A debug check used by the primary solver.
Implements CVC3::TheoryArith.
Definition at line 3621 of file theory_arith_old.cpp.
References CVC3::CommonProofRules::andElim(), CVC3::Expr::arity(), CVC3::TheoryArith::canonSimp(), DebugAssert, CVC3::Theory::getCommonRules(), CVC3::Theorem::getExpr(), CVC3::Theorem::getLHS(), CVC3::Theorem::getRHS(), CVC3::Expr::hasFind(), CVC3::Expr::isFalse(), CVC3::Theory::isLeaf(), CVC3::Theory::isLeafIn(), CVC3::Theorem::isRewrite(), CVC3::Expr::isTerm(), CVC3::Theory::leavesAreSimp(), and CVC3::TheoryArith::recursiveCanonSimpCheck().
|
virtual |
Check that e is a valid Type expr.
Implements CVC3::TheoryArith.
Definition at line 3673 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Theory::getEM(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::INT, CVC3::isIntegerConst(), CVC3::REAL, CVC3::SUBRANGE, and CVC3::Expr::toString().
|
virtual |
Compute information related to finiteness of types.
Used by the TypeComputer defined in TheoryCore (theories should not call this funtion directly – they should use the methods in Type instead). Each theory should implement this if it contains any types that could be non-infinite.
Implements CVC3::TheoryArith.
Definition at line 3697 of file theory_arith_old.cpp.
References CVC3::CARD_FINITE, CVC3::CARD_INFINITE, CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::Rational::getUnsigned(), CVC3::TheoryArith::rat(), and CVC3::SUBRANGE.
|
virtual |
Compute and store the type of e.
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.
Implements CVC3::TheoryArith.
Definition at line 3725 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Theory::boolType(), CVC3::TheoryArith::d_intType, CVC3::TheoryArith::d_realType, CVC3::DARK_SHADOW, DebugAssert, CVC3::DIVIDE, CVC3::GE, CVC3::Theory::getBaseType(), CVC3::Theory::getEM(), CVC3::Expr::getKind(), CVC3::ExprManager::getKindName(), CVC3::Expr::getRational(), CVC3::Expr::getType(), CVC3::GRAY_SHADOW, CVC3::GT, CVC3::IS_INTEGER, CVC3::Rational::isInteger(), isInteger(), CVC3::Expr::isRational(), CVC3::LE, CVC3::LT, CVC3::MINUS, CVC3::MULT, CVC3::PLUS, CVC3::POW, RATIONAL_EXPR, CVC3::REAL_CONST, CVC3::Expr::setType(), CVC3::Type::toString(), CVC3::Expr::toString(), and CVC3::UMINUS.
Compute the base type of the top-level operator of an arbitrary type.
Implements CVC3::TheoryArith.
Definition at line 3808 of file theory_arith_old.cpp.
References DebugAssert, CVC3::Type::getExpr(), CVC3::Expr::getKind(), IF_DEBUG, CVC3::INT, CVC3::REAL, CVC3::TheoryArith::realType(), CVC3::SUBRANGE, and CVC3::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.
Implements CVC3::TheoryArith.
Definition at line 3575 of file theory_arith_old.cpp.
References CVC3::Expr::begin(), CVC3::DIVIDE, CVC3::Expr::end(), CVC3::Theory::findExpr(), CVC3::Expr::getKind(), CVC3::MULT, CVC3::PLUS, CVC3::POW, RATIONAL_EXPR, CVC3::Expr::toString(), and 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)
Implements CVC3::TheoryArith.
Definition at line 3603 of file theory_arith_old.cpp.
References CVC3::andExpr(), CVC3::Expr::getEM(), CVC3::Type::getExpr(), CVC3::Expr::getKind(), CVC3::INT, CVC3::IS_INTEGER, CVC3::leExpr(), CVC3::SUBRANGE, and CVC3::ExprManager::trueExpr().
Compute and cache the TCC of e.
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.
Implements CVC3::TheoryArith.
Definition at line 3817 of file theory_arith_old.cpp.
References CVC3::Expr::andExpr(), CVC3::Expr::arity(), CVC3::Theory::computeTCC(), DebugAssert, CVC3::DIVIDE, CVC3::Expr::getKind(), and CVC3::TheoryArith::rat().
|
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.
Implements CVC3::TheoryArith.
Definition at line 3952 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), CVC3::DARK_SHADOW, CVC3::DIVIDE, CVC3::Expr::end(), std::endl(), CVC3::GE, CVC3::Rational::getInt(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::GRAY_SHADOW, CVC3::GT, CVC3::INT, CVC3::IS_INTEGER, CVC3::isInt(), CVC3::Rational::isInteger(), isInteger(), CVC3::isRational(), CVC3::ExprStream::lang(), CVC3::LE, CVC3::LISP_LANG, CVC3::LT, CVC3::MINUS, CVC3::MULT, CVC3::NEGINF, CVC3::PLUS, CVC3::POSINF, CVC3::POW, CVC3::PRESENTATION_LANG, CVC3::Expr::print(), CVC3::Expr::printAST(), CVC3::TheoryArith::printRational(), CVC3::push(), RATIONAL_EXPR, CVC3::REAL, CVC3::REAL_CONST, CVC3::SIMPLIFY_LANG, CVC3::SMTLIB_LANG, CVC3::SMTLIB_V2_LANG, CVC3::space(), CVC3::SPASS_LANG, CVC3::SUBRANGE, CVC3::Expr::toString(), CVC3::TPTP_LANG, and CVC3::UMINUS.
Theory-specific parsing implemented by the DP.
Implements CVC3::TheoryArith.
Definition at line 3833 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::begin(), DebugAssert, CVC3::DIVIDE, CVC3::divideExpr(), CVC3::Expr::end(), CVC3::GE, CVC3::geExpr(), CVC3::Theory::getEM(), CVC3::Expr::getEM(), CVC3::ExprManager::getKind(), CVC3::Expr::getKind(), CVC3::GT, CVC3::gtExpr(), ID, CVC3::INT, CVC3::INTDIV, CVC3::IS_INTEGER, CVC3::LE, CVC3::leExpr(), CVC3::LT, CVC3::ltExpr(), CVC3::MINUS, CVC3::minusExpr(), CVC3::MOD, CVC3::MULT, CVC3::multExpr(), CVC3::NEGINF, CVC3::ExprManager::newLeafExpr(), NULL_KIND, CVC3::Theory::parseExpr(), CVC3::PLUS, CVC3::plusExpr(), CVC3::POSINF, CVC3::POW, CVC3::powExpr(), RAW_LIST, CVC3::REAL, CVC3::SMTLIB_LANG, CVC3::SMTLIB_V2_LANG, CVC3::SUBRANGE, CVC3::Expr::toString(), CVC3::UMINUS, and CVC3::uminusExpr().
Returns the current maximal coefficient of the variable.
var | the variable. |
Definition at line 1948 of file theory_arith_old.cpp.
References CVC3::Expr::getType(), CVC3::Rational::toString(), CVC3::Expr::toString(), and TRACE.
Fixes the current max coefficient to be used in the ordering. If the maximal coefficient changes in the future, it will not be used in the ordering.
variable | the variable |
max | the value to set it to |
Definition at line 1980 of file theory_arith_old.cpp.
References CVC3::max().
|
private |
Among given input variables, select the smallest ones with respect to the coefficients.
Definition at line 1984 of file theory_arith_old.cpp.
Given an inequality theorem check if it is on integers and get rid of the non-integer constants.
Definition at line 2953 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), canonPred(), canonPredEquiv(), d_rules, DebugAssert, CVC3::Theorem::getExpr(), CVC3::Theorem::getRHS(), CVC3::Theory::iffMP(), CVC3::isIneq(), isIntegerThm(), CVC3::Theorem::isNull(), CVC3::isPlus(), CVC3::isRational(), CVC3::Theorem::isRewrite(), CVC3::plusExpr(), CVC3::ArithProofRules::rafineStrictInteger(), rewrite(), TRACE, and CVC3::Theory::transitivityRule().
Referenced by normalize().
Given an equality theorem check if it is on integers with a non-integer constant. If yes, return a theorem 0 = 1
Definition at line 2913 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), d_rules, DebugAssert, EQ, CVC3::Theorem::getExpr(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::Theorem::getRHS(), CVC3::Theory::iffMP(), CVC3::ArithProofRules::intEqualityRationalConstant(), CVC3::Rational::isInteger(), isIntegerThm(), CVC3::Theorem::isNull(), CVC3::isPlus(), CVC3::isRational(), CVC3::Theorem::isRewrite(), CVC3::plusExpr(), rewrite(), TRACE, and CVC3::Theory::transitivityRule().
Referenced by normalize().
|
private |
Takes an inequality theorem and substitutes the rhs for it's find. It also get's normalized.
Definition at line 4613 of file theory_arith_old.cpp.
References CVC3::Theorem::getExpr(), CVC3::Theorem::getRHS(), CVC3::Theory::iffMP(), CVC3::int2string(), CVC3::isRational(), normalize(), CVC3::Theory::simplify(), CVC3::Theory::substitutivityRule(), CVC3::Expr::toString(), TRACE, and CVC3::Theory::transitivityRule().
|
private |
Take inequality of the form 0 op t and extract the c1, t1, c2 and t2, such that c1 <= t1 and t2 <= c2, where c1 and c2 are constants, and t1 and t2 are either sums of monomials or a monomial.
Definition at line 1196 of file theory_arith_old.cpp.
References DebugAssert, CVC3::Expr::getString(), CVC3::isIneq(), CVC3::isPlus(), CVC3::isRational(), CVC3::multExpr(), CVC3::plusExpr(), CVC3::Rational::toString(), CVC3::Expr::toString(), and TRACE.
Referenced by registerAtom().
|
privatevirtual |
Theory-specific registration of atoms.
If a theory wants to implement its own theory propagation, it should implement this method and use it to collect all atoms that the core is interested in. If the theory can deduce the atom or its negation, it should do so (using enqueueFact).
Reimplemented from CVC3::Theory.
Definition at line 4662 of file theory_arith_old.cpp.
References d_rules, CVC3::Theory::enqueueFact(), extractTermsFromInequality(), formulaAtomLowerBound, formulaAtoms, formulaAtomUpperBound, CVC3::Theory::getCommonRules(), CVC3::Theorem::getExpr(), CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::ArithProofRules::implyNegatedInequality(), CVC3::ArithProofRules::implyWeakerInequality(), CVC3::ExprMap< Data >::insert(), CVC3::Expr::isAbsAtomicFormula(), CVC3::isIneq(), CVC3::LE, CVC3::LT, termLowerBound, termLowerBoundThm, termUpperBound, termUpperBoundThm, CVC3::Rational::toString(), CVC3::Expr::toString(), and TRACE.
|
private |
Definition at line 5334 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Rational::getInt(), CVC3::Expr::getRational(), CVC3::Theory::isLeaf(), CVC3::isMult(), and CVC3::isPow().
|
private |
Definition at line 5345 of file theory_arith_old.cpp.
References CVC3::abs(), CVC3::Expr::arity(), CVC3::Expr::begin(), DebugAssert, CVC3::Expr::end(), isIntegerThm(), CVC3::Theory::isLeaf(), CVC3::Theory::isLeafIn(), and CVC3::isMult().
Referenced by rewrite().
|
private |
Check if the term is bounded. If the term is non-linear, just returns false.
Definition at line 5386 of file theory_arith_old.cpp.
References hasLowerBound(), hasUpperBound(), CVC3::Expr::toString(), and TRACE.
|
inlineprivate |
Definition at line 926 of file theory_arith_old.h.
References getLowerBound(), and CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::isFinite().
Referenced by isBounded().
|
inlineprivate |
Definition at line 927 of file theory_arith_old.h.
References getUpperBound(), and CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::isFinite().
Referenced by isBounded().
|
private |
Definition at line 5799 of file theory_arith_old.cpp.
References isConstrainedAbove(), isConstrainedBelow(), isIntegerThm(), CVC3::Theorem::isNull(), CVC3::Expr::toString(), and TRACE.
Referenced by computeTermBounds().
|
private |
Definition at line 5692 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::getRational(), isConstrainedBelow(), CVC3::Theory::isLeaf(), CVC3::isMult(), isNonlinearSumTerm(), CVC3::isPlus(), CVC3::Expr::isRational(), QueryWithCacheAll, separateMonomial(), termConstrainedAbove, CVC3::Expr::toString(), and TRACE.
Referenced by computeTermBounds(), getUpperBound(), isConstrained(), and isConstrainedBelow().
|
private |
Definition at line 5746 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::getRational(), isConstrainedAbove(), CVC3::Theory::isLeaf(), CVC3::isMult(), isNonlinearSumTerm(), CVC3::isPlus(), CVC3::Expr::isRational(), QueryWithCacheAll, separateMonomial(), termConstrainedBelow, CVC3::Expr::toString(), and TRACE.
Referenced by computeTermBounds(), getLowerBound(), isConstrained(), and isConstrainedAbove().
|
private |
Check if the term is bounded from above. If the term is non-linear, just returns false.
Definition at line 5391 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), getLowerBound(), CVC3::Expr::getRational(), isConstrainedAbove(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::isFinite(), CVC3::Theory::isLeaf(), CVC3::isMult(), isNonlinearSumTerm(), CVC3::isPlus(), CVC3::Expr::isRational(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::PlusInfinity, QueryWithCacheAll, QueryWithCacheLeaves, QueryWithCacheLeavesAndConstrainedComputation, separateMonomial(), termConstrainedAbove, termUpperBounded, CVC3::Rational::toString(), CVC3::Expr::toString(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::toString(), TRACE, and CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::Zero.
Referenced by computeTermBounds(), getLowerBound(), and hasUpperBound().
|
private |
Check if the term is bouned from below. If the term is non-linear, just return false.
Definition at line 5463 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Expr::getRational(), getUpperBound(), isConstrainedBelow(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::isFinite(), CVC3::Theory::isLeaf(), CVC3::isMult(), isNonlinearSumTerm(), CVC3::isPlus(), CVC3::Expr::isRational(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::MinusInfinity, QueryWithCacheAll, QueryWithCacheLeaves, QueryWithCacheLeavesAndConstrainedComputation, separateMonomial(), termConstrainedBelow, termLowerBounded, CVC3::Rational::toString(), CVC3::Expr::toString(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::toString(), TRACE, and CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::Zero.
Referenced by computeTermBounds(), getUpperBound(), and hasLowerBound().
|
private |
See whether and which terms are bounded.
Definition at line 5535 of file theory_arith_old.cpp.
References d_graph, d_inequalitiesLeftDB, d_inequalitiesRightDB, d_inModelCreation, diffLogicGraph, diffLogicOnly, CVC3::Theory::find(), CVC3::TheoryArithOld::DifferenceLogicGraph::getEdgeWeight(), CVC3::Theorem::getExpr(), getLowerBound(), CVC3::Theorem::getRHS(), getUpperBound(), CVC3::TheoryArithOld::DifferenceLogicGraph::getVariables(), CVC3::TheoryArithOld::VarOrderGraph::getVerticesTopological(), CVC3::Expr::hasFind(), CVC3::TheoryArithOld::DifferenceLogicGraph::hasIncoming(), CVC3::TheoryArithOld::DifferenceLogicGraph::hasOutgoing(), IF_DEBUG, CVC3::TheoryArithOld::DifferenceLogicGraph::inCycle(), CVC3::TheoryArithOld::Ineq::ineq(), CVC3::int2string(), isConstrained(), isConstrainedAbove(), isConstrainedBelow(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::isFinite(), isIntegerThm(), CVC3::Theorem::isNull(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::MinusInfinity, QueryWithCacheAll, QueryWithCacheLeaves, QueryWithCacheLeavesAndConstrainedComputation, CVC3::CDList< T >::size(), termConstrainedAbove, termConstrainedBelow, termLowerBounded, termUpperBounded, CVC3::Expr::toString(), TRACE, CVC3::TheoryArithOld::DifferenceLogicGraph::writeGraph(), and zero.
void TheoryArithOld::updateConstrained | ( | const Expr & | t) |
Definition at line 5926 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), d_varConstrainedMinus, d_varConstrainedPlus, CVC3::Expr::getRational(), CVC3::isIneq(), CVC3::isMult(), CVC3::isPlus(), CVC3::Expr::isRational(), separateMonomial(), and TRACE.
bool TheoryArithOld::isUnconstrained | ( | const Expr & | t) |
Definition at line 5895 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), d_varConstrainedMinus, d_varConstrainedPlus, diffLogicGraph, diffLogicOnly, CVC3::TheoryArithOld::DifferenceLogicGraph::hasIncoming(), CVC3::TheoryArithOld::DifferenceLogicGraph::hasOutgoing(), CVC3::isMult(), CVC3::isPlus(), CVC3::Expr::isRational(), separateMonomial(), and TRACE.
Referenced by checkSat().
void TheoryArithOld::tryPropagate | ( | const Expr & | x, |
const Expr & | y, | ||
const DifferenceLogicGraph::EdgeInfo & | x_y_edge, | ||
int | kind | ||
) |
Definition at line 5039 of file theory_arith_old.cpp.
References canon(), d_rules, diffLogicGraph, CVC3::ExprMap< Data >::end(), CVC3::Theory::enqueueFact(), CVC3::ExprMap< Data >::find(), CVC3::Theory::find(), formulaAtomLowerBound, formulaAtomUpperBound, CVC3::TheoryArithOld::DifferenceLogicGraph::getEdgeTheorems(), CVC3::Expr::getKind(), CVC3::TheoryArithOld::DifferenceLogicGraph::EpsRational::getRational(), CVC3::Theorem::getRHS(), CVC3::ArithProofRules::implyNegatedInequalityDiffLogic(), CVC3::ArithProofRules::implyWeakerInequalityDiffLogic(), CVC3::LE, CVC3::TheoryArithOld::DifferenceLogicGraph::EdgeInfo::length, CVC3::plusExpr(), CVC3::TheoryArith::rat(), CVC3::Expr::toString(), TRACE, and zero.
|
virtual |
Reimplemented from CVC3::TheoryArith.
Definition at line 5194 of file theory_arith_old.cpp.
References multiplicativeSignSplits.
Record that smaller should be smaller than bigger in the variable order. Should be implemented in decision procedures that support it.
Reimplemented from CVC3::TheoryArith.
Definition at line 5198 of file theory_arith_old.cpp.
References CVC3::TheoryArithOld::VarOrderGraph::addEdge(), d_graph, FatalAssert, CVC3::Expr::getType(), CVC3::isInt(), CVC3::isReal(), CVC3::TheoryArithOld::VarOrderGraph::lessThan(), CVC3::Expr::toString(), and TRACE.
|
inline |
Definition at line 959 of file theory_arith_old.h.
References d_splitSign.
bool TheoryArithOld::isNonlinearEq | ( | const Expr & | e) |
Check if equation is nonlinear. An equation is nonlinear if there is at least one nonlinear term in the sum on either side of the equation.
Definition at line 5223 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Expr::isEq(), isNonlinearSumTerm(), and CVC3::Expr::toString().
Referenced by findRationalBound(), and rewrite().
bool TheoryArithOld::isNonlinearSumTerm | ( | const Expr & | term) |
Check if a sum term is nonlinear
Definition at line 5210 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), CVC3::Theory::isLeaf(), CVC3::isMult(), and CVC3::isPow().
Referenced by getLowerBound(), getUpperBound(), isConstrainedAbove(), isConstrainedBelow(), isNonlinearEq(), and rewrite().
Check if the equality is of the form c + power1^n - power2^n = 0;
Definition at line 5244 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Expr::getRational(), CVC3::Expr::isEq(), CVC3::isMult(), CVC3::isPlus(), CVC3::isPow(), CVC3::isRational(), and CVC3::Expr::toString().
Referenced by rewrite().
bool TheoryArithOld::isPowerEquality | ( | const Expr & | nonlinearEq, |
Rational & | constant, | ||
Expr & | power1 | ||
) |
Check if the equality is of the form c - x^n = 0
Definition at line 5300 of file theory_arith_old.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Expr::getRational(), CVC3::Expr::isEq(), isInteger(), CVC3::isMult(), CVC3::isPlus(), CVC3::isPow(), CVC3::isRational(), and CVC3::Expr::toString().
Referenced by rewrite().
|
friend |
Printing.
Definition at line 46 of file theory_arith_old.cpp.
|
friend |
Printing.
Definition at line 56 of file theory_arith_old.cpp.
Definition at line 31 of file theory_arith_old.h.
Referenced by assertFact(), checkSat(), and TheoryArithOld().
|
private |
Definition at line 32 of file theory_arith_old.h.
Referenced by checkSat().
Definition at line 33 of file theory_arith_old.h.
Referenced by checkSat().
|
private |
Definition at line 34 of file theory_arith_old.h.
Referenced by assertFact(), checkIntegerEquality(), checkSat(), normalize(), rafineInequalityToInteger(), registerAtom(), rewrite(), TheoryArithOld(), tryPropagate(), and ~TheoryArithOld().
|
private |
Definition at line 35 of file theory_arith_old.h.
Referenced by assertFact(), checkSat(), computeModelBasic(), computeTermBounds(), and refineCounterExample().
Database of inequalities with a variable isolated on the right.
Definition at line 78 of file theory_arith_old.h.
Referenced by computeTermBounds(), findBounds(), processFiniteIntervals(), and ~TheoryArithOld().
Database of inequalities with a variable isolated on the left.
Definition at line 81 of file theory_arith_old.h.
Referenced by computeTermBounds(), findBounds(), processFiniteIntervals(), and ~TheoryArithOld().
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 91 of file theory_arith_old.h.
Buffer of input inequalities (high priority)
Is the problem only difference logic
Definition at line 99 of file theory_arith_old.h.
Referenced by assertFact(), checkSat(), and TheoryArithOld().
Buffer of input inequalities (one variable)
Definition at line 100 of file theory_arith_old.h.
Referenced by assertFact(), checkSat(), and TheoryArithOld().
Buffer of input inequalities (small constraints)
Definition at line 101 of file theory_arith_old.h.
Referenced by assertFact(), checkSat(), and TheoryArithOld().
Buffer of input inequalities (big constraint)
Definition at line 102 of file theory_arith_old.h.
Referenced by assertFact(), checkSat(), and TheoryArithOld().
|
private |
Buffer index of the next unprocessed inequality.
Definition at line 104 of file theory_arith_old.h.
Referenced by assertFact().
|
private |
Buffer index of the next unprocessed inequality.
Definition at line 105 of file theory_arith_old.h.
Referenced by assertFact(), and TheoryArithOld().
|
private |
Buffer index of the next unprocessed inequality.
Definition at line 106 of file theory_arith_old.h.
Referenced by assertFact(), and TheoryArithOld().
|
private |
Buffer index of the next unprocessed inequality.
Definition at line 107 of file theory_arith_old.h.
Referenced by assertFact(), and TheoryArithOld().
|
private |
Number of queries that are just difference logic.
Definition at line 109 of file theory_arith_old.h.
|
private |
Threshold when the buffer must be processed.
Definition at line 111 of file theory_arith_old.h.
Referenced by assertFact().
|
private |
Definition at line 113 of file theory_arith_old.h.
Referenced by nonlinearSignSplit().
|
private |
Threshold on gray shadow size (ignore it and set incomplete)
Definition at line 115 of file theory_arith_old.h.
Referenced by assertFact().
Mapping of a variable to the number of inequalities where the variable would be isolated on the right.
Definition at line 121 of file theory_arith_old.h.
Mapping of a variable to the number of inequalities where the variable would be isolated on the left.
Definition at line 125 of file theory_arith_old.h.
Set of shared terms (for counterexample generation)
Definition at line 128 of file theory_arith_old.h.
Referenced by addSharedTerm(), refineCounterExample(), and update().
Definition at line 129 of file theory_arith_old.h.
Referenced by addSharedTerm().
Set of shared integer variables (i-leaves)
Definition at line 132 of file theory_arith_old.h.
|
private |
Definition at line 155 of file theory_arith_old.h.
Referenced by addPairToArithOrder(), assignVariables(), and computeTermBounds().
Map from variables to the maximal (by absolute value) of one of it's coefficients
Definition at line 350 of file theory_arith_old.h.
Definition at line 351 of file theory_arith_old.h.
Map from variables to the fixed value of one of it's coefficients
Definition at line 354 of file theory_arith_old.h.
Keep the expressions that are already in the buffer
Definition at line 390 of file theory_arith_old.h.
Referenced by update().
Strict lower bounds on terms, so that we don't add inequalities to the buffer
Definition at line 393 of file theory_arith_old.h.
Referenced by registerAtom().
Definition at line 394 of file theory_arith_old.h.
Referenced by registerAtom().
Strict upper bounds on terms, so that we don't add inequalities to the buffer
Definition at line 396 of file theory_arith_old.h.
Referenced by registerAtom().
Definition at line 397 of file theory_arith_old.h.
Referenced by registerAtom().
Which inequalities have already been projected (on which monomial).
Definition at line 406 of file theory_arith_old.h.
Referenced by update().
Sometimes we know an inequality is in the buffer (as a find of something) and we don't want it in the buffer, but we do want to pre-process it, so we put it here.
Definition at line 413 of file theory_arith_old.h.
Referenced by update().
|
private |
Are we doing only difference logic?
Definition at line 418 of file theory_arith_old.h.
Referenced by assertFact(), assignVariables(), computeTermBounds(), and isUnconstrained().
|
private |
Map from terms to their lower bound (and the original formula expression)
Definition at line 448 of file theory_arith_old.h.
Referenced by registerAtom(), and tryPropagate().
|
private |
Map from terms to their upper bound (and the original formula expression)
Definition at line 451 of file theory_arith_old.h.
Referenced by registerAtom(), and tryPropagate().
|
private |
Map of all the atoms in the formula
Definition at line 454 of file theory_arith_old.h.
Referenced by registerAtom().
|
private |
The graph for difference logic
Definition at line 885 of file theory_arith_old.h.
Referenced by assignVariables(), computeTermBounds(), isUnconstrained(), TheoryArithOld(), and tryPropagate().
|
private |
Definition at line 887 of file theory_arith_old.h.
Referenced by computeTermBounds(), TheoryArithOld(), and tryPropagate().
|
private |
Index for expanding on shared term equalities
Definition at line 890 of file theory_arith_old.h.
|
private |
Index for expanding on shared term equalities
Definition at line 892 of file theory_arith_old.h.
|
private |
Definition at line 894 of file theory_arith_old.h.
Referenced by addMultiplicativeSignSplit(), and assertFact().
|
private |
Definition at line 903 of file theory_arith_old.h.
Referenced by computeTermBounds(), and getUpperBound().
|
private |
Definition at line 904 of file theory_arith_old.h.
Referenced by computeTermBounds(), and getLowerBound().
Definition at line 906 of file theory_arith_old.h.
Referenced by isUnconstrained(), and updateConstrained().
Definition at line 907 of file theory_arith_old.h.
Referenced by isUnconstrained(), and updateConstrained().
Definition at line 910 of file theory_arith_old.h.
Referenced by computeTermBounds(), getLowerBound(), and isConstrainedBelow().
Definition at line 911 of file theory_arith_old.h.
Referenced by computeTermBounds(), getUpperBound(), and isConstrainedAbove().