DIRECTORY BasicTime, CedarProcess, Commander, IO, List, MakeDo, RedBlackTree, Rope, TimeStamp; MakeDoPrivate: CEDAR DEFINITIONS = BEGIN OPEN MakeDo; NodeList: TYPE = LIST OF Node; Node: TYPE = REF NodeRep; NodeRep: TYPE = RECORD [ name: ROPE, class: NodeClass, down: MyMonitorLock, producer: Edge _ NIL, props: PropList _ NIL, lastVisit: Visit _ noVisit, needed: BOOL _ FALSE, up: MONITORLOCK, suspect: BOOL _ TRUE, to: ARRAY CmdDep OF EdgeRingHead _ ALL[emptyHead], timeValid: BOOL _ FALSE, forceNotExist: BOOL _ FALSE, created: Time _ unknownTime, lockedOuts: LockoutList _ NIL ]; Command: TYPE = REF CommandRep; CommandRep: TYPE = RECORD [ class: CommandClass, foundData: REF ANY, makes: EdgeRingHead _ emptyHead, down: MyMonitorLock, cmd: ROPE, from: ARRAY CmdDep OF EdgeRingHead _ ALL[emptyHead], lastVisit: Visit _ noVisit, missedSources: NodeList _ NIL, outdatedAsked, outdated: BOOL _ FALSE, suspectNeed, canBeDone: BOOL _ TRUE, dataRecurse: BOOL _ FALSE, failed, succeeded, aborted: BOOL _ FALSE, whyOutdated: ROPE _ NIL, reasonWhyLastDone: ROPE _ NIL, up: MONITORLOCK, suspect: ARRAY CmdDep OF BOOL _ ALL[TRUE], lockedOuts: LockoutList _ NIL ]; MyMonitorLock: TYPE = RECORD [ locked: BOOL _ FALSE, change: CONDITION]; NewMonitorLock: PROC RETURNS [mml: MyMonitorLock]; LockoutList: TYPE = LIST OF Lockout; Lockout: TYPE = RECORD [sg: Subgoal, work: WorkRef]; EdgeRingHead: TYPE = RECORD [first, last: Edge]; emptyHead: EdgeRingHead = [NIL, NIL]; Edge: TYPE = REF EdgeRep; EdgeRep: TYPE = RECORD [ optional: BOOL, traverseCreated: Time _ unknownTime, n: Node, cNext, cPrev: Edge, c: Command, nNext, nPrev: Edge ]; Visit: TYPE = RECORD [key: CARDINAL]; noVisit: Visit = [0]; Job: TYPE = REF JobRep; JobRep: TYPE = RECORD [ wDir: ROPE, visit: Visit, goals, modifiable: Table, boundaryKnown, assumeAllInconsistent, do, record: BOOL, nSteps: NAT _ 0, failedSteps: CommandList _ NIL, cmds: ROPE _ NIL ]; WorkList: TYPE = LIST OF WorkRef; WorkRef: TYPE = REF WorkRec; WorkRec: TYPE = RECORD [ job: Job, depth: INTEGER, change, cChange, dChange: BOOL _ FALSE, e: Edge _ NIL, subject: SELECT kind: * FROM node => [goal: Node], cmd => [c: Command, possibleNewNeed: Node], ENDCASE ]; CWork: TYPE = REF WorkRec[cmd]; NWork: TYPE = REF WorkRec[node]; SubgoalList: TYPE = LIST OF Subgoal; Subgoal: TYPE = REF SubgoalRep; SubgoalRep: TYPE = RECORD [ job: Job, toDo: Table--of Work not yet started--, parent: WorkRef, PerFinish: PROC [parent, sub: WorkRef] _ NIL, AllDone: Continuation _ NIL, state: SubgoalState _ unspecified, locked: WorkRef _ NIL, working: Table--of Work started but not yet finished-- _ NIL, lockoutCount: INTEGER--# of ex-toDo's locked-- _ 0, recursing: Table--of Subgoals started but not yet finished-- _ NIL, caller: Subgoal _ NIL ]; SubgoalState: TYPE = {unspecified, workToDo, waitForWork, waitForLocks, waitForRecursion, needToFinish, waitForFinish, waitForTail, done}; Continuation: TYPE = PROC [parent: WorkRef] RETURNS [Subgoal]; debugging: BOOL; leaf: Command; Log: PROC [depth: INTEGER, fmt: ROPE, v1, v2, v3, v4, v5: IO.Value _ [null[]]]; Confirm: PROC [depth: INTEGER, action: ROPE]; GetCommanderHandle: PROC RETURNS [Commander.Handle]; AchieveGoal: PROC [Subgoal]; DestroyQueues: PROC; NewVisit: PROC RETURNS [Visit]; EnumerateFinders: PROC [to: PROC [Finder]]; NewWorkTable: PROC RETURNS [Table]; InsertWork: PROC [Table, WorkRef]; IncrementStepCount: PROC [Job]; AddFailedCmd: PROC [Job, Command]; AddCommand: PROC [Job, ROPE]; IdGetKey: RedBlackTree.GetKey; CompareNodes: RedBlackTree.Compare; CompareRefs: RedBlackTree.Compare; EnglishList: PROC [NodeList] RETURNS [el: ROPE, ec: CARDINAL]; NodeInTable: PROC [n: Node, t: Table] RETURNS [BOOL]; IsRootGoal: PROC [job: Job, n: Node] RETURNS [BOOL]; IsLeaf: PROC [job: Job, n: Node] RETURNS [BOOL]; Link: PROC [c: Command, ch: EdgeRingHead, n: Node, nh: EdgeRingHead, optional, suspect: BOOL] RETURNS [chNew, nhNew: EdgeRingHead]; EnumerateConsumerEdges: PROC [n: Node, which: CmdDep, to: PROC [Edge, CmdDep]]; ReallySuspectNodeChange: PROC [n: Node, op: NTOp, stack: Table]; NTOp: TYPE = {forceNotExist, unforceNotExist, leaveNotExist}; UnlinkToFrom: PROC [e: Edge--on n.to=c.from--, which: CmdDep]; ShouldRemakeNode: PROC [n: Node, callerPromisesToDoIt: BOOL] RETURNS [BOOL]; CmdMayNeedRemaking: PROC [c: Command, which: CmdDep, stack: Table]; ShouldRemakeCmd: PROC [c: Command, which: CmdDep, callerPromisesToDoIt: BOOL] RETURNS [BOOL]; MayEnterDownNode: PROC [Node] RETURNS [in: BOOL]; ExitDownNode: PROC [n: Node]; NodeWork: PROC [nWork: NWork] RETURNS [sg: Subgoal]; MayEnterDownCmd: PROC [Command] RETURNS [in: BOOL]; ExitDownCmd: PROC [Command]; CmdWork: PROC [cWork: CWork] RETURNS [sg: Subgoal]; AddConsumption: PROC [c: Command, nl: NodeList, which: CmdDep, optional: BOOL]; RemoveConsumption: PROC [c: Command, which: CmdDep]; NeedsToBeDone: PROC [job: Job, c: Command, alwaysAsk: BOOL] RETURNS [missedResults: NodeList, outdated: BOOL]; END. ΄MakeDoPrivate.Mesa Last Edited by: Spreitzer, September 3, 1985 8:48:20 pm PDT Carl Hauser, April 11, 1985 3:34:27 pm PST Locking Order: n downward c = n.producer.c downward n = c.from.first(.cNext)*.n downward ... Watch out for cycles in the dependency graph. ... n upward c = n.to.first(.nNext)*.c upward n = c.makes.first(.cNext)*.c upward Invariant: Downward: Downward(producer): Upward: Suspect needs to be rederived. Process stuff: Yet Unclassified (i.e., wrong): Invariant: Downward: Upward: Suspect this cmd needs to be rederived/rerun. Process stuff: Yet Unclassified (i.e., wrong): Invariant: Invariant for c.from-n.to, Irrelevant for c.makes-n.producer: Create time of some version (hopefully latest) extant before latest use certain to (have) happen(ed). Invariant for cmd.makes, Downward for cmd.from Upward for n.to, Downward for n.producer Yet Unclassified (i.e., wrong): Arguments: Callee temps: Caller temps: More Arguments: ΚC– "cedar" style˜code™J™;K™*—K˜KšΟk œ%œ.˜^K˜KšΠbx œœ œ˜"K˜Kšœœ˜K˜™K™ K™K™$K™K™-K™K™K™ K™#—K˜Kšœ œœœ˜Kšœœœ ˜šœ œœ˜™ Kšœœ˜ K˜—™ Kšœ˜Kšœœ˜Kšœœ˜—™Kšœ˜Kšœœœ˜—™Kšœ œ˜šœ œœ˜K™—Kšœœœœ ˜2Kšœ œœ˜Kšœœœ˜Kšœ˜—™Kšœ˜—K™K˜—K˜Kšœ œœ ˜šœ œœ˜™ K˜Kšœ œœ˜Kšœ ˜ —™ Kšœ˜Kšœœ˜ Kšœœœœ ˜4Kšœ˜Kšœœ˜Kšœœœ˜&Kšœœœ˜$Kšœ œœ˜Kšœœœ˜)Kšœ œœ˜Kšœœœ˜—™Kšœ œ˜š œ œœœœœ˜*K™-——™Kšœ˜—K™Kšœ˜—K˜šœœœ˜Kšœœœ˜Kšœ œ˜—K˜KšΟnœœœ˜2K˜Kšœ œœœ ˜$Kšœ œœ˜4K˜Kšœœœ˜0Kšœœœ˜%K˜Kšœœœ ˜šœ œœ˜™ Kšœ œ˜—šœ=™=šœ$˜$K™e——™.K˜Kšœ˜—™(K˜ Kšœ˜—K™K˜—K˜Kšœœœœ˜%K˜K˜Kšœœœ˜šœœœ˜Kšœœ˜ K˜ K˜Kšœ2œ˜7Kšœœ˜Kšœœ˜Kšœœ˜K˜—K˜Kšœ œœœ ˜!Kšœœœ ˜šœ œœ˜™ K˜ Kšœœ˜—™ Kšœœœ˜'—™ Kšœ œ˜—™šœ œ ˜K˜Kšœ+˜+Kš˜——Kšœ˜—K˜Kšœœœ˜Kšœœœ˜ K˜Kšœ œœœ ˜$Kšœ œœ ˜šœ œœ˜K˜ Kšœ Οcœ˜'Kšœ˜KšŸ œœœ˜-Kšœœ˜Kšœ"˜"Kšœœ˜Kšœ (œœ˜=Kšœ œ˜3Kšœ ,œœ˜CKšœ˜K˜—K˜Kšœœx˜ŠK˜KšŸ œœœœ ˜>K˜Kšœ œ˜K˜K˜Kš Ÿœœ œœœ˜OKšŸœœ œ œ˜-KšŸœœœ˜4K˜KšŸ œœ ˜KšŸ œœ˜K˜KšŸœœœ ˜K˜KšŸœœœ ˜+K˜KšŸ œœœ ˜#KšŸ œœ˜"K˜KšŸœœ˜KšŸ œœ˜"KšŸ œœœ˜K˜Kšœ˜K•StartOfExpansion[]šœ#˜#Kšœ"˜"K˜Kš Ÿ œœ œœœ˜>KšŸ œœœœ˜5KšŸ œœœœ˜4KšŸœœœœ˜0KšŸœœNœœ˜ƒK˜KšŸœœœ˜OšŸœœ#˜@Kšœœ3˜=—KšŸ œœ  œ˜>Kš Ÿœœ!œœœ˜LK˜KšŸœœ+˜CKš Ÿœœ3œœœ˜]K˜KšŸœœœœ˜1KšŸ œœ ˜KšŸœœœ˜4K˜KšŸœœ œœ˜3KšŸ œœ ˜KšŸœœœ˜3KšŸœœ5œ˜OKšŸœœ˜4Kš Ÿ œœ#œœ%œ˜nK˜Kšœ˜—…—ja