Topic: data type as constructors, selectors, and predicates

topics > computer science > data > Group: data type

data structures
object-oriented programming

access to components of a data object
data record
data type as a set of operations
finalization of data
generic operations and polymorphism
initialization of data
list processing
object transformation language
object-oriented classes
variable as function that accesses an object's value


An early view of data type and one that is still prevalent, is that a data type consists of constructors for creating new instances, selectors for accessing and modifying the type's components, and predicates for testing attributes. When data structures are defined by records, this is a natural definition of data types. The selectors can be anything, they don't have to correspond to primitive types. (cbb 1/90)
Subtopic: type as constructors, selectors up

Quote: abstract data as matrix of constructors and observations of abstract state; e.g. cons and head [»cookWR5_1990]
Quote: object-oriented abstraction as constructors of objects with fields as observations [»cookWR5_1990]
Quote: need constructors and extractors for records; default values and tuple values [»gescCM6_1975, OK]
Quote: allow anything to be part of a mode declaration, e.g., a field that returns the number of leading zero's [»wegbB_1971, OK]
Quote: define data types by object creation function and field selectors [»grisRE_1972, OK]
Quote: example of defining a structure by specifying the accessing algorithms; uses paraphrase extension [»wulfWA12_1971, OK]
Quote: implementers see types as a specification of storage mapping for values [»wegnP10_1986]
Quote: an ASDL type is defined by productions that enumerate the type's constructors; e.g., stm = Compound(stm, stm) | Assign(Id, exp) | Print (exp, list) [»wangDS10_1997]
QuoteRef: wulfWA4_1974 ;;7 every form has a create and destroy function for own and local instantiations
QuoteRef: stanT_1967 ;; Landin '64: originated idea of predicates, selectors and constructors

Subtopic: constructor as initializer up

Quote: constructing a type with an initial value is the same as assigning a value; both values equal afterwards [»dehnJC4_1998]

Subtopic: property setters up

Quote: allow default constructor plus property setters in place of a parameterized constructor [»cwalK_2006]

Subtopic: get and put up

Quote: an L-value has two functions, one for its R-value (contents) and the other to update its R-value [»straC8_1967]
Quote: a relational database has only one type, 'relation', with get and put operations on field values

Subtopic: predicates up

Quote: with type, declare predicates for testing type states, e.g., c = UPPERCASE [»hendP9_1975]

Subtopic: time complexity up

Quote: constructors, destructors, and assignment are average-case linear time in total size of all parts [»dehnJC4_1998]

Subtopic: examples up

QuoteRef: landPJ_1966 ;;108 on AE's have predicates for each type (ed identifier (x) == true) selectors for each component (eg lambda body (lambda x.x+1) == x+1 constructors for each type (eg constructlambda (x, x+1)
Quote: APPL = [opr: EXP, opnd: EXP] defines a set APPL, selectors opr and opnd, classifier appl?, and constructor mk-appl
QuoteRef: ledgHF9_1971 ;;134 Standish 67: structure generator ("constructor"), analyzer ("selector of structure component) and tester (true if defined structure "predicate
QuoteRef: mccaJ_1960 ;;187 Lisp has predicates (atom, eq-- true iff two equal atoms), selectors (carr -- 1st element, cdr -- last element of pair) and constructors (cons --construct and ordered pair)

Related Topics up

Group: data structures   (12 topics, 278 quotes)
Group: object-oriented programming   (26 topics, 822 quotes)

Topic: access to components of a data object (4 items)
Topic: data record (57 items)
Topic: data type as a set of operations (38 items)
Topic: finalization of data (11 items)
Topic: generic operations and polymorphism (67 items)
Topic: initialization of data (45 items)
Topic: list processing (15 items)
Topic: object transformation language (10 items)
Topic: object-oriented classes (67 items)
Topic: variable as function that accesses an object's value
(21 items)

Updated barberCB 12/05
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.