summaryrefslogtreecommitdiff
path: root/src/smt
diff options
context:
space:
mode:
Diffstat (limited to 'src/smt')
-rw-r--r--src/smt/dump.cpp8
-rw-r--r--src/smt/smt_engine.cpp32
2 files changed, 36 insertions, 4 deletions
diff --git a/src/smt/dump.cpp b/src/smt/dump.cpp
index b1222a51e..ce146da0e 100644
--- a/src/smt/dump.cpp
+++ b/src/smt/dump.cpp
@@ -59,6 +59,8 @@ void DumpC::setDumpFromString(const std::string& optarg) {
} else if(!strcmp(p, "boolean-terms")) {
} else if(!strcmp(p, "constrain-subtypes")) {
} else if(!strcmp(p, "substitution")) {
+ } else if(!strcmp(p, "bv-to-bool")) {
+ } else if(!strcmp(p, "bool-to-bv")) {
} else if(!strcmp(p, "strings-pp")) {
} else if(!strcmp(p, "skolem-quant")) {
} else if(!strcmp(p, "simplify")) {
@@ -163,9 +165,9 @@ assertions\n\
+ Output the assertions after preprocessing and before clausification.\n\
Can also specify \"assertions:pre-PASS\" or \"assertions:post-PASS\",\n\
where PASS is one of the preprocessing passes: definition-expansion\n\
- boolean-terms constrain-subtypes substitution strings-pp skolem-quant\n\
- simplify static-learning ite-removal repeat-simplify\n\
- rewrite-apply-to-const theory-preprocessing.\n\
+ boolean-terms constrain-subtypes substitution bv-to-bool bool-to-bv\n\
+ strings-pp skolem-quant simplify static-learning ite-removal\n\
+ repeat-simplify rewrite-apply-to-const theory-preprocessing.\n\
PASS can also be the special value \"everything\", in which case the\n\
assertions are printed before any preprocessing (with\n\
\"assertions:pre-everything\") or after all preprocessing completes\n\
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index b94e08fad..2aaf43569 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -602,6 +602,9 @@ private:
// Lift bit-vectors of size 1 to booleans
void bvToBool();
+ // Convert booleans to bit-vectors of size 1
+ void boolToBv();
+
// Abstract common structure over small domains to UF
// return true if changes were made.
void bvAbstraction();
@@ -1371,10 +1374,18 @@ void SmtEngine::setDefaults() {
if(options::bitvectorToBool.wasSetByUser()) {
throw OptionException("bv-to-bool not supported with unsat cores");
}
- Notice() << "SmtEngine: turning off bitvector-to-bool support unsat-cores" << endl;
+ Notice() << "SmtEngine: turning off bitvector-to-bool to support unsat-cores" << endl;
options::bitvectorToBool.set(false);
}
+ if(options::boolToBitvector()) {
+ if(options::boolToBitvector.wasSetByUser()) {
+ throw OptionException("bool-to-bv not supported with unsat cores");
+ }
+ Notice() << "SmtEngine: turning off bool-to-bitvector to support unsat-cores" << endl;
+ options::boolToBitvector.set(false);
+ }
+
if(options::bvIntroducePow2()) {
if(options::bvIntroducePow2.wasSetByUser()) {
throw OptionException("bv-intro-pow2 not supported with unsat cores");
@@ -3016,6 +3027,16 @@ void SmtEnginePrivate::bvToBool() {
}
}
+void SmtEnginePrivate::boolToBv() {
+ Trace("bool-to-bv") << "SmtEnginePrivate::boolToBv()" << endl;
+ spendResource(options::preprocessStep());
+ std::vector<Node> new_assertions;
+ d_smt.d_theoryEngine->ppBoolToBv(d_assertions.ref(), new_assertions);
+ for (unsigned i = 0; i < d_assertions.size(); ++ i) {
+ d_assertions.replace(i, Rewriter::rewrite(new_assertions[i]));
+ }
+}
+
bool SmtEnginePrivate::simpITE() {
TimerStat::CodeTimer simpITETimer(d_smt.d_stats->d_simpITETime);
@@ -3927,6 +3948,14 @@ void SmtEnginePrivate::processAssertions() {
dumpAssertions("post-bv-to-bool", d_assertions);
Trace("smt") << "POST bvToBool" << endl;
}
+ // Convert non-top-level Booleans to bit-vectors of size 1
+ if(options::boolToBitvector()) {
+ dumpAssertions("pre-bool-to-bv", d_assertions);
+ Chat() << "...doing boolToBv..." << endl;
+ boolToBv();
+ dumpAssertions("post-bool-to-bv", d_assertions);
+ Trace("smt") << "POST boolToBv" << endl;
+ }
if(options::sepPreSkolemEmp()) {
for (unsigned i = 0; i < d_assertions.size(); ++ i) {
Node prev = d_assertions[i];
@@ -3938,6 +3967,7 @@ void SmtEnginePrivate::processAssertions() {
}
}
}
+
if( d_smt.d_logic.isQuantified() ){
Trace("smt-proc") << "SmtEnginePrivate::processAssertions() : pre-quant-preprocess" << endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback