CVC3
|
This theory handles datatypes. More...
#include <theory_datatype_lazy.h>
Inherits CVC3::TheoryDatatype.
This theory handles datatypes.
Author: Clark Barrett
Created: Wed Dec 1 22:27:12 2004
Definition at line 43 of file theory_datatype_lazy.h.
enum CVC3::TheoryDatatypeLazy::ProcessKinds [private] |
Definition at line 45 of file theory_datatype_lazy.h.
TheoryDatatypeLazy::TheoryDatatypeLazy | ( | TheoryCore * | theoryCore | ) |
Definition at line 41 of file theory_datatype_lazy.cpp.
CVC3::TheoryDatatypeLazy::~TheoryDatatypeLazy | ( | ) | [inline] |
Definition at line 65 of file theory_datatype_lazy.h.
Reimplemented from CVC3::TheoryDatatype.
Definition at line 50 of file theory_datatype_lazy.cpp.
References CVC3::Type::arity(), CVC3::ExprMap< Data >::begin(), CVC3::TheoryDatatype::d_datatypes, CVC3::TheoryDatatype::d_facts, d_processQueue, d_processQueueKind, CVC3::TheoryDatatype::d_rules, DebugAssert, CVC3::DatatypeProofRules::dummyTheorem(), CVC3::ExprMap< Data >::end(), ENQUEUE, CVC3::Expr::eqExpr(), EXISTS, CVC3::ExprMap< Data >::find(), CVC3::Theory::findExpr(), CVC3::Theory::getEM(), CVC3::Type::getExpr(), CVC3::Expr::getType(), CVC3::Expr::hasFind(), CVC3::isConstructor(), CVC3::Expr::isFinite(), CVC3::Expr::isSelected(), CVC3::Expr::isTranslated(), CVC3::Expr::mkOp(), CVC3::ExprManager::newClosureExpr(), CVC3::CDList< T >::push_back(), CVC3::Expr::setTranslated(), CVC3::Expr::toString(), and CVC3::Type::toString().
Referenced by initializeLabels(), and mergeLabels().
Reimplemented from CVC3::TheoryDatatype.
Definition at line 90 of file theory_datatype_lazy.cpp.
References CVC3::TheoryDatatype::d_datatypes, CVC3::TheoryDatatype::d_labels, CVC3::TheoryDatatype::d_splitters, d_typeComplete, DebugAssert, CVC3::CDMap< Key, Data, HashFcn >::end(), CVC3::ExprMap< Data >::end(), CVC3::CDMap< Key, Data, HashFcn >::find(), CVC3::ExprMap< Data >::find(), CVC3::Theory::findExpr(), CVC3::getConstructor(), CVC3::Type::getExpr(), CVC3::CDMap< Key, Data, HashFcn >::insert(), instantiate(), CVC3::isConstructor(), CVC3::CDList< T >::push_back(), CVC3::Theory::theoryCore(), and CVC3::Expr::toString().
Referenced by setup().
void TheoryDatatypeLazy::mergeLabels | ( | const Theorem & | thm, |
const Expr & | e1, | ||
const Expr & | e2 | ||
) | [private, virtual] |
Reimplemented from CVC3::TheoryDatatype.
Definition at line 123 of file theory_datatype_lazy.cpp.
References CVC3::TheoryDatatype::d_facts, CVC3::TheoryDatatype::d_labels, CVC3::TheoryDatatype::d_rules, DebugAssert, CVC3::DatatypeProofRules::dummyTheorem(), CVC3::CDMap< Key, Data, HashFcn >::end(), CVC3::Theory::falseExpr(), CVC3::CDMap< Key, Data, HashFcn >::find(), CVC3::Theory::find(), CVC3::Expr::getType(), CVC3::Expr::hasFind(), instantiate(), CVC3::Theorem::isNull(), CVC3::CDList< T >::push_back(), and CVC3::Theory::setInconsistent().
Referenced by checkSat().
void TheoryDatatypeLazy::mergeLabels | ( | const Theorem & | thm, |
const Expr & | e, | ||
unsigned | position, | ||
bool | positive | ||
) | [private, virtual] |
Reimplemented from CVC3::TheoryDatatype.
Definition at line 151 of file theory_datatype_lazy.cpp.
References CVC3::TheoryDatatype::d_facts, CVC3::TheoryDatatype::d_labels, CVC3::TheoryDatatype::d_rules, DebugAssert, CVC3::DatatypeProofRules::dummyTheorem(), CVC3::CDMap< Key, Data, HashFcn >::end(), CVC3::Theory::falseExpr(), CVC3::CDMap< Key, Data, HashFcn >::find(), CVC3::Theory::find(), CVC3::Expr::hasFind(), instantiate(), CVC3::CDList< T >::push_back(), and CVC3::Theory::setInconsistent().
void TheoryDatatypeLazy::checkSat | ( | bool | fullEffort | ) | [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.
Reimplemented from CVC3::TheoryDatatype.
Definition at line 178 of file theory_datatype_lazy.cpp.
References CVC3::Theory::addSplitter(), CVC3::ExprMap< Data >::begin(), CVC3::TheoryDatatype::d_datatypes, CVC3::TheoryDatatype::d_facts, CVC3::TheoryDatatype::d_labels, d_processIndex, d_processQueue, d_processQueueKind, CVC3::TheoryDatatype::d_splitterAsserted, CVC3::TheoryDatatype::d_splitters, CVC3::TheoryDatatype::d_splittersIndex, d_typeComplete, CVC3::TheoryDatatype::datatypeTestExpr(), DebugAssert, CVC3::ExprMap< Data >::end(), CVC3::CDMap< Key, Data, HashFcn >::end(), ENQUEUE, CVC3::Theory::enqueueFact(), CVC3::ExprMap< Data >::find(), CVC3::CDMap< Key, Data, HashFcn >::find(), CVC3::Theory::findExpr(), CVC3::Type::getExpr(), CVC3::Theorem::getLHS(), CVC3::Theorem::getRHS(), CVC3::Expr::getType(), CVC3::Expr::isSelected(), MERGE1, MERGE2, mergeLabels(), CVC3::CDList< T >::push_back(), CVC3::Expr::setSelected(), CVC3::CDList< T >::size(), CVC3::Expr::toString(), and CVC3::Type::toString().
void TheoryDatatypeLazy::setup | ( | const Expr & | e | ) | [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::TheoryDatatype.
Definition at line 246 of file theory_datatype_lazy.cpp.
References CVC3::Expr::addToNotify(), APPLY, CVC3::Expr::arity(), CVC3::TheoryDatatype::d_labels, d_processQueue, d_processQueueKind, CVC3::TheoryDatatype::d_rules, CVC3::DATATYPE, CVC3::CDMap< Key, Data, HashFcn >::end(), ENQUEUE, CVC3::CDMap< Key, Data, HashFcn >::find(), CVC3::Type::getExpr(), CVC3::Expr::getKind(), CVC3::Expr::getType(), initializeLabels(), CVC3::isConstructor(), CVC3::isSelector(), MERGE2, CVC3::DatatypeProofRules::noCycle(), CVC3::CDList< T >::push_back(), CVC3::Theory::reflexivityRule(), CVC3::Expr::setSelected(), and CVC3::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 CVC3::TheoryDatatype.
Definition at line 267 of file theory_datatype_lazy.cpp.
References CVC3::Expr::addToNotify(), CVC3::Expr::arity(), CVC3::TheoryDatatype::canCollapse(), CVC3::TheoryDatatype::d_facts, d_processQueue, d_processQueueKind, CVC3::TheoryDatatype::d_rules, CVC3::DatatypeProofRules::decompose(), ENQUEUE, CVC3::Theory::getEM(), CVC3::Theorem::getLHS(), CVC3::Expr::getOpExpr(), CVC3::Expr::getRep(), CVC3::Theorem::getRHS(), CVC3::Expr::getSig(), CVC3::ExprManager::invalidateSimpCache(), CVC3::Expr::isApply(), CVC3::isConstructor(), CVC3::Theorem::isNull(), CVC3::Expr::isNull(), CVC3::isSelector(), CVC3::isTester(), MERGE2, CVC3::CDList< T >::push_back(), CVC3::DatatypeProofRules::rewriteSelCons(), CVC3::DatatypeProofRules::rewriteTestCons(), CVC3::Expr::setRep(), CVC3::Expr::setSig(), CVC3::Theory::symmetryRule(), CVC3::Theory::transitivityRule(), and CVC3::Theory::updateHelper().
Definition at line 51 of file theory_datatype_lazy.h.
Referenced by checkSat(), instantiate(), setup(), and update().
Definition at line 52 of file theory_datatype_lazy.h.
Referenced by checkSat(), instantiate(), setup(), and update().
CDO<unsigned> CVC3::TheoryDatatypeLazy::d_processIndex [private] |
Definition at line 53 of file theory_datatype_lazy.h.
Referenced by checkSat().
CDO<bool> CVC3::TheoryDatatypeLazy::d_typeComplete [private] |
Definition at line 54 of file theory_datatype_lazy.h.
Referenced by checkSat(), and initializeLabels().