Fixed wrong recursive call.
This commit is contained in:
parent
4d72c20d9b
commit
3fa7b93d44
@ -112,7 +112,7 @@ inline ExpressionPointer Binary<Derived>::negationNormalized()
|
|||||||
{
|
{
|
||||||
BOOST_ASSERT(m_arguments[i]);
|
BOOST_ASSERT(m_arguments[i]);
|
||||||
|
|
||||||
m_arguments[i] = m_arguments[i]->normalized();
|
m_arguments[i] = m_arguments[i]->negationNormalized();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -57,18 +57,18 @@ ExpressionPointer Not::negationNormalized()
|
|||||||
{
|
{
|
||||||
auto &argument = dynamic_cast<Not &>(*m_argument);
|
auto &argument = dynamic_cast<Not &>(*m_argument);
|
||||||
|
|
||||||
return argument.m_argument->normalized();
|
return argument.m_argument->negationNormalized();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normalize argument
|
// Normalize argument
|
||||||
m_argument = m_argument->normalized();
|
m_argument = m_argument->negationNormalized();
|
||||||
|
|
||||||
// Remove double negations occurring after normalizing the argument
|
// Remove double negations occurring after normalizing the argument
|
||||||
if (m_argument->expressionType() == Expression::Type::Not)
|
if (m_argument->expressionType() == Expression::Type::Not)
|
||||||
{
|
{
|
||||||
auto &argument = dynamic_cast<Not &>(*m_argument);
|
auto &argument = dynamic_cast<Not &>(*m_argument);
|
||||||
|
|
||||||
return argument.m_argument->normalized();
|
return argument.m_argument->negationNormalized();
|
||||||
}
|
}
|
||||||
|
|
||||||
// De Morgan for negative conjunctions
|
// De Morgan for negative conjunctions
|
||||||
@ -82,7 +82,7 @@ ExpressionPointer Not::negationNormalized()
|
|||||||
for (size_t i = 0; i < andExpression.arguments().size(); i++)
|
for (size_t i = 0; i < andExpression.arguments().size(); i++)
|
||||||
orExpression->addArgument(andExpression.arguments()[i]->negated());
|
orExpression->addArgument(andExpression.arguments()[i]->negated());
|
||||||
|
|
||||||
return orExpression->normalized();
|
return orExpression->negationNormalized();
|
||||||
}
|
}
|
||||||
|
|
||||||
// De Morgan for negative disjunctions
|
// De Morgan for negative disjunctions
|
||||||
@ -96,7 +96,7 @@ ExpressionPointer Not::negationNormalized()
|
|||||||
for (size_t i = 0; i < orExpression.arguments().size(); i++)
|
for (size_t i = 0; i < orExpression.arguments().size(); i++)
|
||||||
andExpression->addArgument(orExpression.arguments()[i]->negated());
|
andExpression->addArgument(orExpression.arguments()[i]->negated());
|
||||||
|
|
||||||
return andExpression->normalized();
|
return andExpression->negationNormalized();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
Reference in New Issue
Block a user