concepts.pdsketch.strips.strips_grounding.GStripsTranslatorOptimistic#
- class GStripsTranslatorOptimistic[source]#
Bases:
GStripsTranslatorBase
Methods
compile_derived_predicate
(dp, state[, ...])compile_expr
(expr, state)compile_operator
(op, state[, is_relaxed])compile_regression_rule
(op, state)compile_state
(state[, forward_derived])compile_task
(state, goal_expr[, actions, ...])Compile a grounded STRIPS task.
compose_bool_expression
(expr[, negated])compose_grounded_assignment
(assignments[, ...])compose_grounded_predicate
(predicate_app[, ...])define_grounded_predicate
(name[, modifier])Allocate a new identifier for the predicate (with modifier).
get_grounded_predicate_indentifier
(name[, ...])recompile_relaxed_task
(task[, ...])Recompile a task to a delete-relaxed task.
recompile_task_new_state
(task, new_state[, ...])Compile a new GStripsTask from a new state.
relevance_analysis
(task[, ...])Attributes
The domain.
The executor for the domain.
The mapping from predicate names to index.
- __init__(executor, use_string_name=True, prob_goal_threshold=0.5, use_derived_predicates=False, use_regression_rules=True)#
- Parameters:
executor (PDSketchExecutor)
use_string_name (bool)
prob_goal_threshold (float)
use_derived_predicates (bool)
use_regression_rules (bool)
- __new__(**kwargs)#
- compile_expr(expr, state)[source]#
- Parameters:
expr (str | Expression)
state (State)
- Return type:
- compile_operator(op, state, is_relaxed=False)[source]#
- Parameters:
op (OperatorApplier)
state (State)
- Return type:
- compile_task(state, goal_expr, actions=None, regression_rules=None, is_relaxed=False, forward_relevance_analysis=True, backward_relevance_analysis=True, verbose=False)#
Compile a grounded STRIPS task.
- Parameters:
state (State) – the initial state.
goal_expr (str | Expression) – the goal expression.
actions (Sequence[OperatorApplier] | None) – the list of actions. If not specified, all actions in the domain will be used.
regression_rules (Sequence[RegressionRuleApplier] | None) – the list of regression rules. If not specified, all regression rules in the domain will be used.
is_relaxed (bool) – whether the task is a delete-relaxed task.
forward_relevance_analysis (bool) – whether to perform forward relevance analysis.
backward_relevance_analysis (bool) – whether to perform backward relevance analysis.
verbose (bool) – whether to print verbose information.
- Returns:
the compiled task.
- Return type:
- compose_bool_expression(expr, negated=False)[source]#
- Parameters:
expr (ValueOutputExpression)
negated (bool)
- Return type:
Tuple[GSBoolOutputExpression | GSOptimisticStaticObjectType, Set[str]]
- compose_grounded_assignment(assignments, is_relaxed=False)[source]#
- Parameters:
assignments (Sequence[VariableAssignmentExpression])
is_relaxed (bool)
- Return type:
- compose_grounded_predicate(predicate_app, negated=False, optimistic=None, allow_set=False, return_argument_indices=False)[source]#
- define_grounded_predicate(name, modifier=None)#
Allocate a new identifier for the predicate (with modifier).
- get_grounded_predicate_indentifier(name, modifier=None)#
- recompile_relaxed_task(task, forward_relevance_analysis=True, backward_relevance_analysis=True)#
Recompile a task to a delete-relaxed task.
- Parameters:
task (GStripsProblem) – the task to be recompiled.
forward_relevance_analysis (bool) – whether to perform forward relevance analysis.
backward_relevance_analysis (bool) – whether to perform backward relevance analysis.
- Returns:
the recompiled task.
- Return type:
- recompile_task_new_state(task, new_state, forward_relevance_analysis=True, backward_relevance_analysis=True, forward_derived=False)#
Compile a new GStripsTask from a new state.
- Parameters:
task (GStripsProblem) – the original task.
forward_relevance_analysis (bool) – whether to perform forward relevance analysis. Defaults to True.
backward_relevance_analysis (bool) – whether to perform backward relevance analysis. Defaults to True.
forward_derived (bool) – whether to forward derived predicates. Defaults to False.
- Returns:
the new task.
- Return type:
- relevance_analysis(task, relaxed_relevance=False, forward=True, backward=True)[source]#
- Parameters:
task (GStripsProblem)
relaxed_relevance (bool)
forward (bool)
backward (bool)
- Return type:
- property executor: PDSketchExecutor#
The executor for the domain.