-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAS translator over determinized PDDLs #16
Comments
@haz pointed out in #11 (comment):
|
I thought the That option means:
I tested on the example I attach here and indeed: the no-op effect operator is gone anyways. 🤷 Now, I may have missed something, but it seems that option (and others) are not used at all. Look: $ grep -r keep *
axiom_rules.py: continue # Required to keep one of multiple identical axioms.
options.py: "--keep-unreachable-facts",
options.py: help="keep facts that can't be reached from the initial state")
options.py: "--keep-unimportant-variables",
options.py: help="keep variables that do not influence the goal in the causal graph")
pddl_parser/parsing_functions.py: # We use add-after-delete semantics, keep positive effect
translate.py: # and we do not want to keep an effect whose condition contradicts I would have expected Said so Chris, even so there are two issues that may not make using the translator "as is" the best option:
Check this:
Then I run: $ ~/PROJECTS/planning/FOND/parsers/translator-fond.git/original-translators/downward-release-24.06.0/src/translate/translate.py --keep-unimportant-variables output/domain_02_all_outcomes.pddl test/no-op/p1.pdd
cat output.sas
begin_version
3
end_version
begin_metric
0
end_metric
1
begin_variable
var0
-1
2
Atom q()
NegatedAtom q()
end_variable
0
begin_state
1
end_state
begin_goal
1
0 0
end_goal
1
begin_operator
sq_detdup_1
0
1
0 0 -1 0
1
end_operator
0 As we can see, proposition |
Ah, ok. Let me bring Basel in on this. I think it would be fine to prune an action because it's not reachable/executable ever (if you get rid of one determinized action because of this, all will go). I don't think it's fine to prune an action because it doesn't seem relevant for the goal (noop actions need to be kept, etc). @FlorianPommerening : Any chance we have a no-code opportunity to get the behaviour we want from the FD translator? I.e., we'd rather not modify the translator at all -- just pass in the command-line option that will keep the seemingly irrelevant actions around. @ssardina : Think it's worth having a utility done up to cross-reference the names? Given (1) a determinized domain file, (2) indication what the detdup suffix is, and (3) a sas file...check and see if all the determinized actions appear (if a ground action is there in the sas file, all of the sibling outcomes are also there). |
fine with that, it would mean that the static analysis figures out that the action is unreachable (precondition never true), which would not be complete. Not sure where in the translate code that happens, but in that case we would eliminate ALL the determinized versions of the original action (as they all share the same precondition)
It does for classical planning; these actions can be removed right away, no need to consider them in the search. It is however not right to remove them for FOND in general
Certainly we would rather not modify the FD translator and use it "as is'. But what is the feature we would like to have? Not really completely disabling full simplification of irrelevant operators. I think what we would like is to be able to state exceptions to those simplification and be able to state that some operators should not be simplified/removed. In the simplest form, would like to be able to state that actions containing a substring should not be dropped, something like:
telling the translator to not drop any action containing
Do you mean a utility in this repo that checks that a .sas file contains all the determinized actions of a domain? Kind of a "checker" that the translator used was good? Is that what you mean? |
Hi all,
The reason you didn't find a usage with grep is that the option is called differently internally (don't ask me why) argparser.add_argument(
"--keep-unimportant-variables",
dest="filter_unimportant_vars", action="store_false",
help="keep variables that do not influence the goal in the causal graph") The |
Hi @FlorianPommerening , silly me, yes I wrongly assumed the options will keep the same name, very naive on me not checking well the options file. I did read it and saw they are loaded into the module. OK good, I was very confused that it wasn't implemented and be there for so man years! 🤦
I am OK domain variables being dropped, it may make the problem simpler to solve, but I want to keep (certain) operators, even if they are (eventually) no-ops. Question @FlorianPommerening : could the operator simplification ever involve more sophisticated cases like an operator making the goal impossible? I would think so, it could happen, say an operator that makes the precondition of a must action false forever. Would that be dropped in general? If so, would the flag above avoid that being dropped? |
As far as I know, there is no fine-grained control over what is dropped and what is kept. My understanding is that there first is a reachability analysis that is done as part of the grounding. That means only facts/actions that are reachable in the delete-relaxation will be grounded. Static facts (constants) are compiled away in this step as well. Then, there is an optional second step that does a relevance analysis. It computes a causal graph, marks the goal as relevant, and then iteratively marks facts as relevant that can have an influence on other relevant facts. Everything not marked in this way is not relevant for the goal and is removed (facts and actions that become no-ops after removing the facts). With the option In your example, I'm assuming "must action" means action landmark? But in that case, an action destroying the landmark's precondition forever could not be pruned: let's say L is an action landmark and o is an operator that makes L's precondition false forever. There could still be a plan that first uses L and then uses o afterwards. Anyway, as far as I know, the translator only does the relevance analysis, nothing else. |
Thanks @FlorianPommerening Yes, a landmark was what I was thinking of. Yes it may very well be that you need the "bad" action after the landmark actions has been done, but in other cases it is irrelevant to the goal except sending you to a dead-end. But as you said, the translator doesn't go that far. I tried this example with goal
and the I will try In any case, @haz ,as far as I can do, we would need a translator that can take exceptions on operators to drop. There seems no way out... |
Could you point us to the part in the translator code, @FlorianPommerening , that would be removing these unnecessary actions? Noops are a good example of them. |
I think the call stack would be this one:
@ssardina in your example, |
Agree @FlorianPommerening , I didn't think those kind of powerful reasoning were being done, as they would make the problem intractable. But I don't know if there are other cases that could end up removing actions that yield a dead-end; even making the goal false (and nothing else) would be OK and not simplified. So yes I think that from the semantic point of view, the operators that end up being simplified are the ones that end up behaving like "no-ops" (immediately or due to predicate simplifications). @haz , if you see my repo of the modified FD translator, I have documented the changes I did to avoid dropping our determinized actions. Note this is NOT the same as the option |
@FlorianPommerening , consider this domain + problem:
would you agree that $ downward-release-24.06.0/src/translate/translate.py test/no-op/domain_01.pddl test/no-op/p1.pddl --keep-unimportant-variables
$ cat output.sas
begin_version
3
end_version
begin_metric
0
end_metric
1
begin_variable
var0
-1
2
Atom q()
NegatedAtom q()
end_variable
0
begin_state
1
end_state
begin_goal
1
0 0
end_goal
1
begin_operator
setq
0
1
0 0 -1 0
1
end_operator
0
|
Can you make I think what caused the original example to lose the noop was that it had no prepost -- likely due to the fluent being removed due to it being static. |
I do indeed. It's common for many FOND planners to use FD (of some sort) as a base. The test I would hope to use:
There may be some groundings that never happen (preconditions not reachable), but if you have one outcome in the SAS file, all the others should be there with the same grounding. I'm starting to suspect that PRP+PR2+MyND+Paladinus all used the same assumption of |
Good, issue created to track that new feature, I agree it is a useful tool to have. 👍 @haz , added this action to the PDDL:
Now Note we are doing hit and miss here; the right thing is to study the code well 😉 The bottom line Chris is that it is not clear that we can use the FD translator off the shelf (and even if we do, may not be the best as I don't want to switch off all simplifications!) |
With the original version of the domain, |
Good one. If it is in the initial state then it will not be static and we get the right behavior: dropped without the keep option, but kept if we state to keep the unimportant: 👍
|
@haz , I think I know understand a bit better (not fully) the limits of FD translator and the requirements needed for us. I have documented 3 test cases and explained a bit here with concrete simple examples The bottom line: it is not enough to use the
So, unless we convinced them to add an option:
to keep all operators containing |
Sure 'bout this? What would be the downstream impact on performance if we had |
Not sure I am following you.. If we use Are you saying that such simplifications have no impact on the actual search on planners? If so I would not think that is the case in general. I think we want the default behavior of FD translator that simplifies the input via static analysis. However, we want to keep all non-det operators. A special case is: what if all the determinized effects become trivial no-op, or what happens if the non-deterministic operator has a false precondition always? In this case we can drop ALL the determinized actions (I don't do that now) |
Aye, I'm questioning if the actual potential improvement is present in any of the examples we see. What about a double-pass?
|
Seems like a hack @haz ... Not sure the impact on the current problems, but I believe it does have significant impact in many classical planning tasks, and those can always be converted into FOND versions easily right? We want a solution that is not over-fitting to the current tasks. Haven't thought about the double pass, it´s clever but again I see two problems;
I don't know, but it looks too much work and going around when we can trivially get exactly what we want by a slight modification of the original translator. In fact, I would say it can be beneficial to extend the official translator with a regular expression match: those actions that match the regular expressions are kept. |
Because of that I have elaborated the translate-fond I had with two translators (the one that does both determinization and SAS, and the standard classical SAS but without deleting actions that are determinizations). You will need to also deal with this Chris in your PRP
Originally posted by @ssardina in #11 (comment)
The text was updated successfully, but these errors were encountered: