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

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:  def eat_chips_on_the_sofa():
	# 0: walk to livingroom
	walk('livingroom')
	# 1: find chips
	find('chips')
	# 2: grab chips
	assert('close' to 'chips')
		else: find('chips')
	grab('chips')
	# 3: sit on sofa
	find('sofa')
	sit('sofa')
	# 4: eat chips
	# 5: Done

<char0> [walk] <livingroom> (335)
<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.
find('sofa')
False
<char0> [find] <sofa> (368)
State check:
You see: chips, sofa ON rug.  You have chips.
sit('sofa')
False
<char0> [sit] <sofa> (368)

--Executing task: put salmon in the fridge--
Plan:  def put_salmon_in_the_fridge():
	# 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' )
False
<char0> [find] <fridge> (305)
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:  def wash_the_plate():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find sink
	find('sink')
	# 2: turn on faucet
	find('faucet')
	assert('close' to 'faucet' )  
		else: find('faucet')
	assert('faucet' is 'switchoff' )
		else: switchoff('faucet')
	switchon('faucet')
	# 3: put plate under water
	find('plate')
	assert('close' to 'plate')
		else: find('plate')
	grab('plate')
	find('sink')
	assert('plate' in 'hands' )
		else: find('plate')
		else: grab('plate')
	assert('close' to 'sink' )  
		else: find('sink')
	putin('plate', 'sink')
	# 4: put dishwashing liquid on plate
	find('dishwashingliquid')
	assert('close' to 'dishwashingliquid')
		else: find('dishwashingliquid')
	grab('dishwashingliquid')
	find('sink')
	assert('dishwashingliquid' in 'hands' )
		else: find('dishwashingliquid')
		else: grab('dishwashingliquid')
	assert('close' to 'sink' )  
		else: find('sink')
	putin('dishwashingliquid', 'sink')
	# 5: grab washingsponge
	find('washingsponge')
	assert('close' to 'washingsponge')
		else: find('washingsponge')
	grab('washingsponge')
	# 6: scrub plate
	find('sink')
	assert('washingsponge' in 'hands' )
		else: find('washingsponge')
		else: grab('washingsponge')
	assert('close' to 'sink' )  
		else: find('sink')
	putin('washingsponge', 'sink')
	# 7: rinse plate
	# 8: dry plate
	# 9: Done
	find('faucet')
	assert('close' to 'faucet' )
		else: find('faucet')
	assert('faucet' is 'switchon' )
		else: switchon('faucet')
	switchoff('faucet')

<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' )
False
<char0> [find] <faucet> (50)
State check:
You see: faucet is OFF, faucet ON bathroomcounter.
assert('faucet' is 'switchoff' )
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)
<char0> [find] <sink> (247)
State check:
You see: plate, .  You have plate.
assert('plate' in 'hands' )
True
State check:
You see: sink
assert('close' to 'sink' )
False
<char0> [find] <sink> (247)
State check:
You see: sink
putin('plate', 'sink')
False
<char0> [putin] <plate> (199) <sink> (247)
State check:
You see: sink
find('dishwashingliquid')
False
<char0> [find] <dishwashingliquid> (267)
State check:
You see: dishwashingliquid, dishwashingliquid ON kitchencounter.
assert('close' to 'dishwashingliquid')
True
<char0> [grab] <dishwashingliquid> (267)
<char0> [find] <sink> (247)
State check:
You see: dishwashingliquid, .  You have dishwashingliquid.
assert('dishwashingliquid' in 'hands' )
True
State check:
You see: sink
assert('close' to 'sink' )
False
<char0> [find] <sink> (247)
State check:
You see: sink
putin('dishwashingliquid', 'sink')
False
<char0> [putin] <dishwashingliquid> (267) <sink> (247)
State check:
You see: sink
find('washingsponge')
False
<char0> [find] <washingsponge> (266)
State check:
You see: washingsponge, washingsponge ON kitchencounter.
assert('close' to 'washingsponge')
True
<char0> [grab] <washingsponge> (266)
<char0> [find] <sink> (247)
State check:
You see: washingsponge, .  You have washingsponge.
assert('washingsponge' in 'hands' )
True
State check:
You see: sink
assert('close' to 'sink' )
False
<char0> [find] <sink> (247)
State check:
You see: sink
putin('washingsponge', 'sink')
False
<char0> [putin] <washingsponge> (266) <sink> (247)
State check:
You see: sink
find('faucet')
False
<char0> [find] <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)

