Issue446

Title Translator bug?: Confused by types and predicates with the same name
Priority bug Status resolved
Superseder Nosy List malte, masataro
Assigned To Keywords
Optional summary

Created on 2014-07-27.05:45:19 by masataro, last changed by malte.

Files
File name Uploaded Type Edit Remove
bug.tar.gz masataro, 2014-07-27.05:45:19 application/gzip
Messages
msg3246 (view) Author: malte Date: 2014-07-27.11:40:11
No problem, and thanks for checking the bug list. :-)
msg3245 (view) Author: masataro Date: 2014-07-27.09:29:17
Thank you for the fast answer and the reference.
I thought I checked the past bug list but it was not enough actually. (it was in
the wish list...)
Sorry for bothering.
msg3243 (view) Author: malte Date: 2014-07-27.08:15:36
Thanks for reporting! This is a duplicate of issue171, so I'll close this one
and add a crossreference to this issue over there. If you want to follow the
further development of this, you can add yourself to the nosy list of issue171.
msg3242 (view) Author: masataro Date: 2014-07-27.05:45:19
Hi all,

I found that the translator fails to parse a certain type of domain files as
shown in the following. The problem disappears when I rename the predicate
`reachable`, which has the same name as a PDDL type `reachable`, to some other
name like `foo`. Attached are the minimal reproducible test cases, including 4
PDDL files and the result log files.

``` lisp
(define (domain cell-assembly-eachparts)
  (:requirements :strips :typing)
  (:types arm position - object
          reachable - position
          table - reachable) ;;;; **********
  (:predicates
   (reachable ?arm - arm ?to - reachable) ;;;; ********************
   (at ?obj - object ?pos - position))
  (:action move-arm
       :parameters (?arm - arm ?from ?to - reachable) ;;;; **************
       :precondition (and (at ?arm ?from)
                  (reachable ?arm ?to)) ;;;; ********************
       :effect (and (at ?arm ?to)
            (not (at ?arm ?from)))))
```

the translator log is

```
Parsing...
Parsing: [0.000s CPU, 0.001s wall-clock]
Normalizing task... [0.000s CPU, 0.000s wall-clock]
Instantiating...
Generating Datalog program... [0.000s CPU, 0.000s wall-clock]
Normalizing Datalog program...
Trivial rules: Converted to facts.
Normalizing Datalog program: [0.000s CPU, 0.001s wall-clock]
Preparing model... [0.000s CPU, 0.000s wall-clock]
Generated 5 rules.
Computing model... Traceback (most recent call last):
  File "/mnt/video/guicho/repos/downward/src/translate/translate.py", line 676,
in <module>
    main()
  File "/mnt/video/guicho/repos/downward/src/translate/translate.py", line 666,
in main
    sas_task = pddl_to_sas(task)
  File "/mnt/video/guicho/repos/downward/src/translate/translate.py", line 498,
in pddl_to_sas
    reachable_action_params) = instantiate.explore(task)
  File "/mnt/video/guicho/repos/downward/src/translate/instantiate.py", line 75,
in explore
    model = build_model.compute_model(prog)
  File "/mnt/video/guicho/repos/downward/src/translate/build_model.py", line
324, in compute_model
    rule.update_index(next_atom, cond_index)
  File "/mnt/video/guicho/repos/downward/src/translate/build_model.py", line 97,
in update_index
    for position in self.common_var_positions[cond_index]]
IndexError: tuple index out of range
Command exited with non-zero status 1
real 0.08
user 0.06
sys 0.01
maxmem 13256
```
History
Date User Action Args
2014-07-27 11:40:11maltesetstatus: chatting -> resolved
messages: + msg3246
2014-07-27 09:29:17masatarosetstatus: resolved -> chatting
messages: + msg3245
2014-07-27 08:15:36maltesetstatus: unread -> resolved
nosy: + malte
messages: + msg3243
2014-07-27 05:45:19masatarocreate