diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-10-01 11:07:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-01 11:07:13 -0700 |
commit | da3b2212ed6befc0d29646ef65570919377913fe (patch) | |
tree | ade1547a960df8e38cedbd54d942e038580f71c4 /src/smt/dump.cpp | |
parent | 48ea68aa581d492c48fe9e08b54e9ce26f3508b9 (diff) |
Fix dumping pre/post preprocessing passes (#2469)
This commit changes the hard-coded list of checks for
preprocessing-related dump tags to take advantage of the new
preprocessing pass registration mechanism from PR #2468. It also fixes a
typo in the `Dump.isOn()` check in `PreprocessingPass::dumpAssertions()`
and adds a list of available passes to the `--dump help` output.
Diffstat (limited to 'src/smt/dump.cpp')
-rw-r--r-- | src/smt/dump.cpp | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/smt/dump.cpp b/src/smt/dump.cpp index 58a1e2912..eae11606f 100644 --- a/src/smt/dump.cpp +++ b/src/smt/dump.cpp @@ -15,8 +15,10 @@ **/ #include "smt/dump.h" -#include "lib/strtok_r.h" + #include "base/output.h" +#include "lib/strtok_r.h" +#include "preprocessing/preprocessing_pass_registry.h" namespace CVC4 { @@ -55,25 +57,10 @@ void DumpC::setDumpFromString(const std::string& optarg) { optargPtr + "'. Please consult --dump help."); } if(!strcmp(p, "everything")) { - } else if(!strcmp(p, "definition-expansion")) { - } 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")) { - } else if(!strcmp(p, "static-learning")) { - } else if(!strcmp(p, "ite-removal")) { - } else if(!strcmp(p, "repeat-simplify")) { - } else if(!strcmp(p, "rewrite-apply-to-const")) { - } else if(!strcmp(p, "theory-preprocessing")) { - } else if(!strcmp(p, "nonclausal")) { - } else if(!strcmp(p, "theorypp")) { - } else if(!strcmp(p, "itesimp")) { - } else if(!strcmp(p, "unconstrained")) { - } else if(!strcmp(p, "repeatsimp")) { + } + else if (preprocessing::PreprocessingPassRegistry::getInstance().hasPass( + p)) + { } else { throw OptionException(std::string("don't know how to dump `") + optargPtr + "'. Please consult --dump help."); @@ -116,6 +103,16 @@ void DumpC::setDumpFromString(const std::string& optarg) { } } else if(!strcmp(optargPtr, "help")) { puts(s_dumpHelp.c_str()); + + std::stringstream ss; + ss << "Available preprocessing passes:\n"; + for (const std::string& pass : + preprocessing::PreprocessingPassRegistry::getInstance() + .getAvailablePasses()) + { + ss << "- " << pass << "\n"; + } + puts(ss.str().c_str()); exit(1); } else if(!strcmp(optargPtr, "bv-abstraction")) { Dump.on("bv-abstraction"); @@ -140,7 +137,6 @@ void DumpC::setDumpFromString(const std::string& optarg) { #endif /* CVC4_DUMPING */ } - const std::string DumpC::s_dumpHelp = "\ Dump modes currently supported by the --dump option:\n\ \n\ |