concepts.dm.pdsketch.strips.strips_grounded_expression.GSExpression#

class GSExpression[source]#

Bases: ABC

The base class for all grounded STRIPS expressions.

Methods

compile()

Compile the expression into a function that takes a state as input and returns a boolean value.

filter_propositions(propositions[, state])

Filter the propositions in this expression.

iter_propositions()

Iterate over all propositions that are used in this expression.

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

Compile the expression into a function that takes a state as input and returns a boolean value.

Return type:

Callable[[SState], Any]

abstract 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:

GSExpression

abstract iter_propositions()[source]#

Iterate over all propositions that are used in this expression.

Return type:

Iterable[str]