DIRECTORY AlpsBool; AlpsDecoder: CEDAR PROGRAM IMPORTS AlpsBool = BEGIN OPEN AlpsBool; Decoder: PUBLIC PROC [] RETURNS [table: AlpsBool.TableOfVariables] = { pBar: AlpsBool.Expression _ AlpsBool.true; gBar: AlpsBool.Expression _ AlpsBool.true; a, b: AlpsBool.Expression; plus, or, and, xor: AlpsBool.Expression; table _ AlpsBool.InitTableOfVariables[4+1]; table[1].name _ "a"; table[2].name _ "b"; table[3].name _ "op1"; table[4].name _ "op2"; a _ Var[1]; b _ Var[2]; plus _ And[table, Var[3], Var[4]]; xor _ And[table, Not[Var[3]], Var[4]]; and _ And[table, Var[3], Not[Var[4]]]; or _ And[table, Not[Var[3]], Not[Var[4]]]; pBar _ If[table, plus, Xor[table, a, Not[b]], pBar]; gBar _ If[table, plus, Or[table, Not[a], Not[b]], gBar]; pBar _ If[table, or, Nor[table, a, b], pBar]; pBar _ If[table, and, Not[And[table, a, b]], pBar]; pBar _ If[table, xor, Xor[table, a, Not[b]], pBar]; AlpsBool.AddOutput[table, NEW[AlpsBool.OutputRec _ [expr: pBar, name: "pBar"]]]; AlpsBool.AddOutput[table, NEW[AlpsBool.OutputRec _ [expr: gBar, name: "gBar"]]]; }; END. \AlpsDecoder.mesa Copyright c 1984 by Xerox Corporation. All rights reversed. Created by: Serlet, June 28, 1985 11:16:00 am PDT Bertrand Serlet October 23, 1985 4:31:24 pm PDT Decoder: PUBLIC PROC [] RETURNS [table: AlpsBool.TableOfVariables] = { pBar, gBar: AlpsBool.Expression _ AlpsBool.true; a, b: AlpsBool.Expression; table _ AlpsBool.InitTableOfVariables[7+1]; table[1].name _ "a"; table[2].name _ "b"; table[3].name _ "op+"; table[4].name _ "op-"; table[5].name _ "opOr"; table[6].name _ "opAnd"; table[7].name _ "opXor"; a _ Var[1]; b _ Var[2]; pBar _ If[table, Var[3], Xor[table, a, Not[b]], pBar]; gBar _ If[table, Var[3], Or[table, Not[a], Not[b]], gBar]; pBar _ If[table, Var[4], Xor[table, a, b], pBar]; gBar _ If[table, Var[4], Or[table, Not[a], b], gBar]; pBar _ If[table, Var[5], Nor[table, a, b], pBar]; pBar _ If[table, Var[6], Not[And[table, a, b]], pBar]; pBar _ If[table, Var[7], Xor[table, a, Not[b]], pBar]; AlpsBool.AddOutput[table, NEW[AlpsBool.OutputRec _ [expr: pBar, name: "pBar"]]]; AlpsBool.AddOutput[table, NEW[AlpsBool.OutputRec _ [expr: gBar, name: "gBar"]]]; }; Κ˜– "Cedar" stylešœ™Jšœ Οmœ1™