#Policy main:   # This is a policy for DoorKey
#    if yellow_key.x != -1:
#        if not at(yellow_key):
#            Execute go_to_policy(yellow_key)
#        else:
#            Execute pickup

#Policy main:
#    if yellow_door.is_open:
#        Execute go_to(goal)
#    elif carrying(yellow_key):
#        Execute toggle


#Policy main:
#    if not in_inventory(yellow_key):
#        Execute step_towards(yellow_key)
#    else:
#        if not yellow_door.is_open:
#            Execute toggle


Plan main:  # This is a (better) plan for DoorKey
    Execute go_to(yellow_key)
    Execute pickup
    Execute go_to(yellow_door)
    Execute toggle
    Execute go_to(goal)

Effect main:
    if at(yellow_door) and A == toggle and carrying(yellow_key) and not yellow_door.is_open:
        yellow_door.is_open' -> True
        S' -*> S
    Reward 0

Policy main:
    if reachable(goal):
        Execute go_to(goal)
