sp {99*bottles*init (state ^superstate nil) --> ( ^beer-bottles 99) } sp {99*bottles*propose*countdown (state ^beer-bottles ) --> ( ^operator +) ( ^name countdown ^num-bottles ) } sp {99*bottles*apply*countdown (state ^beer-bottles { > 0 } ^operator ) ( ^name countdown ^num-bottles ) --> (write (crlf) | bottles of beer on the wall; | | bottles of beer. You take one down, you pass it around, | (- 1) | bottles of beer on the wall.|) ( ^beer-bottles - ^beer-bottles (- 1)) } sp {99*bottles*stop-at-0 (state ^beer-bottles 0) --> (write (crlf) |Agent is on strike. Need more beer.|) (halt) }