diff options
Diffstat (limited to 'src/theory')
-rw-r--r-- | src/theory/arrays/type_enumerator.h | 26 | ||||
-rw-r--r-- | src/theory/model.cpp | 7 | ||||
-rw-r--r-- | src/theory/model.h | 9 | ||||
-rw-r--r-- | src/theory/quantifiers/first_order_model.cpp | 4 | ||||
-rw-r--r-- | src/theory/quantifiers/first_order_model.h | 2 | ||||
-rw-r--r-- | src/theory/theory_engine.cpp | 6 | ||||
-rw-r--r-- | src/theory/theory_engine.h | 4 |
7 files changed, 39 insertions, 19 deletions
diff --git a/src/theory/arrays/type_enumerator.h b/src/theory/arrays/type_enumerator.h index c6b73b9f6..161c90f5c 100644 --- a/src/theory/arrays/type_enumerator.h +++ b/src/theory/arrays/type_enumerator.h @@ -46,13 +46,37 @@ public: d_index(type.getArrayIndexType()), d_constituentType(type.getArrayConstituentType()), d_nm(NodeManager::currentNM()), - d_finished(false) + d_indexVec(), + d_constituentVec(), + d_finished(false), + d_arrayConst() { d_indexVec.push_back(*d_index); d_constituentVec.push_back(new TypeEnumerator(d_constituentType)); d_arrayConst = d_nm->mkConst(ArrayStoreAll(type.toType(), (*(*d_constituentVec.back())).toExpr())); } + // An array enumerator could be large, and generally you don't want to + // go around copying these things; but a copy ctor is presently required + // by the TypeEnumerator framework. + ArrayEnumerator(const ArrayEnumerator& ae) throw() : + TypeEnumeratorBase<ArrayEnumerator>(ae.d_nm->mkArrayType(ae.d_index.getType(), ae.d_constituentType)), + d_index(ae.d_index), + d_constituentType(ae.d_constituentType), + d_nm(ae.d_nm), + d_indexVec(ae.d_indexVec), + d_constituentVec(),// copied below + d_finished(ae.d_finished), + d_arrayConst(ae.d_arrayConst) + { + for(std::vector<TypeEnumerator*>::const_iterator i = + ae.d_constituentVec.begin(), i_end = ae.d_constituentVec.end(); + i != i_end; + ++i) { + d_constituentVec.push_back(new TypeEnumerator(**i)); + } + } + ~ArrayEnumerator() { while (!d_constituentVec.empty()) { delete d_constituentVec.back(); diff --git a/src/theory/model.cpp b/src/theory/model.cpp index d4b71c9e2..a4cbd720b 100644 --- a/src/theory/model.cpp +++ b/src/theory/model.cpp @@ -77,11 +77,6 @@ Cardinality TheoryModel::getCardinality( Type t ){ } } -void TheoryModel::toStream( std::ostream& out ) -{ - out << this; -} - Node TheoryModel::getModelValue( TNode n ) { if( n.isConst() ) { @@ -550,6 +545,7 @@ void TheoryEngineModelBuilder::buildModel(Model* m, bool fullModel) } } while (changed); +#ifdef CVC4_ASSERTIONS if (fullModel) { // Assert that all representatives have been converted to constants for (it = typeRepSet.begin(); it != typeRepSet.end(); ++it) { @@ -557,6 +553,7 @@ void TheoryEngineModelBuilder::buildModel(Model* m, bool fullModel) Assert(repSet.empty()); } } +#endif /* CVC4_ASSERTIONS */ Trace("model-builder") << "Copy representatives to model..." << std::endl; tm->d_reps.clear(); diff --git a/src/theory/model.h b/src/theory/model.h index 0a846a3c6..a10d0a9ac 100644 --- a/src/theory/model.h +++ b/src/theory/model.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009-2012 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences ** New York University ** See the file COPYING in the top-level source directory for licensing @@ -116,8 +116,6 @@ public: Expr getValue( Expr expr ); /** get cardinality for sort */ Cardinality getCardinality( Type t ); - /** to stream function */ - void toStream( std::ostream& out ); public: /** print representative debug function */ void printRepresentativeDebug( const char* c, Node r ); @@ -139,6 +137,7 @@ public: typedef std::hash_map<TypeNode, std::set<Node>*, TypeNodeHashFunction> TypeSetMap; typedef std::hash_map<TypeNode, TypeEnumerator*, TypeNodeHashFunction> TypeToTypeEnumMap; typedef TypeSetMap::iterator iterator; + typedef TypeSetMap::const_iterator const_iterator; private: TypeSetMap d_typeSet; TypeToTypeEnumMap d_teMap; @@ -173,9 +172,9 @@ private: s->insert(n); } - std::set<Node>* getSet(TypeNode t) + std::set<Node>* getSet(TypeNode t) const { - iterator it = d_typeSet.find(t); + const_iterator it = d_typeSet.find(t); if (it == d_typeSet.end()) { return NULL; } diff --git a/src/theory/quantifiers/first_order_model.cpp b/src/theory/quantifiers/first_order_model.cpp index 33dcdd533..44eb00730 100644 --- a/src/theory/quantifiers/first_order_model.cpp +++ b/src/theory/quantifiers/first_order_model.cpp @@ -106,10 +106,6 @@ Node FirstOrderModel::getInterpretedValue( TNode n ){ return TheoryModel::getInterpretedValue( n ); } -void FirstOrderModel::toStream(std::ostream& out){ - -} - //for evaluation of quantifier bodies diff --git a/src/theory/quantifiers/first_order_model.h b/src/theory/quantifiers/first_order_model.h index 64e5fc904..52688a816 100644 --- a/src/theory/quantifiers/first_order_model.h +++ b/src/theory/quantifiers/first_order_model.h @@ -85,8 +85,6 @@ public: public: // initialize the model void initialize( bool considerAxioms = true ); - /** to stream function */ - void toStream( std::ostream& out ); //the following functions are for evaluating quantifier bodies public: /** reset evaluation */ diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index de32409c5..4de6dc231 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -50,6 +50,7 @@ using namespace CVC4::theory; TheoryEngine::TheoryEngine(context::Context* context, context::UserContext* userContext, + RemoveITE& iteRemover, const LogicInfo& logicInfo) : d_propEngine(NULL), d_decisionEngine(NULL), @@ -70,7 +71,10 @@ TheoryEngine::TheoryEngine(context::Context* context, d_propagationMapTimestamp(context, 0), d_propagatedLiterals(context), d_propagatedLiteralsIndex(context, 0), + d_iteRemover(iteRemover), d_combineTheoriesTime("TheoryEngine::combineTheoriesTime"), + d_true(), + d_false(), d_interrupted(false), d_inPreregister(false), d_factsAsserted(context, false), @@ -1175,7 +1179,7 @@ theory::LemmaStatus TheoryEngine::lemma(TNode node, bool negated, bool removable std::vector<Node> additionalLemmas; IteSkolemMap iteSkolemMap; additionalLemmas.push_back(node); - RemoveITE::run(additionalLemmas, iteSkolemMap); + d_iteRemover.run(additionalLemmas, iteSkolemMap); additionalLemmas[0] = theory::Rewriter::rewrite(additionalLemmas[0]); // assert to prop engine diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h index 8f534a62c..633d52a32 100644 --- a/src/theory/theory_engine.h +++ b/src/theory/theory_engine.h @@ -387,6 +387,8 @@ class TheoryEngine { */ theory::LemmaStatus lemma(TNode node, bool negated, bool removable); + RemoveITE& d_iteRemover; + /** Time spent in theory combination */ TimerStat d_combineTheoriesTime; @@ -399,7 +401,7 @@ class TheoryEngine { public: /** Constructs a theory engine */ - TheoryEngine(context::Context* context, context::UserContext* userContext, const LogicInfo& logic); + TheoryEngine(context::Context* context, context::UserContext* userContext, RemoveITE& iteRemover, const LogicInfo& logic); /** Destroys a theory engine */ ~TheoryEngine(); |