
----PROMPT for planning----
from actions import turnright, turnleft, walkforward, walktowards <obj>, walk <obj>, run <obj>, grab <obj>, switchon <obj>, switchoff <obj>, open <obj>, close <obj>, lookat <obj>, sit <obj>, standup, find <obj>, turnto <obj>, drink <obj>, pointat <obj>, watch <obj>, putin <obj> <obj>, putback <obj> <obj>

objects = ['wineglass', 'garbagecan', 'orchid', 'bathtub', 'breadslice', 'wallphone', 'closet', 'bathroomcabinet', 'towelrack', 'photoframe', 'faucet', 'kitchencounter', 'cabinet', 'stovefan', 'peach', 'clothesshirt', 'wallpictureframe', 'towel', 'lime', 'bathroomcounter', 'toilet', 'kitchencounterdrawer', 'barsoap', 'cellphone', 'bellpepper', 'microwave', 'curtains', 'window', 'rug', 'facecream', 'whippedcream', 'creamybuns', 'dishwashingliquid', 'tablelamp', 'floor', 'bench', 'paper', 'condimentshaker', 'ceiling', 'crackers', 'nightstand', 'folder', 'kitchencabinet', 'bed', 'computer', 'plate', 'deodorant', 'waterglass', 'chocolatesyrup', 'powersocket', 'bedroom', 'livingroom', 'coffeemaker', 'coffeetable', 'toothpaste', 'kitchentable', 'tv', 'cereal', 'apple', 'clothespants', 'candle', 'keyboard', 'sink', 'washingsponge', 'sofa', 'clothespile', 'wallshelf', 'door', 'lightswitch', 'plum', 'tvstand', 'hairproduct', 'mousemat', 'bananas', 'fryingpan', 'mouse', 'box', 'salmon', 'bookshelf', 'stall', 'closetdrawer', 'slippers', 'doorjamb', 'chips', 'clock', 'cupcake', 'chair', 'kitchen', 'radio', 'cutleryknife', 'candybar', 'desk', 'wall', 'washingmachine', 'pillow', 'walllamp', 'painkillers', 'toaster', 'mug', 'pie', 'bathroom', 'coffeepot', 'oventray', 'ceilinglamp', 'stove', 'fridge', 'remotecontrol', 'cutleryfork', 'dishbowl', 'cpuscreen', 'condimentbottle', 'perfume', 'book', 'hanger', 'toothbrush']

def put_the_wine_glass_in_the_kitchen_cabinet():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find wine glass
	find('wineglass')
	# 2: grab wine glass
	assert('close' to 'wineglass')
		else: find('wineglass')
	grab('wineglass')
	# 3: find kitchen cabinet
	find('kitchencabinet')
	# 4: open kitchen cabinet
	assert('close' to 'kitchencabinet' )  
		else: find('kitchencabinet')
	assert('kitchencabinet' is 'closed' )
		else: close('kitchencabinet')
	open('kitchencabinet')
	# 5: put wine glass in kitchen cabinet
	assert('wineglass' in 'hands' )
		else: find('wineglass')
		else: grab('wineglass')
	assert('close' to 'kitchencabinet' )  
		else: find('kitchencabinet')
	assert('kitchencabinet' is 'opened' )
		else: open('kitchencabinet')
	putin('wineglass', 'kitchencabinet')
	# 6: close kitchen cabinet
	assert('close' to 'kitchencabinet' )
		else: find('kitchencabinet')
	assert('kitchencabinet' is 'opened' )
		else: open('kitchencabinet')
	close('kitchencabinet')
	# 7: Done

def throw_away_the_lime():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find garbage can
	find('garbagecan')
	# 2: grab lime
	find('lime')
	assert('close' to 'lime')
		else: find('lime')
	grab('lime')
	# 3: put lime in garbage can
	find('garbagecan')
	assert('close' to 'garbagecan' )  
		else: find('garbagecan')
	assert('garbagecan' is 'closed' )
		else: close('garbagecan')
	open('garbagecan')
	assert('lime' in 'hands' )
		else: find('lime')
		else: grab('lime')
	assert('close' to 'garbagecan' )  
		else: find('garbagecan')
	assert('garbagecan' is 'opened' )
		else: open('garbagecan')
	putin('lime', 'garbagecan')
	assert('close' to 'garbagecan' )
		else: find('garbagecan')
	assert('garbagecan' is 'opened' )
		else: open('garbagecan')
	close('garbagecan')
	# 4: Done

def wash_mug():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find sink
	find('sink')
	# 2: turn on faucet
	find('faucet')
	find('faucet')
	find('faucet')
	assert('close' to 'faucet' )  
		else: find('faucet')
	assert('faucet' is 'switchoff' )
		else: switchoff('faucet')
	switchon('faucet')
	# 3: put mug under water
	find('mug')
	find('mug')
	find('mug')
	assert('close' to 'mug')
		else: find('mug')
	grab('mug')
	find('sink')
	assert('mug' in 'hands' )
		else: find('mug')
		else: grab('mug')
	assert('close' to 'sink' )  
		else: find('sink')
	putin('mug', 'sink')
	# 4: grab dishwashing liquid
	find('dishwashingliquid')
	assert('close' to 'dishwashingliquid')
		else: find('dishwashingliquid')
	grab('dishwashingliquid')
	# 5: put dishwashing liquid on mug
	find('sink')
	assert('dishwashingliquid' in 'hands' )
		else: find('dishwashingliquid')
		else: grab('dishwashingliquid')
	assert('close' to 'sink' )  
		else: find('sink')
	putin('dishwashingliquid', 'sink')
	# 6: grab washingsponge
	find('washingsponge')
	assert('close' to 'washingsponge')
		else: find('washingsponge')
	grab('washingsponge')
	# 7: start scrubbing mug
	find('sink')
	assert('washingsponge' in 'hands' )
		else: find('washingsponge')
		else: grab('washingsponge')
	assert('close' to 'sink' )  
		else: find('sink')
	putin('washingsponge', 'sink')
	# 8: rinse mug off with water 1
	# 9: dry mug with towel 1
	# 10: Done
	find('faucet')
	assert('close' to 'faucet' )
		else: find('faucet')
	assert('faucet' is 'switchon' )
		else: switchon('faucet')
	switchoff('faucet')

def refrigerate_the_salmon():
	# 0: I would go to the kitchen and find the salmon.
	find('kitchen')
	find('salmon')
	# 1: I would take the salmon and put it in the fridge.
	assert('close' to 'salmon')
		else: find('salmon')
	grab('salmon')
	find('fridge')
	assert('close' to 'fridge' )  
		else: find('fridge')
	assert('fridge' is 'closed' )
		else: close('fridge')
	open('fridge')
	assert('salmon' in 'hands' )
		else: find('salmon')
		else: grab('salmon')
	assert('close' to 'fridge' )  
		else: find('fridge')
	assert('fridge' is 'opened' )
		else: open('fridge')
	putin('salmon', 'fridge')
	# 2: I would close the fridge.
	assert('close' to 'fridge' )
		else: find('fridge')
	assert('fridge' is 'opened' )
		else: open('fridge')
	close('fridge')
	# 3: Done

def bring_me_some_fruit():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find fruit
	find('bananas')
	# 2: grab fruit
	assert('close' to 'bananas')
		else: find('bananas')
	grab('bananas')
	# 3: bring fruit to you
	find('livingroom')
	# 4: Done

