diff --git a/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp b/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp index 88dae1f..1abd73d 100644 --- a/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp +++ b/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp @@ -312,17 +312,15 @@ void eliminateDoubleNegations(ast::Precondition &precondition) const auto handleNot = [&](ast::NotPointer ¬_) { + eliminateDoubleNegations(not_->argument); + if (not_->argument.is>()) { - eliminateDoubleNegations(not_->argument); - // As the parent contains the argument, the argument needs to be saved before overwriting the parent // TODO: check whether this workaround can be avoided auto argument = std::move(not_->argument.get>()); precondition = std::move(argument); } - - eliminateDoubleNegations(not_->argument); }; const auto handleOr =