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

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' )
True
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> (173)
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> (173)
act_success: False, message: <lightswitch> (173) is not off when executing "[SWITCHON] <lightswitch> (173) [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: tvstand, tv is OFF, tv ON tvstand.
assert('close' to 'tv') else: find('tv')
False
State check:
You see: tvstand, tv is OFF, 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> (105)
<char0> [find] <book> (292)
State check:
You see: book is CLOSED, bookshelf, book INSIDE bookshelf.
assert('close' to 'book')
True
<char0> [grab] <book> (292)

--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> (427)
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> (427)

--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> (186)
State check:
You see: pillow, pillow ON bed.
assert('close' to 'pillow') else: find('pillow')
False
State check:
You see: pillow, pillow ON bed.
grab('pillow')
False
<char0> [grab] <pillow> (186)
State check:
You see: pillow, .  You have pillow.
find('bed')
False
<char0> [find] <bed> (109)
State check:
You see: pillow, .  You have pillow.
putback('pillow', 'bed')
True
<char0> [putback] <pillow> (186) <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, hanger INSIDE closet, closetdrawer ON closetdrawer, closetdrawer INSIDE closet.
assert('close' to 'closet') else: find('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> (188)
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> (188)

--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: tvstand, tv is OFF, remotecontrol ON tvstand, tv ON tvstand.
assert('close' to 'tv' )
True
State check:
You see: tvstand, tv is OFF, remotecontrol ON tvstand, tv 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> (189)
State check:
You see: 
assert('close' to 'photoframe')
False
<char0> [find] <photoframe> (301)
State check:
You see: photoframe, photoframe ON tvstand.
grab('photoframe')
False
<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: book is CLOSED, bookshelf, book ON book, book INSIDE bookshelf.
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', 'character INSIDE bedroom', 'window CLOSE character'}, Pred Diff: {'character CLOSE window', 'character INSIDE bedroom', 'window CLOSE character'}
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 INSIDE livingroom', 'sofa CLOSE character', 'character CLOSE sofa', 'character ON sofa'}, Pred Diff: {'character INSIDE livingroom', 'sofa CLOSE character', 'character CLOSE sofa', 'character ON sofa'}
Task: open living room window, GT Diff: {'character CLOSE window', 'character INSIDE bedroom', 'window CLOSE character'}, Pred Diff: {'character CLOSE window', 'character INSIDE bathroom', 'window CLOSE character'}
Task: switch on bathroom light, GT Diff: {'character CLOSE lightswitch', 'character INSIDE bedroom', 'lightswitch CLOSE character'}, Pred Diff: {'character CLOSE lightswitch', 'character INSIDE bedroom', 'lightswitch CLOSE character'}
Task: pick up remote from table, GT Diff: {'remotecontrol CLOSE character', 'character CLOSE remotecontrol', 'tvstand CLOSE character', 'character CLOSE tvstand', 'character INSIDE livingroom', 'character HOLDS_RH remotecontrol'}, Pred Diff: {'remotecontrol CLOSE character', 'character CLOSE remotecontrol', 'tvstand CLOSE character', 'character CLOSE tvstand', 'character INSIDE livingroom', 'character HOLDS_RH remotecontrol'}
Task: turn on tv in living room, GT Diff: {'character CLOSE tv', 'tvstand CLOSE character', 'character CLOSE tvstand', 'tv CLOSE character'}, Pred Diff: {'character CLOSE tv', 'tvstand CLOSE character', 'character CLOSE tvstand', 'tv CLOSE character'}
Task: grab book from shelf, GT Diff: {'character INSIDE bedroom', 'character CLOSE floor', 'floor CLOSE character'}, Pred Diff: {'character HOLDS_RH book'}
Task: turn off bathroom light, GT Diff: {'cutleryfork FACING clock', 'book FACING clock', 'character INSIDE livingroom', 'pie FACING clock', 'cutleryknife FACING clock', 'plate FACING clock', 'waterglass FACING clock', 'whippedcream FACING clock'}, Pred Diff: {'character INSIDE livingroom'}
Task: put pillow on bed, GT Diff: {'pillow CLOSE character', 'character CLOSE bed', 'pillow CLOSE bed', 'character INSIDE bedroom', 'bed CLOSE pillow', 'character CLOSE pillow', 'bed CLOSE character'}, Pred Diff: {'pillow CLOSE character', 'character CLOSE bed', 'pillow CLOSE bed', 'character INSIDE bedroom', 'bed CLOSE pillow', 'character CLOSE pillow', 'bed CLOSE character'}
Task: open bedroom closet, GT Diff: {'character CLOSE closetdrawer', 'character INSIDE bedroom', 'character CLOSE hanger', 'hanger CLOSE character', 'closet CLOSE character', 'tv FACING clock', 'closetdrawer CLOSE character', 'clock FACING tv', 'character CLOSE closet'}, Pred Diff: {'character CLOSE closetdrawer', 'character INSIDE bedroom', 'character CLOSE hanger', 'hanger CLOSE character', 'closet CLOSE character', 'closetdrawer CLOSE character', 'character CLOSE closet'}
Task: grab phone from nightstand, GT Diff: {'character CLOSE coffeetable', 'character INSIDE bedroom', 'pie FACING clock', 'cutleryknife FACING clock', 'plate FACING clock', 'character CLOSE cellphone', 'whippedcream FACING clock', 'cellphone CLOSE character', 'waterglass FACING clock', 'character HOLDS_RH cellphone', 'coffeetable CLOSE character'}, Pred Diff: {'character CLOSE coffeetable', 'character INSIDE bedroom', 'character CLOSE cellphone', 'cellphone CLOSE character', 'character HOLDS_RH cellphone', 'coffeetable CLOSE character'}
Task: watch tv in livingroom, GT Diff: {'character CLOSE tv', 'tvstand CLOSE character', 'character CLOSE tvstand', 'tv CLOSE character'}, Pred Diff: {'remotecontrol CLOSE character', 'character CLOSE remotecontrol', 'tvstand CLOSE character', 'character CLOSE tvstand', 'character INSIDE livingroom'}
Task: pick up photo frame, GT Diff: {'photoframe CLOSE character', 'tvstand CLOSE character', 'character CLOSE tvstand', 'character CLOSE photoframe'}, Pred Diff: {'photoframe CLOSE character', 'tvstand CLOSE character', 'character CLOSE tvstand', 'character CLOSE photoframe'}
Task: grab blanket from sofa, GT Diff: {'character INSIDE livingroom'}, Pred Diff: {'character INSIDE livingroom'}
Task: turn off bedside lamp, GT Diff: {'character CLOSE tablelamp', 'nightstand CLOSE character', 'character INSIDE bedroom', 'character CLOSE nightstand', 'tablelamp CLOSE character'}, Pred Diff: {'character CLOSE tablelamp', 'nightstand CLOSE character', 'character INSIDE bedroom', 'character CLOSE nightstand', 'tablelamp CLOSE character'}
Task: open living room curtains, GT Diff: {'curtains CLOSE character', 'character INSIDE bathroom', 'character CLOSE curtains'}, Pred Diff: {'curtains CLOSE character', 'character INSIDE bathroom', 'character CLOSE curtains'}
Task: grab book from bedside table, GT Diff: {'character HOLDS_RH book'}, Pred Diff: {'character INSIDE livingroom', 'character HOLDS_RH book'}