summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-10-05 22:46:27 +0000
committerMorgan Deters <mdeters@gmail.com>2012-10-05 22:46:27 +0000
commit129dadba47447148096acd216d61f93e14539cb4 (patch)
treefd0053624ee96ee84eb35d1542d1977e40830750 /src/theory
parent4c87c0794b7e954afd090cfbf441caa0b09c3ef5 (diff)
Bug-related:
* ITE removal fixed to be context-dependent (on UserContext). Resolves incrementality bugs 376 and 396 (which had given wrong answers). * some bugfixes for incrementality that Dejan found (fixes bug 394) * fix for bug in SmtEngine::getValue() where definitions weren't respected (partially resolves bug 411, but get-model is still broken). * change status of microwave21.ec.minimized.smt2 (it's actually unsat, but was labeled sat); re-enable it for "make regress" Also: * --check-model doesn't fail if quantified assertions don't simplify away. * fix some examples, and the Java system test, for the disappearance of the BoolExpr class * add copy constructor to array type enumerator (the type enumerator framework requires copy ctors, and the automatically-generated copy ctor was copying pointers that were then deleted, leaving dangling pointers in the copy and causing segfaults) * --dump=assertions now implies --dump=skolems * --dump=assertions:pre-<PASS> and --dump=assertions:post-<PASS> now allow you to dump before/after a particular preprocessing pass. E.g., --dump=assertions:pre-ite-removal or --dump=assertions:post-static-learning. "--dump=assertions" by itself is after all preprocessing, just before CNF conversion. * minor fixes to dumping output * include Model in language bindings Minor refactoring/misc: * fix compiler warning in src/theory/model.cpp * remove unnecessary SmtEngine::printModel(). * mkoptions script doesn't give progress output if stdout isn't a terminal (e.g., if it's written to a log, or piped through less(1), or whatever). * add some type enumerator unit tests * de-emphasize --parse-only and --preprocess-only (they aren't really "common" options) * fix some exception throw() specifications in SmtEngine * minor documentation clarifications
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/arrays/type_enumerator.h26
-rw-r--r--src/theory/model.cpp7
-rw-r--r--src/theory/model.h9
-rw-r--r--src/theory/quantifiers/first_order_model.cpp4
-rw-r--r--src/theory/quantifiers/first_order_model.h2
-rw-r--r--src/theory/theory_engine.cpp6
-rw-r--r--src/theory/theory_engine.h4
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();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback