PDDLSharp 1.1.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package PDDLSharp --version 1.1.9
                    
NuGet\Install-Package PDDLSharp -Version 1.1.9
                    
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.1.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PDDLSharp" Version="1.1.9" />
                    
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.1.9
                    
#r "nuget: PDDLSharp, 1.1.9"
                    
#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.
#:package PDDLSharp@1.1.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PDDLSharp&version=1.1.9
                    
Install as a Cake Addin
#tool nuget:?package=PDDLSharp&version=1.1.9
                    
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)

PDDLSharp

This is a package to make a PDDL parser, contextualiser, analyser, code generator and much more for C#. The parser is fully PDDL 2.2 compatible. The package can be found through Nuget or the Git package manager.

Parsers

There is a few parsers included in PDDLSharp, each of them will be explained in the subsections.

PDDL Parser

The PDDL Parser is the main part of PDDLSharp. Its a fully fledged parser that can parser up to PDDL 2.2 files.

A usage example of how to use the PDDL parser:

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
PDDLDecl decl = new PDDLDecl(
    parser.ParseAs<DomainDecl>(new FileInfo("domain.pddl")),
    parser.ParseAs<ProblemDecl>(new FileInfo("problem.pddl"))
)

To parse a file as a specific PDDL object:

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
ActionDecl decl = parser.ParseAs<ActionDecl>(new FileInfo("action-file.pddl"));

To contextualise a domain/problem:

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
PDDLDecl decl = new PDDLDecl(
    parser.ParseAs<DomainDecl>(new FileInfo("domain.pddl")),
    parser.ParseAs<ProblemDecl>(new FileInfo("problem.pddl"))
)
contextualiser.Contexturalise(decl);

To analyse a domain/problem (Note, the analyser will also contextualise the PDDL declaration, if it have not been contextualised):

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
IAnalyser analyser = new PDDLAnalyser(listener);
PDDLDecl decl = new PDDLDecl(
    parser.ParseAs<DomainDecl>(new FileInfo("domain.pddl")),
    parser.ParseAs<ProblemDecl>(new FileInfo("problem.pddl"))
)
analyser.Analyse(decl);

Plan Parser

There is also a plan parser that can parse Fast Downward output plans.

IErrorListener listener = new ErrorListener();
IParser<ActionPlan> parser = new FastDownwardPlanParser(listener);
ActionPlan plan = parser.Parse(new FileInfo("planFile.plan"));

SAS Parser

There is also a SAS parser that can parse Fast Downward intermediate output SAS format.

IErrorListener listener = new ErrorListener();
IParser<ISASNode> parser = new SASParser(listener);
SASDecl sas = parser.ParseAs<SASDecl>(new FileInfo("file.sas"));

Code Generators

PDDL Code Generator

To generate PDDL code from a PDDL declaration:

IErrorListener listener = new ErrorListener();
ICodeGenerator<INode> generator = new PDDLCodeGenerator(listener);
PDDLDecl decl = new PDDLDecl(...);
// If you want a "pretty" output, use:
// generator.Readable = true;
generator.Generate(decl.Domain, "domain.pddl");
generator.Generate(decl.Problem, "problem.pddl");

Plan Code Generator

To generate a Fast Downward plan from a ActionPlan declaration:

IErrorListener listener = new ErrorListener();
ICodeGenerator<ActionPlan> generator = new FastDownwardPlanGenerator(listener);
ActionPlan plan = new ActionPlan(...);
generator.Generate(plan, "planFile");

SAS Code Generator

To generate a Fast Downward intermediate output from a SASDecl declaration:

IErrorListener listener = new ErrorListener();
ICodeGenerator<ISASNode> generator = new SASCodeGenerator(listener);
SASDecl sas = new SASDecl(...);
generator.Generate(sas, "output.sas");

Toolkit

PDDLSharp includes a few tools, that can be found in the namespace PDDLSharp.Toolkit.

State Space Simulator

There is a State Space Simulator included with PDDLSharp. This is a simulator that is capable of simulating the state changes for each action execution. If there are invalid arguments or type issues, the simulator will throw an exception.