--Executing task: bring coffeepot and cupcake to the coffee table--
Plan:  def bring_coffeepot_and_cupcake_to_the_coffee_table():
	# 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 coffee table
	find('coffeetable')
	# 4: put coffeepot on coffee table
	assert('coffeepot' in 'hands' )
		else: find('coffeepot')
		else: grab('coffeepot')
	assert('close' to 'coffeetable' )  
		else: find('coffeetable')
	putback('coffeepot', 'coffeetable')
	# 5: find cupcake
	find('cupcake')
	# 6: grab cupcake
	assert('close' to 'cupcake')
		else: find('cupcake')
	grab('cupcake')
	# 7: put cupcake on coffee table
	assert('cupcake' in 'hands' )
		else: find('cupcake')
		else: grab('cupcake')
	assert('close' to 'coffeetable' )  
		else: find('coffeetable')
	putback('cupcake', 'coffeetable')
	# 8: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <coffeepot> (307)
State check:
You see: coffeepot is CLOSED, coffeepot INSIDE coffeemaker, coffeepot ON kitchencounter.
assert('close' to 'coffeepot')
True
<char0> [grab] <coffeepot> (307)
<char0> [find] <coffeetable> (371)
State check:
You see: coffeepot is CLOSED, coffeetable ON rug.  You have coffeepot.
assert('coffeepot' in 'hands' )
True
State check:
You see: coffeetable, coffeetable ON rug.  You have coffeepot.
assert('close' to 'coffeetable' )
True
<char0> [putback] <coffeepot> (307) <coffeetable> (371)
<char0> [find] <cupcake> (195)
State check:
You see: cupcake, cupcake ON desk.
assert('close' to 'cupcake')
False
<char0> [find] <cupcake> (195)
State check:
You see: cupcake, cupcake ON desk.
grab('cupcake')
True
<char0> [grab] <cupcake> (195)
State check:
You see: cupcake, .  You have cupcake.
assert('cupcake' in 'hands' )
True
State check:
You see: 
assert('close' to 'coffeetable' )
False
<char0> [find] <coffeetable> (111)
State check:
You see: coffeetable, coffeetable ON floor.  You have cupcake.
putback('cupcake', 'coffeetable')
True
<char0> [putback] <cupcake> (195) <coffeetable> (111)

--Executing task: microwave salmon--
Plan:  def microwave_salmon():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find salmon
	find('salmon')
	# 2: put salmon on oventray
	find('oventray')
	assert('close' to 'oventray' )  
		else: find('oventray')
	assert('oventray' is 'closed' )
		else: close('oventray')
	open('oventray')
	assert('salmon' in 'hands' )
		else: find('salmon')
		else: grab('salmon')
	assert('close' to 'oventray' )  
		else: find('oventray')
	assert('oventray' is 'opened' )
		else: open('oventray')
	putin('salmon', 'oventray')
	assert('close' to 'oventray' )
		else: find('oventray')
	assert('oventray' is 'opened' )
		else: open('oventray')
	close('oventray')
	# 3: set microwave to 5 minutes
	find('microwave')
	assert('close' to 'microwave' )  
		else: find('microwave')
	assert('microwave' is 'switchoff' )
		else: switchoff('microwave')
	switchon('microwave')
	# 4: start microwave
	# 5: wait for microwave to finish
	# 6: take salmon out of microwave
	assert('close' to 'microwave' )
		else: find('microwave')
	assert('microwave' is 'switchon' )
		else: switchon('microwave')
	switchoff('microwave')
	assert('close' to 'oventray' )  
		else: find('oventray')
	assert('oventray' is 'closed' )
		else: close('oventray')
	open('oventray')
	assert('close' to 'salmon')
		else: find('salmon')
	grab('salmon')
	assert('close' to 'oventray' )
		else: find('oventray')
	assert('oventray' is 'opened' )
		else: open('oventray')
	close('oventray')
	# 7: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <salmon> (327)
