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

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: eat chips on the sofa--
Plan:  # 0: walk to kitchen
walk('kitchen')
# 1: find chips
find('chips')
# 2: grab chips
assert('close' to 'chips')
else: find('chips')
grab('chips')
# 3: walk to living room
walk('livingroom')
# 4: find sofa
find('sofa')
# 5: sit on sofa
assert('close' to 'sofa')
else: find('sofa')
sit('sofa')
# 6: eat chips
assert('chips' in 'hands')
else: find('chips')
else: grab('chips')
eat('chips')
# 7: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <chips> (329)
State check:
You see: chips, chips ON wallshelf.
assert('close' to 'chips')
False
<char0> [find] <chips> (328)
State check:
You see: chips, chips ON wallshelf.
grab('chips')
False
<char0> [grab] <chips> (328)
State check:
You see: chips, chips ON wallshelf.  You have chips.
walk('livingroom')
False
<char0> [walk] <livingroom> (335)
State check:
You see: chips, .  You have chips.
find('sofa')
False
<char0> [find] <sofa> (368)
State check:
You see: sofa, sofa ON rug.  You have chips.
assert('close' to 'sofa')
True
<char0> [sit] <sofa> (368)
State check:
You see: chips, sofa ON rug.  You have chips.
assert('chips' in 'hands')
True
<char0> [eat] <chips> (328)
act_success: False, message: <chips> (328) is not eatable when executing "[EAT] <chips> (328) [0]"

--Executing task: put salmon in the fridge--
Plan:  # 0: walk to kitchen
walk('kitchen')
# 1: find salmon
find('salmon')
# 2: grab salmon
assert('close' to 'salmon')
else: find('salmon')
grab('salmon')
# 3: find fridge
find('fridge')
# 4: open fridge
assert('close' to 'fridge')
else: find('fridge')
assert('fridge' is 'closed')
else: close('fridge')
open('fridge')
# 5: put salmon in 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')
# 6: close fridge
assert('close' to 'fridge')
else: find('fridge')
assert('fridge' is 'opened')
else: open('fridge')
close('fridge')
# 7: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <salmon> (327)
State check:
You see: salmon, salmon ON microwave.
assert('close' to 'salmon')
True
<char0> [grab] <salmon> (327)
<char0> [find] <fridge> (305)
State check:
You see: fridge is CLOSED, fridge ON floor.  You have salmon.
assert('close' to 'fridge')
True
State check:
You see: fridge is CLOSED, fridge ON floor.  You have salmon.
assert('fridge' is 'closed')
True
<char0> [open] <fridge> (305)
State check:
You see: salmon, fridge ON floor.  You have salmon.
assert('salmon' in 'hands')
True
State check:
You see: fridge is OPEN, fridge ON floor.  You have salmon.
assert('close' to 'fridge')
True
State check:
You see: fridge is OPEN, fridge ON floor.  You have salmon.
assert('fridge' is 'opened')
True
<char0> [putin] <salmon> (327) <fridge> (305)
State check:
You see: fridge is OPEN, salmon INSIDE fridge, fridge ON floor.
assert('close' to 'fridge')
True
State check:
You see: fridge is OPEN, salmon INSIDE fridge, fridge ON floor.
assert('fridge' is 'opened')
True
<char0> [close] <fridge> (305)

