package INTEGER_SETS is -- by R J Botting, CSUSB type INTEGER_SET is limited private; NULL_SET:constant INTEGER_SET; function Member(I:integer; ISIN:INTEGER_SET) return boolean; function "="(LEFT,RIGHT:INTEGER_SET) return boolean; --Two sets are equal if they have the same Members. function Empty(ISIN:INTEGER_SET) return boolean;--Empty(NULL_SET); function Full(ISIN:INTEGER_SET) return boolean; function Max(S:INTEGER_SET) return integer; function Min(S:INTEGER_SET) return integer; procedure Put(S:in INTEGER_SET); -- output set to standard output procedure Make_Empty(S:out INTEGER_SET); -- after S=NULL_SET procedure Put(I:integer; INTO:in out INTEGER_SET); -- put I into set procedure Get(I: out integer; FROM:in out INTEGER_SET);--get fastest procedure Getmin(I: out integer; FROM:in out INTEGER_SET);--get first procedure Getmax(I: out integer; FROM:in out INTEGER_SET);--get last procedure Take(I: integer; FROM:in out INTEGER_SET);--take I out EMPTY_GET: exception;--Attempt to find or get next/max/min from empty set FULL_PUT : exception;-- Attempt to add element when no space allocated private -- linked list type DATA; type LINK is access DATA; type INTEGER_SET is new LINK; -- automatically initialized to NULL NULL_SET:constant INTEGER_SET := NULL; end INTEGER_SETS;