Plan main:
    Execute go_to(green_ball)
    Execute pickup
    Execute left
    Execute drop
    Execute go_to(blue_key)
    Execute pickup
    Execute go_to(blue_door)
    Execute toggle
    Execute left
    Execute drop
    Execute go_to(green_key)
    Execute pickup
    Execute go_to(green_door)
    Execute toggle
    Execute right
    Execute drop
    Execute go_to(purple_ball)
    Execute pickup
    Execute right
    Execute drop

Effect main:
    if at(Wall) and A == forward:
        Reward 0
        S' -> S
    elif at(purple_door) and purple_door.is_locked and A == toggle and not carrying(purple_key):
        Reward 0
        S' -> S
    elif at(yellow_door) and yellow_door.is_locked and A == toggle and not carrying(yellow_key):
        Reward 0
        S' -> S
    elif at(red_door) and red_door.is_locked and A == toggle and not carrying(red_key):
        Reward 0
        S' -> S

Policy main:
    if reachable(grey_door) and carrying(grey_key) and grey_door.is_locked:
        if at(grey_door):
            Execute toggle
        else:
            Execute go_to(grey_door)

    elif reachable(purple_door) and carrying(purple_key) and purple_door.is_locked:
        if at(purple_door):
            Execute toggle
        else:
            Execute go_to(purple_door)

    elif reachable(yellow_door) and carrying(yellow_key) and yellow_door.is_locked:
        if at(yellow_door):
            Execute toggle
        else:
            Execute go_to(yellow_door)

    elif reachable(red_door) and carrying(red_key) and red_door.is_locked:
        if at(red_door):
            Execute toggle
        else:
            Execute go_to(red_door)
    
    elif reachable(goal):
        Execute go_to(goal)