--Executing task: wash the plate--
Plan:  # 0: walk to kitchen
walk('kitchen')
# 1: find sink
find('sink')
# 2: turn on faucet
find('faucet')
assert('close' to 'faucet')
switchon('faucet')
# 3: find plate
find('plate')
# 4: grab plate
assert('close' to 'plate')
grab('plate')
# 5: put plate under water
assert('plate' in 'hands')
assert('close' to 'sink')
putin('plate', 'sink')
# 6: grab dishwashing liquid
find('dishwashingliquid')
assert('close' to 'dishwashingliquid')
grab('dishwashingliquid')
# 7: put dishwashing liquid on plate
assert('dishwashingliquid' in 'hands')
assert('close' to 'sink')
putin('dishwashingliquid', 'sink')
# 8: grab washingsponge
find('washingsponge')
assert('close' to 'washingsponge')
grab('washingsponge')
# 9: start scrubbing plate
assert('washingsponge' in 'hands')
assert('close' to 'sink')
putin('washingsponge', 'sink')
# 10: rinse plate off with water
assert('close' to 'faucet')
assert('faucet' is 'switchon')
# 11: dry plate with towel
find('towel')
assert('close' to 'towel')
grab('towel')
assert('plate' in 'hands')
assert('close' to 'sink')
putin('plate', 'towel')
# 12: turn off faucet
assert('close' to 'faucet')
assert('faucet' is 'switchon')
switchoff('faucet')
# 13: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <sink> (247)
<char0> [find] <faucet> (50)
State check:
You see: faucet is OFF, faucet ON bathroomcounter.
assert('close' to 'faucet')
True
<char0> [switchon] <faucet> (50)
<char0> [find] <plate> (199)
State check:
You see: plate, plate ON coffeetable.
assert('close' to 'plate')
True
<char0> [grab] <plate> (199)
State check:
You see: plate, .  You have plate.
assert('plate' in 'hands')
True
State check:
You see: 
assert('close' to 'sink')
False
State check:
You see: 
putin('plate', 'sink')
False
<char0> [putin] <plate> (199) <sink> (247)
act_success: False, message: <character> (1) is not close to <sink> (247) when executing "[PUTIN] <plate> (199) <sink> (247) [0]"
State check:
You see: 
find('dishwashingliquid')
False
<char0> [find] <dishwashingliquid> (267)
State check:
You see: dishwashingliquid, dishwashingliquid ON kitchencounter.  You have plate.
assert('close' to 'dishwashingliquid')
True
<char0> [grab] <dishwashingliquid> (267)
State check:
You see: dishwashingliquid, dishwashingliquid.
assert('dishwashingliquid' in 'hands')
False
State check:
You see: 
assert('close' to 'sink')
False
State check:
You see: 
putin('dishwashingliquid', 'sink')
True
<char0> [putin] <dishwashingliquid> (267) <sink> (247)
act_success: False, message: <character> (1) is not close to <sink> (247) when executing "[PUTIN] <dishwashingliquid> (267) <sink> (247) [0]"
<char0> [find] <washingsponge> (266)
State check:
You see: washingsponge, washingsponge ON kitchencounter.  You have plate
assert('close' to 'washingsponge')
True
<char0> [grab] <washingsponge> (266)
act_success: False, message: <character> (1) does not have a free hand when executing "[GRAB] <washingsponge> (266) [0]"
State check:
You see: washingsponge, washingsponge ON kitchencounter.  You have plate
assert('washingsponge' in 'hands')
False
State check:
You see: 
assert('close' to 'sink')
False
State check:
You see: 
putin('washingsponge', 'sink')
True
obj not in hand
State check:
You see: 
assert('close' to 'faucet')
False
State check:
You see: 
assert('faucet' is 'switchon')
False
State check:
You see: 
find('towel')
False
<char0> [find] <towel> (54)
State check:
You see: towel, towel ON bathroomcounter.  You have plate
assert('close' to 'towel')
True
<char0> [grab] <towel> (54)
act_success: False, message: <character> (1) does not have a free hand when executing "[GRAB] <towel> (54) [0]"
State check:
You see: plate, towel ON bathroomcounter.  You have plate
assert('plate' in 'hands')
True
State check:
You see: 
assert('close' to 'sink')
False
State check:
You see: 
putin('plate', 'towel')
False
<char0> [putin] <plate> (199) <towel> (54)
State check:
You see: 
assert('close' to 'faucet')
False
State check:
You see: 
assert('faucet' is 'switchon')
False
State check:
You see: 
switchoff('faucet')
False
<char0> [switchoff] <faucet> (50)