def wash_clothes():
	# 0: walk to laundry room
	walk('bathroom')
	# 1: find washing machine
	find('washingmachine')
	# 2: put clothes in washing machine
	find('clothespile')
	find('closet')
	find('closet')
	find('closet')
	assert('close' to 'closet' )  
		else: find('closet')
	assert('closet' is 'closed' )
		else: close('closet')
	open('closet')
	find('clothespile')
	find('closet')
	find('clothespile')
	assert('close' to 'clothespile')
		else: find('clothespile')
	grab('clothespile')
	find('washingmachine')
	assert('close' to 'washingmachine' )  
		else: find('washingmachine')
	assert('washingmachine' is 'closed' )
		else: close('washingmachine')
	open('washingmachine')
	assert('clothespile' in 'hands' )
		else: find('clothespile')
		else: grab('clothespile')
	assert('close' to 'washingmachine' )  
		else: find('washingmachine')
	assert('washingmachine' is 'opened' )
		else: open('washingmachine')
	putin('clothespile', 'washingmachine')
	# 3: add detergent
	# 4: start washing machine
	assert('close' to 'washingmachine' )
		else: find('washingmachine')
	assert('washingmachine' is 'opened' )
		else: open('washingmachine')
	close('washingmachine')
	assert('close' to 'washingmachine' )  
		else: find('washingmachine')
	assert('washingmachine' is 'switchoff' )
		else: switchoff('washingmachine')
	switchon('washingmachine')
	# 5: wait for cycle to finish
	# 6: take clothes out of washing machine
	assert('close' to 'washingmachine' )
		else: find('washingmachine')
	assert('washingmachine' is 'switchon' )
		else: switchon('washingmachine')
	switchoff('washingmachine')
	assert('close' to 'washingmachine' )  
		else: find('washingmachine')
	assert('washingmachine' is 'closed' )
		else: close('washingmachine')
	open('washingmachine')
	assert('close' to 'clothespile')
		else: find('clothespile')
	grab('clothespile')
	assert('close' to 'washingmachine' )
		else: find('washingmachine')
	assert('washingmachine' is 'opened' )
		else: open('washingmachine')
	close('washingmachine')
	# 7: put clothes in dryer
	# 8: set dryer for appropriate time 1
	# 9: start dryer 1
	# 10: wait for cycle to finish 1
	# 11: take clothes out of dryer 1
	# 12: put clothes away 1
	# 13: Done

----Test set tasks----
['eat chips on the sofa', 'put salmon in the fridge', 'wash the plate', 'bring coffeepot and cupcake to the coffee table', 'microwave salmon', 'watch tv', 'turn off light', 'brush teeth', 'throw away apple', 'make toast']
Total: 10 tasks

----PROMPT for state check----
You see: microwave is OFF and CLOSED, lightswitch is ON, cereal, bookshelf, book is CLOSED, bookshelf ON floor, microwave ON kitchencounterdrawer, salmon ON microwave, book INSIDE bookshelf, dishbowl INSIDE bookshelf, clothespile INSIDE bookshelf, bananas INSIDE bookshelf, box ON bookshelf, book ON kitchentable, dishbowl ON bookshelf, condimentshaker INSIDE bookshelf, box INSIDE bookshelf, character HOLD_RH book, book ON rug, cereal ON wallshelf, plate INSIDE microwave, condimentbottle INSIDE bookshelf, microwave ON kitchencounter, paper INSIDE bookshelf

assert('close' to 'mug' )
False
assert('close' to 'microwave' )
True
assert('book' is 'closed' )
True
assert('lightswitch' is 'OFF')
False
assert('book' in 'bookshelf')
True
assert('book' in 'hands')
True
assert('cereal' on 'bookshelf')
False

--Executing task: turn off bedroom light--
Plan:  def turn_off_bedroom_light():
	# 0: walk to bedroom
	walk('bedroom')
	# 1: find lightswitch
	find('lightswitch')
	assert('close' to 'lightswitch') else: find('lightswitch')
	switchoff('lightswitch')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bedroom> (73)
<char0> [find] <lightswitch> (261)
State check:
You see: lightswitch is ON
assert('close' to 'lightswitch') else: find('lightswitch')
False
State check:
You see: lightswitch is ON
switchoff('lightswitch')
True
<char0> [switchoff] <lightswitch> (261)

