DIRECTORY Collections, LichenDataStructure, PairCollections, IntFunctions; LichenStructuring: CEDAR DEFINITIONS IMPORTS Collections = BEGIN OPEN LichenDataStructure, Colls:Collections, PairColls:PairCollections, IntFns:IntFunctions; Set: TYPE ~ LichenDataStructure.Set; Relation: TYPE ~ LichenDataStructure.Relation; Function: TYPE ~ LichenDataStructure.Function; OneToOne: TYPE ~ LichenDataStructure.OneToOne; Seq: TYPE ~ LichenDataStructure.Seq; Thing: TYPE ~ REF ANY --actually UNION [Port, Wire]--; StepTriple: TYPE ~ RECORD [parent: StepNode, step: NameStep, child: StepNode]; StepDAG: TYPE ~ REF StepDAGPrivate; StepDAGPrivate: TYPE ~ RECORD [ down: Function--parent StepNode _ Decomp--, up: OneToOne--child stepNode f Ups--, cands: Set--of StepNode--, root: Thing ]; Decomp: TYPE ~ REF OneToOne--NameStep _ child StepNode--; Ups: TYPE ~ REF Relation--parent StepNode X NameStep--; StepNode: TYPE ~ REF ANY --actually UNION [Thing, Fake]--; Fake: TYPE ~ REF ANY; CreateDAG: PROC [root: StepNode, ups: BOOL] RETURNS [dag: StepDAG]; VerifyDAG: PROC [dag: StepDAG, mayBeLone: StepNode, midThings: BOOL]; InsertInDAG: PROC [dag: StepDAG, parent: StepNode, parts: SteppyName, thing: Thing]; AddLink: PROC [dag: StepDAG, parent: StepNode, step: NameStep, child: StepNode, downRed: BOOL]; GetDown: PROC [dag: StepDAG, parent: StepNode, step: NameStep, mayAdd: BOOL] RETURNS [child: StepNode]; GetDecomp: PROC [dag: StepDAG, parent: StepNode, mayAdd: BOOL] RETURNS [dec: Decomp]; GetUps: PROC [dag: StepDAG, child: StepNode, mayAdd: BOOL] RETURNS [ups: Ups]; RemoveLink: PROC [dag: StepDAG, parent: StepNode, step: NameStep, child: StepNode, cleanup: CleanOption]; CleanOption: TYPE ~ {ignore, wontBeNeeded, ifFake, do}; ReplaceNode: PROC [dag: StepDAG, doomed, survivor: StepNode]; RemoveLeaf: PROC [dag: StepDAG, leaf: StepNode]; CreateTreeSpace: PROC [dag: StepDAG] RETURNS [treeSpace: Colls.Space]; IsThing: PROC [node: StepNode] RETURNS [BOOL] ~ INLINE { RETURN [WITH node SELECT FROM x: Port => TRUE, x: Wire => TRUE, x: Fake => FALSE, ENDCASE => ERROR]}; RawLeaf: PROC [dag: StepDAG, node: StepNode] RETURNS [BOOL] ~ INLINE { RETURN [node#dag.root AND (WITH node SELECT FROM x: Port => TRUE, x: Wire => TRUE, x: Fake => FALSE, ENDCASE => ERROR)]}; IsKidCand: PROC [dag: StepDAG, node: StepNode] RETURNS [BOOL] ~ INLINE { RETURN [node#dag.root AND (WITH node SELECT FROM x: Port => TRUE, x: Wire => TRUE, x: Fake => dag.cands.HasMember[x], ENDCASE => ERROR)]}; END. LichenStructuring.Mesa Last tweaked by Mike Spreitzer on September 18, 1987 11:25:38 am PDT Doesn't matter what it is, only the identity is used (and the fact that it's runtime-distinguishable from a Thing). Let's use its Decomp (actually, that choice is depended on now). Κ¨– "cedar" style˜code™KšœD™D—K˜KšΟk œA˜JK˜šΟnœœ ˜$Kšœ ˜Kšœ˜—Kš˜K˜Kšœžœž œžœ˜\K˜Kšœœ˜$Kšœ œ ˜.Kšœ œ ˜.Kšœ œ ˜.Kšœœ˜$K˜Kš œœœœΟcœ˜6K˜Kšœ œœ5˜NK˜Kšœ œœ˜#šœœœ˜KšœŸΠcmŸ œ˜+Kšœ Ÿ Ÿœ˜%Kšœ Ÿœ˜K˜ K˜—K˜Kš œœœ Ÿ  Ÿœ˜9Kš œœœ Ÿ Ÿ œ˜7K˜Kš œ œœœŸ œ˜:šœœœœ˜Kšœ΅™΅—K˜Kšž œœœœ˜CKšž œœ0œ˜EK˜Kšž œœC˜TKšžœœLœ˜_Kšžœœ:œœ˜gKšž œœ*œœ˜UKšžœœ)œœ ˜Nšž œœY˜iKšœ œ&˜7—Kšž œœ,˜=Kšž œœ ˜0K˜Kšžœœœ˜FK˜š žœœœœœ˜8šœœœ˜Kšœ œ˜Kšœ œ˜Kšœ œ˜Kšœœ˜——K˜š žœœ œœœ˜Fš œœœœ˜0Kšœ œ˜Kšœ œ˜Kšœ œ˜Kšœœ˜—K˜—š ž œœ œœœ˜Hš œœœœ˜0Kšœ œ˜Kšœ œ˜Kšœ"˜"Kšœœ˜——K˜Kšœ˜—…— Έx