MakeDoPrivate.Mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on October 6, 1992 11:06 am PDT
Carl Hauser, April 11, 1985 3:34:27 pm PST
Eduardo Pelegri-Llopart March 17, 1989 8:32:14 am PST
DIRECTORY
Commander USING [Handle],
Icons USING [IconFlavor],
IO USING [Value],
MakeDo,
SymTab;
MakeDoPrivate: CEDAR DEFINITIONS =
BEGIN OPEN MakeDo;
Definitions:
ia = i is a determiner of a
iba = i is an input of a
iÒa = i is a mandatory input of a
Current[n] = if Leaf[n]
then true
else let a = n.producer in
CorrectlyDerived[a]
' ( iba: Current[i])
' (a.Consistent[{i:iba}, n]
( iÒa: ~i.Exists[]
( iba: Broken[i]
( a.Fails[{i:iba}])
CorrectlyDerived[a] = ia: Current[i] ' DerivedFrom[a, i] ( ia: Broken[i]
Leaf[n] = CertainlyNotModifiable[n] ( n has no producer
Current[n] Ò Broken[n] =
CertainlyModifiable[n] ' ~n.Exists[]
( ~CertainlyNotModifiable[n] ' abn: (
iba: Broken[i] ( ia: Broken[i]
( CertainlyModifiable[n] ' iÒa: ~i.Exists[]
(  iba: (i.Exists ' ~a.Consistent[i, n])
' ( iÒa: ~i.Exists[] ( a.Fails[{i:iba}]) )
Basic Monitor Invariant:
(eb: ExpensiveBool H b: BOOL { eb`notComputed Ò b=eb)
~RawLeaf[node] Ò node.consistencyAsked Ò
node.consistent = node.producer.Consistent[{i:iba}, node]
node.current H Current[n]
node.created dates contents used herein
node.current=true Ò node.broken = Broken[n]
NodeSets agree with nodes
act.correctlyDerived Ò CorrectlyDerived[a]
act.fails=notComputed Ò act.timesTried=0
if
act.permissionGranted ' act.queuedFailsInvalidation then a.Fails[..] unknown
else act.fails H a.Fails[..]
NodeList: TYPE = LIST OF Node;
Node: TYPE = REF NodeRep;
NodeRep: TYPE = RECORD [
given, name: ROPE,
class: NodeClass,
memberships: RefTable--of NodeSet--,
producer: Edge ¬ NIL,
props: PropList ¬ NIL,
to: ARRAY ActionDep OF EdgeRingHead ¬ ALL[emptyHead],
modifiability: Modifiability ¬ uninitialized,
created: Time ¬ unknownTime,
length: INT ¬ FIRST[INT],
current: ExpensiveBool ¬ notComputed,
broken: BOOL ¬ FALSE,
consistencyAsked: BOOL ¬ FALSE,
consistent: BOOL ¬ FALSE,
consistencyReason: ROPE ¬ NIL,
someoneWhoCares: Job ¬ NIL,
state: NodeState ¬ inactive,
waitCount: INTEGER ¬ 0,
waitingOnCurrent: NodeList ¬ NIL
];
NodeState: TYPE = {inactive, ready, working, waiting};
Action: TYPE = REF ActionRep;
ActionRep: TYPE = RECORD [
class: ActionClass,
foundData: REF ANY,
cmd: ROPE,
makes: EdgeRingHead ¬ emptyHead,
from: ARRAY ActionDep OF EdgeRingHead ¬ ALL[emptyHead],
waitingForPermission: NodeList ¬ NIL,
permissionGranted: BOOL ¬ FALSE,
derivedFromCurrentDeterminers: BOOL ¬ TRUE,
queuedFailsInvalidation: BOOL ¬ FALSE,
fails: ExpensiveBool ¬ notComputed,
timesTried: INTEGER ¬ 0,
reasonWhyLastDone: ROPE ¬ NIL
];
ExpensiveBool: TYPE = {notComputed, false, true} ¬ notComputed;
Expensify: ARRAY BOOL OF ExpensiveBool = [false, true];
EdgeRingHead: TYPE = RECORD [first, last: Edge];
emptyHead: EdgeRingHead = [NIL, NIL];
Edge: TYPE = REF EdgeRep;
EdgeRep: TYPE = RECORD [
optional: BOOL,
n: Node,
a: Action,
nNext, nPrev: Edge,
aNext, aPrev: Edge
];
Job: TYPE = REF JobRep;
JobRep: TYPE = RECORD [
wDir: ROPE,
goals, processes: RefTable,
otherModifiable: ModifiabilitySpec,
nSteps: NAT ¬ 0,
failedSteps: ActionList ¬ NIL
];
NodeSet: TYPE = REF NodeSetPrivate;
NodeSetPrivate: TYPE = RECORD [
nodes: RefTable,
currents, nonCurrents: INT ¬ 0,
currents counts nodes with current=true; nonCurrent counts others.
broken, ok: INT ¬ 0
Only current nodes are counted broken or ok.
];
NodeClass: TYPE = REF NodeClassRep;
NodeClassRep: TYPE = RECORD [
name: ROPE,
CanonizeName: PROC [ROPE] RETURNS [ROPE],
GetInfo: GetInfoProc
];
debugging: BOOL;
leaf: Action;
Log: PROC [fmt: ROPE, v1, v2, v3, v4, v5: IO.Value ¬ [null[]]];
Confirm: PROC [action: ROPE];
GetCommanderHandle: PROC RETURNS [Commander.Handle];
MDInstall: PROC [dir, packageName: ROPE] RETURNS [foundFile, failed: BOOL];
EnumerateFinders: PROC [to: PROC [Finder] RETURNS [stop: BOOL]];
IncrementStepCount: PROC [Job];
AddFailedCmd: PROC [Job, Action];
EnglishList: PROC [NodeList] RETURNS [el: ROPE, ec: CARDINAL];
NodeInRefTable: PROC [n: Node, t: RefTable] RETURNS [BOOL];
IsRootGoal: PROC [job: Job, n: Node] RETURNS [BOOL];
IsLeaf: PROC [job: Job, n: Node] RETURNS [BOOL];
In Basic monitor:
StartTime: PROC [n: Node];
In node table monitor:
EnumerateAndDestroy: PROC [to: PROC [Node], andDestroy--table when done--: BOOL];
IconSeq: TYPE = REF IconSeqPrivate;
IconSeqPrivate: TYPE = RECORD [icons: SEQUENCE length: NAT OF Icons.IconFlavor];
icons: IconSeq;
EmptyCmdUtils: PROC;
Clears data cached by the command utilities.
END.
Eduardo Pelegri-Llopart October 20, 1988 5:07:28 pm PDT
cleaned up DIRECTORY and removed GetTerminal