LichenComparisonOps:
CEDAR
DEFINITIONS
IMPORTS LichenDataOps, LichenDataStructure
=
BEGIN OPEN LichenDataStructure;
Log: PROC [format: ROPE, v1, v2, v3, v4, v5: IO.Value ← [null[]]];
FlushLog: PROC;
WriteColorTable: PROC [colorTable: ColorTable, descriptions: RealGraphDescriptions];
WriteAll: PROC [when: ROPE, descriptions: RealGraphDescriptions, a, b: CellType, oldColorData, curColorData: ColorTable];
VerboseVName: PROC [Vertex] RETURNS [ROPE];
InitialColor:
PROC [v: Vertex]
RETURNS [initialColor: Color] =
INLINE {
WITH v
SELECT
FROM
w: Wire => initialColor ← initialNetColor;
ci: CellInstance => initialColor ← IF LichenDataOps.IsMirror[ci] THEN mirrorColor ELSE ci.type.color;
im: Intermediary => initialColor ← initialNetColor;
ENDCASE => ERROR;
initialColor ← FilterColor[initialColor];
};
VName: PROC [v: Vertex] RETURNS [r: ROPE] = INLINE {r ← Describe[v, v.containingCT]};
VDead: PROC [v: Vertex] RETURNS [ded: BOOL] = INLINE {RETURN [FALSE]};
OldColor: PROC [v: Vertex] RETURNS [c: Color] = INLINE {c ← v.oldColor};
SetOldColor: PROC [v: Vertex, c: Color] = INLINE {v.oldColor ← c};
CurColor: PROC [v: Vertex] RETURNS [c: Color] = INLINE {c ← v.curColor};
SetCurColor: PROC [v: Vertex, c: Color] = INLINE {v.curColor ← c};
GetGraph: PROC [v: Vertex] RETURNS [g: GraphID] = INLINE {g ← v.graph};
SetGraph: PROC [v: Vertex, g: GraphID] = INLINE {v.graph ← g};
GetUnique: PROC [v: Vertex] RETURNS [b: BOOL] = INLINE {b ← v.unique};
SetUnique: PROC [v: Vertex, b: BOOL] = INLINE {v.unique ← b};
GetSuspect: PROC [v: Vertex] RETURNS [b: BOOL] = INLINE {b ← v.suspect};
SetSuspect: PROC [v: Vertex, b: BOOL] = INLINE {v.suspect ← b};
GetQNext: PROC [v: Vertex] RETURNS [w: Vertex] = INLINE {w ← v.QNext};
SetQNext: PROC [v: Vertex, w: Vertex] = INLINE {v.QNext ← w};
GetColorNext: PROC [v: Vertex] RETURNS [w: Vertex] = INLINE {w ← v.colorNext};
SetColorNext: PROC [v: Vertex, w: Vertex] = INLINE {v.colorNext ← w};
GetEquiv: PROC [v: Vertex] RETURNS [w: Vertex] = INLINE {w ← v.equiv};
SetEquiv: PROC [v: Vertex, w: Vertex] = INLINE {v.equiv ← w};
DeleteVertex:
PROC [parent: CellType, v: Vertex]
~ INLINE{LichenDataOps.DeleteVertex[v]};
MergeVertices:
PROC [parent: CellType, v1, v2: Vertex]
RETURNS [merged, doomed: Vertex]
~ INLINE {[merged, doomed] ← LichenDataOps.MergeNets[NARROW[v1], NARROW[v2]]};
RemoveEdge:
PROC [e: Edge]
~ INLINE {LichenDataOps.RemoveEdges[e]};
CompareGraphs:
PROC
[
descriptions: RealGraphDescriptions,
a, b: CellType,
GenerateHints: PROC [Consume: PROC [vA, vB: Vertex]],
pick, mirrors, mayQuitEarly: BOOL,
abort: REF BOOL]
RETURNS [equiv, didQuitEarly: BOOL, partition: ColorTable];
END.