Create: Commander.CommandProc =
-- [cmd: Handle] --
BEGIN
height: INTEGER = 15; -- used for positionning buttons. That is a hack!
interval: INTEGER = 3; -- used for positionning buttons. That is a hack!
queue: MBQueue.Queue ← MBQueue.Create[];
context: Context ← NEW [ContextRec ← [ac: NEW[AlpsTile.ContextRec]]];
viewer: ViewerClasses.Viewer = Containers.Create[
info: [name: "Alps", scrollable: FALSE, openHeight: 9*height+8*interval, icon: Icons.NewIconFromFile["AlpsViewer.icons", 16]], paint: TRUE];
subviewer: ViewerClasses.Viewer;
wx, wy: INTEGER; -- current next viewer position
Info:
PROC [name:
ROPE, border:
BOOL ←
TRUE]
RETURNS [ViewerClasses.ViewerRec] =
{RETURN [[name: name, parent: viewer, wx: wx, wy: wy, border: border]]};
NextWx: PROC [] = {wx ← wx + subviewer.ww + 1};
Labels giving some info
wx ← wy ← 0;
subviewer ← Labels.Create[info: Info[" In: 999 Aux: 999 Out: 999 Latch: 999 Check: 9999 Area: 99999 Size: 99999 Ifs: 9999 Width: 999-999 Deep: 99", FALSE]]; context.labelPrintVars ← subviewer; NextWx[];
State buttons and labels
wy ← wy + height + interval; wx ← 0;
subviewer ← Buttons.Create[info: Info["Shared"], clientData: context, proc: Shared, documentation: "Shared or not shared style"]; NextWx[];
subviewer ← Labels.Create[info: Info["FALSE", FALSE]]; context.labelShared ← subviewer; NextWx[];
subviewer ← Buttons.Create[info: Info["PermutLimit"], clientData: context, proc: PermutLimit, documentation: "*2/Min-Max//2 PermutLimit"]; NextWx[]; wx ← wx + 4;
subviewer ← Labels.Create[info: Info["99", FALSE]]; context.labelPermutLimit ← subviewer; NextWx[];
subviewer ← Buttons.Create[info: Info["BetterProc"], clientData: context, proc: BetterProc, documentation: "Change BetterProc"]; NextWx[]; wx ← wx + 4;
subviewer ← Labels.Create[info: Info["ImproveAreaAndDelay", FALSE]]; context.labelBetterProc ← subviewer; NextWx[];
subviewer ← Buttons.Create[info: Info["DistGlue"], clientData: context, proc: DistGlue, documentation: "Incr/Min-Max/Decr DistGlue"]; NextWx[]; wx ← wx + 4;
subviewer ← Labels.Create[info: Info["99", FALSE]]; context.labelPrintDistGlue ← subviewer; NextWx[];
subviewer ← Buttons.Create[info: Info["DistContacts"], clientData: context, proc: DistContacts, documentation: "Incr/Min-Max/Decr DistContacts"]; NextWx[]; wx ← wx + 4;
subviewer ← Labels.Create[info: Info["99", FALSE]]; context.labelPrintDistContacts ← subviewer; NextWx[];
Process State buttons and labels
wy ← wy + height + interval; wx ← 0;
subviewer ← Buttons.Create[info: Info["PrintLevel"], clientData: context, proc: PrintLevel, documentation: "Incr/Min-Max/Decr PrintLevel"]; NextWx[]; wx ← wx + 4;
subviewer ← Labels.Create[info: Info["9999", FALSE]]; context.labelPrintLevel ← subviewer; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["Checkpoint"], clientData: context, proc: Checkpoint]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["RollBack"], clientData: context, proc: RollBack]; NextWx[];
Input buttons
wy ← wy + height + interval; wx ← 0;
subviewer ← MBQueue.CreateButton[q: queue, info: Info["ReadPLA"], clientData: context, proc: ReadPLA, documentation: "Read a PLA file in a Mayo-Curry format", fork: FALSE, guarded: TRUE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["ReadTable"], clientData: context, proc: ReadTable, documentation: "Read a table in Alps format to be evaluated", fork: FALSE, guarded: TRUE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["ReadIfuFetch"], clientData: context, proc: ReadIfuFetch, documentation: "Read IFU Fetch PLA file in a Mayo-Curry format", fork: FALSE, guarded: TRUE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["ReadIfuPhA"], clientData: context, proc: ReadIfuPhA, documentation: "Read IFU PhA PLA file in a Mayo-Curry format", fork: FALSE, guarded: TRUE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["ReadIfuPhB"], clientData: context, proc: ReadIfuPhB, documentation: "Read IFU PhB PLA file in a Mayo-Curry format", fork: FALSE, guarded: TRUE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["ExampleC1MX07A"], clientData: context, proc: ExampleC1MX07A, documentation: "Standard Cell C1MX07A", fork: FALSE, guarded: TRUE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["NWFinite"], clientData: context, proc: NWFinite, documentation: "NWFinite", fork: FALSE, guarded: TRUE]; NextWx[];
Output buttons
wy ← wy + height + interval; wx ← 0;
subviewer ← MBQueue.CreateButton[q: queue, info: Info["PrintAll"], clientData: context, proc: PrintAll, documentation: "Print all variables"]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["LayoutGen"], clientData: context, proc: LayoutGen, documentation: "Generates layout"]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["DumpTT"], clientData: context, proc: DumpTT, documentation: "Dumps the truth table", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["DumpAlps"], clientData: context, proc: DumpAlps, documentation: "Dumps the table as a program", fork: FALSE]; NextWx[];
Computation buttons
wy ← wy + height + interval; wx ← 0;
subviewer ← MBQueue.CreateButton[q: queue, info: Info["FactorizeBest"], clientData: context, proc: FactorizeBest, documentation: "Introduce a good aux. var. and factorizes all", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["Factorize10Best"], clientData: context, proc: Factorize10Best, documentation: "Introduce 10 good aux. var. and factorizes all", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["FactorizeAllBest"], clientData: context, proc: FactorizeAllBest, documentation: "Introduce lots of good aux. var. and factorizes all", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["RemoveAuxVar"], clientData: context, proc: RemoveAuxVar, documentation: "Deletes the worse aux. var. and expands all", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["Remove10AuxVar"], clientData: context, proc: Remove10AuxVar, documentation: "Deletes 10 aux. var. and expands all", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["RemoveAllAuxVar"], clientData: context, proc: RemoveAllAuxVar, documentation: "Deletes all aux. var. and expands all", fork: FALSE]; NextWx[];
wy ← wy + height + interval; wx ← 0;
subviewer ← MBQueue.CreateButton[q: queue, info: Info["RemoveAndFactorize"], clientData: context, proc: RemoveAndFactorize, documentation: "Deletes aux. var. and factorize while better", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["FastPermute"], clientData: context, proc: FastPermute, documentation: "Tries to position variables so to minimize betterProc", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["AllPermute"], clientData: context, proc: AllPermute, documentation: "Tries all permutations so to minimize betterProc", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["BestPermute"], clientData: context, proc: BestPermute, documentation: "Tries to position variables so to minimize betterProc", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["BestPermuteInfinitely"], clientData: context, proc: BestPermuteInfinitely, documentation: "Tries to permute 2 variables as long as necessary", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["Latchize"], clientData: context, proc: Latchize, documentation: "Transforms to finite state machine", fork: FALSE]; NextWx[];
wy ← wy + height + interval; wx ← 0;
subviewer ← MBQueue.CreateButton[q: queue, info: Info["RemoveAndPermute"], clientData: context, proc: RemoveAndPermute, documentation: "Deletes aux. var. and permutes once and again and again...", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["Reverse"], clientData: context, proc: Reverse, documentation: "Reverse all vars (useful after a Dump)", fork: FALSE]; NextWx[];
subviewer ← MBQueue.CreateButton[q: queue, info: Info["Interp"], clientData: context, proc: Interp, documentation: "Causes an error so to call the interpretor", fork: FALSE]; NextWx[];
Buttons.SetDisplayStyle[buttonReadPLA, $BlackOnGrey];
Menus.AppendMenuEntry[menu, menuReadPLA, 0];
context.ac.table ← AlpsBool.InitTableOfVariables[1]; -- the only client data passed to buttons
RepaintAll[context];
END;