--Executing task: close living room window--
Plan:  def close_living_room_window():
	# 0: walk to living room
	walk('livingroom')
	# 1: find window
	find('window')
	assert('close' to 'window') else: find('window')
	close('window')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <window> (91)
State check:
You see: window is CLOSED
assert('close' to 'window') else: find('window')
True
<char0> [close] <window> (91)
act_success: False, message: <window> (91) is not open when executing "[CLOSE] <window> (91) [0]"

--Executing task: open bathroom door--
Plan:  def open_bathroom_door():
	# 0: walk to bathroom
	walk('bathroom')
	# 1: find door
	find('door')
	assert('close' to 'door') else: find('door')
	open('door')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bathroom> (11)
<char0> [find] <door> (51)
State check:
You see: door is OPEN
assert('close' to 'door') else: find('door')
False
State check:
You see: door is OPEN
open('door')
False
<char0> [open] <door> (51)
act_success: False, message: <door> (51) is not closed when executing "[OPEN] <door> (51) [0]"

--Executing task: sit on sofa--
Plan:  def sit_on_sofa():
	# 0: walk to living room
	walk('livingroom')
	# 1: find sofa
	find('sofa')
	sit('sofa')
	# 2: Done
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <sofa> (368)
<char0> [sit] <sofa> (368)

--Executing task: open living room window--
Plan:  def open_living_room_window():
	# 0: walk to living room
	walk('livingroom')
	# 1: find window
	find('window')
	find('window')
	# 2: grab window
	# 3: open window
	assert('close' to 'window' )  
		else: find('window')
	assert('window' is 'closed' )
		else: close('window')
	open('window')
	# 4: Done
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <window> (91)
<char0> [find] <window> (70)
State check:
You see: window is CLOSED
assert('close' to 'window' )
False
<char0> [find] <window> (70)
State check:
You see: window is CLOSED
assert('window' is 'closed' )
True
<char0> [open] <window> (70)

--Executing task: switch on bathroom light--
Plan:  def switch_on_bathroom_light():
	# 0: walk to bathroom
	walk('bathroom')
	# 1: find lightswitch
	find('lightswitch')
	assert('close' to 'lightswitch') else: find('lightswitch')
	switchon('lightswitch')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bathroom> (11)
<char0> [find] <lightswitch> (261)
State check:
You see: lightswitch is ON
assert('close' to 'lightswitch') else: find('lightswitch')
False
State check:
You see: lightswitch is ON
switchon('lightswitch')
True
<char0> [switchon] <lightswitch> (261)
act_success: False, message: <lightswitch> (261) is not off when executing "[SWITCHON] <lightswitch> (261) [0]"

--Executing task: pick up remote from table--
Plan:  def pick_up_remote_from_table():
	# 0: walk to living room
	walk('livingroom')
	# 1: find remote control
	find('remotecontrol')
	assert('close' to 'remotecontrol') else: find('remotecontrol')
	grab('remotecontrol')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <remotecontrol> (452)
State check:
You see: remotecontrol is OFF, remotecontrol ON tvstand.
assert('close' to 'remotecontrol') else: find('remotecontrol')
False
State check:
You see: remotecontrol is OFF, remotecontrol ON tvstand.
grab('remotecontrol')
True
<char0> [grab] <remotecontrol> (452)

--Executing task: turn on tv in living room--
Plan:  def turn_on_tv_in_living_room():
	# 0: walk to livingroom
	walk('livingroom')
	# 1: find tv
	find('tv')
	assert('close' to 'tv') else: find('tv')
	switchon('tv')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <tv> (264)
State check:
You see: tv is OFF, tvstand, tv ON tvstand.
assert('close' to 'tv') else: find('tv')
False
State check:
You see: tv is OFF, tvstand, tv ON tvstand.
switchon('tv')
False
<char0> [switchon] <tv> (264)

