Remove unwanted detection rule

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.
This commit is contained in:
Patrick Lühne 2018-04-21 15:47:49 +02:00
parent a9b00dfb7c
commit 03c22d00f5
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -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 &parameter = predicate.declaration->parameters[i];
if (parameter.domain != ast::Domain::Integer)
continue;
if (!variableArgument.is<ast::Variable>())
continue;
auto &variable = variableArgument.get<ast::Variable>();
if (variable.declaration->domain == ast::Domain::Integer)
continue;
operationResult = OperationResult::Changed;
variable.declaration->domain = ast::Domain::Integer;
}
return operationResult;
return OperationResult::Unchanged;
}
};