These tests ensure that universal quantifiers are correctly reduced to
negated existential quantifiers over the negated argument via derived
predicates in preconditions (nested and not) and goal descriptions.
Previously, the parser read the first statement of the goal as its
precondition, but didn’t check that it was properly terminated with a
closing parenthesis. This allowed arbitrary text to be included within
the goal description without error, which was incorrect.
This commit fixes this issue and adds a corresponding unit test.
Previously, variables referenced within values were unpacked within
values. This was inconsistent, because all predicates are usually used
in their unpacked form in the rest of the output format. This commit
makes this consistent by using variables in their packed form within
values, making it more compact to handle them.
Due to a mistake in commit 6d07fcb, the closing parenthesis and period
at the end of initial state facts was omitted. This adds these back in
order to solve this syntax error.
Some of the unit tests depended on Boost’s null_sink to redirect the
unwanted test output to /dev/null. This commit adds a simple
NullOutputStream as a replacement and removes the obsolete Boost
includes.
As Boost isn’t used in the rest of this project anymore, this commit
removes the unnecessary dependency to boost::bimap just for language
detection, and replaces it with a simple std::map instead.
Even though the parser shouldn’t be able to put variables into the goal
description, the AST theoretically allows for this case. This commit
adds a defensive check that goal descriptions are variable-free.
By accident, the support for derived predicates in goals was missing.
This commit adds this, in a very similar way to how normal predicates
are handled in the goal description.
Previously, derived predicates in the initial state weren’t handled at
all. That’s not an issue, because derived predicates shouldn’t occur in
the initial state. However, as a defensive measure, this commit adds an
error thrown in such cases.
While derived predicates stemming from the domain were already
translated, the ones from the problem were missing. This commit fixes
that, although it duplicates the definition of “contains.”
The IDs of derived predicates within problems were accidentally starting
with 1 again, colliding with the IDs of derived predicates in the
domain. With this fix, the IDs are continuously incremented, even after
switching from domain to problem.