Container Abstractions: Abstractions for containers (such as lists, stacks, sets, or queues) may represent just the state of a container—e.g., full or empty—and abstract away from the actual container content. The list operations also need to be abstracted. For example, consider the operation insert(l,x) which adds element x to the end of list l. The corresponding abstract operation will have the following definition:
Insert(full, x) ≡ Insert(empty, x) ≡ full
You can also use container abstractions in conjunction with the symbolic data abstractions presented above. Consider, for example, an abstraction that supports reasoning about ordered lists. This abstraction represents the behavior of lists that contain elements which were themselves abstracted using the abstract domain {d1, d2,other}. Conceptually, the abstract list records whether the list contains a specific d1 value; the list also records the ordering of two inserted elements d1 and d2, but the abstraction does not record any information about the size of the list.