#include <theory_array.h>
Inheritance diagram for CVCL::TheoryArray:
Author: Clark Barrett
Created: Thu Feb 27 00:38:20 2003
Definition at line 58 of file theory_array.h.
|
Definition at line 61 of file theory_array.cpp. References CVCL::ARRAY, CVCL::ARRAY_LITERAL, createProofRules(), d_rules, CVCL::Theory::getEM(), CVCL::ExprManager::newKind(), CVCL::READ, CVCL::Theory::registerTheory(), and CVCL::WRITE. |
|
Definition at line 85 of file theory_array.cpp. References d_rules. |
|
Definition at line 47 of file theory_array.cpp. References CVCL::TheoryCore::addToVarDB(), CVCL::Theory::getCommonRules(), CVCL::Theorem::getRHS(), CVCL::Theorem::isRewrite(), CVCL::Expr::isSkolem(), CVCL::Theory::theoryCore(), CVCL::Theorem::toString(), and CVCL::CommonProofRules::varIntroSkolem(). Referenced by update(). |
|
Definition at line 49 of file array_theorem_producer.cpp. References CVCL::Theory::theoryCore(). Referenced by TheoryArray(). |
|
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 CVCL::Theory. Definition at line 80 of file theory_array.h. |
|
Assert a new fact to the decision procedure. Each fact that makes it into the core framework is assigned to exactly one theory: the theory associated with that fact. assertFact is called to inform the theory that a new fact has been assigned to the theory. Implements CVCL::Theory. Definition at line 81 of file theory_array.h. |
|
Check for satisfiability in the theory.
Implements CVCL::Theory. Definition at line 82 of file theory_array.h. |
|
Theory-specific rewrite rules. By default, rewrite just returns a reflexive theorem stating that the input expression is equivalent to itself. However, rewrite is allowed to return any theorem which describes how the input expression is equivalent to some new expression. rewrite should be used to perform simplifications, normalization, and any other preprocessing on theory-specific expressions that needs to be done. Reimplemented from CVCL::Theory. Definition at line 90 of file theory_array.cpp. Referenced by computeModel(), and update(). |
|
|
|
Set up the term e for call-backs when e or its children change. setup is called once for each expression associated with the theory. It is typically used to setup theory-specific data for an expression and to add call-back information for use with update.
Reimplemented from CVCL::Theory. Definition at line 189 of file theory_array.cpp. References CVCL::Expr::addToNotify(), CVCL::Expr::arity(), d_reads, CVCL::Expr::isAtomic(), CVCL::Expr::isEq(), CVCL::Expr::isNot(), CVCL::isRead(), CVCL::isWrite(), CVCL::CDList< T >::push_back(), CVCL::READ, CVCL::Theory::reflexivityRule(), CVCL::Expr::setRep(), CVCL::Expr::setSig(), CVCL::TheoryCore::setupTerm(), CVCL::Theory::simplifyExpr(), CVCL::Theory::theoryCore(), and CVCL::TRACE. |
|
Notify a theory of a new equality. update is a call-back used by the notify mechanism of the core theory. It works as follows. When an equation t1 = t2 makes it into the core framework, the two find equivalence classes for t1 and t2 are merged. The result is that t2 is the new equivalence class representative and t1 is no longer an equivalence class representative. When this happens, the notify list of t1 is traversed. Notify list entries consist of a theory and an expression d. For each entry (i,d), i->update(e, d) is called, where e is the theorem corresponding to the equality t1=t2. To add the entry (i,d) to a term t1's notify list, a call must be made to t1.addNotify(i,d). This is typically done in setup.
Reimplemented from CVCL::Theory. Definition at line 216 of file theory_array.cpp. References CVCL::Expr::addToNotify(), CVCL::Expr::arity(), d_rules, CVCL::Theory::enqueueEquality(), CVCL::Theory::enqueueFact(), CVCL::Theory::find(), CVCL::Expr::getRep(), CVCL::Theorem::getRHS(), CVCL::Expr::getSig(), CVCL::Expr::isAtomic(), CVCL::Theorem::isNull(), CVCL::isRead(), CVCL::isWrite(), renameExpr(), rewrite(), CVCL::ArrayProofRules::rewriteReadWrite(), CVCL::Expr::setRep(), CVCL::Expr::setSig(), CVCL::Theory::symmetryRule(), CVCL::Expr::toString(), CVCL::Theory::transitivityRule(), and CVCL::Theory::updateHelper(). |
|
An optional solver. The solve method can be used to implement a Shostak-style solver. Since solvers do not in general combine, the following technique is used. One theory is designated as the primary solver (in our case, it is the theory of arithmetic). For each equation that enters the core framework, the primary solver is called to ensure that the equation is in solved form with respect to the primary theory. After the primary solver, the solver for the theory associated with the equation is called. This solver can do whatever it likes, as long as the result is still in solved form with respect to the primary solver. This is a slight generalization of what is described in my (Clark)'s PhD thesis. Reimplemented from CVCL::Theory. Definition at line 281 of file theory_array.cpp. References CVCL::Theorem::getExpr(), CVCL::Expr::isEq(), CVCL::isWrite(), CVCL::Theory::symmetryRule(), and CVCL::Expr::toString(). |
|
Check that e is a valid Type expr.
Reimplemented from CVCL::Theory. Definition at line 294 of file theory_array.cpp. References CVCL::Expr::arity(), CVCL::ARRAY, CVCL::Theory::getEM(), CVCL::Expr::getKind(), CVCL::Type::isBool(), and CVCL::Type::isFunction(). |
|
Compute and store the type of e.
Reimplemented from CVCL::Theory. Definition at line 320 of file theory_array.cpp. References CVCL::Expr::arity(), CVCL::ARRAY_LITERAL, CVCL::arrayType(), CVCL::Theory::getBaseType(), CVCL::Expr::getBody(), CVCL::Expr::getKind(), CVCL::Expr::getType(), CVCL::Expr::getVars(), CVCL::isArray(), CVCL::Expr::isClosure(), CVCL::READ, CVCL::Expr::setType(), CVCL::Type::toString(), CVCL::Expr::toString(), and CVCL::WRITE. |
|
Compute the base type of the top-level operator of an arbitrary type.
Reimplemented from CVCL::Theory. Definition at line 392 of file theory_array.cpp. References CVCL::Expr::arity(), CVCL::ARRAY, CVCL::Expr::begin(), CVCL::Expr::end(), CVCL::Theory::getBaseType(), CVCL::Type::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getOp(), and CVCL::Type::toString(). |
|
Add variables from 'e' to 'v' for constructing a concrete model. If e is already of primitive type, do NOT add it to v. Reimplemented from CVCL::Theory. Definition at line 404 of file theory_array.cpp. References CVCL::ARRAY, CVCL::CDList< T >::begin(), d_reads, CVCL::CDList< T >::end(), CVCL::Type::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getType(), CVCL::isRead(), CVCL::READ, and CVCL::WRITE. |
|
Compute the value of a compound variable from the more primitive ones. The more primitive variables for e are already assigned concrete values, and are available through getModelValue(). The new value for e must be assigned using assignValue() method.
Reimplemented from CVCL::Theory. Definition at line 444 of file theory_array.cpp. References CVCL::Type::arity(), CVCL::ARRAY, CVCL::arrayLiteral(), CVCL::Theory::assignValue(), CVCL::ExprHashMap< Data >::begin(), CVCL::CDList< T >::begin(), d_applicationsInModel, d_reads, CVCL::ExprHashMap< Data >::end(), CVCL::CDList< T >::end(), CVCL::Expr::eqExpr(), CVCL::Theory::getBaseType(), CVCL::Theory::getEM(), CVCL::Expr::getKind(), CVCL::Theorem::getLHS(), CVCL::Theory::getModelValue(), CVCL::Theorem::getRHS(), CVCL::Expr::getType(), CVCL::int2string(), CVCL::isArray(), CVCL::Expr::isNull(), CVCL::isRead(), CVCL::Expr::iteExpr(), CVCL::CDList< T >::push_back(), CVCL::READ, CVCL::Theory::reflexivityRule(), rewrite(), CVCL::Expr::setType(), CVCL::ExprHashMap< Data >::size(), CVCL::Theory::substitutivityRule(), CVCL::Theory::symmetryRule(), CVCL::Expr::toString(), CVCL::TRACE, CVCL::Theory::transitivityRule(), and CVCL::WRITE. |
|
Compute and cache the TCC of e.
The default implementation is to compute TCCs recursively for all children, and return their conjunction. Reimplemented from CVCL::Theory. Definition at line 546 of file theory_array.cpp. References CVCL::andExpr(), CVCL::Expr::andExpr(), CVCL::ARRAY_LITERAL, CVCL::Theory::computeTCC(), CVCL::Theorem::getRHS(), CVCL::Theory::getTypePred(), CVCL::READ, CVCL::Theory::rewriteAnd(), and CVCL::WRITE. |
|
Theory-specific parsing implemented by the DP.
Reimplemented from CVCL::Theory. Definition at line 681 of file theory_array.cpp. References CVCL::Theory::addBoundVar(), CVCL::Expr::arity(), CVCL::ARRAY, CVCL::ARRAY_LITERAL, CVCL::Expr::begin(), CVCL::Expr::end(), CVCL::Expr::getEM(), CVCL::Theory::getEM(), CVCL::ExprManager::getKind(), CVCL::Expr::getKind(), CVCL::Expr::getString(), CVCL::ID, CVCL::ExprManager::newClosureExpr(), CVCL::Theory::parseExpr(), CVCL::RAW_LIST, CVCL::READ, CVCL::Expr::toString(), CVCL::TRACE, and CVCL::WRITE. |
|
Theory-specific pretty-printing. By default, print the top node in AST, and resume pretty-printing the children. The same call e.print(os) can be used in DP-specific printers to use AST printing for the given node. In fact, it is strongly recommended to add e.print(os) as the default for all the cases/kinds that are not handled by the particular pretty-printer. Reimplemented from CVCL::Theory. Definition at line 575 of file theory_array.cpp. References CVCL::Expr::arity(), CVCL::ARRAY, CVCL::ARRAY_LITERAL, CVCL::Theory::d_theoryUsed, CVCL::Expr::getKind(), CVCL::ExprStream::lang(), CVCL::LISP_LANG, CVCL::pop(), CVCL::popdag(), CVCL::PRESENTATION_LANG, CVCL::Expr::printAST(), CVCL::push(), CVCL::pushdag(), CVCL::READ, CVCL::SMTLIB_LANG, CVCL::space(), and CVCL::WRITE. |
|
Definition at line 59 of file theory_array.h. Referenced by TheoryArray(), update(), and ~TheoryArray(). |
|
Backtracking list of array reads, for building concrete models.
Definition at line 62 of file theory_array.h. Referenced by computeModel(), computeModelTerm(), and setup(). |
|
Set of renaming theorems indexed by t.
Definition at line 64 of file theory_array.h. |
|
Flag to include array reads to the concrete model.
Definition at line 66 of file theory_array.h. Referenced by computeModel(). |