content_image/735604.jpg
## CHAPTER 8 

## Set Types 

A set type provides a compact structure for recording a collection of values having the same ordinal t) I)e. More precisely, a set type defines the set of values that is the powe,\et of its base type, i.e., the set of all possible subsets of values of the base type, including the empty set. Therefore, a single value of a set t) pe is a set, and the elements of that set are values of the base type. A set is also a random-access structure whose elements all have the same base type, which must be an ordinal type . 

<img src='content_image/735604.jpg'>

Operations valid for set vallil:s are assignment, the familiar set operations (e.g., set union), equality. and selection of components by testing for membership (see beloVo I. Set values may be built up from set elements by the operation of se 1 construction. Implementations of Pascal usually define limits for the ~ize of sets, which can be quite small (e.g., the number bits in a machine·' word"). The limit applies directly to the range of the base type of the set type. 

