def bind_action_plan(opt_plan, mapping): fn = lambda o: mapping.get(o, o) new_action_plan = [ transform_action_args(action, fn) for action in opt_plan.action_plan ] new_preimage_facts = frozenset( replace_expression(fact, fn) for fact in opt_plan.preimage_facts) return OptPlan(new_action_plan, new_preimage_facts)
def obj_from_existential_expression(parent): # obj_from_value_expression return replace_expression(parent, lambda o: OptimisticObject .from_opt(o, o) if is_parameter(o) else Object.from_value(o))
def obj_from_existential_expression(parent): # obj_from_value_expression return replace_expression(parent, parse_value)