Skip to content

Commit feaf162

Browse files
feat: add preprocessing-only option
1 parent fbc93ac commit feaf162

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

src/config/Config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ namespace d4 {
4949
config.isFloat = false;
5050
config.dump_ddnnf = "";
5151
config.dump_preproc = "";
52+
config.only_preproc = true;
5253
config.query = "";
5354
config.projMC_refinement = false;
5455
config.keyword_output_format_solution = "s";

src/config/Config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ namespace d4 {
5252
bool isFloat;
5353
string dump_ddnnf;
5454
string dump_preproc;
55+
bool only_preproc;
5556
string query;
5657
bool projMC_refinement;
5758
string keyword_output_format_solution;

src/config/ConfigConverter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ namespace d4 {
6666
config.dump_preproc = "";
6767
}
6868

69+
config.only_preproc = vm["only-preproc"].as<bool>();
70+
6971
if (vm.count("query")) {
7072
config.query = vm["query"].as<string>();
7173
} else {

src/methods/MethodManager.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ MethodManager *MethodManager::makeMethodManager(Config &config,
7979

8080
LastBreathPreproc lastBreath;
8181
ProblemManager *runProblem = runPreproc(config, problem, out, lastBreath);
82-
displayInfoVariables(runProblem, out);
83-
out << "c [MODE] Panic: " << lastBreath.panic << "\n";
8482

8583
if (!config.dump_preproc.empty()) {
8684
std::ofstream outFile;
@@ -89,6 +87,13 @@ MethodManager *MethodManager::makeMethodManager(Config &config,
8987
outFile.close();
9088
}
9189

90+
if (config.only_preproc) {
91+
exit(0);
92+
}
93+
94+
displayInfoVariables(runProblem, out);
95+
out << "c [MODE] Panic: " << lastBreath.panic << "\n";
96+
9297
if (meth == "counting") {
9398
if (!isFloat)
9499
return new DpllStyleMethod<mpz::mpz_int, mpz::mpz_int>(

src/option.dsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
("float,f", boost::program_options::value<bool>()->default_value(false), "If the count is computed as a float or not.")
4545
("dump-ddnnf", boost::program_options::value<std::string>(), "Print out the decision DNNF formula in a given file.")
4646
("dump-preproc", boost::program_options::value<std::string>(), "Print out the preprocessed CNF in a given file.")
47+
("only-preproc", boost::program_options::value<bool>()->default_value(false), "Stop after preprocessing.")
4748
("query,q", boost::program_options::value<std::string>(), "Perform the queries given in a file (m l1 l2 ... ln 0 for a model counting query, and d l1 l2 ... ln 0 for a satisfiability query).")
4849
("projMC-refinement", boost::program_options::value<bool>()->default_value(false), "Try to reduce the set of selector by computing a MSS.")
4950
("keyword-output-format-solution", boost::program_options::value<std::string>()->default_value("s"), "The keyword prints in front of the solution when it is printed out.")

0 commit comments

Comments
 (0)