Source: system

You will be given an instruction describing a task to perform in a house and a set of propositions that define whether the task was done successfully. The task instruction may say that certain propositions should be completed before others ("then", "after", "finally"). Your job is to write python code that defines groups of propositions and the order in which they should be completed.

The propositions are well-defined python functions that return a boolean value.

You will be given a list of propositions where index i corresponds to the ith proposition. To solve the task, define the variable proposition_order, which groups propositions together that can be completed in any order. Each proposition group appearing in proposition_order must be satisfied before the group that comes after it. For example,

proposition_order = [
    [0, 1]
]

means that propositions 0 and 1 can be completed in any order. This example

proposition_order = [
    [0],
    [1]
]

means that the proposition 0 must be completed before proposition 1. This example

proposition_order = [
    [0, 1],
    [2]
]

means that propositions 0 and 1 can be completed in either order, but proposition 2 must be completed after.

Start by assuming that propositions can be completed in any order. If the instruction includes time ordering words such as "then", "next", "finally", or "after", then order matters and propositions should be in multiple groups.

Double check that the index for each proposition is included in proposition_order.

<step> Source: user

Instruction: "Bring an apple and an orange to the kitchen table."

propositions = [
    is_on_top(["apple_1"], ["table_4"]),
    is_on_top(["orange_1"], ["table_4"])
]

<step> Source: assistant

proposition_order = [
    [0, 1]
]

<step> Source: user

Instruction: "Put the toy vehicle in the living room and return the dish to the kitchen."

propositions = [
    is_in_room(["toy_truck_1"], ["living_room_1"]),
    is_in_room(["bowl_2"], ["kitchen"])
]

<step> Source: assistant

proposition_order = [
    [0, 1]
]

<step> Source: user

Instruction: "Put an apple on the bench in the entryway and move the broom to the closet."

propositions = [
    is_on_top(["apple_0", "apple_1"], ["bench_2"]),
    is_inside(["broom_0"], ["closet_0"])
]

<step> Source: assistant

proposition_order = [
    [0, 1]
]

<step> Source: user

Instruction: "Bring me the toy truck from the bedroom and put it in the living room. Then put an apple on the kitchen table."

propositions = [
    is_in_room(["toy_truck_1"], ["living_room_1"]),
    is_on_top(["apple_1", "apple_2"], ["table_1"])
]

<step> Source: assistant

proposition_order = [
    [0],
    [1]
]


<step> Source: user

Instruction: "Bring the dishes back to the kitchen counter. After that, put the cushion on the bed."

propositions = [
    is_on_top(["plate_1"], ["counter_1", "counter_2", "counter_3"]),
    is_on_top(["fork_1"], ["counter_1", "counter_2", "counter_3"]),
    is_on_top(["cushion_1"], ["bed_1", "bed_2"]),
]

<step> Source: assistant

proposition_order = [
    [0, 1],
    [2]
]

<step> Source: user

Instruction: "Bring the dishes back to the kitchen counter. Put the cushion on the bed."

propositions = [
    is_on_top(["plate_1"], ["counter_1", "counter_2", "counter_3"]),
    is_on_top(["fork_1"], ["counter_1", "counter_2", "counter_3"]),
    is_on_top(["cushion_1"], ["bed_1", "bed_2"]),
]

<step> Source: assistant

proposition_order = [
    [0, 1, 2]
]

<step> Source: user

Instruction: "Move the clothes from the bedroom to the washer. After that, Put the cushion on the bed. Finally, put the book in the living room."

propositions = [
    is_on_top(["shirt_1"], ["washer_dryer_1"]),
    is_on_top(["shirt_2"], ["washer_dryer_1"]),
    is_on_top(["pants_1"], ["washer_dryer_1"]),
    is_on_top(["cushion_1"], ["bed_1", "bed_2"]),
    is_in_room(["book_1"], ["living_room_1"])
]

<step> Source: assistant

proposition_order = [
    [0, 1, 2],
    [3],
    [4]
]

<step> Source: user

Instruction: "{INSTRUCTION}"

{PROPOSITIONS}

<step> Source: assistant
Destination: user

proposition_order = [