PWCLCoreFlatExtras.mesa
Mike Spreitzer March 5, 1987 4:29:48 pm PST
DIRECTORY Core, CoreFlat, CoreOps, IO;
PWCLCoreFlatExtras: CEDAR DEFINITIONS = {OPEN CoreFlat, CO: CoreOps;
Abstract Cut Sets
Cut: TYPE = RECORD [
MembershipTester: CutMembershipTester,
data: REF ANYNIL];
CutMembershipTester: TYPE = PROC [cutData: REF ANY, root: CellType, cellType: CellType, flatCell: FlatCellTypeRec, instance: CellInstance] RETURNS [BOOL];
Includes: PROC [cut: Cut, root: CellType, cellType: CellType, flatCell: FlatCellTypeRec, instance: CellInstance] RETURNS [BOOL]
= INLINE {RETURN [cut.MembershipTester[cut.data, root, cellType, flatCell, instance]]};
SetCut: PROC [CutSet] RETURNS [Cut];
leaves: Cut;
Flat printing
FlatPrint: PROC [
root: CellType,
filter: Filter ← NIL,
to: IO.STREAM,
Annotator: PROC [subject: Descendant, to: IO.STREAM] ← NIL,
leaves: Cut
];
Filter: TYPE ~ PROC [cellType: CellType, flatCell: FlatCellTypeRec, instance: CellInstance, bindings: Bindings] RETURNS [BOOL];
PrintNeighborhood: PROC [
root: CellType,
of: DescendantListList,
to: IO.STREAM,
Annotator: PROC [subject: Descendant, to: IO.STREAM] ← NIL,
leaves: Cut
];
MakeNeighborhoodFilter: PROC [of: DescendantListList, Consume: PROC [Filter]];
DescendantListList: TYPE = LIST OF DescendantList;
DescendantList: TYPE = LIST OF Descendant;
Descendant: TYPE = REF ANY--actually UNION [FlatWire, FlatCellType, REF InstancePath]--;
Helpful things for CoreFlat
InitialBindingTable: PROC [root: CellType] RETURNS [bindings: Bindings];
Makes entries for all the public wires of root.
Helpful things for CoreOps
VisitWireSeq: PROC [seq: Wire, eachWire: CO.EachWireProc] RETURNS [quit: BOOL];
Calls VisitWire on each element of the seq.
VisitBindingSeq: PROC [actual, public: Wire, eachWirePair: CO.EachWirePairProc] RETURNS [quit: BOOL];
Calls VisitBinding on each element of the two sequences.
CorrectConform: PROC [actual, public: Wire] RETURNS [BOOL];
Works for DAGs, not just trees.
}.