PDDLSharp 1.6.15

dotnet add package PDDLSharp --version 1.6.15
                    
NuGet\Install-Package PDDLSharp -Version 1.6.15
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PDDLSharp" Version="1.6.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PDDLSharp" Version="1.6.15" />
                    
Directory.Packages.props
<PackageReference Include="PDDLSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PDDLSharp --version 1.6.15
                    
#r "nuget: PDDLSharp, 1.6.15"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=PDDLSharp&version=1.6.15
                    
Install PDDLSharp as a Cake Addin
#tool nuget:?package=PDDLSharp&version=1.6.15
                    
Install PDDLSharp as a Cake Tool

<p align="center"> <img src="https://github.com/kris701/PDDLSharp/assets/22596587/6c7c3516-bb1e-4713-ad17-e2eaff67107b" width="200" height="200" /> </p>

Build and Publish Nuget Nuget GitHub last commit (branch) GitHub commit activity (branch) Static Badge Static Badge Static Badge

Welcome to PDDLSharp! This wiki serves to document how to use different parts of PDDLSharp. If you encounter any problems, please make sure you have read through the wiki first. If you can still not find an answer, feel free to make an issue.

Content

What is PDDL?

PDDL is a standardised format that is extensively used in planning. The general idea of it is to have a set of initial facts (predicates), a set of goal facts we want to each and a set of actions that modify facts. The PDDL format is split into two parts; a domain and a problem. The domain contains the definitions of the actions, as well as what predicates can be used. An example of a domain can be the well known domain Gripper. Gripper is a domain where the goal is to move balls to other rooms by means of a robot hand. It usually consists of 3 actions, pick, move and drop. An example of a gripper domain could be:

(define (domain gripper-strips)
   (:predicates (room ?r) (ball ?b) (gripper ?g)
		(at-robby ?r) (at ?b ?r) (free ?g) (carry ?o ?g)
   )

   (:action move
       :parameters (?from ?to)
       :precondition 
         (and 
            (room ?from) (room ?to) 
            (at-robby ?from)
         )
       :effect
         (and
            (at-robby ?to)
            (not (at-robby ?from))
         )
   )

   (:action pick
       :parameters (?obj ?room ?gripper)
       :precondition  
         (and 
            (ball ?obj) 
            (room ?room) 
            (gripper ?gripper)
            (at ?obj ?room) 
            (at-robby ?room) 
            (free ?gripper)
         )
       :effect 
         (and 
            (carry ?obj ?gripper)
            (not (at ?obj ?room)) 
            (not (free ?gripper))
         )
   )

   (:action drop
       :parameters (?obj ?room ?gripper)
       :precondition
         (and
            (ball ?obj) 
            (room ?room) 
            (gripper ?gripper)
            (carry ?obj ?gripper) 
            (at-robby ?room)
         )
       :effect 
         (and
            (at ?obj ?room)
            (free ?gripper)
            (not (carry ?obj ?gripper))
         )
   )
)

Where the predicate and actions definitions can be seen.

The other part is the problem declaration. This contains the initial facts and goal facts, so its more or less an instanciated version of the domain. An example of a gripper problem can be seen below:

(define (problem strips-gripper-x-1)
   (:domain gripper-strips)
   (:objects rooma roomb ball4 ball3 ball2 ball1 left right)
   (:init (room rooma)
          (room roomb)
          (ball ball4)
          (ball ball3)
          (ball ball2)
          (ball ball1)
          (at-robby rooma)
          (free left)
          (free right)
          (at ball4 rooma)
          (at ball3 rooma)
          (at ball2 rooma)
          (at ball1 rooma)
          (gripper left)
          (gripper right))
   (:goal (and (at ball4 roomb)
               (at ball3 roomb)
               (at ball2 roomb)
               (at ball1 roomb))))

This example is just a very simple domain, PDDL contains many more constructs to make more advanced domains and problems or to extend their possibilities.

Why PDDLSharp?

PDDLSharp is much more than just a parser for PDDL, it contains contextualisers, analysers, code generators, macro generators, plan validators, grounders and much more. And it is fully managed, open source C# code, so no mucking about with ANTLR grammars and weird return node formats. PDDLSharp can serve as a solid and tested backbone for your own project, whether you just want to parse PDDL or use some other more advanced PDDLSharp components.

How to install PDDLSharp?

There are a few ways to install PDDLSharp on. You can either find it on Nuget Package Manager, GitHub Package Manager or simply download the source code and compile it yourself.

How to use PDDLSharp?

