concepts.pdsketch.strips.strips_grounded_expression.gs_compose_bool_expressions#
- gs_compose_bool_expressions(expressions, is_disjunction=False, propagate_implicit_propositions=True)[source]#
Compose a list of Boolean expressions into a single expression, by taking the conjunction or disjunction of them. This function will automatically handles possible merging of simple expressions to reduce the complexity of the final expression. For example, if we are taking the conjunction of two simple conjunctive expressions, then the two expressions will be merged into one single conjunction.
This function takes an additional argument propagate_implicit_propositions, which controls whether the implicit propositions should be propagated to the final expression. Specifically, when propagate_implicit_propositions is set to True, the argument expression should be a list of tuples, where the first element is the Boolean expression and the second element is the set of implicit propositions. In this case, the return will also be a tuple, where the first element is the final expression and the second element is the set of implicit propositions.
When propagate_implicit_propositions is set to False, the argument expression should be a list of Boolean expressions, and the return is also a single Boolean expression.
- Parameters:
expressions (Sequence[Tuple[GSBoolOutputExpression, Set[str]]] | Sequence[GSBoolOutputExpression]) – a list of Boolean expressions.
is_disjunction (bool | None) – whether to take disjunction of the expressions, default to False (conjunction).
propagate_implicit_propositions (bool) – whether to keep the implicit propositions in the final expression, default to True.
- Return type:
Tuple[GSBoolOutputExpression, Set[str]] | GSBoolOutputExpression