--Executing task: bring coffeepot and cupcake to the coffee table--
Plan:  # 0: walk to kitchen
walk('kitchen')
# 1: find coffeepot
find('coffeepot')
# 2: grab coffeepot
assert('close' to 'coffeepot')
else: find('coffeepot')
grab('coffeepot')
# 3: find cupcake
find('cupcake')
# 4: grab cupcake
assert('close' to 'cupcake')
else: find('cupcake')
grab('cupcake')
# 5: walk to living room
walk('livingroom')
# 6: find coffee table
find('coffeetable')
# 7: put coffeepot on coffee table
assert('coffeepot' in 'hands')
else: find('coffeepot')
else: grab('coffeepot')
assert('close' to 'coffeetable')
else: find('coffeetable')
putin('coffeepot', 'coffeetable')
# 8: put cupcake on coffee table
assert('cupcake' in 'hands')
else: find('cupcake')
else: grab('cupcake')
assert('close' to 'coffeetable')
else: find('coffeetable')
putin('cupcake', 'coffeetable')
# 9: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <coffeepot> (307)
State check:
You see: coffeepot is CLOSED, coffeepot ON kitchencounter, coffeepot INSIDE coffeemaker.
assert('close' to 'coffeepot')
True
<char0> [grab] <coffeepot> (307)
<char0> [find] <cupcake> (195)
State check:
You see: cupcake, cupcake ON desk.  You have coffeepot.
assert('close' to 'cupcake')
False
<char0> [find] <cupcake> (196)
State check:
You see: cupcake, cupcake ON desk.  You have coffeepot.
grab('cupcake')
False
<char0> [grab] <cupcake> (196)
State check:
You see: cupcake, cupcake ON desk.  You have cupcake
walk('livingroom')
False
<char0> [walk] <livingroom> (335)
State check:
You see: cupcake, .  You have cupcake
find('coffeetable')
False
<char0> [find] <coffeetable> (111)
State check:
You see: coffeepot is CLOSED, coffeepot.
assert('coffeepot' in 'hands')
False
<char0> [find] <coffeepot> (307)
<char0> [grab] <coffeepot> (307)
act_success: False, message: <character> (1) does not have a free hand when executing "[GRAB] <coffeepot> (307) [0]"
State check:
You see: coffeetable, coffeetable ON floor.  You have cupcake
assert('close' to 'coffeetable')
True
<char0> [putin] <coffeepot> (307) <coffeetable> (371)
act_success: False, message: <character> (1) does not have a free hand when executing "[GRAB] <coffeepot> (307) [0]",<character> (1) is not close to <coffeetable> (371) when executing "[PUTIN] <coffeepot> (307) <coffeetable> (371) [0]"
State check:
You see: cupcake, coffeetable ON floor.  You have cupcake
assert('cupcake' in 'hands')
True
State check:
You see: coffeetable, coffeetable ON floor.  You have cupcake
assert('close' to 'coffeetable')
True
<char0> [putin] <cupcake> (196) <coffeetable> (111)

--Executing task: microwave salmon--
Plan:  # 0: Walk to the kitchen
walk('kitchen')
# 1: Find the salmon
find('salmon')
# 2: Grab the salmon
assert('close' to 'salmon')
else: find('salmon')
grab('salmon')
# 3: Find the microwave
find('microwave')
# 4: Open the microwave
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'closed')
else: close('microwave')
open('microwave')
# 5: Put the salmon in the microwave
assert('salmon' in 'hands')
else: find('salmon')
else: grab('salmon')
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'opened')
else: open('microwave')
putin('salmon', 'microwave')
# 6: Close the microwave
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'opened')
else: open('microwave')
close('microwave')
# 7: Turn on the microwave
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'switchoff')
else: switchoff('microwave')
switchon('microwave')
# 8: Wait for the microwave to finish
# 9: Turn off the microwave
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'switchon')
else: switchon('microwave')
switchoff('microwave')
# 10: Open the microwave
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'closed')
else: close('microwave')
open('microwave')
# 11: Take the salmon out of the microwave
assert('close' to 'microwave')
else: find('microwave')
assert('microwave' is 'opened')
else: open('microwave')
grab('salmon')
# 12: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <salmon> (327)
State check:
You see: salmon, salmon ON microwave.
assert('close' to 'salmon')
True
<char0> [grab] <salmon> (327)
<char0> [find] <microwave> (313)
State check:
You see: microwave is CLOSED and OFF
assert('close' to 'microwave')
True
State check:
You see: microwave is CLOSED and OFF
assert('microwave' is 'closed')
True
<char0> [open] <microwave> (313)
State check:
You see: salmon, .  You have salmon.
assert('salmon' in 'hands')
True
State check:
You see: microwave is OFF and OPEN
assert('close' to 'microwave')
True
State check:
You see: microwave is OFF and OPEN
assert('microwave' is 'opened')
True
<char0> [putin] <salmon> (327) <microwave> (313)
State check:
You see: microwave is OFF and OPEN, salmon INSIDE microwave.
assert('close' to 'microwave')
True
State check:
You see: microwave is OFF and OPEN, salmon INSIDE microwave.
assert('microwave' is 'opened')
True
<char0> [close] <microwave> (313)
State check:
You see: microwave is CLOSED and OFF, salmon INSIDE microwave.
assert('close' to 'microwave')
True
State check:
You see: microwave is CLOSED and OFF, salmon INSIDE microwave.
assert('microwave' is 'switchoff')
True
<char0> [switchon] <microwave> (313)
State check:
You see: microwave is CLOSED and ON, salmon INSIDE microwave.
assert('close' to 'microwave')
True
State check:
You see: microwave is CLOSED and ON, salmon INSIDE microwave.
assert('microwave' is 'switchon')
True
<char0> [switchoff] <microwave> (313)
State check:
You see: microwave is CLOSED and OFF, salmon INSIDE microwave.
assert('close' to 'microwave')
True
State check:
You see: microwave is CLOSED and OFF, salmon INSIDE microwave.
assert('microwave' is 'closed')
True
<char0> [open] <microwave> (313)
State check:
You see: microwave is OFF and OPEN, salmon INSIDE microwave.
assert('close' to 'microwave')
True
State check:
You see: microwave is OFF and OPEN, salmon INSIDE microwave.
assert('microwave' is 'opened')
True
<char0> [grab] <salmon> (327)