<char0> [find] <oventray> (312)
State check:
You see: 
assert('close' to 'oventray' )
False
<char0> [find] <oventray> (312)
State check:
You see: 
assert('oventray' is 'closed' )
True
<char0> [open] <oventray> (312)
act_success: False, message: <oventray> (312) can not be opened when executing "[OPEN] <oventray> (312) [0]"
State check:
You see: 
assert('salmon' in 'hands' )
False
<char0> [find] <salmon> (327)
<char0> [grab] <salmon> (327)
State check:
You see: salmon, .  You have salmon.
find('microwave')
True
<char0> [find] <microwave> (313)
State check:
You see: microwave is OFF and CLOSED
assert('close' to 'microwave' )
True
State check:
You see: microwave is OFF and CLOSED
assert('microwave' is 'switchoff' )
True
<char0> [switchon] <microwave> (313)
State check:
You see: microwave is ON and CLOSED
assert('close' to 'microwave' )
True
State check:
You see: microwave is ON and CLOSED
assert('microwave' is 'switchon' )
True
<char0> [switchoff] <microwave> (313)
State check:
You see: 
assert('close' to 'oventray' )
False
<char0> [find] <oventray> (312)
State check:
You see: 
assert('oventray' is 'closed' )
False
<char0> [close] <oventray> (312)
act_success: False, message: <oventray> (312) can not be opened when executing "[CLOSE] <oventray> (312) [0]"
State check:
You see: 
open('oventray')
False
<char0> [open] <oventray> (312)
act_success: False, message: <oventray> (312) can not be opened when executing "[CLOSE] <oventray> (312) [0]",<oventray> (312) can not be opened when executing "[OPEN] <oventray> (312) [0]"
State check:
You see: salmon, .  You have salmon.
assert('close' to 'salmon')
True
<char0> [grab] <salmon> (327)

--Executing task: watch tv--
Plan:  def watch_tv():
	# 0: walk to livingroom
	walk('livingroom')
	# 1: find tv
	find('tv')
	# 2: turn on tv
	assert('close' to 'tv' )  
		else: find('tv')
	assert('tv' is 'switchoff' )
		else: switchoff('tv')
	switchon('tv')
	# 3: find remote control
	find('remotecontrol')
	# 4: grab remote control
	assert('close' to 'remotecontrol')
		else: find('remotecontrol')
	grab('remotecontrol')
	# 5: find tv
	find('tv')
	# 6: point remote control at tv
	assert('close' to 'tv' )
		else: find('tv')
	assert('tv' is 'switchon' )
		else: switchon('tv')
	pointat('remotecontrol', 'tv')
	# 7: Done

<char0> [walk] <livingroom> (335)
<char0> [find] <tv> (264)
State check:
You see: tvstand, tv is OFF, tv ON tvstand.
assert('close' to 'tv' )
False
<char0> [find] <tv> (426)
State check:
You see: tvstand, tv is OFF, tv ON tvstand.
assert('tv' is 'switchoff' )
True
<char0> [switchon] <tv> (426)
<char0> [find] <remotecontrol> (452)
State check:
You see: remotecontrol is OFF, remotecontrol ON tvstand.
assert('close' to 'remotecontrol')
False
<char0> [find] <remotecontrol> (452)
State check:
You see: remotecontrol is OFF, remotecontrol ON tvstand.
grab('remotecontrol')
False
<char0> [grab] <remotecontrol> (452)
State check:
You see: remotecontrol is OFF, tv ON tvstand.  You have remotecontrol.
find('tv')
True
<char0> [find] <tv> (426)
State check:
You see: tv is ON, tvstand, tv is OFF, tv ON tvstand.  You have remotecontrol.
assert('close' to 'tv' )
True
State check:
You see: tv is ON, tvstand, tv is OFF, tv ON tvstand.  You have remotecontrol.
assert('tv' is 'switchon' )
False
<char0> [switchon] <tv> (426)
act_success: False, message: <tv> (426) is not off when executing "[SWITCHON] <tv> (426) [0]"
State check:
You see: tv is ON, tvstand, tv is OFF, tv ON tvstand.  You have remotecontrol.
pointat('remotecontrol', 'tv')
True
bad action

--Executing task: turn off light--
Plan:  def turn_off_light():
	# 0: walk to livingroom
	walk('livingroom')
	# 1: find lightswitch
	find('lightswitch')
	assert('close' to 'lightswitch') else: find('lightswitch')
	switchoff('lightswitch')
	# 2: Done.

