Simple data types We have the unit type {

Simple data types

We have the unit type {?}, to begin with.Without inputs; this trivial type serves as the domain of relations.With T nonempty, these relations are of the form {?} × T, and we denote them by T (when the type is clear from the context subscript T is omitted). For T.?, we also use T as abbreviation; in that case T denotes an arbitrary value of type T.We do not know whether T =T—unless T is a singleton type, of course, as this value is not fixed.If T is a singleton type, note that T is a constant; in that case we write—as usual—c instead of T, where c is the unique element of T.Denoted by Bool, another finite type is the set of booleans {false, true}.For predicates, boolean operators are denoted by the same symbols, which are boolean-valued functions.Certainly, together with the well-known arithmetical operators, there are the numerical types Natural (naturals), Int (integers), and Real (reals).We use standard notations, for these types, except perhaps for our notation for intervals: (a,b) denotes set {x | a ? x < b}, in which the type of dummy x depends on the context; the three other variations, which speak for themselves are a..b, (a..b, and (a..b).
We use the values ? and ??, in connection with numerical types.It depends on the context whether a numerical type contains these values or not, because it is a common practice.
Structured data types

We Will Write a Custom Essay Specifically
For You For Only \$13.90/page!

order now

Consider T be a nonempty data type.We have the finite sets over T, the finite bags over T, the finite lists over T, and the finite binary trees over T, or “sets”, “bags”, “lists”, and “trees” for short, in order of increasing structure.These structured types are denoted by {T}, (T) and T respectively, and we will sometimes call elements of these types “structures” in the sequel.We will also use the above pairs of brackets to form structures of the respective types according to this notation.Particularly, we use { }, , and ( ) to denote the empty set, the empty list ,the empty bag,and the empty tree.Similarly, {a}, a, a, and a’ denote singleton structures, and, for example, 1, 2, 1 denotes a three-element bag.Expressions like {0} denote both a type and a structure, in this notation. The role of structures and types is however quite different such that the context usually resolves such obscurities.We use the symbol #, to denote the size of a