--Executing task: watch tv--
Plan:  # 0: Walk to the living room
walk('livingroom')
# 1: Find the TV
find('tv')
# 2: Turn on the TV
assert('close' to 'tv')
    else: find('tv')
assert('tv' is 'switchoff')
    else: switchoff('tv')
switchon('tv')
# 3: Sit down on the sofa
find('sofa')
assert('close' to 'sofa')
    else: find('sofa')
sit('sofa')
# 4: Watch TV
watch('tv')
# 5: Done

<char0> [walk] <livingroom> (335)
<char0> [find] <tv> (264)
State check:
You see: tv is OFF, tvstand, tv ON tvstand.
assert('close' to 'tv')
True
State check:
You see: tv is OFF, tvstand, tv ON tvstand.
assert('tv' is 'switchoff')
True
<char0> [switchon] <tv> (264)
<char0> [find] <sofa> (368)
State check:
You see: sofa, sofa ON rug.
assert('close' to 'sofa')
True
<char0> [sit] <sofa> (368)
<char0> [watch] <tv> (426)

--Executing task: turn off light--
Plan:  # 0: Find the light switch
find('lightswitch')
# 1: Ensure the light switch is close
assert('close' to 'lightswitch')
    else: find('lightswitch')
# 2: Turn off the light switch
assert('lightswitch' is 'switchon')
    else: switchon('lightswitch')
switchoff('lightswitch')
# 3: Done

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

--Executing task: brush teeth--
Plan:  # 0: walk to bathroom
walk('bathroom')
# 1: find toothbrush
find('toothbrush')
# 2: grab toothbrush
assert('close' to 'toothbrush')
else: find('toothbrush')
grab('toothbrush')
# 3: find toothpaste
find('toothpaste')
# 4: grab toothpaste
assert('close' to 'toothpaste')
else: find('toothpaste')
grab('toothpaste')
# 5: put toothpaste on toothbrush
assert('toothbrush' in 'hands')
else: find('toothbrush')
else: grab('toothbrush')
assert('toothpaste' in 'hands')
else: find('toothpaste')
else: grab('toothpaste')
putin('toothpaste', 'toothbrush')
# 6: brush teeth
# (Assuming brushing teeth is a simulated action)
# 7: rinse toothbrush
find('sink')
assert('close' to 'sink')
else: find('sink')
putin('toothbrush', 'sink')
find('faucet')
assert('close' to 'faucet')
else: find('faucet')
assert('faucet' is 'switchoff')
else: switchoff('faucet')
switchon('faucet')
# 8: turn off faucet
assert('close' to 'faucet')
else: find('faucet')
assert('faucet' is 'switchon')
else: switchon('faucet')
switchoff('faucet')
# 9: put toothbrush back
assert('toothbrush' in 'hands')
else: find('toothbrush')
else: grab('toothbrush')
putback('toothbrush', 'bathroomcounter')
# 10: Done

