concepts.pdsketch.parsers.pdsketch_parser.PDSketchTransformer#

class PDSketchTransformer[source]#

Bases: Transformer

The tree-to-object transformer for PDSketch domain and problem files. Users should not use this class directly.

Methods

action_controller(function_call)

action_definition(name, *defs)

action_definition2(name, extends, *defs)

action_effect(function_call)

action_instantiates(name)

action_name(name[, kwargs])

action_parameters(args)

action_precondition(function_call)

annotated_function_call(annotation, ...)

axiom_definition(decorator, vars, context, ...)

bool(v)

constant(name)

constants_definition(*args)

cspcommitflag(*args)

decorator_k(k)

decorator_kwarg(k[, v])

decorator_kwargs(args)

decorator_v(v)

definition_decl(definition_type, definition_name)

derived_definition(signature, expr)

derived_name(name[, kwargs])

derived_signature1(name, *args)

derived_signature2(name, *args)

ellipsis()

extended_macro_body(*body_statements)

extended_macro_definition(name, *defs)

extended_macro_effect(function_call)

extended_macro_name(name[, kwargs])

extended_macro_parameters(args)

extended_macro_precondition(function_call)

extends_definition(filename)

fancy_generator_definition(name, parameters, ...)

find_domain_file(filename)

float(v)

function_annotation(kwargs)

function_call(name, *args)

function_name(name[, kwargs])

generator_definition(name, parameters, ...)

generator_name(name[, kwargs])

goal_definition(function_call)

init_definition_item(function_call)

int(v)

list(*args)

list_construction(*args)

list_expansion(e, args)

list_object_type_name(dtype)

list_value_type_name(dtype)

macro_content(*body_statements)

macro_definition(signature, body)

macro_name(name[, kwargs])

macro_signature(name, *args)

method_name(predicate_name, _, method_name)

object_type_name(typedef)

object_type_name_unwrapped(typedef)

objects_definition(*constants)

pm_function_call(pm_sign, function_call)

pragma_definition(kwargs)

predicate_definition(name, *args)

predicate_definition2(name, *args)

predicate_group_definition(*args)

predicate_name(name[, kwargs])

quantified_function_call(quantifier, *args)

quantifiedvariable(quantifier, variable)

quantifier_name(name[, kwargs])

regression_body(*body_statements)

regression_definition(name, *defs)

regression_goal(function_call)

regression_name(name[, kwargs])

regression_parameters(args)

regression_precondition(function_call)

regression_side_effect(function_call)

simple_function_call(name, *args)

slot(_, name[, kwargs])

string(v)

transform(tree)

Transform the given tree, and return the final result

type_definition(args)

Parse a type definition.

type_name(name)

typedconstant(name, typename)

typedvariable(name, typename)

value_type_name(typedef)

value_type_name_unwrapped(typedef)

variable(name)

vector_type_name(dtype, dim, choices[, kwargs])

__init__(init_domain=None, allow_object_constants=True, ignore_unknown_predicates=False, domain_file_paths=tuple())[source]#
Parameters:
__mul__(other)#

Chain two transformers together, returning a new transformer.

Parameters:
  • self (Transformer)

  • other (Transformer | TransformerChain[_Leaf_U, _Return_V])

Return type:

TransformerChain[_Leaf_T, _Return_V]

__new__(**kwargs)#
action_controller(function_call)[source]#
action_definition(name, *defs)[source]#
action_definition2(name, extends, *defs)[source]#
action_effect(function_call)[source]#
action_instantiates(name)[source]#
action_name(name, kwargs=None)[source]#
action_parameters(args)[source]#
action_precondition(function_call)[source]#
annotated_function_call(annotation, function_call)[source]#
axiom_definition(decorator, vars, context, implies)[source]#
bool(v)[source]#
constant(name)[source]#
Return type:

ObjectConstant

constants_definition(*args)[source]#
cspcommitflag(*args)[source]#
decorator_k(k)[source]#
decorator_kwarg(k, v=True)[source]#
decorator_kwargs(args)[source]#
decorator_v(v)[source]#
definition_decl(definition_type, definition_name)[source]#
derived_definition(signature, expr)[source]#
derived_name(name, kwargs=None)[source]#
derived_signature1(name, *args)[source]#
derived_signature2(name, *args)[source]#
ellipsis()[source]#
extended_macro_body(*body_statements)[source]#
extended_macro_definition(name, *defs)[source]#
extended_macro_effect(function_call)[source]#
extended_macro_name(name, kwargs=None)[source]#
extended_macro_parameters(args)[source]#
extended_macro_precondition(function_call)[source]#
extends_definition(filename)[source]#
fancy_generator_definition(name, parameters, certifies)[source]#
find_domain_file(filename)[source]#
Parameters:

filename (str)

Return type:

str

float(v)[source]#
function_annotation(kwargs)[source]#
function_call(name, *args)[source]#
function_name(name, kwargs=None)[source]#
generator_definition(name, parameters, certifies, context, generates)[source]#
generator_name(name, kwargs=None)[source]#
goal_definition(function_call)[source]#
init_definition_item(function_call)[source]#
int(v)[source]#
list(*args)[source]#
list_construction(*args)[source]#
list_expansion(e, args)[source]#
list_object_type_name(dtype)[source]#
list_value_type_name(dtype)[source]#
macro_content(*body_statements)[source]#
macro_definition(signature, body)[source]#
macro_name(name, kwargs=None)[source]#
macro_signature(name, *args)[source]#
method_name(predicate_name, _, method_name)[source]#
object_type_name(typedef)[source]#
object_type_name_unwrapped(typedef)[source]#
objects_definition(*constants)[source]#
pm_function_call(pm_sign, function_call)[source]#
pragma_definition(kwargs)[source]#
predicate_definition(name, *args)[source]#
predicate_definition2(name, *args)[source]#
predicate_group_definition(*args)[source]#
predicate_name(name, kwargs=None)[source]#
quantified_function_call(quantifier, *args)[source]#
quantifiedvariable(quantifier, variable)[source]#
quantifier_name(name, kwargs=None)[source]#
regression_body(*body_statements)[source]#
regression_definition(name, *defs)[source]#
regression_goal(function_call)[source]#
regression_name(name, kwargs=None)[source]#
regression_parameters(args)[source]#
regression_precondition(function_call)[source]#
regression_side_effect(function_call)[source]#
simple_function_call(name, *args)[source]#
slot(_, name, kwargs=None)[source]#
string(v)[source]#
transform(tree)#

Transform the given tree, and return the final result

Parameters:

tree (Tree[_Leaf_T])

Return type:

_Return_T

type_definition(args)[source]#

Parse a type definition.

Very ugly hack to handle multi-line definition in PDDL. In PDDL, type definition can be separated by newline. This kinds of breaks the parsing strategy that ignores all whitespaces. More specifically, consider the following two definitions:

(:types
  a
  b - a
)

and

(:types
  a b - a
)
type_name(name)[source]#
typedconstant(name, typename)[source]#
typedvariable(name, typename)[source]#
value_type_name(typedef)[source]#
value_type_name_unwrapped(typedef)[source]#
variable(name)[source]#
Return type:

Variable

vector_type_name(dtype, dim, choices, kwargs=None)[source]#