#include <theory_datatype.h>
Inheritance diagram for CVCL::TheoryDatatype:
Author: Clark Barrett
Created: Wed Dec 1 22:27:12 2004
Definition at line 59 of file theory_datatype.h.
|
Definition at line 68 of file theory_datatype.h. |
|
Definition at line 49 of file theory_datatype.cpp. References CVCL::CONSTRUCTOR, createProofRules(), d_rules, CVCL::DATATYPE, CVCL::Theory::getEM(), CVCL::ExprManager::newKind(), CVCL::Theory::registerTheory(), CVCL::SELECTOR, and CVCL::TESTER. |
|
Definition at line 76 of file theory_datatype.cpp. References d_rules. |
|
|
|
Reimplemented in CVCL::TheoryDatatypeLazy. Definition at line 151 of file theory_datatype.cpp. References d_facts, d_labels, d_rules, CVCL::DatatypeProofRules::dummyTheorem(), CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::Theory::falseExpr(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Theory::findExpr(), CVCL::Expr::getType(), CVCL::Expr::hasFind(), instantiate(), CVCL::Theorem::isNull(), CVCL::CDList< T >::push_back(), and CVCL::Theory::setInconsistent(). Referenced by assertFact(), setup(), and update(). |
|
Reimplemented in CVCL::TheoryDatatypeLazy. Definition at line 174 of file theory_datatype.cpp. References d_facts, d_labels, d_rules, CVCL::DatatypeProofRules::dummyTheorem(), CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::Theory::falseExpr(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Theory::findExpr(), CVCL::Expr::hasFind(), instantiate(), CVCL::CDList< T >::push_back(), and CVCL::Theory::setInconsistent(). |
|
Definition at line 50 of file datatype_theorem_producer.cpp. Referenced by TheoryDatatype(). |
|
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 198 of file theory_datatype.cpp. References CVCL::Expr::addToNotify(), d_labels, CVCL::DATATYPE, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Type::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getType(), and initializeLabels(). |
|
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 208 of file theory_datatype.cpp. References getConsForTester(), getConsPos(), CVCL::Theorem::getExpr(), CVCL::Expr::getOpExpr(), CVCL::Expr::getOpKind(), CVCL::Expr::isNot(), CVCL::Theorem::isRewrite(), mergeLabels(), and CVCL::TESTER. |
|
Check for satisfiability in the theory.
Implements CVCL::Theory. Reimplemented in CVCL::TheoryDatatypeLazy. Definition at line 226 of file theory_datatype.cpp. References CVCL::Theory::addSplitter(), CVCL::ExprMap< Data >::begin(), d_datatypes, d_labels, d_smartSplits, d_splitterAsserted, d_splitters, d_splittersIndex, datatypeTestExpr(), CVCL::ExprMap< Data >::end(), CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::ExprMap< Data >::find(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Theory::findExpr(), getConsPos(), CVCL::Type::getExpr(), CVCL::Expr::getOpExpr(), getSelectorInfo(), CVCL::Expr::getType(), CVCL::Expr::isFinite(), CVCL::isSelector(), CVCL::CDList< T >::size(), CVCL::Expr::toString(), and CVCL::Type::toString(). |
|
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 284 of file theory_datatype.cpp. References canCollapse(), d_facts, d_rules, CVCL::Theorem::getRHS(), CVCL::isConstructor(), CVCL::isSelector(), CVCL::isTester(), CVCL::Theory::reflexivityRule(), CVCL::DatatypeProofRules::rewriteSelCons(), CVCL::DatatypeProofRules::rewriteTestCons(), CVCL::Theory::simplify(), and CVCL::Theory::transitivityRule(). |
|
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. Reimplemented in CVCL::TheoryDatatypeLazy. Definition at line 303 of file theory_datatype.cpp. References CVCL::Expr::addToNotify(), CVCL::APPLY, CVCL::Expr::arity(), d_labels, d_rules, d_smartSplits, d_splitters, CVCL::DATATYPE, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::Theory::enqueueFact(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Type::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getType(), initializeLabels(), CVCL::isConstructor(), CVCL::isSelector(), mergeLabels(), CVCL::DatatypeProofRules::noCycle(), CVCL::CDList< T >::push_back(), CVCL::Expr::setSelected(), and CVCL::Theory::setupCC(). |
|
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. Reimplemented in CVCL::TheoryDatatypeLazy. Definition at line 323 of file theory_datatype.cpp. References CVCL::Expr::addToNotify(), CVCL::Expr::arity(), canCollapse(), d_facts, d_rules, CVCL::DatatypeProofRules::decompose(), CVCL::Theory::enqueueFact(), CVCL::Theorem::getLHS(), CVCL::Expr::getOpExpr(), CVCL::Expr::getRep(), CVCL::Theorem::getRHS(), CVCL::Expr::getSig(), CVCL::Expr::isApply(), CVCL::isConstructor(), CVCL::Theorem::isNull(), CVCL::Expr::isNull(), CVCL::Expr::isSelected(), CVCL::isSelector(), CVCL::isTester(), mergeLabels(), CVCL::CDList< T >::push_back(), CVCL::DatatypeProofRules::rewriteSelCons(), CVCL::DatatypeProofRules::rewriteTestCons(), CVCL::Expr::setRep(), CVCL::Expr::setSelected(), CVCL::Expr::setSig(), CVCL::Theory::symmetryRule(), 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 381 of file theory_datatype.cpp. References CVCL::Theorem::getLHS(), CVCL::Theorem::getRHS(), CVCL::isConstructor(), CVCL::Theorem::isRewrite(), CVCL::Expr::isTerm(), and CVCL::Theory::symmetryRule(). |
|
Check that e is a valid Type expr.
Reimplemented from CVCL::Theory. Definition at line 392 of file theory_datatype.cpp. References CVCL::Expr::arity(), CVCL::CONSTRUCTOR, CVCL::DATATYPE, CVCL::Theory::getEM(), CVCL::Expr::getKind(), CVCL::Expr::isString(), CVCL::Theory::resolveID(), CVCL::SELECTOR, CVCL::TESTER, and CVCL::Expr::toString(). |
|
Compute and store the type of e.
Reimplemented from CVCL::Theory. Definition at line 413 of file theory_datatype.cpp. References CVCL::Expr::arity(), CVCL::ARROW, CVCL::Expr::begin(), CVCL::CONSTRUCTOR, CVCL::DATATYPE, CVCL::Expr::end(), CVCL::Theory::getBaseType(), CVCL::Type::getExpr(), CVCL::Op::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getOp(), CVCL::Expr::getOpKind(), CVCL::Expr::isApply(), CVCL::Type::isNull(), CVCL::Expr::lookupType(), CVCL::SELECTOR, CVCL::Expr::setType(), CVCL::TESTER, and CVCL::Expr::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 460 of file theory_datatype.cpp. |
|
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 465 of file theory_datatype.cpp. References CVCL::Expr::andExpr(), CVCL::APPLY, CVCL::Theory::computeTCC(), CVCL::CONSTRUCTOR, datatypeTestExpr(), CVCL::Expr::getKind(), getSelectorInfo(), CVCL::SELECTOR, and CVCL::Theory::trueExpr(). |
|
Theory-specific parsing implemented by the DP.
Reimplemented from CVCL::Theory. Definition at line 543 of file theory_datatype.cpp. References CVCL::Expr::arity(), CVCL::ExprMap< Data >::count(), dataType(), CVCL::DATATYPE, CVCL::Theory::getEM(), CVCL::ExprManager::getKind(), CVCL::Expr::getKind(), CVCL::Expr::getString(), CVCL::ID, CVCL::ExprMap< Data >::insert(), CVCL::Theory::parseExpr(), CVCL::RAW_LIST, and CVCL::Expr::toString(). |
|
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 492 of file theory_datatype.cpp. References CVCL::APPLY, CVCL::Expr::arity(), CVCL::Expr::begin(), CVCL::CONSTRUCTOR, CVCL::DATATYPE, CVCL::Expr::end(), CVCL::Theory::getEM(), CVCL::Expr::getKind(), CVCL::Expr::getName(), CVCL::Expr::getOpExpr(), CVCL::Expr::getString(), CVCL::Expr::isString(), CVCL::Expr::isSymbol(), CVCL::ExprStream::lang(), CVCL::LISP_LANG, CVCL::PRESENTATION_LANG, CVCL::Expr::printAST(), CVCL::push(), CVCL::SELECTOR, CVCL::SMTLIB_LANG, CVCL::space(), and CVCL::TESTER. |
|
Referenced by parseExprOp(). |
|
|
|
|
|
|
|
Referenced by CVCL::TheoryDatatypeLazy::checkSat(), checkSat(), and computeTCC(). |
|
Definition at line 915 of file theory_datatype.cpp. References d_selectorMap, CVCL::ExprMap< Data >::end(), CVCL::ExprMap< Data >::find(), CVCL::Expr::getKind(), CVCL::SELECTOR, and CVCL::Expr::toString(). Referenced by canCollapse(), checkSat(), computeTCC(), and CVCL::DatatypeTheoremProducer::rewriteSelCons(). |
|
Definition at line 925 of file theory_datatype.cpp. References d_testerMap, CVCL::ExprMap< Data >::end(), CVCL::ExprMap< Data >::find(), CVCL::Expr::getKind(), CVCL::TESTER, and CVCL::Expr::toString(). Referenced by assertFact(), and CVCL::DatatypeTheoremProducer::rewriteTestCons(). |
|
Definition at line 936 of file theory_datatype.cpp. References CVCL::Type::arity(), CVCL::CONSTRUCTOR, d_datatypes, CVCL::ExprMap< Data >::end(), CVCL::ExprMap< Data >::find(), CVCL::Type::getExpr(), CVCL::Expr::getKind(), CVCL::Expr::getType(), CVCL::isDatatype(), CVCL::Type::isFunction(), CVCL::Expr::toString(), and CVCL::Type::toString(). Referenced by assertFact(), canCollapse(), and checkSat(). |
|
|
Definition at line 990 of file theory_datatype.cpp. References d_reach, CVCL::ExprMap< Data >::end(), CVCL::ExprMap< Data >::find(), CVCL::Type::getExpr(), and CVCL::isDatatype(). Referenced by CVCL::DatatypeTheoremProducer::noCycle(). |
|
Definition at line 999 of file theory_datatype.cpp. References CVCL::Expr::arity(), d_labels, CVCL::CDMap< Key, Data, HashFcn >::end(), CVCL::CDMap< Key, Data, HashFcn >::find(), CVCL::Theory::findExpr(), getConsPos(), CVCL::Expr::getOpExpr(), getSelectorInfo(), CVCL::isConstructor(), and CVCL::isSelector(). Referenced by rewrite(), CVCL::DatatypeTheoremProducer::rewriteSelCons(), CVCL::TheoryDatatypeLazy::update(), and update(). |
|
Definition at line 61 of file theory_datatype.h. Referenced by CVCL::TheoryDatatypeLazy::instantiate(), instantiate(), CVCL::TheoryDatatypeLazy::mergeLabels(), mergeLabels(), rewrite(), CVCL::TheoryDatatypeLazy::setup(), setup(), TheoryDatatype(), CVCL::TheoryDatatypeLazy::update(), update(), and ~TheoryDatatype(). |
|
Definition at line 63 of file theory_datatype.h. Referenced by CVCL::TheoryDatatypeLazy::checkSat(), checkSat(), getConsPos(), getConstant(), CVCL::TheoryDatatypeLazy::initializeLabels(), initializeLabels(), CVCL::TheoryDatatypeLazy::instantiate(), and instantiate(). |
|
Definition at line 64 of file theory_datatype.h. Referenced by getSelectorInfo(). |
|
Definition at line 65 of file theory_datatype.h. Referenced by getConsForTester(). |
|
Definition at line 66 of file theory_datatype.h. Referenced by getReachablePredicate(). |
|
Definition at line 69 of file theory_datatype.h. Referenced by addSharedTerm(), canCollapse(), CVCL::TheoryDatatypeLazy::checkSat(), checkSat(), CVCL::TheoryDatatypeLazy::initializeLabels(), initializeLabels(), CVCL::TheoryDatatypeLazy::mergeLabels(), mergeLabels(), CVCL::TheoryDatatypeLazy::setup(), and setup(). |
|
Definition at line 71 of file theory_datatype.h. Referenced by CVCL::TheoryDatatypeLazy::checkSat(), CVCL::TheoryDatatypeLazy::instantiate(), instantiate(), CVCL::TheoryDatatypeLazy::mergeLabels(), mergeLabels(), rewrite(), CVCL::TheoryDatatypeLazy::update(), and update(). |
|
Definition at line 72 of file theory_datatype.h. Referenced by CVCL::TheoryDatatypeLazy::checkSat(), checkSat(), CVCL::TheoryDatatypeLazy::initializeLabels(), initializeLabels(), and setup(). |
|
Definition at line 73 of file theory_datatype.h. Referenced by CVCL::TheoryDatatypeLazy::checkSat(), and checkSat(). |
|
Definition at line 74 of file theory_datatype.h. Referenced by CVCL::TheoryDatatypeLazy::checkSat(), and checkSat(). |
|
Definition at line 75 of file theory_datatype.h. Referenced by checkSat(), initializeLabels(), and setup(). |