--Executing task: grab book from shelf--
Plan:  def grab_book_from_shelf():
	# 0: Walk to the bookshelf.
	find('bookshelf')
	# 1: Find the book.
	find('book')
	assert('close' to 'book')
		else: find('book')
	grab('book')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [find] <bookshelf> (249)
<char0> [find] <book> (191)
State check:
You see: bookshelf
assert('close' to 'book')
True
<char0> [grab] <book> (191)

--Executing task: turn off bathroom light--
Plan:  def turn_off_bathroom_light():
	# 0: walk to bathroom
	walk('bathroom')
	# 1: find lightswitch
	find('lightswitch')
	assert('close' to 'lightswitch') else: find('lightswitch')
	switchoff('lightswitch')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bathroom> (11)
<char0> [find] <lightswitch> (71)
State check:
You see: lightswitch is ON
assert('close' to 'lightswitch') else: find('lightswitch')
False
State check:
You see: lightswitch is ON
switchoff('lightswitch')
True
<char0> [switchoff] <lightswitch> (71)

--Executing task: put pillow on bed--
Plan:  def put_pillow_on_bed():
	# 0: walk to bedroom
	walk('bedroom')
	# 1: find pillow
	find('pillow')
	assert('close' to 'pillow') else: find('pillow')
	grab('pillow')
	# 2: place pillow on bed
	find('bed')
	putback('pillow', 'bed')
	# 3: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bedroom> (73)
<char0> [find] <pillow> (421)
State check:
You see: pillow, pillow ON sofa.
assert('close' to 'pillow') else: find('pillow')
True
<char0> [grab] <pillow> (421)
<char0> [find] <bed> (109)
<char0> [putback] <pillow> (421) <bed> (109)

--Executing task: open bedroom closet--
Plan:  def open_bedroom_closet():
	# 0: walk to bedroom
	walk('bedroom')
	# 1: find closet
	find('closet')
	assert('close' to 'closet') else: find('closet')
	open('closet')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bedroom> (73)
<char0> [find] <closet> (112)
State check:
You see: closetdrawer, closet is CLOSED, closetdrawer INSIDE closet, hanger INSIDE closet, closetdrawer ON closetdrawer.
assert('close' to 'closet') else: find('closet')
False
State check:
You see: closetdrawer, closet is CLOSED, closetdrawer INSIDE closet, hanger INSIDE closet, closetdrawer ON closetdrawer.
open('closet')
True
<char0> [open] <closet> (112)

--Executing task: grab phone from nightstand--
Plan:  def grab_phone_from_nightstand():
	# 0: walk to bedroom
	walk('bedroom')
	# 1: find phone
	find('cellphone')
	assert('close' to 'cellphone') else: find('cellphone')
	grab('cellphone')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bedroom> (73)
<char0> [find] <cellphone> (202)
State check:
You see: cellphone is OFF, cellphone ON coffeetable.
assert('close' to 'cellphone') else: find('cellphone')
False
State check:
You see: cellphone is OFF, cellphone ON coffeetable.
grab('cellphone')
False
<char0> [grab] <cellphone> (202)

--Executing task: watch tv in livingroom--
Plan:  def watch_tv_in_livingroom():
	# 0: walk to livingroom
	walk('livingroom')
	# 1: find tv
	find('tv')
	# 2: find remote control
	find('remotecontrol')
	# 3: point remote control at tv
	pointat('tv')
	# 4: press power button on remote control
	find('tv')
	assert('close' to 'tv' )  
		else: find('tv')
	assert('tv' is 'switchoff' )
		else: switchoff('tv')
	switchon('tv')
	# 5: find tv
	find('tv')
	# 6: find remote control
	find('remotecontrol')
	# 7: Done
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <tv> (264)
<char0> [find] <remotecontrol> (452)
<char0> [pointat] <tv> (426)
act_success: False, message: <character> (1) does not face <tv> (426) when executing "[POINTAT] <tv> (426) [0]"
<char0> [find] <tv> (426)
State check:
You see: tv is OFF, tvstand, tv ON tvstand, remotecontrol ON tvstand.
assert('close' to 'tv' )
True
State check:
You see: tv is OFF, tvstand, tv ON tvstand, remotecontrol ON tvstand.
assert('tv' is 'switchoff' )
True
<char0> [switchon] <tv> (426)
<char0> [find] <tv> (264)
<char0> [find] <remotecontrol> (452)

