An introduction to formal reasoning on programs
A. Bossavit
Abstract:types, algebraic approach The notion of "abstract (data) type" [7] can be formalized in various ways. We adopt here the style of the authors of [4] and [10], to which we refer the reader for a more formal treatment. As a rule, one doesn't define a single type in isolation, but a family of interacting types: sets are provided (the INTEGER set, the set of REALS, the LOGICAL set, with its two elements true and false, etc.), as well as mappings between them, for instance, 1 We underline a word, either for emphasis, as here, or to warn that a definition is meant, be it explicitly given in the text, or just evoked and left to the reader's recollections. Such labels as REAL, INTEGER, etc., will be singular or plural, as convenient. Italics are reserved from program objects in this text. As a rule, CAPITALS will denote data types, while individual objects and operations will stand in small case. Underlined italicized words, such as while, do, etc., are keywords of the programming language. (1) even : INTEGER → LOGICAL, a unary function (a single operand), or the common arithmetic functions, most often binary, or else the constants, such as (2) 0 : → INTEGER, (3) true : → LOGICAL, whose "arity" is zero. All that is organized by relations, which assert properties of functions, for instance