rewrite superstates-substates example