Documentation
¶
Overview ¶
Package pddl provides a parser for PDDL (Planning Domain Definition Language) files. It supports STRIPS with :typing and :equality requirements as well as ADL features including :disjunctive-preconditions, :conditional-effects, :quantified-preconditions, and :derived-predicates. The parser handles universal and existential quantifiers (forall, exists), implication, disjunction (or), conditional effects (when), and derived predicate axioms. Parsed ASTs are converted to graphplan Formula trees and 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 AndFormulaAST
- type AtomFormulaAST
- type DerivedAST
- type DomainAST
- type ExistsFormulaAST
- type ForallFormulaAST
- type FormulaAST
- type ImplyFormulaAST
- type Lexer
- type LiteralAST
- type OrFormulaAST
- type ParseError
- type PredicateAST
- type ProblemAST
- type Token
- type TokenKind
- type TypedList
- type WhenFormulaAST
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
Precondition FormulaAST
Effect FormulaAST
Params []TypedList
}
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 AndFormulaAST ¶ added in v0.2.2
type AndFormulaAST struct {
Children []FormulaAST
}
AndFormulaAST is a parsed conjunction.
type AtomFormulaAST ¶ added in v0.2.2
AtomFormulaAST is a parsed atomic predicate.
type DerivedAST ¶ added in v0.2.2
type DerivedAST struct {
Body FormulaAST
Name string
Params []TypedList
}
DerivedAST is a parsed derived predicate axiom.
type DomainAST ¶
type DomainAST struct {
Name string
Requirements []string
Types []TypedList
Constants []TypedList
Predicates []PredicateAST
Actions []ActionAST
Derived []DerivedAST
}
DomainAST is the parsed form of a PDDL domain.
func ParseDomain ¶
ParseDomain parses a PDDL domain definition and returns the corresponding AST.
type ExistsFormulaAST ¶ added in v0.2.2
type ExistsFormulaAST struct {
Body FormulaAST
Vars []TypedList
}
ExistsFormulaAST is a parsed existential quantifier.
type ForallFormulaAST ¶ added in v0.2.2
type ForallFormulaAST struct {
Body FormulaAST
Vars []TypedList
}
ForallFormulaAST is a parsed universal quantifier.
type FormulaAST ¶ added in v0.2.2
type FormulaAST interface {
// contains filtered or unexported methods
}
FormulaAST is the parsed representation of a logical formula.
type ImplyFormulaAST ¶ added in v0.2.2
type ImplyFormulaAST struct {
Antecedent FormulaAST
Consequent FormulaAST
}
ImplyFormulaAST is a parsed implication.
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 OrFormulaAST ¶ added in v0.2.2
type OrFormulaAST struct {
Children []FormulaAST
}
OrFormulaAST is a parsed disjunction.
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
Goal FormulaAST
Objects []TypedList
Init []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.
type WhenFormulaAST ¶ added in v0.2.2
type WhenFormulaAST struct {
Condition FormulaAST
Effect FormulaAST
}
WhenFormulaAST is a parsed conditional effect.
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. |