Контракты:
<tex> push </tex> pre: element != NULL post: size = size' + 1 and elements[size'] == element void push (Object element)
<tex pop pre: size >pre0 post: element !size = NULL </tex>= size' - 1 and result == elements[size] Object pop()
<tex peek pre: size >0 post: size result == size' + 1</tex> <tex> and </tex> <tex> elements[size'- 1] == element </tex> Object peek()
<tex> void</tex> <tex> push size post: result == size int size(Object</tex> <tex> element) </tex>
<tex> pop:</tex> <tex> pre: size > 0 </tex> <tex>post: size == size' - 1</tex> <tex> and </tex> <tex>result == elements[size]</tex> <tex> Object</tex> <tex> pop() </tex> <tex> peek:</tex> <tex>pre: size > 0</tex> <tex>post: result == elements[size - 1]</tex> <tex> Object</tex> <tex> peek() </tex> <tex> size:</tex> <tex>post: result == size </tex> <tex>int</tex> <tex> size()</tex> <tex> isEmpty:</tex> <tex> post: result == size > 0</tex> <tex> boolean</tex> <tex>isEmpty() </tex>