--Executing task: pick up photo frame--
Plan:  def pick_up_photo_frame():
	# 0: Walk to the living room.
	walk('livingroom')
	# 1: Find the photo frame.
	find('photoframe')
	# 2: Grab the photo frame.
	assert('close' to 'photoframe')
		else: find('photoframe')
	grab('photoframe')
	# 3: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <photoframe> (301)
State check:
You see: photoframe, photoframe ON tvstand.
assert('close' to 'photoframe')
True
<char0> [grab] <photoframe> (301)
act_success: False, message: <photoframe> (301) is not grabbable when executing "[GRAB] <photoframe> (301) [0]"

--Executing task: grab blanket from sofa--
Plan:  def grab_blanket_from_sofa():
	# 0: walk to living room
	walk('livingroom')
	# 1: find blanket
	find('blanket')
	assert('close' to 'blanket') else: find('blanket')
	grab('blanket')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
obj not found
State check:
You see: 
assert('close' to 'blanket') else: find('blanket')
False
State check:
You see: 
grab('blanket')
False
obj not found

--Executing task: turn off bedside lamp--
Plan:  def turn_off_bedside_lamp():
	# 0: walk to bedroom
	walk('bedroom')
	# 1: find lamp
	find('tablelamp')
	assert('close' to 'tablelamp') else: find('tablelamp')
	switchoff('tablelamp')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bedroom> (73)
<char0> [find] <tablelamp> (102)
State check:
You see: tablelamp is ON, tablelamp ON nightstand.
assert('close' to 'tablelamp') else: find('tablelamp')
True
<char0> [switchoff] <tablelamp> (102)

--Executing task: open living room curtains--
Plan:  def open_living_room_curtains():
	# 0: walk to living room
	walk('livingroom')
	# 1: find curtains
	find('curtains')
	assert('close' to 'curtains') else: find('curtains')
	open('curtains')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <livingroom> (335)
<char0> [find] <curtains> (31)
State check:
You see: curtains is CLOSED
assert('close' to 'curtains') else: find('curtains')
True
<char0> [open] <curtains> (31)

--Executing task: grab book from bedside table--
Plan:  def grab_book_from_bedside_table():
	# 0: walk to bedroom
	walk('bedroom')
	# 1: find book
	find('book')
	assert('close' to 'book') else: find('book')
	grab('book')
	# 2: Done.
	# Reflect: Check the generated plan. The task doesn't trigger any alarm The task put_the_wine_glass_in_the_kitchen_cabinetis finished. Execute the plan.

<char0> [walk] <bedroom> (73)
<char0> [find] <book> (434)
State check:
You see: bookshelf, book is CLOSED, book INSIDE bookshelf, book ON book.
assert('close' to 'book') else: find('book')
True
<char0> [grab] <book> (434)

