concepts.pdsketch.strips.strips_grounded_expression.GSVariableAssignmentExpression#

class GSVariableAssignmentExpression[source]#

Bases: GSExpression, ABC

The base class for assignment expressions.

Methods

compile()

Compile the assignment expression into a function.

filter_propositions(propositions[, state])

Filter the propositions in this expression.

iter_propositions()

Iterate over all propositions that are used in this expression.

relax()

Relax the expression (a.k.a.

__init__()#
__new__(**kwargs)#
abstract compile()[source]#

Compile the assignment expression into a function. By default, the function will return the state with the add and delete effects applied.

Return type:

Callable[[SState], SState]

filter_propositions(propositions, state=None)[source]#

Filter the propositions in this expression. Only the propositions in the given set will be kept. Note that this function also takes a state as input, essentially, the state is the initial state of the environment, and the propositions contains all propositions that will be possibly changed by actions. Therefore, for propositions outside the propositions set, their value will stay as the same value as in the initial state. See, for example, the implementation for GSSimpleBoolExpression.filter_propositions() for more details.

Parameters:
  • propositions (SState | Set[str]) – the propositions that should be kept.

  • state (SState | None) – the initial state, default to None.

Returns:

the filtered expression.

Return type:

GSVariableAssignmentExpression

abstract iter_propositions()#

Iterate over all propositions that are used in this expression.

Return type:

Iterable[str]

abstract relax()[source]#

Relax the expression (a.k.a. delete relaxation).

Return type:

GSVariableAssignmentExpression | List[GSVariableAssignmentExpression]