Testing simplification of nested existential quantifiers.

This commit is contained in:
Patrick Lühne 2016-09-06 18:51:29 +02:00
parent 31068bf89c
commit edbc8770e3

View File

@ -186,3 +186,31 @@ TEST(PDDLNormalizationTests, SimplifyNestedForAll)
ASSERT_EQ(output.str(), "(forall (?x ?y ?z ?u ?v ?w) (a))");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
TEST(PDDLNormalizationTests, SimplifyNestedExists)
{
auto v1 = expressions::VariablePointer(new expressions::Variable("x"));
auto v2 = expressions::VariablePointer(new expressions::Variable("y"));
auto v3 = expressions::VariablePointer(new expressions::Variable("z"));
auto v4 = expressions::VariablePointer(new expressions::Variable("u"));
auto v5 = expressions::VariablePointer(new expressions::Variable("v"));
auto v6 = expressions::VariablePointer(new expressions::Variable("w"));
auto e1 = expressions::ExistsPointer(new expressions::Exists);
auto e2 = expressions::ExistsPointer(new expressions::Exists);
auto d = expressions::DummyPointer(new expressions::Dummy("a"));
e1->variables() = {v1, v2, v3};
e2->variables() = {v4, v5, v6};
e1->setArgument(e2);
e2->setArgument(d);
std::stringstream output;
e1->normalized()->print(output);
ASSERT_EQ(output.str(), "(exists (?x ?y ?z ?u ?v ?w) (a))");
}