DIRECTORY LichenDataStructure, IO; LichenTransforms: CEDAR DEFINITIONS = BEGIN OPEN LichenDataStructure; IntroCellType: PROC [design: Design] RETURNS [newCT: CellType]; ExtroCellType: PROC [design: Design, oldCT: CellType]; Differentiate: PROC [design: Design, uses: ConstSet--of Use of oldCT--] RETURNS [newCT: CellType]; Undifferentiate: PROC [design: Design, toType, fromType: CellType] RETURNS [changed: ConstSet--of Use of fromType--]; LowerChildren: PROC [design: Design, childType: CellType, sibber: ConstFunction--instance of array*n of childType _ Seq (role f sibling: instance of array*n of type of gcs[role])--] RETURNS [gcs: Seq--role f grandchild--]; RaiseGrandchildren: PROC [design: Design, gcs: Seq--role f instance in childType--] RETURNS [childType: CellType, sibber: ConstFunction--instance of array*n of childType _ Seq (role f sibling: instance of array*n of type of gcs[role])--, typer: ConstFunction--array*n of childType _ Seq (role f array*n of type of gcs[role])--]; MergeTypes: PROC [design: Design, pairs: ConstOneToOne--instance of array* of from f instance of array* of into--]; SplitType: PROC [design: Design, fizz: ConstSet--of instance in from--] RETURNS [from, to: CellType, pairs: ConstOneToOne--instance of array* of from f instance of array* of to--]; GroupUnorganized: PROC [design: Design, mapper: ConstFunction--any _ Seq (role f sibling: instance of array* of type of newType's roleth child)--] RETURNS [newType: CellType, pairs: ConstOneToOne--domain of mapper f instance of array* of newType--, gcs: Seq--role f instance in newType--]; ExpandUnorganized: PROC [design: Design, cellType: CellType] RETURNS [mapper: ConstFunction--instance of array*n of cellType _ Seq (role f sibling: instance of array*n of type of cellType's roleth child)--]; ExpandVertex: PROC [child: CellInstance] RETURNS [roleToSib: Seq--role f sibling: CellInstance--]; ExpandChildren: PROC [design: Design, parent: CellType, flatten: BOOL _ FALSE]; Flatten: PROC [root: CellType, expand: ConstFilter--of CellInstance--]; END. œLichenTransforms.Mesa Last tweaked by Mike Spreitzer on July 10, 1987 1:51:23 pm PDT Use of CT = instance of CT or array of ct Pre: newCT N design Post: newCT B design & empty newCT & |uses of newCT|=0 Pre: newCT B design & (empty newCT V |uses of newCT|=0) Post: newCT N design Pre: E oldCT A i B uses: i of oldCT Post: (uses of newCT) = uses & equiv(newCT, oldCT) Pre: A i B changed: i of fromType & equiv(fromType, toType) Post: A i B changed: i of toType Inverse of RaiseGrandchildren. Equivalent to [, pairs, gcs] _ GroupUnorganized[sibber]; MergeTypes[pairs-1]. Inverse of LowerChildren. Equivalent to [childType, temp, pairs] _ SplitType[gcs]; ss _ ExpandUnorganized[temp]; sibber _ pairsgss. Each pair is replaced by an instance of the new version of into, which got the contents of from merged into it. Cell type from is then deleted. Inverse of SplitType. Equivalent to [from, sibber]_RaiseGrandchildren[]; LowerChildren[into, pairs-1gsibber]; ExtroCellType[from]. The fizz must all be components of from; they are moved into the new cell type to. At each use of from, a corresponding use of to is created. Inverse of MergeTypes. Equivalent to (assuming no array+s of from) to_CreateCellType[]; ForEachInstance[from, l fi {ti _ Instantiate[type: to, in: fi.parent]; pairs _ pairs + }]; [from, sibber]_RaiseGrandchildren[fizz]; LowerChildren[to, pairs-1gsibber]. For each pair in the mapping, replace the range of the range with an instance of the new cell type. Inverse of ExpandUnorganized. Equivalent to (assuming no sibling is array+ed) newType _ IntroCellType[]; mapper.Enum[l {ti _ Instantiate[newType, seq[0].parent]; pairs _ pairs + }]; gcs _ LowerChildren[newType, pairs-1gmapper]. Replaces each use of cellType with corresponding uses of the contents of cellType. Inverse of GroupType. Equivalent to [cellType, mapper] _ RaiseGrandchildren[]; ExtroCellType[cellType]. replaces child with its contents. Equivalent to Differentiate[{child}] then ExpandUnorganized[(new type of child)]. If flatten then ExpandVertex[each composite descendant] else ExpandVertex[each composite child]. Expands the given vertices. ΚΤ– "cedar" style˜code™K™>—K˜KšΟk œœ˜"K˜KšΠbxœœ œ˜%K˜Kšœœ˜K˜K™)K˜šΟn œœœ˜?Kšœ Οmœ™Kšœ  œ œ  œ™6—K˜šŸ œœ#˜6Kšœ  œ œ œ™7Kšœ  œ™—K˜šŸ œœ Οcœœ˜bKšœ œ œ œ™#Kšœ œ™2—K˜šŸœœ.œ‘œ˜uKšœ œ œ œ™;Kšœ œ œ™ —K˜šŸ œœ<‘Πcu‘Πcm‘ £‘’‘œœ ‘£‘ œ˜ήKšœ™KšœIΟuœ™M—K˜šŸœœ‘£‘œœ,‘’‘£‘ £‘’‘œ‘’‘£‘ £‘’‘œ˜ΘKšœ™K•CharSetseο• CharProps