Simple Stack
In this exercise we will model a bounded stack using a sequence.
Variables
The spec should contain a single variable buffer, which is a sequence of values.
Initial State
Initially buffer should be the empty sequence <<>>.
Transitions
- If the length of
bufferis less than3, any value in the set{1, 2, 3}can be appended tobuffer. - If
bufferis not empty, the last element can be removed frombuffer.