concepts.dm.pdsketch.domain.Problem#

class Problem[source]#

Bases: object

The representation for a planning problem. It contains the set of objects, a inital state (a set of propositions), and a goal expression.

Methods

add_object(name, typename)

Add an object to the problem.

add_proposition(proposition)

Add a proposition to the initial problem.

set_goal(goal)

Set the goal of the problem.

to_state(executor)

Convert the problem to a State object.

Attributes

objects

The set of objects, which are mappings from object names to object type names.

predicates

The initial state, which is a set of propositions.

goal

The goal expression.

__init__(domain=None)[source]#

Initialize the problem.

Parameters:

domain (Domain | None)

__new__(**kwargs)#
add_object(name, typename)[source]#

Add an object to the problem.

Parameters:
  • name (str) – the name of the object.

  • typename (str) – the type of the object.

add_proposition(proposition)[source]#

Add a proposition to the initial problem.

Parameters:

proposition (FunctionApplicationExpression) – the proposition to add.

set_goal(goal)[source]#

Set the goal of the problem.

Parameters:

goal (ValueOutputExpression) – the goal expression.

to_state(executor)[source]#

Convert the problem to a State object.

Parameters:

executor (PDSketchExecutor) – the executor to use to instantiate the state.

Returns:

the state object.

Return type:

State

goal: ValueOutputExpression | None#

The goal expression.

objects: Dict[str, str]#

The set of objects, which are mappings from object names to object type names.

predicates: List[FunctionApplicationExpression]#

The initial state, which is a set of propositions.