concepts.dm.pdsketch.strips.strips_grounded_expression.GSSASAssignExpression#
- class GSSASAssignExpression[source]#
Bases:
GSVariableAssignmentExpression
A SAS assignment expression. It is represented as the name for the SAS predicate, the size of the SAS predicate, a list of assignments, and a mapping from Boolean expressions to integers (the value of the SAS assignment).
Methods
compile
()Compile the SAS assignment expression to a function.
filter_propositions
(propositions[, state])Filter the propositions in this expression.
Iterate over all propositions that are used in this expression.
relax
()Delete relaxation of a SAS assignment.
Convert the SAS assignment to a list of conditional assignments.
Attributes
The name of the SAS predicate.
The size of the SAS predicate.
The arguments of the SAS predicate.
A string format for the arguments of the SAS predicate.
All the Boolean propositions of the SAS predicate.
All the negated Boolean propositions of the SAS predicate.
The expressions for SAS assignments, which is a mapping from integers to Boolean expressions.
- __init__(sas_name, sas_size, arguments, expression)[source]#
Initialize the SAS assignment expression.
- __new__(**kwargs)#
- compile()[source]#
Compile the SAS assignment expression to a function.
Warning
This method is deprecated and will be removed in the future. Use the
to_conditional_assignments()
orrelax()
methods instead.
- 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:
- Returns:
the filtered expression.
- Return type:
- relax()[source]#
Delete relaxation of a SAS assignment. Essentially, it removes all delete effects for the inner simple assignment expression. Note that this method returns a list of conditional assignments, instead of a single SASAssignment.
- Returns:
a list of delete-relaxed SAS assignment expression.
- Return type:
- to_conditional_assignments()[source]#
Convert the SAS assignment to a list of conditional assignments.
- Returns:
a list of conditional assignments.
- Return type:
- expression: Dict[int, GSBoolOutputExpression]#
The expressions for SAS assignments, which is a mapping from integers to Boolean expressions.