<char0> [walk] <livingroom> (335)
<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: brush teeth--
Plan:  def brush_teeth():
	# 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: find faucet
	find('faucet')
	# 6: turn on faucet
	assert('close' to 'faucet' )  
		else: find('faucet')
	assert('faucet' is 'switchoff' )
		else: switchoff('faucet')
	switchon('faucet')
	# 7: put toothpaste on toothbrush
	assert('toothpaste' in 'hands' )
		else: find('toothpaste')
		else: grab('toothpaste')
	assert('close' to 'toothbrush' )  
		else: find('toothbrush')
	putin('toothpaste', 'toothbrush')
	# 8: brush teeth
	# 9: turn off faucet
	assert('close' to 'faucet' )
		else: find('faucet')
	assert('faucet' is 'switchon' )
		else: switchon('faucet')
	switchoff('faucet')
	# 10: Done
	# 11: find waterglass
	find('waterglass')
	# 12: grab waterglass
	assert('close' to 'waterglass')
		else: find('waterglass')
	grab('waterglass')
	# 13: find faucet
	find('faucet')
	# 14: turn on faucet
	assert('close' to 'faucet' )  
		else: find('faucet')
	assert('faucet' is 'switchoff' )
		else: switchoff('faucet')
	switchon('faucet')
	# 15: fill waterglass with water
	assert('waterglass' in 'hands' )
		else: find('waterglass')
		else: grab('waterglass')
	assert('close' to 'faucet' )  
		else: find('faucet')
	putin('waterglass', 'faucet')
	# 16: turn off faucet
	assert('close' to 'faucet' )
		else: find('faucet')
	assert('faucet' is 'switchon' )
		else: switchon('faucet')
	switchoff('faucet')
	# 17: Done

<char0> [walk] <bathroom> (11)
<char0> [find] <toothbrush> (65)
State check:
You see: toothbrush, toothbrush ON bathroomcounter.
assert('close' to 'toothbrush')
True
<char0> [grab] <toothbrush> (65)
<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)
<char0> [find] <faucet> (248)
State check:
You see: faucet is OFF, faucet ON kitchencounter.  You have toothpaste
assert('close' to 'faucet' )
True
State check:
You see: faucet is OFF, faucet ON kitchencounter.  You have toothpaste
assert('faucet' is 'switchoff' )
True
<char0> [switchon] <faucet> (248)
State check:
You see: toothpaste is CLOSED, faucet ON kitchencounter.  You have toothpaste
assert('toothpaste' in 'hands' )
True
State check:
You see: toothbrush, toothbrush.
assert('close' to 'toothbrush' )
True
<char0> [putin] <toothpaste> (62) <toothbrush> (65)
State check:
You see: faucet is ON, faucet is OFF, faucet ON kitchencounter.  You have toothbrush.
assert('close' to 'faucet' )
True
State check:
You see: faucet is ON, faucet is OFF, faucet ON kitchencounter.  You have toothbrush.
assert('faucet' is 'switchon' )
False
<char0> [switchon] <faucet> (248)
act_success: False, message: <faucet> (248) is not off when executing "[SWITCHON] <faucet> (248) [0]"
State check:
You see: faucet is ON, faucet is OFF, faucet ON kitchencounter.  You have toothbrush.
switchoff('faucet')
False
<char0> [switchoff] <faucet> (248)
State check:
You see: faucet is OFF, faucet ON kitchencounter.  You have toothbrush.
find('waterglass')
False
<char0> [find] <waterglass> (274)
State check:
You see: waterglass, waterglass ON rug, waterglass ON kitchentable.  You have toothbrush.
assert('close' to 'waterglass')
True
<char0> [grab] <waterglass> (274)
<char0> [find] <faucet> (248)
State check:
You see: faucet is OFF, faucet ON kitchencounter.  You have toothbrush
assert('close' to 'faucet' )
True
State check:
You see: faucet is OFF, faucet ON kitchencounter.  You have toothbrush
assert('faucet' is 'switchoff' )
False
<char0> [switchoff] <faucet> (248)
act_success: False, message: <faucet> (248) is not on when executing "[SWITCHOFF] <faucet> (248) [0]"
State check:
You see: faucet is OFF, faucet ON kitchencounter.  You have toothbrush
switchon('faucet')
False
<char0> [switchon] <faucet> (248)
State check:
You see: waterglass, waterglass.
assert('waterglass' in 'hands' )
False
<char0> [find] <waterglass> (270)
<char0> [grab] <waterglass> (270)
act_success: False, message: <character> (1) does not have a free hand when executing "[GRAB] <waterglass> (270) [0]"
State check:
You see: 
assert('close' to 'faucet' )
False
<char0> [find] <faucet> (248)
State check:
You see: faucet is ON, faucet is OFF, faucet ON kitchencounter.  You have toothbrush
putin('waterglass', 'faucet')
False
<char0> [putin] <waterglass> (274) <faucet> (248)
State check:
You see: faucet is ON, faucet is OFF, faucet ON kitchencounter, waterglass INSIDE faucet.  You have toothbrush.
assert('close' to 'faucet' )
True
State check:
You see: faucet is ON, faucet is OFF, faucet ON kitchencounter, waterglass INSIDE faucet.  You have toothbrush.
assert('faucet' is 'switchon' )
True
<char0> [switchoff] <faucet> (248)

