1: program setest(input,output); 2: 3: type 4: aset = set of 1..41; 5: sint = 0 .. 30000; 6: 7: var 8: set1, set2 :aset; 9: ptr :^aset; 10: i :sint; 11: 12: begin 13: writeln('Enter a number between 2 and 41.'); 14: writeln('Numbers 2, 10..12, 17, and 37 print "false" all others "true".'); 15: i := ord(input^); 16: read(i); 17: writeln('i =',i:2); 18: write('The set opcodes work :'); 19: set1 := [5..15]; 20: set2 := [10]; 21: if set1 * [23] = [] then 22: write(' []') 23: else 24: write(false:6); 25: if set1-set2 <> [5..9,11..15] then 26: write(false:6); 27: new(ptr); 28: ptr^ := [2,10,37,i]; 29: set1 := ptr^ - [1..3]; 30: set2 := ptr^ + [10..12,17]; 31: if ptr^ * set1 = set1 then 32: write(' mul plus minus') 33: else 34: write(false:6); 35: if (17 in [10..13,15..20,25..30]) and 36: (not (22 in [1..17,36..41])) then 37: write(' in') 38: else 39: write(false:6); 40: if (set1 <> set2) and 41: (set1 < set2) and 42: (set2 > set1) and 43: (set2 >= ptr^) and 44: (set1 <= set2) and 45: (set1 >= set1) and 46: (set1 <= set1) and 47: (card(set2) = 7) then 48: write(' and rel') 49: else 50: write(false:6); 51: if (set1 <> set1) or 52: (set2 < set1) or 53: (set1 > set2) or 54: (ptr^ >= set2) or 55: (set2 <= set1) or 56: (set1 = set2) or 57: (17 in set2) then 58: writeln(' or rel') 59: else 60: writeln(false:6); 61: i := pred(i); 62: i := (i + i) div i; 63: end.