PairList.Mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last changed by: 26-Jun-81 18:28:36
Cedar version:18-Jun-81 14:24:37
Ordered pairs; building and searching
Nearly the same as RelationDefs, written by Rick Tiberi
PairList: CEDAR DEFINITIONS =
BEGIN
RelationHead: TYPE = RECORD[first, last: REF Pair];
Relation: TYPE = REF RelationHead;
Pair: TYPE = RECORD[link: REF Pair, left, right: REF ANYNIL];
NotFound: SIGNAL;
EqualProc: TYPE = PROC[left,right: REF ANY] RETURNS[return: BOOLEAN];
CreateRelation: PROCEDURE RETURNS [Relation];
AddPair: PROCEDURE [relation: Relation, left, right: REF ANYNIL];
Left: PROCEDURE[relation: Relation, equals: EqualProc, right: REF ANYNIL]
RETURNS [REF ANYNIL];
Right: PROCEDURE[relation: Relation, equals: EqualProc, left: REF ANYNIL]
RETURNS [REF ANYNIL];
ForAllPairs: PROCEDURE[relation: Relation,
do: PROCEDURE[leftPart, rightPart: REF ANYNIL]];
DestroyRelation: PROCEDURE[relation: Relation];
END.