Invariant encoded: the stack must be free from duplicates