PDDLDecl declaration = new PDDLDecl(...);
IStateSpaceSimulator simulator = new StateSpaceSimulator(declaration);
simulator.Step("actionName", "obj1", "obj2");

Plan Validator

There is a simple plan validator included in PDDLSharp. It is capable of taking in a ActionPlan and a PDDLDecl and verify if the given plan is even possible or not.

IErrorListener listener = new ErrorListener();
IParser<ActionPlan> parser = new FastDownwardPlanParser(listener);
ActionPlan plan = parser.Parse(new FileInfo("planFile"));

PDDLDecl declaration = new PDDLDecl(...);
IPlanValidator validator = new PlanValidator();
validator.Validate(plan, declaration);

The Validate(...) method returns true if the plan is valid, false otherwise.

Mutex Detector

There is a simple predicate mutex detector included in PDDLSharp. It is able to find simple action predicate mutexes. You just give it a PDDLDecl and it will try and find mutex predicates in it:

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
PDDLDecl decl = new PDDLDecl(...)

IMutexDetectors detector = new EffectBalanceMutexes();
var mutexes = detector.FindMutexes(decl);

Static Predicate Detector

There is a simple static predicate detector included in PDDLSharp. It is able to find predicates that are not ever set in action effects. You just give it a PDDLDecl and it will try and find static predicates in it:

IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
PDDLDecl decl = new PDDLDecl(...)

IStaticPredicateDetectors detector = new SimpleStaticPredicateDetector();
var predicates = detector.FindStaticPredicates(decl);

Predicate Grounder

There is a predicate grounder included in PDDLSharp. It is able to take in a predicate, and instanciate it with all possible valid combinations of objects (and constants).

PDDLDecl decl = new PDDLDecl(...)
IGrounder<PredicateExp> grounder = new PredicateGrounder(decl);
PredicateExp predicate = new PredicateExp(...);
List<PredicateExp> groundedPredicates = grounder.Ground(predicate);

IParametized Grounder

Another grounder that is included is one that can ground IParametized nodes. This is nodes such as ActionDecl, ForAllExp, ExistsExp, etc. It takes in an IParametized node and makes grounded copies of it.

PDDLDecl decl = new PDDLDecl(...)
IGrounder<IParametized> grounder = new ParametizedGrounder(decl);
ActionDecl action = new ActionDecl(...);
List<IParametized> groundedActions = grounder.Ground(action);

Sequential Macro Generator

PDDLSharp also have a simple sequential macro generator. It can generate lifted macros based on reoccuring sequences in ActionPlans

PDDLDecl decl = new PDDLDecl(...)
IMacroGenerator<List<ActionPlan>> generator = new SequentialMacroGenerator(decl);
List<ActionPlan> plans = new List<ActionPlan>(...);
List<ActionDecl> macros = generator.FindMacros(plans);

Supported Requirements

PDDLSharp supports a large set of requirements, all the way up to PDDL 2.2:

  • STRIPS (:strips)
  • Typing (:typing)
  • Disjunctive Preconditions (:disjunctive-preconditions)
  • Equality (:equality)
  • Quantified Preconditions (:quantified-preconditions)
    • Existential Preconditions (:existential-preconditions)
    • Universal Preconditions (:universal-preconditions)
  • Conditional Effects (:conditional-effects)
  • Domain Axioms (:domain-axioms)
    • Subgoals Through Axioms (:subgoals-through-axioms)
    • Expression Evaluation (:expression-evaluation)
  • ADL (:adl)
  • Fluents (:fluents)
  • Durative Actions (:durative-actions)
    • Durative Inequalities (:durative-inequalities)
    • Continuous Effects (:continuous-effects)
  • Negative Preconditions (:negative-preconditions)
  • Derived Predicates (:derived-predicates)
  • Timed Initial Literals (:timed-initial-literals)
  • Action Expansions (:action-expansions)
  • Foreach Expansions (:forach-expansions)
  • DAG Expansions (:dag-expansions)
  • Safety Constraints (:safety-constraints)
  • Open World (:open-world)
  • True Negation (:true-negation)
  • UCPOP (:ucpop)
  • Constraints (:constraints)
  • Preferences (:preferences)