<char0> [walk] <bathroom> (11)
<char0> [find] <toothbrush> (65)
State check:
You see: toothbrush, toothbrush ON bathroomcounter.
assert('close' to 'toothbrush')
False
<char0> [find] <toothbrush> (65)
State check:
You see: toothbrush, toothbrush ON bathroomcounter.
grab('toothbrush')
False
<char0> [grab] <toothbrush> (65)
State check:
You see: toothbrush, .  You have toothbrush.
find('toothpaste')
False
<char0> [find] <toothpaste> (62)
State check:
You see: toothpaste is CLOSED, toothpaste ON bathroomcounter.  You have toothbrush.
assert('close' to 'toothpaste')
True
<char0> [grab] <toothpaste> (62)
State check:
You see: toothbrush, toothbrush.
assert('toothbrush' in 'hands')
False
<char0> [find] <toothbrush> (65)
<char0> [grab] <toothbrush> (65)
act_success: False, message: <character> (1) does not have a free hand when executing "[GRAB] <toothbrush> (65) [0]"
State check:
You see: toothpaste is CLOSED, .  You have toothpaste
assert('toothpaste' in 'hands')
True
<char0> [putin] <toothpaste> (62) <toothbrush> (65)
<char0> [find] <sink> (247)
State check:
You see: sink
assert('close' to 'sink')
False
<char0> [find] <sink> (247)
State check:
You see: sink
putin('toothbrush', 'sink')
False
<char0> [putin] <toothbrush> (65) <sink> (247)
State check:
You see: sink
find('faucet')
False
<char0> [find] <faucet> (50)
State check:
You see: faucet is OFF, faucet ON bathroomcounter.
assert('close' to 'faucet')
True
State check:
You see: faucet is OFF, faucet ON bathroomcounter.
assert('faucet' is 'switchoff')
True
<char0> [switchon] <faucet> (50)
State check:
You see: faucet is OFF, faucet is ON, faucet ON bathroomcounter.
assert('close' to 'faucet')
True
State check:
You see: faucet is OFF, faucet is ON, faucet ON bathroomcounter.
assert('faucet' is 'switchon')
True
<char0> [switchoff] <faucet> (50)
State check:
You see: 
assert('toothbrush' in 'hands')
False
<char0> [find] <toothbrush> (65)
<char0> [grab] <toothbrush> (65)
State check:
You see: toothbrush, .  You have toothbrush.
putback('toothbrush', 'bathroomcounter')
False
<char0> [putback] <toothbrush> (65) <bathroomcounter> (49)
act_success: False, message: <character> (1) is not close to <bathroomcounter> (49) when executing "[PUTBACK] <toothbrush> (65) <bathroomcounter> (49) [0]"

--Executing task: throw away apple--
Plan:  # 0: walk to kitchen
walk('kitchen')
# 1: find garbage can
find('garbagecan')
# 2: grab apple
find('apple')
assert('close' to 'apple')
	else: find('apple')
grab('apple')
# 3: put apple in garbage can
find('garbagecan')
assert('close' to 'garbagecan' )  
	else: find('garbagecan')
assert('garbagecan' is 'closed' )
	else: close('garbagecan')
open('garbagecan')
assert('apple' in 'hands' )
	else: find('apple')
	else: grab('apple')
assert('close' to 'garbagecan' )  
	else: find('garbagecan')
assert('garbagecan' is 'opened' )
	else: open('garbagecan')
putin('apple', 'garbagecan')
assert('close' to 'garbagecan' )
	else: find('garbagecan')
assert('garbagecan' is 'opened' )
	else: open('garbagecan')
close('garbagecan')
# 4: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <garbagecan> (229)
<char0> [find] <apple> (438)
State check:
You see: apple, apple ON coffeetable.
assert('close' to 'apple')
False
<char0> [find] <apple> (438)
State check:
You see: apple, apple ON coffeetable.
grab('apple')
False
<char0> [grab] <apple> (438)
State check:
You see: apple, .  You have apple.
find('garbagecan')
False
<char0> [find] <garbagecan> (229)
State check:
You see: garbagecan is CLOSED
assert('close' to 'garbagecan' )
False
<char0> [find] <garbagecan> (229)
State check:
You see: garbagecan is CLOSED
assert('garbagecan' is 'closed' )
True
<char0> [open] <garbagecan> (229)
State check:
You see: apple, .  You have apple.
assert('apple' in 'hands' )
True
State check:
You see: garbagecan is OPEN
assert('close' to 'garbagecan' )
True
State check:
You see: garbagecan is OPEN
assert('garbagecan' is 'opened' )
True
<char0> [putin] <apple> (438) <garbagecan> (229)
State check:
You see: garbagecan is OPEN, apple INSIDE garbagecan.
assert('close' to 'garbagecan' )
True
State check:
You see: garbagecan is OPEN, apple INSIDE garbagecan.
assert('garbagecan' is 'opened' )
True
<char0> [close] <garbagecan> (229)

