concepts.dm.pdsketch.strips.strips_expression.SSASExpression#

class SSASExpression[source]#

Bases: SValueOutputExpression

The representation of an SAS expression. The return value of the expression is an SAS index, therefore it can be represented as a dictionary, mapping from Boolean expressions to SAS indices. The execution procedure is to first evaluate all Boolean expressions, and then set the SAS index. Suggested implementation is:

for sas_index, expr in self.mappings.items():
    if evaluate(expr, state):
        return sas_index

Methods

ground(variable_dict[, state])

Return a new expression with all variables grounded according to the given variable dictionary.

iter_effect_predicates()

Iterate over the effect predicate names in the expression.

iter_precondition_predicates()

Iterate over the precondition predicate names in the expression.

Attributes

mappings

The mappings from SAS indices to Boolean expressions.

__init__(mappings)[source]#

Initialize an SAS expression.

Parameters:

mappings (Dict[int, SBoolOutputExpression]) – the mappings from SAS indices to Boolean expressions.

__new__(**kwargs)#
ground(variable_dict, state=None)[source]#

Return a new expression with all variables grounded according to the given variable dictionary.

Parameters:
iter_effect_predicates()#

Iterate over the effect predicate names in the expression.

Return type:

Iterable[str]

abstract iter_precondition_predicates()#

Iterate over the precondition predicate names in the expression.

Return type:

Iterable[str]

mappings: Dict[int, SBoolOutputExpression]#

The mappings from SAS indices to Boolean expressions.