SetsAndStuffDoc.Tioga
Last tweaked by Mike Spreitzer on December 8, 1987 12:54:28 pm PST
SetsAndStuff
CEDAR 7.0 — FOR INTERNAL XEROX USE ONLY
SetsAndStuff
Abstract Data Types for Sets, Relations, &etc.
Mike Spreitzer
© Copyright 1987 Xerox Corporation. All rights reserved.
Abstract: This package defines some abstract data types for abstractions like sets, relations, functions, sequences, and so on. Some implementations are also provided.
Created by: Mike Spreitzer
Maintained by: Mike Spreitzer <Spreitzer.pa>
Keywords: Set, Relation, Function, Sequence, Series, Array
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. The Package
Basic Philosophy
An abstract data type is one that specifies the operations the may be performed without specifying the implementation. This is done, as usual, by having a REF ANY that holds the actual implementation, and a record of class procedures. For each abstraction, or related set of abstractions, there is an interface. That interface include a section containing the generic operations, a section for some special cases of the general abstraction and operations peculiar to the special case, and a section dealing with how to make an implementation for one of the abstractions.
Particulars
The basic interface is AbSets (Abstract Sets). It sets forth an abstract data type for sets and set variables. It uses some basic definitions set forth in the SetBasics and IntStuff interfaces. The BiRels interface deals with an abstract data type for binary relations and variables thereover; a binary relation is viewed as a set of 2-tuples. Another interface could be introduced for general relations, where a general relation is a natural number n and a set of n-tuples; this would get us into the relational algebra popular with databases.
An element of a set or tuple is represented by a variant record, whose variants cover REF ANY and INT. The SetBasics interface defines an abstract data type called Space, whose purpose is to provide the interpretation of those variant records as arbitrary mathematical objects. Each Set knows the Space it uses to provide interpretations for its elements. The IntStuff interface's main purpose is to introduce an extended-precision integer datatype, which we need because we want a representation for things like the number of Cedar INTs (i.e., 1+CARD.LAST).
2. Design Issues
There are lots of them. Discussion and suggestions are welcome.
More to come. (In OldSetsAndStuffDoc.Tioga you can see a discussion that's partially outdated because of a major design change.)