# 3 pegs, 3 slots each, each slot is an integer representing plate width type Peg: left middle right task Main: Init() Hanoi() task Hanoi(right.bottom == 3 & right.middle == 2 & right.top == 1): complete() task Init: pass effects: left.bottom = 3 left.middle = 2 left.top = 1 task Pickup_top(carry==0 & peg.top > 0) for Peg as peg: pickup(peg.top) effects: carry = peg.top peg.top = 0 task Pickup_middle(carry==0 & peg.middle > 0 & peg.top == 0) for Peg as peg: pickup(peg.middle) effects: carry = peg.middle peg.middle = 0 task Pickup_bottom(carry==0 & peg.bottom > 0 & peg.middle == 0 & peg.top == 0) for Peg as peg: pickup(peg.bottom) effects: carry = peg.bottom peg.bottom = 0 task Dropoff_top(carry>0 & peg.top==0 & peg.middle > carry) for Peg as peg: dropoff(peg.top, carry) effects: peg.top = carry carry = 0 task Dropoff_middle(carry>0 & peg.middle==0 & peg.bottom > carry & peg.top == 0) for Peg as peg: dropoff(peg.middle, carry) effects: peg.middle = carry carry = 0 task Dropoff_bottom(carry>0 & peg.bottom==0 & peg.middle == 0 & peg.top == 0) for Peg as peg: dropoff(peg.bottom, carry) effects: peg.bottom = carry carry = 0