Notes

The system tests uses the Downward Benchmark Set to test on. A repository with solved instances of the benchmarks are also used for the plan parsing and verification.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.
  • net7.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 216 6/12/2024
1.6.14 131 6/12/2024
1.6.13 128 6/12/2024
1.6.12 204 6/9/2024
1.6.11 141 6/9/2024
1.6.10 165 6/9/2024
1.6.9 218 6/7/2024
1.6.8 199 6/6/2024
1.6.7 223 5/30/2024
1.6.6 166 5/29/2024
1.6.5 289 5/24/2024
1.6.4 189 5/24/2024
1.6.3 509 5/13/2024
1.6.2 137 5/13/2024
1.6.1 245 5/11/2024
1.6.0 156 5/10/2024
1.5.6 167 5/10/2024
1.5.5 437 5/10/2024
1.5.4 221 5/9/2024
1.5.3 227 5/9/2024
1.5.2 445 3/21/2024
1.5.1 201 2/5/2024
1.5.0 150 2/5/2024
1.4.7 169 1/26/2024
1.4.6 153 1/24/2024
1.4.5 156 1/24/2024
1.4.4 155 1/20/2024
1.4.3 167 1/19/2024
1.4.2 145 1/19/2024
1.4.1 161 1/18/2024
1.4.0 145 1/17/2024
1.3.18 148 1/17/2024
1.3.17 267 12/1/2023
1.3.16 140 12/1/2023
1.3.15 145 12/1/2023
1.3.14 197 11/29/2023
1.3.13 138 11/20/2023
1.3.12 173 11/19/2023
1.3.11 132 11/18/2023
1.3.10 181 11/17/2023
1.3.9 131 11/16/2023
1.3.8 191 11/10/2023
1.3.7 235 11/5/2023
1.3.6 166 11/4/2023
1.3.5 199 11/4/2023
1.3.4 155 11/3/2023
1.3.3 330 11/2/2023
1.3.2 144 11/1/2023
1.3.1 131 10/31/2023
1.3.0 153 10/31/2023
1.2.9 153 10/30/2023
1.2.8 133 10/30/2023
1.2.7 148 10/30/2023
1.2.6 168 10/29/2023
1.2.5 158 10/29/2023
1.2.4 153 10/29/2023
1.2.3 145 10/28/2023
1.2.2 169 10/28/2023
1.2.1 159 10/28/2023
1.2.0 167 10/27/2023
1.1.13 223 10/22/2023
1.1.12 161 10/21/2023
1.1.11 159 10/21/2023
1.1.10 159 10/21/2023
1.1.9 172 10/21/2023
1.1.8 344 10/20/2023
1.1.7 227 10/18/2023
1.1.6 163 10/18/2023
1.1.5 184 10/18/2023
1.1.4 159 10/18/2023
1.1.3 314 10/15/2023
1.1.2 169 10/15/2023
1.1.1 172 10/15/2023
1.1.0 176 10/15/2023
1.0.25 163 10/14/2023
1.0.24 154 10/14/2023
1.0.23 157 10/12/2023
1.0.22 160 10/11/2023
1.0.21 189 10/11/2023
1.0.20 161 10/10/2023
1.0.19 146 10/10/2023
1.0.18 234 10/9/2023
1.0.17 168 10/9/2023
1.0.16 190 10/8/2023
1.0.15 156 10/6/2023
1.0.14 151 10/6/2023
1.0.13 174 10/6/2023
1.0.12 145 10/4/2023
1.0.11 138 10/4/2023
1.0.10 162 10/2/2023
1.0.9 162 10/1/2023
1.0.8 180 10/1/2023
1.0.7 177 9/30/2023
1.0.6 149 9/28/2023
1.0.5 177 9/28/2023
1.0.4 150 9/27/2023
1.0.3 156 9/27/2023
1.0.2 166 9/27/2023
1.0.0 162 9/26/2023