This replaces all user-defined variable names with continuously numbered
ones so that they don’t lead to syntax problems in ASP, while still
unique and distinguishable. For instance, this avoids problems when
variable names contain hyphens, which are allowed in PDDL identifiers
but not in ASP variables.
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.