jan-dolejsi / vscode-pddl

Planning Domain Description Language (PDDL) grammar, syntax highlighting, code snippets, parser and planner integration for Visual Studio Code.
MIT License
87 stars 23 forks source link

Possible incorrect autocomplete syntax. #71

Open PabloMK7 opened 4 years ago

PabloMK7 commented 4 years ago

I'm facing the following problem, trying to autocomplete a durative-action creates the following template.

(:durative-action action_name
    :parameters ()
    :duration (= ?duration 1)
    :condition (and 
        (at start (and 
        ))
        (over all (and 
        ))
        (at end (and 
        ))
    )
    :effect (and 
        (at start (and 
        ))
        (at end (and 
        ))
    )
)

The planner I'm using to evaluate the domain starts acting weirdly using this syntax, with multiple errors and even crashes. The following part causes the weird behaviour, for example:

:effect (and 
        (at start (and 
            (example ?a ?b)
            (not (example2 ?a ?b))
        ))
    )

Changing it to the following, works as intended:

:effect (and
        (at start (example ?a ?b)) 
        (at start (not (example2 ?a ?b)))
    )

NOTE: I faced this issue as I'm being introduced to PDDL at college, and the planner we are using is LPG-td-1.0. I'm not sure if the PDDL syntax allows this usage of the :effect section, as I couldn't find anything in the PDDL documentation using the syntax in this extension. If this is part of the standard PDDL syntax then it would be great to know in order to let the people at the college know. Thanks in advance.

jan-dolejsi commented 4 years ago

Thanks for reporting this. I did not try LPG. Yes, it is quite possible that different planners implement the PDDL parsing differently. The syntax suggested by the auto-completion snippet is compliant with the published PDDL BNF syntax. But that does not help you, I know. I can offer two solutions:

  1. you can add your own more suitable snippets using the VS Code custom user snippet mechanisms described here
  2. I simplify the snippet to be relevant to more planners, including LPG (while keeping the snippets useful for most users)
jan-dolejsi commented 4 years ago

Related:

I would like to get your feedback on the support for LPG planner command-line switches and its plan format parsing. Please try the new version of the extension (best if you configure your LPG executable using the configuration facility now provided).

2.19.4

Support for LPG planner

The LPG Planner uses slightly different format for the plans. Now those plans are parsed and visualized.

LPG command-line options are also presented in the drop down, while invoking the planner:

LPG Planner Support

PabloMK7 commented 4 years ago

Thanks a lot for the reply! I will give it a try and report you back the results. (It will take me a few days to test it however.) How would I go installing the 2.19.4 version? I've always installed vscode extensions through the extensions menu, but the latest version listed there is 2.19.3.

jan-dolejsi commented 4 years ago

My mistake. The update did not get pushed to the Microsoft marketplace. Fixing it now...

jan-dolejsi commented 4 years ago

There were some build reliability issues, but now the 2.19.4 is in the marketplace and your version should update upon next two VS Code reloads.

dingyuhang14 commented 3 years ago

Thanks for the extension of PDDL, it's excellent. The LPG planner is what I have been looking for to solve the duration-action problems, it's great that the newest version supports that. However, I'm confused about how to get the LPG Application (you showed in the video above), whenever I enter the LPG website, I can only get lots of code to be compiled. How can I get this LPG application? Please help. Thank you in advance. @jan-dolejsi @mariohackandglitch

jan-dolejsi commented 3 years ago

I found the binaries on this site: https://lpg.unibs.it/lpg/

Although the windows build from there was not behaving correctly (spawning endless number of subprocesses).

dingyuhang14 commented 3 years ago

So how did you solve the problem? The windows version can't be built correctly but the Linux version is ok......