PairList.Mesa
Last changed by: 26-Jun-81 18:28:36
Cedar version:18-Jun-81 14:24:37
Ordered pairs; building and searching
Last Edited by: Beach, May 1, 1984 2:08:58 pm PDT
PairList: CEDAR DEFINITIONS =
BEGIN
RelationHead: TYPE = RECORD[first, last: REF Pair];
Relation: TYPE = REF RelationHead;
Pair: TYPE = RECORD[link: REF Pair, left, right: REF ANY ← NIL];
NotFound: SIGNAL;
EqualProc: TYPE = PROC[left,right: REF ANY] RETURNS[return: BOOLEAN];
CreateRelation: PROCEDURE RETURNS [Relation];
AddPair: PROCEDURE [relation: Relation, left, right: REF ANY ← NIL];
Left:
PROCEDURE[relation: Relation, equals: EqualProc, right:
REF
ANY ←
NIL]
RETURNS [REF ANY ← NIL];
Right:
PROCEDURE[relation: Relation, equals: EqualProc, left:
REF
ANY ←
NIL]
RETURNS [REF ANY ← NIL];
ForAllPairs:
PROCEDURE[relation: Relation,
do: PROCEDURE[leftPart, rightPart: REF ANY ← NIL]];
DestroyRelation: PROCEDURE[relation: Relation];
END.