#ifndef __PDDL_PARSE__AST_FORWARD_H #define __PDDL_PARSE__AST_FORWARD_H #include #include #include #include #include #include namespace pddl { //////////////////////////////////////////////////////////////////////////////////////////////////// // // AST Forward Declarations // //////////////////////////////////////////////////////////////////////////////////////////////////// namespace ast { //////////////////////////////////////////////////////////////////////////////////////////////////// // Primitives //////////////////////////////////////////////////////////////////////////////////////////////////// struct Constant; using ConstantPointer = std::unique_ptr; struct ConstantDeclaration; using ConstantDeclarationPointer = std::unique_ptr; using ConstantDeclarations = std::vector; struct Dummy; using DummyPointer = std::unique_ptr; struct PrimitiveType; using PrimitiveTypePointer = std::unique_ptr; using PrimitiveTypes = std::vector; struct PrimitiveTypeDeclaration; using PrimitiveTypeDeclarationPointer = std::unique_ptr; using PrimitiveTypeDeclarations = std::vector; struct Unsupported; using UnsupportedPointer = std::unique_ptr; struct Variable; using VariablePointer = std::unique_ptr; using Variables = std::vector; struct VariableDeclaration; using VariableDeclarationPointer = std::unique_ptr; using VariableDeclarations = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// // Compounds //////////////////////////////////////////////////////////////////////////////////////////////////// struct Predicate; using PredicatePointer = std::unique_ptr; using Predicates = std::vector; struct PredicateDeclaration; using PredicateDeclarationPointer = std::unique_ptr; using PredicateDeclarations = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// // Expressions //////////////////////////////////////////////////////////////////////////////////////////////////// template struct And; template using AndPointer = std::unique_ptr>; template struct At; template using AtPointer = std::unique_ptr>; template struct Either; template using EitherPointer = std::unique_ptr>; template struct Exists; template using ExistsPointer = std::unique_ptr>; template struct ForAll; template using ForAllPointer = std::unique_ptr>; template struct Imply; template using ImplyPointer = std::unique_ptr>; template struct Not; template using NotPointer = std::unique_ptr>; template struct Or; template using OrPointer = std::unique_ptr>; template struct When; template using WhenPointer = std::unique_ptr>; //////////////////////////////////////////////////////////////////////////////////////////////////// // PDDL Structure //////////////////////////////////////////////////////////////////////////////////////////////////// struct Action; using ActionPointer = std::unique_ptr; using Actions = std::vector; struct Description; using DescriptionPointer = std::unique_ptr; struct Domain; using DomainPointer = std::unique_ptr; struct Problem; using ProblemPointer = std::unique_ptr; enum class Requirement; using Requirements = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// // Variants //////////////////////////////////////////////////////////////////////////////////////////////////// namespace detail { using TermT = Variant< ConstantPointer, VariablePointer>; } class Term : public detail::TermT { using detail::TermT::TermT; }; using Terms = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// namespace detail { using AtomicFormulaT = Variant< PredicatePointer, UnsupportedPointer>; } class AtomicFormula : public detail::AtomicFormulaT { using detail::AtomicFormulaT::AtomicFormulaT; }; //////////////////////////////////////////////////////////////////////////////////////////////////// class Precondition; namespace detail { using PreconditionT = Variant< AtomicFormula, AndPointer, ExistsPointer, ForAllPointer, ImplyPointer, NotPointer, OrPointer, UnsupportedPointer>; } class Precondition : public detail::PreconditionT { using detail::PreconditionT::PreconditionT; }; using Preconditions = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// class ConditionalEffect; namespace detail { using ConditionalEffectT = Variant< AtomicFormula, AndPointer, NotPointer, UnsupportedPointer>; } class ConditionalEffect : public detail::ConditionalEffectT { using detail::ConditionalEffectT::ConditionalEffectT; }; //////////////////////////////////////////////////////////////////////////////////////////////////// class Effect; namespace detail { using EffectT = Variant< AtomicFormula, AndPointer, ForAllPointer, NotPointer, WhenPointer, UnsupportedPointer>; } class Effect : public detail::EffectT { using detail::EffectT::EffectT; }; //////////////////////////////////////////////////////////////////////////////////////////////////// namespace detail { using TypeT = Variant< EitherPointer, PrimitiveTypePointer>; } class Type : public detail::TypeT { using detail::TypeT::TypeT; }; //////////////////////////////////////////////////////////////////////////////////////////////////// namespace detail { using LiteralT = Variant< AtomicFormula, NotPointer>; } class Literal : public detail::LiteralT { using detail::LiteralT::LiteralT; }; using Literals = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// class Fact; namespace detail { using FactT = Variant< AtomicFormula, AtPointer, NotPointer>; } class Fact : public detail::FactT { using detail::FactT::FactT; }; using Facts = std::vector; //////////////////////////////////////////////////////////////////////////////////////////////////// using Goal = Precondition; //////////////////////////////////////////////////////////////////////////////////////////////////// } } #endif