WITH exp
SELECT
FROM
e:
REF max expressionNode =>
v← MAX[ev[handle, e.leftOp], ev[handle, e.rightOp]];
e:
REF min expressionNode =>
v← MIN[ev[handle, e.leftOp], ev[handle, e.rightOp]];
e:
REF add expressionNode =>
v← ev[handle, e.leftOp] + ev[handle, e.rightOp];
e:
REF sub expressionNode =>
v← ev[handle, e.leftOp] - ev[handle, e.rightOp];
e:
REF mul expressionNode =>
v← ev[handle, e.leftOp] * ev[handle, e.rightOp];
e:
REF div expressionNode =>
v← ev[handle, e.leftOp] / ev[handle, e.rightOp];
e:
REF eq expressionNode =>
v←
IF (
LOOPHOLE[ev[handle, e.leftOp],
LONG
CARDINAL]=
LOOPHOLE[ev[handle, e.rightOp], LONG CARDINAL]) THEN 1.0 ELSE 0.0;
e:
REF neq expressionNode =>
v←
IF (
LOOPHOLE[ev[handle, e.leftOp],
LONG
CARDINAL] #
LOOPHOLE[ev[handle, e.rightOp], LONG CARDINAL]) THEN 1.0 ELSE 0.0;
e:
REF grt expressionNode =>
v← IF (ev[handle, e.leftOp] > ev[handle, e.rightOp]) THEN 1.0 ELSE 0.0;
e:
REF les expressionNode =>
v← IF (ev[handle, e.leftOp] < ev[handle, e.rightOp]) THEN 1.0 ELSE 0.0;
e:
REF geq expressionNode =>
v← IF (ev[handle, e.leftOp] >= ev[handle, e.rightOp]) THEN 1.0 ELSE 0.0;
e:
REF leq expressionNode =>
v← IF (ev[handle, e.leftOp] <= ev[handle, e.rightOp]) THEN 1.0 ELSE 0.0;
e:
REF and expressionNode =>
v← IF (ev[handle, e.leftOp]*ev[handle, e.rightOp] # 0.0) THEN 1.0 ELSE 0.0;
e:
REF or expressionNode =>
v←
IF (ev[handle, e.leftOp] # 0.0)
OR (ev[handle, e.rightOp] # 0.0)
THEN 1.0 ELSE 0.0;
e:
REF power expressionNode=> {
x: REAL← ev[handle, e.leftOp];
y: REAL← ev[handle, e.rightOp];
IF
ABS[y] < 100.0
AND y=Real.FixI[y]
THEN {
v← 1.0;
THROUGH[1..ABS[Real.FixI[y]]] DO v← v*x ENDLOOP;
IF y < 0.0 THEN v← 1.0/v;
}
ELSE v← RealFns.Power[ev[handle, e.leftOp], ev[handle, e.rightOp]];
};
e: REF int expressionNode => v← Real.RoundLI[ev[handle, e.unaryOp]];
e: REF abs expressionNode => v← ABS[ev[handle, e.unaryOp]];
e: REF exp expressionNode => v← RealFns.Exp[ev[handle, e.unaryOp]];
e: REF log expressionNode => v← RealFns.Ln[ev[handle, e.unaryOp]];
e: REF sqrt expressionNode => v← RealFns.SqRt[ev[handle, e.unaryOp]];
e: REF neg expressionNode => v← -ev[handle, e.unaryOp];
e: REF not expressionNode => v← IF ev[handle, e.unaryOp] # 0.0 THEN 0.0 ELSE 1.0;
e: REF load expressionNode => v← getParmValue[handle, e.var];
e: REF store expressionNode => putParmValue[handle, e.var, ev[handle, e.expr]];
e: REF num expressionNode => v← e.v;
ENDCASE => v← 0.0;