<> <> <> <> <<>> DIRECTORY AlpsBool, MC, MCCtl, PW; MCCounter: CEDAR PROGRAM IMPORTS AlpsBool, MC, MCCtl, PW EXPORTS MCCtl = BEGIN OPEN AlpsBool, MCCtl; Counter: PUBLIC PROC [table: TableOfVariables] = { numBits: INT = PW.Log2[MC.nLines]; <> <> FOR index: INT IN [0..numBits) DO me: Expression _ Find[table, MC.IndexedName["ArrayAdrsxBA", index]]; allUnderAreOnes: Expression _ true; expr: Expression; FOR under: INT IN (index .. numBits) DO allUnderAreOnes _ And[table, allUnderAreOnes, Find[table, MC.IndexedName["ArrayAdrsxBA", under]]]; ENDLOOP; expr _ If[table, Find[table, "Incr"], If[table, allUnderAreOnes, Not[me], me], me]; AddOutput[table, NEW[OutputRec _ [ name: MC.IndexedName["ArrayAdrsxAB", index], <> <> expr: expr]]]; ENDLOOP; }; END.