DIRECTORY BasicTime, Commander, IO, List, RedBlackTree, Rope, TimeStamp; MakeDo: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; RopeList: TYPE = LIST OF ROPE; RefTable: TYPE = RedBlackTree.Table; PropList: TYPE = List.AList; Time: TYPE = BasicTime.GMT; notExistTime: Time = BasicTime.nullGMT; unknownTime: Time = LOOPHOLE[FIRST[LONG CARDINAL]]; Stamp: TYPE = TimeStamp.Stamp; notExistStamp: Stamp = [255, 255, LAST[LONG CARDINAL]]; unknownStamp: Stamp = TimeStamp.Null; NodeList: TYPE = LIST OF Node; Node: TYPE = REF NodeRep; NodeRep: TYPE; ActionList: TYPE = LIST OF Action; Action: TYPE = REF ActionRep; ActionRep: TYPE; Warning: SIGNAL [message: ROPE]; IsNode: PROC [REF ANY] RETURNS [BOOL]; NarrowToNode: PROC [REF ANY] RETURNS [Node]; IsAction: PROC [REF ANY] RETURNS [BOOL]; NarrowToAction: PROC [REF ANY] RETURNS [Action]; Ensure: PROC [goals: RefTable, modifiabilitySpec: ModifiabilitySpec] RETURNS [okGoalCount, nonOKGoalCount, nSteps: NAT, failedSteps: ActionList, nonOKGoalList: NodeList]; ModifiabilitySpec: TYPE = RefTable; Modifiability: TYPE = {yes, guess, no, uninitialized}; Explain: PROC [ch: Commander.Handle, nodes: RefTable]; GetActions: PROC [goals: RefTable, modifiabilitySpec: ModifiabilitySpec] RETURNS [ActionList]; DestructivelyReverseActionList: PROC [ActionList] RETURNS [ActionList]; SuspectNodeChange: PROC [n: Node]; UncurrentNode: PROC [n: Node]; UncurrentProducer: PROC [n: Node]; ForAll: PROC [suspectChange, uncurrent: BOOL]; DestroyGraph: PROC; RetryToProduce: PROC [Node]; MakeRefTable: PROC RETURNS [table: RefTable]; AddToRefTable: PROC [ra: REF ANY, t: RefTable]; EnsureRefInTable: PROC [ra: REF ANY, t: RefTable]; DeleteFromRefTable: PROC [ra: REF ANY, t: RefTable] RETURNS [found: REF ANY]; AnalyzeDFFile: PROC [dfName: ROPE, goals: RefTable, modifiable: ModifiabilitySpec, doToVerifyGoals, doToOthers: DoToFile]; DoToFile: TYPE = {ignore, makeGoal, makeModifiable}; FindNode: PROC [someName: ROPE, class: NodeClass] RETURNS [node: Node]; LookupNodeClass: PROC [className: ROPE] RETURNS [class: NodeClass]; SetProcessAllocation: PROC [n: NAT]; AddFinder: PROC [finder: Finder, end: End]; End: TYPE = {front, back}; Finder: TYPE = RECORD [name: ROPE, finderProc: FinderProc, finderData: REF ANY _ NIL]; FinderProc: TYPE = PROC [resultName: ROPE, finderData: REF ANY] RETURNS [found: BOOLEAN, sought: Node, makes, cmdFrom: NodeList, from: From, cmd: ROPE, class: ActionClass, foundData: REF ANY]; From: TYPE = RECORD [mustHave, optional: NodeList]; ActionClass: TYPE = REF ActionClassRep; ActionClassRep: TYPE = RECORD [ CheckConsistency: ConsistencyChecker, Rederive: RederiveProc, classData: REF ANY _ NIL]; ConsistencyChecker: TYPE = PROC [a: Action, result: Node] RETURNS [consistent: BOOL, reason: ROPE]; RederiveProc: TYPE = PROC [a: Action] RETURNS [from: From, cmd: ROPE]; GetNode: PROC [someName: ROPE, class: NodeClass, mayAdd: BOOL _ TRUE] RETURNS [node: Node]; NodeClass: TYPE = REF NodeClassRep; NodeClassRep: TYPE; IsNodeClass: PROC [REF ANY] RETURNS [BOOL]; NarrowToNodeClass: PROC [REF ANY] RETURNS [NodeClass]; DeclareNodeClass : PROC [ name: ROPE, CanonizeName: PROC [ROPE] RETURNS [ROPE], GetTime: GetTimeProc ] RETURNS [nodeClass: NodeClass]; GetTimeProc: TYPE = PROC [n: Node] RETURNS [created: Time]; fileClass: NodeClass; PublicPartsOfNode: PROC [n: Node] RETURNS [name: ROPE, class: NodeClass]; PublicPartsOfNodeClass: PROC [nc: NodeClass] RETURNS [name: ROPE, CanonizeName: PROC [ROPE] RETURNS [ROPE], GetTime: GetTimeProc]; DescribeNode: PROC [n: Node] RETURNS [ROPE]; GetProp: PROC [n: Node, prop: REF ANY] RETURNS [val: REF ANY]; SetProp: PROC [n: Node, prop, val: REF ANY]; GetProducer: PROC [n: Node] RETURNS [producer: Action]; InnerGetCreated: PROC [n: Node] RETURNS [t: Time]; InnerExists: PROC [n: Node] RETURNS [exists: BOOL]; PublicPartsOfAction: PROC [a: Action] RETURNS [cmd: ROPE, foundData: REF ANY]; InnerEnumerateSources: PROC [a: Action, which: ActionDep, to: PROC [n: Node, which: ActionDep, optional: BOOL]]; ActionDep: TYPE = {cmd, data}; FmtTime: PROC [Time] RETURNS [ROPE]; GetCreated: PROC [n: Node] RETURNS [t: Time]; Exists: PROC [n: Node] RETURNS [exists: BOOL]; EnumerateConsumers: PROC [n: Node, which: ActionDep, to: PROC [Action, ActionDep]]; EnumerateResults: PROC [a: Action, to: PROC [Node]]; EnumerateSources: PROC [a: Action, which: ActionDep, to: PROC [n: Node, which: ActionDep, optional: BOOL]]; END.  MakeDo.Mesa Last Edited by: Spreitzer, February 18, 1986 5:27:57 pm PST Carl Hauser, April 11, 1985 3:34:27 pm PST New Types & Stuff: For deriving dependecies and ensuring consistency: Ensure that given goal nodes are current. NIL means guess, #NIL means modifiable iff in Table. List edges of the nodes, and give status of their producers. Recursively explores graph to leaves. Returns backwards list: actions to do later appear earlier. It is recommended that you not try to interrupt the following: If it has no producer (other than leaf), try (again) to get one. class may not be NIL. For controlling concurrency: For Stating dependency rules: Missing inputs necessitate any result being consistent; but then, this won't be called if there are missing inputs. class may not be NIL. name will first be canonized. = {exists _ InnerGetCreated[n] # notExistTime} Should only be used from inside ActionClass procs only when called from MakeDo impl. For Extracting the Dependency Graph: = {exists _ GetCreated[n] # notExistTime} Κ– "cedar" style˜code™ J™;K™*—K˜KšΟk œœ&˜HK˜KšΠbxœœ œ˜K˜Kš˜K˜Kšœœœ˜Kš œ œœœœ˜Kšœ œ˜$Kšœ œ˜Kšœœ œ˜K˜'Kš œœœœœ˜3Kšœœ˜Kšœ"œœœ˜7Kšœ%˜%head™Kšœ œœœ˜Kšœœœœ˜(Kšœ œœœ˜"Kšœœœœ˜.K˜KšΠblœœ œ˜ K˜Kš Οnœœœœœœ˜&Kš   œœœœœ˜,Kš  œœœœœœ˜(Kš  œœœœœ ˜0—™2š œœ9œ'œ4˜ͺK™)—K˜šœœ ˜#K™4—K˜Kšœœ#˜6K˜š œœ)˜6K™<—K˜š  œœ9œ˜^K™%K™;Kš œœœ˜G—K˜K™>Kš œœ ˜"Kš  œœ ˜Kš œœ ˜"Kš œœœ˜.Kš  œœ˜š œœ˜K™@—K˜Kš  œœœ˜-Kš  œœœœ˜/Kš œœœœ˜2Kš œœœœœ œœ˜Mš  œœ œY˜zKšœ œ&˜4—K˜š œœ œœ˜GK™—K˜Kš œœ œœ˜C—™Kš œœœ˜$—™Kš  œœ˜+Kšœœ˜K˜Kš œœœœ&œœœ˜VK˜Kš  œœœœœœœ œ;œ!œœ˜ΐK˜Kšœœœ ˜3K˜Kšœ œœ˜'šœœœ˜Kšœ%˜%Kšœ˜Kšœ œœœ˜—K˜š  œœœœœ œ˜cK™s—Kš   œœœ œœ˜FK˜š  œœ œœœœ˜[K™K™—K˜Kšœ œœ˜#Kšœœ˜K˜Kš   œœœœœœ˜+Kš  œœœœœ ˜6K˜šœ˜šœ˜šœ˜Kšœœ˜ Kš   œœœœœ˜)Kšœ˜Kšœ˜—Kšœ˜——K˜Kš  œœœ œ˜;K˜K˜Kš œœ œœ˜IKš œœœœ  œœœœœ˜‚Kš  œœ œœ˜,Kš œœœœœœœ˜>Kš œœœœ˜,Kš  œœ œ˜7Kš œœ œ ˜2š  œœ œ œ˜3Kšœ.™.—K˜Kš  œœ œœ œœ˜Nš œœ#œ'œ˜pKšœT™T—K˜Kšœ œ˜K˜Kš œœœœ˜$—K˜™$Kš  œœ œ ˜-š œœ œ œ˜.Kšœ)™)—Kš œœ!œ˜SKš œœœ ˜4Kš œœ#œ'œ˜k—K˜Kšœ˜—…—Zr