--Executing task: make toast--
Plan:  # 0: Walk to the kitchen
walk('kitchen')
# 1: Find the bread slice
find('breadslice')
# 2: Grab the bread slice
assert('close' to 'breadslice')
else: find('breadslice')
grab('breadslice')
# 3: Find the toaster
find('toaster')
# 4: Put the bread slice in the toaster
assert('close' to 'toaster')
else: find('toaster')
assert('breadslice' in 'hands')
else: find('breadslice')
else: grab('breadslice')
putin('breadslice', 'toaster')
# 5: Turn on the toaster
assert('close' to 'toaster')
else: find('toaster')
switchon('toaster')
# 6: Wait for the toast to be ready
# (Assume some waiting mechanism here)
# 7: Take the toast out of the toaster
assert('close' to 'toaster')
else: find('toaster')
assert('toaster' is 'switchon')
else: switchon('toaster')
switchoff('toaster')
assert('close' to 'toaster')
else: find('toaster')
grab('breadslice')
# 8: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <breadslice> (310)
State check:
You see: breadslice, breadslice INSIDE toaster.
assert('close' to 'breadslice')
True
<char0> [grab] <breadslice> (310)
<char0> [find] <toaster> (308)
State check:
You see: toaster is OFF
assert('close' to 'toaster')
False
<char0> [find] <toaster> (308)
State check:
You see: breadslice, .  You have breadslice.
assert('breadslice' in 'hands')
True
<char0> [putin] <breadslice> (310) <toaster> (308)
State check:
You see: toaster is OFF, breadslice INSIDE toaster.
assert('close' to 'toaster')
True
<char0> [switchon] <toaster> (308)
State check:
You see: toaster is ON, breadslice INSIDE toaster.
assert('close' to 'toaster')
True
State check:
You see: toaster is ON, breadslice INSIDE toaster.
assert('toaster' is 'switchon')
True
<char0> [switchoff] <toaster> (308)
State check:
You see: toaster is OFF, breadslice INSIDE toaster.
assert('close' to 'toaster')
True
<char0> [grab] <breadslice> (310)

