iteration p t v =
  let n = (state (stackTop p)) p t v
      tFirst  (a, _) = a
      tSecond (_, b) = b
  in if tSecond n
    then iteration (tFirst n) t v
    else (tFirst n)
iteration p t v =
  let n = (state (stackTop p)) p t v
      tFirst  (a, _) = a
      tSecond (_, b) = b
  in if tSecond n
    then iteration (tFirst n) t v
    else (tFirst n)
iteration p t v =
  let n = (state (stackTop p)) p t v
      tFirst  (a, _) = a
      tSecond (_, b) = b
  in if tSecond n
    then iteration (tFirst n) t v
    else (tFirst n)