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 as a Cake Addin
#tool nuget:?package=PDDLSharp&version=1.6.15
                    
Install 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 172 6/12/2024
1.6.14 118 6/12/2024
1.6.13 116 6/12/2024
1.6.12 177 6/9/2024
1.6.11 127 6/9/2024
1.6.10 132 6/9/2024
1.6.9 167 6/7/2024
1.6.8 163 6/6/2024
1.6.7 181 5/30/2024
1.6.6 140 5/29/2024
1.6.5 227 5/24/2024
1.6.4 156 5/24/2024
1.6.3 354 5/13/2024
1.6.2 124 5/13/2024
1.6.1 193 5/11/2024
1.6.0 144 5/10/2024
1.5.6 151 5/10/2024
1.5.5 358 5/10/2024
1.5.4 182 5/9/2024
1.5.3 189 5/9/2024
1.5.2 362 3/21/2024
1.5.1 184 2/5/2024
1.5.0 127 2/5/2024
1.4.7 138 1/26/2024
1.4.6 140 1/24/2024
1.4.5 133 1/24/2024
1.4.4 133 1/20/2024
1.4.3 140 1/19/2024
1.4.2 133 1/19/2024
1.4.1 140 1/18/2024
1.4.0 133 1/17/2024
1.3.18 137 1/17/2024
1.3.17 247 12/1/2023
1.3.16 134 12/1/2023
1.3.15 138 12/1/2023
1.3.14 180 11/29/2023
1.3.13 132 11/20/2023
1.3.12 135 11/19/2023
1.3.11 126 11/18/2023
1.3.10 175 11/17/2023
1.3.9 124 11/16/2023
1.3.8 184 11/10/2023
1.3.7 217 11/5/2023
1.3.6 148 11/4/2023
1.3.5 190 11/4/2023
1.3.4 139 11/3/2023
1.3.3 300 11/2/2023
1.3.2 136 11/1/2023
1.3.1 113 10/31/2023
1.3.0 135 10/31/2023
1.2.9 145 10/30/2023
1.2.8 124 10/30/2023
1.2.7 141 10/30/2023
1.2.6 150 10/29/2023
1.2.5 142 10/29/2023
1.2.4 144 10/29/2023
1.2.3 137 10/28/2023
1.2.2 153 10/28/2023
1.2.1 139 10/28/2023
1.2.0 147 10/27/2023
1.1.13 197 10/22/2023
1.1.12 154 10/21/2023
1.1.11 152 10/21/2023
1.1.10 141 10/21/2023
1.1.9 154 10/21/2023
1.1.8 312 10/20/2023
1.1.7 216 10/18/2023
1.1.6 146 10/18/2023
1.1.5 164 10/18/2023
1.1.4 140 10/18/2023
1.1.3 290 10/15/2023
1.1.2 161 10/15/2023
1.1.1 152 10/15/2023
1.1.0 167 10/15/2023
1.0.25 154 10/14/2023
1.0.24 145 10/14/2023
1.0.23 148 10/12/2023
1.0.22 141 10/11/2023
1.0.21 180 10/11/2023
1.0.20 152 10/10/2023
1.0.19 138 10/10/2023
1.0.18 202 10/9/2023
1.0.17 160 10/9/2023
1.0.16 165 10/8/2023
1.0.15 147 10/6/2023
1.0.14 143 10/6/2023
1.0.13 166 10/6/2023
1.0.12 137 10/4/2023
1.0.11 128 10/4/2023
1.0.10 153 10/2/2023
1.0.9 154 10/1/2023
1.0.8 157 10/1/2023
1.0.7 165 9/30/2023
1.0.6 142 9/28/2023
1.0.5 149 9/28/2023
1.0.4 129 9/27/2023
1.0.3 147 9/27/2023
1.0.2 156 9/27/2023
1.0.0 143 9/26/2023