CoreBooleTest.mesa
Copyright © 1985 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet July 31, 1985 3:03:17 pm PDT
Last edited by Bertrand Serlet August 3, 1985 11:15:37 pm PDT
DIRECTORY CoreBoole, Rope;
CoreBooleTest: CEDAR PROGRAM
IMPORTS CoreBoole =
BEGIN OPEN CoreBoole;
Private operations
Decoder: PUBLIC PROC [] RETURNS [result: Expression] = {
pBar: Expression ← true;
gBar: Expression ← true;
a, b, c, d: Expression;
plus, or, and, xor: Expression;
a ← Var["a"]; b ← Var["b"]; c ← Var["c"]; d ← Var["d"];
plus ← And[c, d];
xor ← And[Not[c], d];
and ← And[c, Not[d]];
or ← And[Not[c], Not[d]];
pBar ← If[plus, Xor[a, Not[b]], pBar];
gBar ← If[plus, Or[Not[a], Not[b]], gBar];
pBar ← If[or, Nor[a, b], pBar];
pBar ← If[and, Not[And[a, b]], pBar];
pBar ← If[xor, Xor[a, Not[b]], pBar];
result ← And[gBar, pBar];
};
END.