Input: The nD-OPPs and expressed in the D-EVM. | The number n of dimensions and regularized Boolean operation op. | Output: The output nD-OPP r, such that r = op*, codified as an D-EVM. | Procedure BooleanOperation(EVM p, EVM q, BooleanOperator op, int n) | EVM sP, sQ // Current sections of p and q respectively. | EVM hvl // I/O couplet. | boolean fromP, fromQ // flags for the source of the couplet hvl. | CoordType coord // the common coordinate of couplets. | EVM r, sRprev, sRcurr // nD-OPP r and two of its sections. | if (n = 1) then // Base case | return BooleanOperation1D(p, q, op) | else | n = n 1 | sP = InitEVM( ) | sQ = InitEVM( ) | sRcurr = InitEVM( ) | NextObject(p, q, coord, fromP, fromQ) | while (Not(EndEVM(p)) and Not(EndEVM(q))) | if (fromP = true) then | hvl = ReadHvl(p) | sP = GetSection(sP, hvl) | end-of-if | if (fromQ = true) then | hvl = ReadHvl(q) | sQ = GetSection(sQ, hvl) | end-of-if | sRprev = sRcurr | sRcurr = BooleanOperation(sP,sQ,op,n) // Recursive call | hvl = GetHvl(sRprev, sRcurr) | SetCoord(hvl, coord) | PutHvl(hvl, r) | NextObject(p, q, coord, fromP, fromQ) | end-of-while | while (Not(EndEVM(p))) | hvl = ReadHvl(p) | PutBool(hvl, r, op) | end-of-while | while (Not(EndEVM(q))) | hvl = ReadHvl(q) | PutBool(hvl, r, op) | end-of-while | return r | end-of-if | end-of-procedure |
|