Correctly implemented hiding predicates with nested arguments.

This commit is contained in:
2017-06-12 02:21:16 +02:00
parent 1d172589f5
commit a4cd133ba7
2 changed files with 21 additions and 5 deletions

View File

@@ -58,14 +58,15 @@ void translate(const char *fileName, std::istream &stream, Context &context)
Clingo::parse_program(fileContent.c_str(), translateStatement, logger);
if (context.performSimplification)
for (auto &scopedFormula : scopedFormulas)
simplify(scopedFormula.formula);
ast::PrintContext printContext(context);
if (!context.performCompletion)
{
// Simplify output if specified
if (context.performSimplification)
for (auto &scopedFormula : scopedFormulas)
simplify(scopedFormula.formula);
if (context.visiblePredicateSignatures)
context.logger.log(output::Priority::Warning) << "#show statements are ignored because completion is not enabled";
@@ -78,9 +79,10 @@ void translate(const char *fileName, std::istream &stream, Context &context)
return;
}
// Perform completion
auto completedFormulas = complete(std::move(scopedFormulas), context);
// TODO: rethink simplification steps
// Simplify output if specified
if (context.performSimplification)
for (auto &completedFormula : completedFormulas)
simplify(completedFormula);