-- RightFeaturePQ.mesa -- A generic package to organize items -- in a priority queue, sorted by increasing order of -- Val. -- last modified by E. McCreight, July 29, 1982 2:53 PM -- customized for RightFeature by E. McCreight, -- May 6, 1982 2:34 PM -- written by E. McCreight, February 8, 1982 2:04 PM DIRECTORY ppdefs, ChipNetDefs; RightFeaturePQ: DEFINITIONS IMPORTS ChipNetDefs = BEGIN checkTree: PRIVATE BOOLEAN = FALSE; Domain: PRIVATE TYPE = ChipNetDefs.Coord; Item: PRIVATE TYPE = ChipNetDefs.FeaturePtr; RightFeaturePQHandle: TYPE = LONG POINTER TO PQObject _ NIL; PQHandle: PRIVATE TYPE = RightFeaturePQHandle; PQObject: PRIVATE TYPE = RECORD [ zone: UNCOUNTED ZONE, size: CARDINAL _ 0, s: PQSeqPtr ]; PQSeqPtr: PRIVATE TYPE = LONG POINTER TO PQSeq _ NIL; PQSeq: PRIVATE TYPE = RECORD[ heap: SEQUENCE max: CARDINAL OF Item ]; RightFeaturePQUnderflow: SIGNAL; NewRightFeaturePQ: PROCEDURE[zone: UNCOUNTED ZONE, max: CARDINAL _ 50] RETURNS[PQHandle]; DestroyRightFeaturePQ: PROCEDURE[p: PQHandle] RETURNS[PQHandle]; InsertRightFeaturePQ: PROCEDURE[p: PQHandle, item: Item]; ExtractRightFeaturePQ: PROCEDURE[p: PQHandle] RETURNS[item: Item]; MapEqualRightFeaturePQ: PROCEDURE[p: PQHandle, proc: PROCEDURE[Item]]; DeleteEqualRightFeaturePQ: PROCEDURE[p: PQHandle]; RightFeaturePQSize: PROCEDURE[p: PQHandle] RETURNS[CARDINAL] = INLINE {RETURN[p.size]}; RightFeaturePQMin: PROCEDURE[p: PQHandle] RETURNS[item: Item] = INLINE {RETURN[p.s.heap[0]]}; ValLess: PROCEDURE[item1, item2: Item] RETURNS[BOOLEAN] = INLINE {RETURN[item1.cover.x2