Task: eat chips on the sofa, GT Diff: {'character CLOSE chips', 'sofa CLOSE character', 'chips CLOSE character', 'character ON sofa', 'character INSIDE livingroom', 'character HOLDS_RH chips', 'character CLOSE sofa'}, Pred Diff: {'character CLOSE chips', 'sofa CLOSE character', 'chips CLOSE character', 'character ON sofa', 'character INSIDE livingroom', 'character HOLDS_RH chips', 'chips INSIDE livingroom', 'character CLOSE sofa'}
Task: put salmon in the fridge, GT Diff: {'salmon CLOSE character', 'fridge CLOSE salmon', 'fridge CLOSE character', 'character CLOSE floor', 'salmon CLOSE fridge', 'salmon INSIDE fridge', 'character CLOSE fridge', 'character CLOSE salmon', 'floor CLOSE character'}, Pred Diff: {'salmon CLOSE character', 'fridge CLOSE salmon', 'fridge CLOSE character', 'character CLOSE floor', 'salmon CLOSE fridge', 'salmon INSIDE fridge', 'character CLOSE fridge', 'character CLOSE salmon', 'floor CLOSE character'}
Task: wash the plate, GT Diff: {'character INSIDE bathroom', 'faucet CLOSE character', 'character CLOSE bathroomcounter', 'plate INSIDE sink', 'sink CLOSE dishwashingliquid', 'bathroomcounter CLOSE character', 'dishwashingliquid INSIDE sink', 'tv FACING clock', 'plate CLOSE sink', 'sink CLOSE plate', 'dishwashingliquid CLOSE sink', 'character CLOSE faucet', 'clock FACING tv'}, Pred Diff: {'character INSIDE bathroom', 'towel CLOSE plate', 'dishwashingliquid CLOSE character', 'character CLOSE bathroomcounter', 'bathroomcounter CLOSE character', 'character HOLDS_LH dishwashingliquid', 'character CLOSE dishwashingliquid', 'character CLOSE towel', 'plate CLOSE towel', 'towel CLOSE character', 'plate INSIDE towel'}
Task: bring coffeepot and cupcake to the coffee table, GT Diff: {'character CLOSE cupcake', 'coffeepot INSIDE bedroom', 'coffeetable CLOSE character', 'character CLOSE floor', 'coffeepot CLOSE coffeetable', 'character INSIDE bedroom', 'cupcake CLOSE coffeetable', 'cupcake ON coffeetable', 'coffeetable CLOSE coffeepot', 'cupcake CLOSE character', 'character CLOSE coffeetable', 'floor CLOSE character', 'coffeetable CLOSE cupcake', 'coffeepot ON coffeetable'}, Pred Diff: {'character CLOSE cupcake', 'coffeetable CLOSE character', 'cupcake INSIDE coffeetable', 'character CLOSE floor', 'character INSIDE bedroom', 'cupcake INSIDE livingroom', 'coffeepot INSIDE livingroom', 'cupcake CLOSE coffeetable', 'cupcake CLOSE character', 'character HOLDS_RH coffeepot', 'character CLOSE coffeetable', 'floor CLOSE character', 'coffeetable CLOSE cupcake'}
Task: microwave salmon, GT Diff: {'kitchencounter CLOSE character', 'character CLOSE sink', 'pie CLOSE character', 'book FACING clock', 'character CLOSE salmon', 'cutleryfork FACING clock', 'dishbowl CLOSE character', 'character CLOSE pie', 'kitchencounterdrawer CLOSE character', 'whippedcream FACING clock', 'character CLOSE dishbowl', 'character HOLDS_RH salmon', 'bellpepper CLOSE character', 'character CLOSE kitchencounter', 'pie FACING clock', 'kitchencabinet CLOSE character', 'toaster CLOSE character', 'salmon CLOSE character', 'character CLOSE kitchencabinet', 'character CLOSE microwave', 'sink CLOSE character', 'character CLOSE bellpepper', 'breadslice CLOSE character', 'character CLOSE toaster', 'character CLOSE breadslice', 'character CLOSE kitchencounterdrawer', 'whippedcream CLOSE character', 'microwave CLOSE character', 'character CLOSE whippedcream'}, Pred Diff: {'salmon CLOSE character', 'character HOLDS_RH salmon', 'microwave CLOSE character', 'character CLOSE salmon', 'character CLOSE microwave'}
Task: watch tv, GT Diff: {'character INSIDE livingroom'}, Pred Diff: {'character CLOSE sofa', 'sofa CLOSE character', 'character ON sofa', 'character INSIDE livingroom'}
Task: turn off light, GT Diff: {'character INSIDE bathroom'}, Pred Diff: set()
Task: brush teeth, GT Diff: {'character INSIDE bathroom', 'character CLOSE bathroomcounter', 'character CLOSE toothpaste', 'character HOLDS_RH toothbrush', 'bathroomcounter CLOSE character', 'character CLOSE toothbrush', 'toothbrush CLOSE toothpaste', 'toothpaste CLOSE toothbrush', 'toothpaste INSIDE toothbrush', 'toothbrush CLOSE character', 'toothpaste CLOSE character'}, Pred Diff: {'character INSIDE bathroom', 'character CLOSE sink', 'character HOLDS_RH toothbrush', 'character CLOSE toothbrush', 'toothbrush CLOSE character', 'sink CLOSE character'}
Task: throw away apple, GT Diff: {'apple CLOSE character', 'garbagecan CLOSE apple', 'apple CLOSE garbagecan', 'apple INSIDE garbagecan', 'character CLOSE apple', 'character CLOSE garbagecan', 'garbagecan CLOSE character'}, Pred Diff: {'apple CLOSE character', 'garbagecan CLOSE apple', 'apple CLOSE garbagecan', 'apple INSIDE garbagecan', 'character CLOSE apple', 'character CLOSE garbagecan', 'garbagecan CLOSE character'}
Task: make toast, GT Diff: {'character HOLDS_RH breadslice', 'toaster CLOSE character', 'breadslice CLOSE character', 'character CLOSE toaster', 'character CLOSE breadslice'}, Pred Diff: {'character HOLDS_RH breadslice', 'toaster CLOSE character', 'breadslice CLOSE character', 'character CLOSE toaster', 'character CLOSE breadslice'}