In the example encoding, derived variables were accidentally included in
the inertia rule, as this only checked the position of the parameter.
This commit fixes this by only allowing common variables (and not
derived ones) within the inertia rule.
This change doesn’t affect derived variables, because these aren’t
affected by the “caused” predicate (the “caused” predicate requires a
variable to be in the postcondition of an action, and these may never be
derived variables).
The example encoding assumed that derived predicates weren’t necessary
in the final time step. This is, however, incorrect, as the goal may
have a precondition that requires derived predicates. In this case, the
derived variables must be evaluated for the final time step.
These encodings need to be updated to match the new output format. Until
this is done, hide these files in a separate directory in order not to
confuse users.
Starting from version 2.0.0, cxxopts returns a ParseResult object
instead of storing the results directly within the Options structure.
Additionally, Booleans are handled slightly differently.
These two changes required some minor adjustment of the command-line
argument parsing code.
These tests ensure that multiple negations are eliminated, negated
quantifiers are replaced appropriately, negations introduced by
reduction are correctly handled, and negated disjunctions and
conjunctions are replaced according to De Morgan’s rules.
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.