FrigeLogicFSM Here is a logic to solve a joke problem: "How to put a giraffe to the frige in 3 steps?" "Open the frige, put giraffe, close the frige" "And how to put a behemoth to the frige in 4 steps?" "Open the frige, get giraffe, put behemoth, close the frige" And here is an "extension": you can free the frige by taking appropriate animal out. Empty PutHippopotamus PutGiraffe FreeFrige getHippopotamus getGiraffe putGiraffe putHippopotamus openFrige closeFrige Empty There's noone in a frige giraffe Put Giraffe to the frige PutGiraffe Giraffe openFrige putGiraffe closeFrige behemoth PutHippopotamus Hippopotamus openFrige putHippopotamus closeFrige Hippopotamus We put a hippopotamus to the frige giraffe PutGiraffe Giraffe openFrige getHippopotamus putGiraffe closeFrige free FreeFrige Empty openFrige getHippopotamus closeFrige Giraffe We put a giraffe to the frige hippo PutHippopotamus Hippopotamus openFrige getGiraffe putHippopotamus closeFrige free FreeFrige Empty openFrige getGiraffe closeFrige Giraffe 5197 5303 Empty 5343 5086 Hippopotamus 5450 5310 Empty 0 5273 5195 Empty 1 5456 5204 Giraffe 0 5363 5286 Giraffe 1 5322 5224 Hippopotamus 0 5364 5367 Hippopotamus 1 5395 5220