DIRECTORY
M2D: TYPE USING [SET, WordSize, ModulePtr, StrPtr];
mainmod, sysmod: PUBLIC ModulePtr;
undftyp, booltyp, chartyp, inttyp, cardtyp, bitstyp, dbltyp, realtyp, lrltyp,
proctyp, stringtyp, notyp, addrtyp, wordtyp: PUBLIC StrPtr;
UNION:
PUBLIC
PROC [r, s:
SET]
RETURNS [R:
SET] =
{
FOR i:
CARDINAL
IN [0..WordSize)
DO
R[i] ← r[i] OR s[i];
ENDLOOP };
INTERSECTION:
PUBLIC
PROC [r, s:
SET]
RETURNS [R:
SET] =
{
FOR i:
CARDINAL
IN [0..WordSize)
DO
R[i] ← r[i] AND s[i];
ENDLOOP };
SETDIFF:
PUBLIC
PROC [r, s:
SET]
RETURNS [R:
SET] =
{
FOR i:
CARDINAL
IN [0..WordSize)
DO
R[i] ← r[i] AND NOT s[i];
ENDLOOP };
SYMMDIFF:
PUBLIC
PROC [r, s:
SET]
RETURNS [R:
SET] =
{
FOR i:
CARDINAL
IN [0..WordSize)
DO
R[i] ← r[i] # s[i];
ENDLOOP };
SUBSET:
PUBLIC
PROC [r, s:
SET]
RETURNS [B:
BOOL] =
{ i: CARDINAL ← 0;
DO B ←
NOT r[i]
OR s[i];
IF NOT B OR (i = WordSize-1) THEN EXIT;
i ← i + 1
ENDLOOP };
InitData: PUBLIC PROC = { }; -- forces START trap