DIRECTORY FS, IO, Rope, OracleGen, BitOps, Convert; Gen3Impl: CEDAR PROGRAM IMPORTS FS, IO, OracleGen, Rope, BitOps, Convert ~ BEGIN OPEN OracleGen; outf: IO.STREAM; k : CARD; nr:INT _ 3; --number of colums in the right side of the line nl:INT _ 3; --number of colums in the left side of the line NbRight, NbLeft : TYPE = [0..3); RightLine: TYPE = ARRAY NbRight OF Rope.ROPE; LeftLine: TYPE = ARRAY NbLeft OF Rope.ROPE; rl: RightLine; ll: LeftLine; TwoExp32: PROC [k: CARD] RETURNS [r: Rope.ROPE] ~ { x: BitOps.BitDWord = BitOps.DShift[1,k MOD 32]; y: Rope.ROPE = Hex[x]; r _ LExtend[y,8]; }; TwoExp4: PROC [k: CARD] RETURNS [r: Rope.ROPE] ~ { r _ LExtend[Hex[k MOD 16],1]; }; MergeOut: PROC [] RETURNS [] ~ { column : INT; r : Rope.ROPE; r _ ""; FOR column IN [0..nl) DO r _ Rope.Cat[r,ll[column]," "]; ENDLOOP; r _ Rope.Cat[r,"| "]; FOR column IN [0..nr) DO r _ Rope.Cat[r,rl[column]," "]; ENDLOOP; outf.PutF["%g -- %g \n",IO.rope[r],IO.rope[Convert.RopeFromInt[k]]]; }; outf _ FS.StreamOpen["Gen.oracle", $create]; outf.PutF["-- Begining of the text : \n"]; FOR k IN[0..66) DO SELECT k FROM IN[0..2) => { ll[0] _ "00000000"; ll[1] _ "00000000"; ll[2] _ "0"; rl[0] _ "XXXXXXXX"; rl[1] _ "XXXXXXXX"; rl[2] _ "X"; }; IN[2..4) => { ll[0] _ "00000000"; ll[1] _ TwoExp32[k-2]; ll[2] _ TwoExp4[k-2]; rl[0] _ "XXXXXXXX"; rl[1] _ "XXXXXXXX"; rl[2] _ "X"; }; IN[4..5) => { ll[0] _ "00000000"; ll[1] _ TwoExp32[k-2]; ll[2] _ TwoExp4[k-2]; rl[0] _ "00000000"; rl[1] _ "00000000"; rl[2] _ "0"; }; IN[5..34) => { ll[0] _ "00000000"; ll[1] _ TwoExp32[k-2]; ll[2] _ TwoExp4[k-2]; rl[0] _ "00000000"; rl[1] _ TwoExp32[k-5]; rl[2] _ TwoExp4[k-5]; }; IN[34..37) => { ll[0] _ TwoExp32[k-2]; ll[1] _ "00000000"; ll[2] _ TwoExp4[k-2]; rl[0] _ "00000000"; rl[1] _ TwoExp32[k-5]; rl[2] _ TwoExp4[k-5]; }; IN[37..66) => { ll[0] _ TwoExp32[k-2]; ll[1] _ "00000000"; ll[2] _ TwoExp4[k-2]; rl[0] _ TwoExp32[k-5]; rl[1] _ "00000000"; rl[2] _ TwoExp4[k-5]; }; ENDCASE ; MergeOut[]; ENDLOOP; outf.Close[]; END. ςGen3Impl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Jean Gastinel August 13, 1987 3:51:31 pm PDT Oracle Generation This proc compute 2^k and transform it into a Rope of length 8 Hexa This proc compute k MOD 16 and transform it into a Rope of length 1 Hexa This proc merge into two Rope Right and Left different elements of the line and write the result inthe output stream Start of the Program Here the program start : Create or Append the file Start Generation : Κ ˜codešœ ™ Kšœ<™