Your task is to translate natural language advice to RLang polciy, which is a direct function from states to actions. For each instance, we provide a piece of advice in natural language, a list of allowed primitives, and you should complete the instance by filling the missing policy function. Don't use any primitive outside the provided primitive list corresponding to each instance, e.g., if there is no 'green_door' in the primitive list you must not use 'green_door' for the policy function.

Advice = "If the yellow door is open, go through it and walk to the goal. Otherwise open the yellow door if you have the key."
Primitives = ['Agent', 'Wall', 'GoalTile', 'Lava', 'Key', 'Door', 'Box', 'Ball', 'left', 'right', 'forward', 'pickup', 'drop', 'toggle', 'done', 'pointing_right', 'pointing_down', 'pointing_left', 'pointing_up', 'go_to', 'step_towards', 'yellow_key', 'yellow_door', 'agent', 'goal', 'is_on_a', 'at', 'carrying']
Policy main:
    if yellow_door.is_open:
        Execute go_to(goal)
    elif carrying(yellow_key) and at(yellow_door) and not yellow_door.is_open:
        Execute toggle

Advice = "If you don't have the key, go get it"
Primitives = ['Agent', 'Wall', 'GoalTile', 'Lava', 'Key', 'Door', 'Box', 'Ball', 'left', 'right', 'forward', 'pickup', 'drop', 'toggle', 'done', 'pointing_right', 'pointing_down', 'pointing_left', 'pointing_up', 'go_to', 'step_towards', 'grey_key', 'red_door', 'grey_door', 'agent', 'purple_ball', 'is_on_a', 'at', 'carrying']
Policy main:
    if at(grey_key):
        Execute pickup
    elif not carrying(grey_key):
        Execute go_to(grey_key)

Advice = "If you are carrying a ball and its corresponding box is closed, open the box if you are at it, otherwise go to the box if you can reach it."
Primitives = ['Agent', 'Wall', 'GoalTile', 'Lava', 'Key', 'Door', 'Box', 'Ball', 'left', 'right', 'forward', 'pickup', 'drop', 'toggle', 'done', 'pointing_right', 'pointing_down', 'pointing_left', 'pointing_up', 'go_to', 'step_towards', 'green_ball', 'green_box', 'purple_box', 'agent', 'purple_ball', 'is_on_a', 'at', 'reachable', 'carrying']
Policy main:
    if carrying(green_ball) and not green_box.is_open:
        if at(green_box):
            Execute toggle
        elif reachable(green_box):
            Execute go_to(green_box)

    elif carrying(purple_ball) and not purple_box.is_open:
        if at(purple_box):
            Execute toggle
        elif reachable(purple_box):
            Execute go_to(purple_box)

Advice = "Drop any balls for boxes you can't reach"
Primitives = ['Agent', 'Wall', 'GoalTile', 'Lava', 'Key', 'Door', 'Box', 'Ball', 'left', 'right', 'forward', 'pickup', 'drop', 'toggle', 'done', 'pointing_right', 'pointing_down', 'pointing_left', 'pointing_up', 'go_to', 'step_towards', 'green_ball', 'green_box', 'purple_box', 'agent', 'purple_ball', 'is_on_a', 'at', 'reachable', 'carrying']
Policy main:
    if carrying(green_ball) and not reachable(green_box):
        Execute drop

    if carrying(purple_ball) and not reachable(purple_box):
        Execute drop

Advice = "if you have any key for a door that you cannot reach, you should drop it"
Primitives = ['Agent', 'Wall', 'GoalTile', 'Lava', 'Key', 'Door', 'Box', 'Ball', 'left', 'right', 'forward', 'pickup', 'drop', 'toggle', 'done', 'pointing_right', 'pointing_down', 'pointing_left', 'pointing_up', 'go_to', 'step_towards', 'red_door', 'green_key', 'green_door', 'purple_key', 'agent', 'purple_door', 'red_key','is_on_a', 'at', 'reachable', 'carrying']
Policy main:
    if carrying(green_key) and not reachable(green_door):
        Execute drop

    if carrying(purple_key) and not reachable(purple_door):
        Execute drop

    if carrying(red_key) and not reachable(red_door):
        Execute drop

Advice = "Hey listen, you can open the door if you have the key and at the door when the door is closed"
Primitives = ['Agent', 'Wall', 'GoalTile', 'Lava', 'Key', 'Door', 'Box', 'Ball', 'left', 'right', 'forward', 'pickup', 'drop', 'toggle', 'done', 'pointing_right', 'pointing_down', 'pointing_left', 'pointing_up', 'go_to', 'step_towards', 'purple_door', 'agent', 'purple_key','is_on_a', 'at', 'reachable', 'carrying']
Policy main:
    if carrying(purple_key) and not purple_door.is_open and at(purple_door):
        Execute toggle