Support modulus operation (absolute value)
This adds support for computing the absolute value of a term along with an according unit test.
This commit is contained in:
@@ -159,6 +159,13 @@ String prepareCopy(const String &other)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
UnaryOperation prepareCopy(const UnaryOperation &other)
|
||||
{
|
||||
return UnaryOperation(other.operator_, prepareCopy(other.argument));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variable prepareCopy(const Variable &other)
|
||||
{
|
||||
return Variable(other.declaration);
|
||||
@@ -320,6 +327,12 @@ struct FixDanglingVariablesInTermVisitor
|
||||
{
|
||||
}
|
||||
|
||||
template <class... Arguments>
|
||||
void visit(UnaryOperation &unaryOperation, Arguments &&... arguments)
|
||||
{
|
||||
unaryOperation.argument.accept(*this, std::forward<Arguments>(arguments)...);
|
||||
}
|
||||
|
||||
void visit(Variable &variable, ScopedFormula &scopedFormula, VariableStack &variableStack,
|
||||
std::map<VariableDeclaration *, VariableDeclaration *> &replacements)
|
||||
{
|
||||
|
@@ -178,6 +178,11 @@ struct CollectFreeVariablesVisitor
|
||||
{
|
||||
}
|
||||
|
||||
void visit(UnaryOperation &unaryOperation, VariableStack &variableStack, std::vector<VariableDeclaration *> &freeVariables)
|
||||
{
|
||||
unaryOperation.argument.accept(*this, variableStack, freeVariables);
|
||||
}
|
||||
|
||||
void visit(Variable &variable, VariableStack &variableStack, std::vector<VariableDeclaration *> &freeVariables)
|
||||
{
|
||||
if (variableStack.contains(*variable.declaration))
|
||||
|
Reference in New Issue
Block a user