All of PDDLSharp is a large class library that you can use whatever section of you need. All of the project can be accessed through the common namespace PDDLSharp.. Generally, most of the core components of PDDLSharp is based on an error listener, that can record several errors (such as warnings from the analyser) at the same time. It can be set to throw at a given level of error (e.g. throw if a warning or higher is given). That said, you will find the general format of the components being as follows

IErrorListener listener = new ErrorListener();
...

Since most of the components need a listener object given to them.

An example of how to parse a domain file with PDDLSharp:

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
DomainDecl = parser.ParseAs<DomainDecl>(new FileInfo("domain.pddl"));
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on PDDLSharp:

Package Downloads
MetaActionGenerators

A package to generate meta action candidates.

Stackelberg.MetaAction.Compiler

A package to compile meta actions into Stackelberg Planning variants to be used for verification.

PlanVal

A plan validator for PDDL+Plan files.

MacroGenerators

A collection of macro generators.

MutexDetectors

A collection of mutex detectors for PDDL.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.6.15 151 6/12/2024
1.6.14 104 6/12/2024
1.6.13 106 6/12/2024
1.6.12 165 6/9/2024
1.6.11 115 6/9/2024
1.6.10 121 6/9/2024
1.6.9 151 6/7/2024
1.6.8 153 6/6/2024
1.6.7 172 5/30/2024
1.6.6 129 5/29/2024
1.6.5 215 5/24/2024
1.6.4 141 5/24/2024
1.6.3 344 5/13/2024
1.6.2 108 5/13/2024
1.6.1 182 5/11/2024
1.6.0 133 5/10/2024
1.5.6 140 5/10/2024
1.5.5 348 5/10/2024
1.5.4 173 5/9/2024
1.5.3 180 5/9/2024
1.5.2 351 3/21/2024
1.5.1 174 2/5/2024
1.5.0 117 2/5/2024
1.4.7 124 1/26/2024
1.4.6 127 1/24/2024
1.4.5 121 1/24/2024
1.4.4 123 1/20/2024
1.4.3 123 1/19/2024
1.4.2 123 1/19/2024
1.4.1 123 1/18/2024
1.4.0 124 1/17/2024
1.3.18 127 1/17/2024
1.3.17 236 12/1/2023
1.3.16 127 12/1/2023
1.3.15 133 12/1/2023
1.3.14 172 11/29/2023
1.3.13 126 11/20/2023
1.3.12 129 11/19/2023
1.3.11 120 11/18/2023
1.3.10 169 11/17/2023
1.3.9 119 11/16/2023
1.3.8 178 11/10/2023
1.3.7 204 11/5/2023
1.3.6 135 11/4/2023
1.3.5 172 11/4/2023
1.3.4 132 11/3/2023
1.3.3 268 11/2/2023
1.3.2 128 11/1/2023
1.3.1 106 10/31/2023
1.3.0 130 10/31/2023
1.2.9 140 10/30/2023
1.2.8 119 10/30/2023
1.2.7 135 10/30/2023
1.2.6 143 10/29/2023
1.2.5 136 10/29/2023
1.2.4 138 10/29/2023
1.2.3 130 10/28/2023
1.2.2 141 10/28/2023
1.2.1 130 10/28/2023
1.2.0 131 10/27/2023
1.1.13 180 10/22/2023
1.1.12 145 10/21/2023
1.1.11 143 10/21/2023
1.1.10 132 10/21/2023
1.1.9 145 10/21/2023
1.1.8 278 10/20/2023
1.1.7 204 10/18/2023
1.1.6 132 10/18/2023
1.1.5 150 10/18/2023
1.1.4 130 10/18/2023
1.1.3 269 10/15/2023
1.1.2 151 10/15/2023
1.1.1 133 10/15/2023
1.1.0 156 10/15/2023
1.0.25 142 10/14/2023
1.0.24 135 10/14/2023
1.0.23 137 10/12/2023
1.0.22 131 10/11/2023
1.0.21 168 10/11/2023
1.0.20 142 10/10/2023
1.0.19 128 10/10/2023
1.0.18 178 10/9/2023
1.0.17 149 10/9/2023
1.0.16 148 10/8/2023
1.0.15 137 10/6/2023
1.0.14 132 10/6/2023
1.0.13 156 10/6/2023
1.0.12 127 10/4/2023
1.0.11 118 10/4/2023
1.0.10 142 10/2/2023
1.0.9 143 10/1/2023
1.0.8 144 10/1/2023
1.0.7 147 9/30/2023
1.0.6 131 9/28/2023
1.0.5 135 9/28/2023
1.0.4 119 9/27/2023
1.0.3 137 9/27/2023
1.0.2 146 9/27/2023
1.0.0 133 9/26/2023