Add option to turn on integer variable detection

This commit is contained in:
Patrick Lühne 2018-04-20 16:31:53 +02:00
parent 8b8dd1b57e
commit aedb7e9bbd
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
3 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,7 @@ int main(int argc, char **argv)
("i,input", "Input files", cxxopts::value<std::vector<std::string>>())
("s,simplify", "Simplify the output")
("c,complete", "Perform completion")
("d,detect-integers", "Detect integer variables")
("color", "Colorize output (always, never, auto)", cxxopts::value<std::string>()->default_value("auto"))
("parentheses", "Parenthesis style (normal, full)", cxxopts::value<std::string>()->default_value("normal"))
("p,log-priority", "Log messages starting from this priority (debug, info, warning, error)", cxxopts::value<std::string>()->default_value("info"));
@ -50,6 +51,7 @@ int main(int argc, char **argv)
context.performSimplification = (parseResult.count("simplify") > 0);
context.performCompletion = (parseResult.count("complete") > 0);
context.performIntegerDetection = (parseResult.count("detect-integers") > 0);
colorPolicyString = parseResult["color"].as<std::string>();
parenthesisStyleString = parseResult["parentheses"].as<std::string>();
logPriorityString = parseResult["log-priority"].as<std::string>();

View File

@ -77,6 +77,7 @@ struct Context
bool performSimplification{false};
bool performCompletion{false};
bool performIntegerDetection{false};
std::vector<std::unique_ptr<ast::PredicateDeclaration>> predicateDeclarations;
ast::PredicateDeclaration::Visibility defaultPredicateVisibility{ast::PredicateDeclaration::Visibility::Visible};

View File

@ -111,7 +111,8 @@ void translate(const char *fileName, std::istream &stream, Context &context)
}
// Detect integer variables
detectIntegerVariables(completedFormulas);
if (context.performIntegerDetection)
detectIntegerVariables(completedFormulas);
// Simplify output if specified
if (context.performSimplification)