--Executing task: throw away apple--
Plan:  def throw_away_apple():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find garbage can
	find('garbagecan')
	# 2: find apple
	find('apple')
	# 3: grab apple
	assert('close' to 'apple')
		else: find('apple')
	grab('apple')
	# 4: put apple in garbage can
	find('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')
	# 5: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <garbagecan> (229)
<char0> [find] <apple> (437)
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, apple ON coffeetable.  You have apple.
find('garbagecan')
False
<char0> [find] <garbagecan> (229)
State check:
You see: apple, .  You have apple.
assert('apple' in 'hands' )
True
State check:
You see: garbagecan is CLOSED
assert('close' to 'garbagecan' )
True
State check:
You see: garbagecan is CLOSED
assert('garbagecan' is 'opened' )
False
<char0> [open] <garbagecan> (229)
State check:
You see: garbagecan is OPEN
putin('apple', 'garbagecan')
False
<char0> [putin] <apple> (438) <garbagecan> (229)

--Executing task: make toast--
Plan:  def make_toast():
	# 0: walk to kitchen
	walk('kitchen')
	# 1: find toaster
	find('toaster')
	# 2: put bread in toaster
	find('breadslice')
	assert('close' to 'breadslice')
		else: find('breadslice')
	grab('breadslice')
	find('toaster')
	assert('close' to 'toaster' )  
		else: find('toaster')
	assert('toaster' is 'closed' )
		else: close('toaster')
	open('toaster')
	assert('breadslice' in 'hands' )
		else: find('breadslice')
		else: grab('breadslice')
	assert('close' to 'toaster' )  
		else: find('toaster')
	assert('toaster' is 'opened' )
		else: open('toaster')
	putin('breadslice', 'toaster')
	assert('close' to 'toaster' )
		else: find('toaster')
	assert('toaster' is 'opened' )
		else: open('toaster')
	close('toaster')
	# 3: turn on toaster
	assert('close' to 'toaster' )  
		else: find('toaster')
	assert('toaster' is 'switchoff' )
		else: switchoff('toaster')
	switchon('toaster')
	# 4: wait for toaster to finish
	# 5: take toast out of toaster
	assert('close' to 'toaster' )
		else: find('toaster')
	assert('toaster' is 'switchon' )
		else: switchon('toaster')
	switchoff('toaster')
	assert('close' to 'toaster' )  
		else: find('toaster')
	assert('toaster' is 'closed' )
		else: close('toaster')
	open('toaster')
	assert('close' to 'breadslice')
		else: find('breadslice')
	grab('breadslice')
	assert('close' to 'toaster' )
		else: find('toaster')
	assert('toaster' is 'opened' )
		else: open('toaster')
	close('toaster')
	# 6: Done

<char0> [walk] <kitchen> (205)
<char0> [find] <toaster> (308)
<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: toaster is OFF
assert('toaster' is 'closed' )
True
<char0> [open] <toaster> (308)
act_success: False, message: <toaster> (308) can not be opened when executing "[OPEN] <toaster> (308) [0]"
State check:
You see: toaster is OFF
assert('close' to 'toaster' )
False
<char0> [find] <toaster> (308)
State check:
You see: toaster is OFF
assert('toaster' is 'switchoff' )
True
<char0> [switchon] <toaster> (308)
State check:
You see: toaster is ON
assert('close' to 'toaster' )
False
<char0> [find] <toaster> (308)
State check:
You see: toaster is ON
assert('toaster' is 'switchon' )
True
<char0> [switchoff] <toaster> (308)
State check:
You see: toaster is OFF
assert('close' to 'toaster' )
False
<char0> [find] <toaster> (308)
State check:
You see: toaster is OFF
assert('toaster' is 'closed' )
True
<char0> [open] <toaster> (308)
act_success: False, message: <toaster> (308) can not be opened when executing "[OPEN] <toaster> (308) [0]"
State check:
You see: breadslice, .  You have breadslice.
assert('close' to 'breadslice')
True
<char0> [grab] <breadslice> (310)

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