Issue1127

Title Some goals do not work with non-propositional variables
Priority bug Status resolved
Superseder Nosy List gabi, jendrik, malte, salome
Assigned To Keywords translator
Optional summary

Created on 2023-10-26.12:35:36 by gabi, last changed by gabi.

Files
File name Uploaded Type Edit Remove
domain.pddl gabi, 2023-10-26.12:35:36 application/octet-stream
prob01-mod.pddl gabi, 2023-10-26.12:35:52 application/octet-stream
Messages
msg11582 (view) Author: gabi Date: 2024-02-09.14:11:07
Done and merged.
msg11581 (view) Author: salome Date: 2024-02-09.11:59:07
I looked at the code, looks good to me.
msg11565 (view) Author: gabi Date: 2024-02-01.11:24:20
Alternatively, we could also explore to introduce a goal action (that needs to be handled by the search component as a post-processing of the plan).
msg11563 (view) Author: gabi Date: 2024-01-31.23:08:40
I implemented the fix that enforces a binary encoding of all atoms that occur negatively in the goal. This resolves the issue and I would consider it a better solution than introducing an axiom (which would not be supported by many heuristics).

The experiments don't look critical to me. All differences in output.sas are in the few domains where we always experience non-determinism.

Experiments: https://ai.dmi.unibas.ch/_experiments/ai/downward/issue1127/data/issue1127-v1-eval/issue1127-v1-23499409976f669b036ef162b2835832f01d2fb2-issue1127-v1-compare.html
Pull request: https://github.com/aibasel/downward/pull/217
msg11562 (view) Author: gabi Date: 2024-01-31.22:05:41
Getting back to the general limitation (not the specific example task), one way to support negative literals in the goal would be to force them to be encoded with binary variables. Then it is easy to express them with "the other" value. Since we never ran into the assertion with our benchmark tasks, this should not harm their encoding.
msg11561 (view) Author: gabi Date: 2024-01-31.21:39:30
In the code, we call translate_strips_conditions_aux twice, first with the full mutex information, afterwards with the actual FDR encoding. From the first call, we currently only use the information whether there are conflicting conditions, so it seems a bit excessive to me to continue the computation beyond this decision.

Getting back to the bug: I think it is clear that we want to drop an implied negative condition from the goal (otherwise we run into an assertion). The question is whether we want to drop them in general (avoiding a transformation into a DNF condition, which ultimately leads to several copies of actions or conditional effects for the different conjunctions).
msg11558 (view) Author: gabi Date: 2024-01-31.15:24:13
The actually used variables don't use this mutex group, so we would need to drop negated effects already in the earlier call of the auxiliary method (where we hand in full mutex information).
msg11557 (view) Author: gabi Date: 2024-01-31.14:49:03
This bug relates to a limitation of the translator wrt. negative goals.

If the goal requires (not (P x y)) and (P x y) is encoded by a FDR variable with 5 possible values, we conceptually would need to replace the negative goal with a disjunction over the other 4 values of this variable. Since a normalized goal may not contain a disjunction, we instead would need to add another axiom, something we don't want to do that late in the process (we basically are too lazy because negative goals are rare). In the restricted case where the variable only has 2 possible values, we just add the corresponding other value, which is the reason why the assertion does not fail if the invariance analysis is switched off.

In this particular example, we have a specific situation which we might want to address. The example is a simple gripper task with goal (and (not (carry ball4 left)) (at ball4 roomb)). We have a FDR variable for [Atom at(ball4, ?X), Atom carry(ball4, ?X)].
So (at ball4 roomb) already implies (not (carry ball4 left)) and we should simply drop the negative goal.
The right place for this adaptation would be in translate_strips_conditions_aux.py in the part starting at line 97.
msg11477 (view) Author: gabi Date: 2023-10-26.12:35:36
The translator may throw an exception in certain cases when a negated goal is part of a finite-domain 
variable with more than two values.

https://github.com/aibasel/downward/blob/main/src/translate/translate.py#L490

Attached you find a gripper example, where this happens. It does not happen if you disable mutex and 
finite domain variable generation.

(originally reported by David Speck)
History
Date User Action Args
2024-02-09 14:11:07gabisetstatus: reviewing -> resolved
messages: + msg11582
2024-02-09 11:59:07salomesetnosy: + salome
messages: + msg11581
2024-02-01 11:24:20gabisetmessages: + msg11565
2024-01-31 23:08:40gabisetstatus: chatting -> reviewing
messages: + msg11563
2024-01-31 22:05:41gabisetmessages: + msg11562
2024-01-31 21:39:30gabisetstatus: in-progress -> chatting
messages: + msg11561
2024-01-31 15:24:13gabisetmessages: + msg11558
2024-01-31 14:49:03gabisetstatus: unread -> in-progress
messages: + msg11557
2023-10-26 12:35:52gabisetfiles: + prob01-mod.pddl
2023-10-26 12:35:36gabicreate