diff --git a/app/main.cpp b/app/main.cpp index b77b3a7..ac01789 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -17,8 +17,8 @@ int main(int argc, char **argv) ("help,h", "Display this help message") ("version,v", "Display version information") ("input,i", po::value>(), "Input files") - ("simplify,s", po::bool_switch(&context.simplify), "Simplify the output") - ("complete,c", po::bool_switch(&context.complete), "Perform completion") + ("simplify,s", po::bool_switch(&context.performSimplification), "Simplify the output") + ("complete,c", po::bool_switch(&context.performCompletion), "Perform completion") ("color", po::value()->default_value("auto"), "Colorize output (always, never, auto)") ("log-priority,p", po::value()->default_value("warning"), "Log messages starting from this priority (debug, info, warning, error)"); diff --git a/include/anthem/Context.h b/include/anthem/Context.h index a2c7d07..7a966f0 100644 --- a/include/anthem/Context.h +++ b/include/anthem/Context.h @@ -26,8 +26,8 @@ struct Context output::Logger logger; - bool simplify = false; - bool complete = false; + bool performSimplification = false; + bool performCompletion = false; std::experimental::optional> visiblePredicateSignatures; }; diff --git a/src/anthem/Translation.cpp b/src/anthem/Translation.cpp index 60505e2..4317db6 100644 --- a/src/anthem/Translation.cpp +++ b/src/anthem/Translation.cpp @@ -58,13 +58,13 @@ void translate(const char *fileName, std::istream &stream, Context &context) Clingo::parse_program(fileContent.c_str(), translateStatement, logger); - if (context.simplify) + if (context.performSimplification) for (auto &scopedFormula : scopedFormulas) simplify(scopedFormula.formula); ast::PrintContext printContext; - if (!context.complete) + if (!context.performCompletion) { if (context.visiblePredicateSignatures) context.logger.log(output::Priority::Warning) << "#show statements are ignored because completion is not enabled"; @@ -81,7 +81,7 @@ void translate(const char *fileName, std::istream &stream, Context &context) auto completedFormulas = complete(std::move(scopedFormulas), context); // TODO: rethink simplification steps - if (context.simplify) + if (context.performSimplification) for (auto &completedFormula : completedFormulas) simplify(completedFormula); diff --git a/tests/TestCompletion.cpp b/tests/TestCompletion.cpp index 14b59b1..8c8e069 100644 --- a/tests/TestCompletion.cpp +++ b/tests/TestCompletion.cpp @@ -16,8 +16,8 @@ TEST_CASE("[completion] Rules are completed", "[completion]") anthem::output::Logger logger(output, errors); anthem::Context context(std::move(logger)); - context.simplify = true; - context.complete = true; + context.performSimplification = true; + context.performCompletion = true; SECTION("predicate in single rule head") { diff --git a/tests/TestHiddenPredicateElimination.cpp b/tests/TestHiddenPredicateElimination.cpp index 0e94956..b1b17ed 100644 --- a/tests/TestHiddenPredicateElimination.cpp +++ b/tests/TestHiddenPredicateElimination.cpp @@ -16,8 +16,8 @@ TEST_CASE("[hidden predicate elimination] Hidden predicates are correctly elimin anthem::output::Logger logger(output, errors); anthem::Context context(std::move(logger)); - context.simplify = true; - context.complete = true; + context.performSimplification = true; + context.performCompletion = true; SECTION("simple example (positive 0-ary predicate)") { diff --git a/tests/TestSimplification.cpp b/tests/TestSimplification.cpp index 8748c72..9ec60fa 100644 --- a/tests/TestSimplification.cpp +++ b/tests/TestSimplification.cpp @@ -16,8 +16,8 @@ TEST_CASE("[simplification] Rules are simplified correctly", "[simplification]") anthem::output::Logger logger(output, errors); anthem::Context context(std::move(logger)); - context.simplify = true; - context.complete = false; + context.performSimplification = true; + context.performCompletion = false; SECTION("example 1") { diff --git a/tests/TestTranslation.cpp b/tests/TestTranslation.cpp index 38bd4d0..e8d38a7 100644 --- a/tests/TestTranslation.cpp +++ b/tests/TestTranslation.cpp @@ -16,8 +16,8 @@ TEST_CASE("[translation] Rules are translated correctly", "[translation]") anthem::output::Logger logger(output, errors); anthem::Context context(std::move(logger)); - context.simplify = false; - context.complete = false; + context.performSimplification = false; + context.performCompletion = false; SECTION("simple example 1") {