CVC3
2.4.1
|
This theory handles basic linear arithmetic. More...
#include <theory_arith.h>
Public Member Functions | |
TheoryArith (TheoryCore *core, const std::string &name) | |
~TheoryArith () | |
virtual void | addMultiplicativeSignSplit (const Theorem &case_split_thm) |
virtual bool | addPairToArithOrder (const Expr &smaller, const Expr &bigger) |
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... | |
virtual void | separateMonomial (const Expr &e, Expr &c, Expr &var)=0 |
Separate monomial e = c*p1*...*pn into c and 1*p1*...*pn. More... | |
virtual void | addSharedTerm (const Expr &e)=0 |
Notify theory of a new shared term. More... | |
virtual void | assertFact (const Theorem &e)=0 |
Assert a new fact to the decision procedure. More... | |
virtual void | refineCounterExample ()=0 |
Process disequalities from the arrangement for model generation. More... | |
virtual void | computeModelBasic (const std::vector< Expr > &v)=0 |
Assign concrete values to basic-type variables in v. More... | |
virtual void | computeModel (const Expr &e, std::vector< Expr > &vars)=0 |
Compute the value of a compound variable from the more primitive ones. More... | |
virtual void | checkSat (bool fullEffort)=0 |
Check for satisfiability in the theory. More... | |
virtual Theorem | rewrite (const Expr &e)=0 |
Theory-specific rewrite rules. More... | |
virtual void | setup (const Expr &e)=0 |
Set up the term e for call-backs when e or its children change. More... | |
virtual void | update (const Theorem &e, const Expr &d)=0 |
Notify a theory of a new equality. More... | |
virtual Theorem | solve (const Theorem &e)=0 |
An optional solver. More... | |
virtual void | checkAssertEqInvariant (const Theorem &e)=0 |
A debug check used by the primary solver. More... | |
virtual void | checkType (const Expr &e)=0 |
Check that e is a valid Type expr. More... | |
virtual Cardinality | finiteTypeInfo (Expr &e, Unsigned &n, bool enumerate, bool computeSize)=0 |
Compute information related to finiteness of types. More... | |
virtual void | computeType (const Expr &e)=0 |
Compute and store the type of e. More... | |
virtual Type | computeBaseType (const Type &t)=0 |
Compute the base type of the top-level operator of an arbitrary type. More... | |
virtual void | computeModelTerm (const Expr &e, std::vector< Expr > &v)=0 |
Add variables from 'e' to 'v' for constructing a concrete model. More... | |
virtual Expr | computeTypePred (const Type &t, const Expr &e)=0 |
Theory specific computation of the subtyping predicate for type t applied to the expression e. More... | |
virtual Expr | computeTCC (const Expr &e)=0 |
Compute and cache the TCC of e. More... | |
virtual ExprStream & | print (ExprStream &os, const Expr &e)=0 |
Theory-specific pretty-printing. More... | |
virtual Expr | parseExprOp (const Expr &e)=0 |
Theory-specific parsing implemented by the DP. 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 void | registerAtom (const Expr &e) |
Theory-specific registration of atoms. More... | |
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... | |
Protected Member Functions | |
virtual Theorem | canon (const Expr &e)=0 |
Canonize the expression e, assuming all children are canonical. More... | |
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... | |
Protected Attributes | |
Type | d_realType |
Type | d_intType |
std::vector< int > | d_kinds |
![]() | |
bool | d_theoryUsed |
This theory handles basic linear arithmetic.
Author: Clark Barrett
Created: Sat Feb 8 14:44:32 2003
Definition at line 70 of file theory_arith.h.
|
inline |
Definition at line 98 of file theory_arith.h.
|
inline |
Definition at line 100 of file theory_arith.h.
Canonize the expression e, assuming all children are canonical.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
Referenced by canonThm().
Canonize the expression e recursively.
Definition at line 31 of file theory_arith.cpp.
References CVC3::Expr::arity(), CVC3::Theorem::getLHS(), and CVC3::Theorem::getRHS().
|
protected |
Print a rational in SMT-LIB format.
Definition at line 54 of file theory_arith.cpp.
References DebugAssert, CVC3::Rational::getDenominator(), CVC3::Rational::getNumerator(), CVC3::Rational::isInteger(), CVC3::ExprStream::lang(), CVC3::push(), CVC3::SMTLIB_LANG, CVC3::space(), CVC3::SPASS_LANG, and CVC3::Rational::toString().
Referenced by CVC3::TheoryArithNew::print(), CVC3::TheoryArith3::print(), and CVC3::TheoryArithOld::print().
|
protected |
Whether any ite's appear in the arithmetic part of the term e.
Definition at line 115 of file theory_arith.cpp.
References CVC3::Expr::arity(), CVC3::DIVIDE, CVC3::Expr::getKind(), CVC3::INTDIV, ITE, CVC3::MINUS, CVC3::MOD, CVC3::MULT, CVC3::PLUS, CVC3::POW, RATIONAL_EXPR, and CVC3::UMINUS.
simplify leaves and then canonize
Definition at line 257 of file theory_arith.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Theorem::getLHS(), and CVC3::Theorem::getRHS().
Referenced by CVC3::TheoryArith3::checkAssertEqInvariant(), CVC3::TheoryArithOld::checkAssertEqInvariant(), CVC3::TheoryArithNew::update(), and CVC3::TheoryArith3::update().
|
protected |
helper for checkAssertEqInvariant
Definition at line 283 of file theory_arith.cpp.
References CVC3::Expr::begin(), CVC3::Expr::end(), and CVC3::Expr::hasFind().
Referenced by CVC3::TheoryArith3::checkAssertEqInvariant(), and CVC3::TheoryArithOld::checkAssertEqInvariant().
|
inlinevirtual |
Reimplemented in CVC3::TheoryArithOld.
Definition at line 102 of file theory_arith.h.
|
inlinevirtual |
Record that smaller should be smaller than bigger in the variable order. Should be implemented in decision procedures that support it.
Reimplemented in CVC3::TheoryArithOld.
Definition at line 108 of file theory_arith.h.
Return whether e is syntactically identical to a rational constant.
Definition at line 157 of file theory_arith.cpp.
References CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::isDivide(), CVC3::Expr::isRational(), CVC3::isUMinus(), and CVC3::REAL_CONST.
bool TheoryArith::isAtomicArithFormula | ( | const Expr & | e) |
Whether any ite's appear in the arithmetic part of the formula e.
Definition at line 143 of file theory_arith.cpp.
References EQ, CVC3::GE, CVC3::Expr::getKind(), CVC3::GT, CVC3::LE, and CVC3::LT.
Rewrite an atom to look like x - y op c if possible–for smtlib translation.
Definition at line 189 of file theory_arith.cpp.
References CVC3::Expr::arity(), DebugAssert, EQ, CVC3::GE, CVC3::Expr::getKind(), CVC3::Expr::getRational(), CVC3::GT, CVC3::isRational(), CVC3::LE, CVC3::LT, CVC3::MULT, CVC3::PLUS, and RATIONAL_EXPR.
Composition of canon(const Expr&) by transitivity: take e0 = e1, canonize e1 to e2, return e0 = e2.
Definition at line 120 of file theory_arith.h.
References canon(), CVC3::Theorem::getRHS(), and CVC3::Theory::transitivityRule().
Referenced by CVC3::TheoryArithNew::substAndCanonizeModTableaux(), and CVC3::TheoryArithNew::substAndCanonizeTableaux().
|
pure virtual |
Separate monomial e = c*p1*...*pn into c and 1*p1*...*pn.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure 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)
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure 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::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
Process disequalities from the arrangement for model generation.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
Assign concrete values to basic-type variables in v.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
Compute the value of a compound variable from the more primitive ones.
The more primitive variables for e are already assigned concrete values, and are available through getModelValue().
The new value for e must be assigned using assignValue() method.
e | is the compound type expression to assign a value; |
vars | are the variables actually assigned. Normally, 'e' is the only element of vars. However, e.g. in the case of uninterpreted functions, assigning 'f' means assigning all relevant applications of 'f' to constant values (f(0), f(5), etc.). Such applications might not be known before the model is constructed (they may be of the form f(x), f(y+z), etc., where x,y,z are still unassigned). |
Populating 'vars' is an opportunity for a DP to change the set of top-level "variables" to assign, if needed. In particular, it may drop 'e' from the model entirely, if it is already a concrete value by itself.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure 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::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
Theory-specific rewrite rules.
By default, rewrite just returns a reflexive theorem stating that the input expression is equivalent to itself. However, rewrite is allowed to return any theorem which describes how the input expression is equivalent to some new expression. rewrite should be used to perform simplifications, normalization, and any other preprocessing on theory-specific expressions that needs to be done.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure 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.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
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 CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
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 CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
A debug check used by the primary solver.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
Check that e is a valid Type expr.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure 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.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure 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.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
Compute the base type of the top-level operator of an arbitrary type.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
Add variables from 'e' to 'v' for constructing a concrete model.
If e is already of primitive type, do NOT add it to v.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
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 CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
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.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
pure virtual |
Theory-specific pretty-printing.
By default, print the top node in AST, and resume pretty-printing the children. The same call e.print(os) can be used in DP-specific printers to use AST printing for the given node. In fact, it is strongly recommended to add e.print(os) as the default for all the cases/kinds that are not handled by the particular pretty-printer.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
Theory-specific parsing implemented by the DP.
Reimplemented from CVC3::Theory.
Implemented in CVC3::TheoryArithOld, CVC3::TheoryArith3, and CVC3::TheoryArithNew.
|
inline |
Definition at line 152 of file theory_arith.h.
References d_realType.
Referenced by CVC3::TheoryArithNew::computeBaseType(), CVC3::TheoryArith3::computeBaseType(), CVC3::TheoryArithOld::computeBaseType(), CVC3::ArithTheoremProducer3::realType(), CVC3::ArithTheoremProducerOld::realType(), CVC3::ArithTheoremProducer::realType(), and CVC3::Translator::zeroVar().
|
inline |
Definition at line 153 of file theory_arith.h.
References d_intType.
Referenced by CVC3::ArithTheoremProducer3::intType(), CVC3::ArithTheoremProducerOld::intType(), CVC3::ArithTheoremProducer::intType(), CVC3::Translator::processType(), CVC3::TheoryArithNew::solve(), CVC3::TheoryArith3::solve(), and CVC3::Translator::zeroVar().
Definition at line 154 of file theory_arith.h.
References CVC3::SUBRANGE.
Definition at line 156 of file theory_arith.h.
References CVC3::Theory::getEM(), and CVC3::ExprManager::newRatExpr().
Referenced by CVC3::TheoryArithNew::assignVariables(), CVC3::TheoryArith3::assignVariables(), CVC3::TheoryArithOld::assignVariables(), CVC3::TheoryArithNew::computeTCC(), CVC3::TheoryArith3::computeTCC(), CVC3::TheoryArithOld::computeTCC(), CVC3::TheoryArithOld::findRationalBound(), CVC3::TheoryArithNew::finiteTypeInfo(), CVC3::TheoryArith3::finiteTypeInfo(), CVC3::TheoryArithOld::finiteTypeInfo(), grayShadow(), CVC3::TheoryArithNew::normalize(), CVC3::TheoryArithNew::pivotRule(), CVC3::TheoryArithNew::processFiniteInterval(), CVC3::TheoryArith3::processFiniteInterval(), CVC3::TheoryArithNew::rewrite(), CVC3::TheoryArithOld::rewrite(), CVC3::TheoryArithOld::TheoryArithOld(), and CVC3::TheoryArithOld::tryPropagate().
Construct the dark shadow expression representing lhs <= rhs.
Definition at line 159 of file theory_arith.h.
References CVC3::DARK_SHADOW.
Referenced by CVC3::ArithTheoremProducer3::darkShadow(), CVC3::ArithTheoremProducerOld::darkShadow(), and CVC3::ArithTheoremProducer::darkShadow().
|
inline |
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 165 of file theory_arith.h.
References CVC3::GRAY_SHADOW, and rat().
Referenced by CVC3::ArithTheoremProducer3::grayShadow(), CVC3::ArithTheoremProducerOld::grayShadow(), and CVC3::ArithTheoremProducer::grayShadow().
bool TheoryArith::leavesAreNumConst | ( | const Expr & | e) |
Definition at line 294 of file theory_arith.cpp.
References CVC3::Expr::arity(), DebugAssert, CVC3::Expr::getTerminalsConstFlag(), CVC3::Expr::isAtomic(), CVC3::Expr::isITE(), CVC3::Expr::isPropAtom(), CVC3::Expr::isRational(), CVC3::Expr::isTerm(), CVC3::Expr::setTerminalsConstFlag(), and CVC3::Expr::validTerminalsConstFlag().
Referenced by CVC3::TheoryArithOld::rewrite(), and CVC3::ExprTransform::simplifyWithCare().
|
protected |
Definition at line 72 of file theory_arith.h.
Referenced by CVC3::TheoryArithNew::computeType(), CVC3::TheoryArith3::computeType(), CVC3::TheoryArithOld::computeType(), realType(), CVC3::TheoryArith3::TheoryArith3(), CVC3::TheoryArithNew::TheoryArithNew(), and CVC3::TheoryArithOld::TheoryArithOld().
|
protected |
Definition at line 73 of file theory_arith.h.
Referenced by CVC3::TheoryArithNew::computeType(), CVC3::TheoryArith3::computeType(), CVC3::TheoryArithOld::computeType(), intType(), CVC3::TheoryArith3::TheoryArith3(), CVC3::TheoryArithNew::TheoryArithNew(), and CVC3::TheoryArithOld::TheoryArithOld().
|
protected |
Definition at line 74 of file theory_arith.h.
Referenced by CVC3::TheoryArithOld::TheoryArithOld(), and CVC3::TheoryArithOld::~TheoryArithOld().