From 03c22d00f577f8b7d3ee6ce3a4bd0db67f38a835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 21 Apr 2018 15:47:49 +0200 Subject: [PATCH] Remove unwanted detection rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This piece of code was responsible for propagating the domain of predicate parameters to argument variables. However, this approach doesn’t seem to be correct, which is why this commit removes it. --- src/anthem/IntegerVariableDetection.cpp | 29 ++----------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/anthem/IntegerVariableDetection.cpp b/src/anthem/IntegerVariableDetection.cpp index 9e8d52b..d371446 100644 --- a/src/anthem/IntegerVariableDetection.cpp +++ b/src/anthem/IntegerVariableDetection.cpp @@ -537,34 +537,9 @@ struct DetectIntegerVariablesVisitor return operationResult; } - static OperationResult visit(ast::Predicate &predicate, ast::Formula &, VariableDomainMap &) + static OperationResult visit(ast::Predicate &, ast::Formula &, VariableDomainMap &) { - auto operationResult = OperationResult::Unchanged; - - assert(predicate.arguments.size() == predicate.declaration->arity()); - - // Propagate integer domains from predicates to variables - for (size_t i = 0; i < predicate.arguments.size(); i++) - { - auto &variableArgument = predicate.arguments[i]; - auto ¶meter = predicate.declaration->parameters[i]; - - if (parameter.domain != ast::Domain::Integer) - continue; - - if (!variableArgument.is()) - continue; - - auto &variable = variableArgument.get(); - - if (variable.declaration->domain == ast::Domain::Integer) - continue; - - operationResult = OperationResult::Changed; - variable.declaration->domain = ast::Domain::Integer; - } - - return operationResult; + return OperationResult::Unchanged; } };