Issue220

Title Make translator stricter and improve error output
Priority meta Status chatting
Superseder Nosy List augusto, clemens, gabi, haz, jendrik, malte
Assigned To Keywords translator
Optional summary
Issues reported by others that fall under this:

issue1029
issue1030

Created on 2011-03-02.18:34:33 by malte, last changed by clemens.

Summary
Issues reported by others that fall under this:

issue1029
issue1030
Files
File name Uploaded Type Edit Remove
domain.pddl malte, 2011-12-11.19:18:44 application/octet-stream
probPR2TEST.pddl malte, 2011-12-11.19:18:56 application/octet-stream
Messages
msg11530 (view) Author: clemens Date: 2024-01-18.18:01:24
At some point in the process of issue1030 I went through the issue tracker to find more issues related to the translator error reporting. We decided it makes sense to collect them all in one place and discussed that this might be a good place for that. By doing so, I'm also changing this issue to have priority meta, so this now serves to have an overview about all the related issues in one place from now on. So here's a summary of what I've found:

Issues that are already dealt with after merging issue1030:
- too many parentheses (issue215)
- use undefined predicate name (issue215)
- first token in domain is not "define" (issue1029)
- empty conditions (issue1030)
- undeclared predicates (issue215 and issue220)
- "either" disallowed (issue220 and issue297)
- predicates with wrong arity (issu294)

Next, here is a list of things mentioned in other issues that are not yet addressed:
- disallow predicates with the same name as object types (issue171 and issue293)
- disallow duplicate action names (issue215 and issue430)
- use of object name instead of variable (issue220)
- "numeric" should be a reserved term and in particular not allowed for object types (issue220)
- complain about undefined objects (issue813)
- complain about using variables undeclared in parameters (no issue)

There's also issue472 that is related to this one, but I think it is sufficiently independent to not be considered part of this meta issue.
msg11528 (view) Author: malte Date: 2024-01-18.15:25:37
When we merged issue1030, we left many open pull request comments on the table. It would be nice to address them eventually. See

    https://github.com/aibasel/downward/pull/155

for more details. Make sure to display the changes for the file where the diff is too large to be shown by default to see everything. The whole list includes comments by Victor, Salomé, Florian, Clemens and me (and possibly others).
msg10421 (view) Author: malte Date: 2021-08-30.19:52:48
Added reference to issue1029 to summary.
msg8868 (view) Author: malte Date: 2019-06-10.15:40:54
Error reporting should also mention more about the context in which the error
occurs, such as a line number and perhaps a few lines of context in the PDDL
file. See message by David Epstein on Fast Downward list 09.06.2019 10:08 (CEST).
msg1986 (view) Author: malte Date: 2011-12-11.19:18:44
I'm attaching another example where our error reporting should be improved:


...
Completing instantiation...
Traceback (most recent call last):
  File "./translate/translate.py", line 578, in <module>
    sas_task = pddl_to_sas(task)
  File "./translate/translate.py", line 441, in pddl_to_sas
    reachable_action_params) = instantiate.explore(task)
  File "/home/abdon/downward/src/translate/instantiate.py", line 77, in explore
    return instantiate(task, model)
  File "/home/abdon/downward/src/translate/instantiate.py", line 57, in instantiate
    fluent_facts, type_to_objects)
  File "/home/abdon/downward/src/translate/pddl/actions.py", line 137, in
instantiate
    objects_by_type, effects)
  File "/home/abdon/downward/src/translate/pddl/effects.py", line 129, in
instantiate
    self._instantiate(var_mapping, init_facts, fluent_facts, result)
  File "/home/abdon/downward/src/translate/pddl/effects.py", line 137, in
_instantiate
    self.literal.instantiate(var_mapping, init_facts, fluent_facts, effects)
  File "/home/abdon/downward/src/translate/pddl/conditions.py", line 300, in
instantiate
    raise Impossible()
pddl.conditions.Impossible


The cause of this is apparently that some condition is written as "(open ?door)"
instead of the correct "(open ?d)".
msg1953 (view) Author: malte Date: 2011-11-15.21:17:15
> As another example where better error reporting would be useful, see issue297. I
> think the underlying problem there is that the input uses the "either"
> construct, which we do not support.

Actually no, there is another problem. Still, we should complain about "either"
if we don't support it.
msg1952 (view) Author: malte Date: 2011-11-15.21:12:04
As another example where better error reporting would be useful, see issue297. I
think the underlying problem there is that the input uses the "either"
construct, which we do not support.
msg1882 (view) Author: malte Date: 2011-11-07.18:58:16
> Will open a separate issue for this.

issue293
msg1880 (view) Author: malte Date: 2011-11-07.18:51:32
> It also allows using types as predicates (which is correct according to the
> PDDL 1 specification), but does not check if this clashes with actual
> predicates, as is e.g. the case in the Schedule-ADL domain (not in our
> repository -- we renamed the type "temperature" to "temperature-type" to
> avoid the name clash). In case of such clashes, we typically get a very
> uninformative error message about a tuple index being out of range.

I just got another error report about this behaviour. Will open a separate issue
for this.
msg1249 (view) Author: malte Date: 2011-03-02.18:34:33
The translator accepts quite a few things that are invalid PDDL. Test cases
include the domains mentioned in issue218 before the issue was fixed.

In particular, the translator accepts:

 * predicates that are not declared
 * an object type named "number", which should be reserved for actual
   numeric quantities

It also allows using types as predicates (which is correct according to the PDDL
1 specification), but does not check if this clashes with actual predicates, as
is e.g. the case in the Schedule-ADL domain (not in our repository -- we renamed
the type "temperature" to "temperature-type" to avoid the name clash). In case
of such clashes, we typically get a very uninformative error message about a
tuple index being out of range.
History
Date User Action Args
2024-01-18 18:01:24clemenssetpriority: wish -> meta
nosy: + clemens
messages: + msg11530
2024-01-18 15:25:37maltesetmessages: + msg11528
2024-01-18 15:19:13maltesetsummary: Issues reported by others that fall under this: issue1029 -> Issues reported by others that fall under this: issue1029 issue1030
2021-08-30 19:52:48maltesetmessages: + msg10421
summary: Issues reported by others that fall under this: issue1029
2021-07-08 14:55:16hazsetnosy: + haz
2020-07-03 10:43:03augustosetnosy: + augusto
2019-06-10 15:40:54maltesetmessages: + msg8868
2014-10-04 19:58:34maltesetkeyword: + translator
2011-12-11 19:18:56maltesetfiles: + probPR2TEST.pddl
2011-12-11 19:18:44maltesetfiles: + domain.pddl
messages: + msg1986
2011-11-15 21:17:15maltesetmessages: + msg1953
2011-11-15 21:12:04maltesetmessages: + msg1952
2011-11-07 18:58:16maltesetmessages: + msg1882
2011-11-07 18:51:32maltesetmessages: + msg1880
2011-03-02 18:34:33maltecreate