Task: turn off bedroom light, GT Diff: set(), Pred Diff: set()
Task: close living room window, GT Diff: {'character CLOSE window', 'tv FACING clock', 'clock FACING tv', 'character INSIDE bedroom', 'window CLOSE character'}, Pred Diff: {'window CLOSE character', 'character CLOSE window', 'character INSIDE bedroom'}
Task: open bathroom door, GT Diff: {'character CLOSE door', 'character INSIDE bathroom', 'door CLOSE character'}, Pred Diff: {'character CLOSE door', 'character INSIDE bathroom', 'door CLOSE character'}
Task: sit on sofa, GT Diff: {'character CLOSE sofa', 'sofa CLOSE character', 'character ON sofa', 'character INSIDE livingroom'}, Pred Diff: {'character CLOSE sofa', 'sofa CLOSE character', 'character ON sofa', 'character INSIDE livingroom'}
Task: open living room window, GT Diff: {'window CLOSE character', 'character CLOSE window', 'character INSIDE bedroom'}, Pred Diff: {'window CLOSE character', 'character CLOSE window', 'character INSIDE bathroom'}
Task: switch on bathroom light, GT Diff: {'character INSIDE bedroom', 'character CLOSE lightswitch', 'lightswitch CLOSE character'}, Pred Diff: {'character CLOSE lightswitch', 'lightswitch CLOSE character'}
Task: pick up remote from table, GT Diff: {'remotecontrol CLOSE character', 'character CLOSE remotecontrol', 'character HOLDS_RH remotecontrol', 'character INSIDE livingroom', 'character CLOSE tvstand', 'crackers FACING tv', 'tvstand CLOSE character'}, Pred Diff: {'remotecontrol CLOSE character', 'character CLOSE remotecontrol', 'character HOLDS_RH remotecontrol', 'character INSIDE livingroom', 'character CLOSE tvstand', 'tvstand CLOSE character'}
Task: turn on tv in living room, GT Diff: {'tv CLOSE character', 'character CLOSE tv', 'character CLOSE tvstand', 'tvstand CLOSE character'}, Pred Diff: {'tv CLOSE character', 'character CLOSE tv', 'character CLOSE tvstand', 'tvstand CLOSE character'}
Task: grab book from shelf, GT Diff: {'character CLOSE floor', 'character CLOSE bookshelf', 'character INSIDE bedroom', 'floor CLOSE character', 'bookshelf CLOSE character'}, Pred Diff: {'bookshelf CLOSE character', 'character HOLDS_RH book', 'character CLOSE bookshelf', 'character INSIDE bedroom'}
Task: turn off bathroom light, GT Diff: {'character INSIDE livingroom'}, Pred Diff: {'character INSIDE bathroom'}
Task: put pillow on bed, GT Diff: {'pillow CLOSE bed', 'pillow CLOSE character', 'bed CLOSE pillow', 'character INSIDE bedroom', 'bed CLOSE character', 'character CLOSE bed', 'character CLOSE pillow'}, Pred Diff: {'pillow CLOSE bed', 'character CLOSE floor', 'pillow CLOSE character', 'bed CLOSE pillow', 'character INSIDE bedroom', 'floor CLOSE character', 'bed CLOSE character', 'character CLOSE bed', 'character CLOSE pillow'}
Task: open bedroom closet, GT Diff: {'character CLOSE closet', 'character INSIDE bedroom', 'closet CLOSE character', 'closetdrawer CLOSE character', 'character CLOSE hanger', 'character CLOSE closetdrawer', 'hanger CLOSE character'}, Pred Diff: {'character CLOSE closet', 'character INSIDE bedroom', 'closet CLOSE character', 'closetdrawer CLOSE character', 'character CLOSE hanger', 'character CLOSE closetdrawer', 'hanger CLOSE character'}
Task: grab phone from nightstand, GT Diff: {'character HOLDS_RH cellphone', 'character CLOSE coffeetable', 'character CLOSE cellphone', 'cellphone CLOSE character', 'character INSIDE bedroom', 'coffeetable CLOSE character'}, Pred Diff: {'character HOLDS_RH cellphone', 'character CLOSE coffeetable', 'character CLOSE cellphone', 'cellphone CLOSE character', 'character INSIDE bedroom', 'coffeetable CLOSE character'}
Task: watch tv in livingroom, GT Diff: {'tv CLOSE character', 'character CLOSE tv', 'character CLOSE tvstand', 'tvstand CLOSE character'}, Pred Diff: {'remotecontrol CLOSE character', 'character CLOSE remotecontrol', 'character INSIDE livingroom', 'character CLOSE tvstand', 'tvstand CLOSE character'}
Task: pick up photo frame, GT Diff: set(), Pred Diff: set()