Documentation
¶
Overview ¶
Package pddl provides a parser for PDDL (Planning Domain Definition Language) files. It supports the STRIPS subset with :typing and :equality requirements, and converts parsed ASTs to graphplan domain types.
Index ¶
- func ConvertDomain(ast *DomainAST) (*graphplan.Domain, error)
- func ConvertProblem(ast *ProblemAST, domain *graphplan.Domain) (*graphplan.Problem, error)
- type ActionAST
- type Adapter
- type DomainAST
- type Lexer
- type LiteralAST
- type ParseError
- type PredicateAST
- type ProblemAST
- type Token
- type TokenKind
- type TypedList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDomain ¶
ConvertDomain converts a DomainAST into a graphplan.Domain.
func ConvertProblem ¶
ConvertProblem converts a ProblemAST into a graphplan.Problem, linking it to the given domain.
Types ¶
type ActionAST ¶
type ActionAST struct {
Name string
Params []TypedList
Preconditions []LiteralAST
Effects []LiteralAST
}
ActionAST is a parsed action schema.
type Adapter ¶
type Adapter struct{}
Adapter wraps the PDDL parse and convert pipeline into single-call methods.
Pattern: Adapter -- translates PDDL parse/convert two-step into single-call interfaces.
func (*Adapter) ParseDomain ¶
ParseDomain parses a PDDL domain string and converts it to a graphplan.Domain.
type DomainAST ¶
type DomainAST struct {
Name string
Requirements []string
Types []TypedList
Constants []TypedList
Predicates []PredicateAST
Actions []ActionAST
}
DomainAST is the parsed form of a PDDL domain.
func ParseDomain ¶
ParseDomain parses a PDDL domain definition and returns the corresponding AST.
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer tokenizes PDDL input. It handles comments (;), parentheses, keywords (:keyword), variables (?var), dashes, and bare names.
type LiteralAST ¶
LiteralAST is a predicate application, possibly negated.
type ParseError ¶
ParseError reports a syntax error with position.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
Error implements the error interface.
type PredicateAST ¶
PredicateAST is a predicate declaration.
type ProblemAST ¶
type ProblemAST struct {
Name string
Domain string
Objects []TypedList
Init []LiteralAST
Goal []LiteralAST
}
ProblemAST is the parsed form of a PDDL problem.
func ParseProblem ¶
func ParseProblem( input string, ) (*ProblemAST, error)
ParseProblem parses a PDDL problem definition and returns the corresponding AST.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
parse_rocket
command
Command parse_rocket parses the rocket PDDL files and prints the resulting domain and problem.
|
Command parse_rocket parses the rocket PDDL files and prints the resulting domain and problem. |