ÏÏÏWITH Discrete_Set; 
ÏÏÏWITH Ada.text_io;

ÏÞßàPROCEDURE set_test IS
ÏÏ§ÏïÏTYPE fruit IS (apple, berry, cherry, plum, peach, apricot, mango);
ÏÏ§ÏØÓìPACKAGE fruit_io IS NEW ada.text_io.enumeration_io (fruit);
ÏÏ§ÏØÓìPACKAGE mySet IS NEW Discrete_Set(Element_Type => fruit);
ÏÏ§
ÏÏ§ÏíÏsetA,  setB, setC : mySet.Set_Type;  
ÏÏ§ÏíÏisInSet : boolean;
ÏÏ§
ÏÏ§begin
ÏÏ§  
ÏÏ¨¹¹ÏsetA := mySet.Universal_Set; -- initializing setA to Universal_Set
ÏÏ¨¹¹ÏsetB := mySet.Empty_Set;     -- initializing setB to the Empty_Set
ÏÏ¨¹¹ÏsetC := mySet."+"(setA, setB);  -- initializing setC to the union of setA and setB
ÏÏ§   
ÏÏ§   -- listing all of the elements that are in setA
ÏÏ¨¹¹±FOR i IN fruit LOOP
ÏÏ§ÏÏ7¹³´IF (mySet.is_Member (setA, i)) THEN
ÏÏ§ÏÏ5Ï6¨¹¹Ïfruit_io.put (i);
ÏÏ§ÏÏ5Ï6¾¹¹ÏAda.text_io.new_line;
ÏÏ§ÏÏ5Ï¶ÏEND IF;
ÏÏ§ÏÏ°END LOOP;
ÏÏ¨¹¹ÏAda.text_io.new_line;
ÏÏ§  
ÏÏ§  -- removing all elements that are in setA from setA
ÏÏ¨¹¹±FOR i IN fruit LOOP
ÏÏ§ÏÏ7¹¹ÏsetA := mySet."-"( setA,  i);
ÏÏ§ÏÏ7¹³´IF (mySet.is_Member (setA, i)) THEN
ÏÏ§ÏÏ5Ï6¾¹¹Ïfruit_io.put (i);
ÏÏ§ÏÏ5Ïö´ELSE 
ÏÏ§ÏÏ5Ï¸¨¹¹Ïfruit_io.put (i);
ÏÏ§ÏÏ5Ï¸¾¹¹ÏAda.text_io.put_line (" removed from setA ");
ÏÏ§ÏÏ5ÏÈÏEND IF;
ÏÏ§ÏÏ°END LOOP;
ÏÏ¨¹¹ÏAda.text_io.new_line;
ÏÏ§   
ÏÏ§  -- adding mango to setA  
ÏÏ¨¹¹ÏsetA := mySet."+"( setA, fruit'last);  
ÏÏ§
ÏÏ§  -- seeing if anything is in setB 
ÏÏ¨¹¹±FOR i IN fruit LOOP
ÏÏ§ÏÏ7¹¹ÏisInSet := mySet.is_Member(setB,i);
ÏÏ§ÏÏ7¹³´IF ( NOT isInSet) THEN 
ÏÏ§ÏÏ5Ï6¨¹¹Ïfruit_io.put (i);
ÏÏ§ÏÏ5Ï6¾¹¹ÏAda.text_io.put_line (" is not in setB ");         
ÏÏ§ÏÏ5Ï¶ÏEND IF;  
ÏÏ§ÏÏ°END LOOP;
ÏÏ¨¹¹ÏAda.text_io.new_line;
ÏÏ§
ÏÏ§  -- printing the elements in setC
ÏÏ¨¹¹±FOR i IN fruit LOOP
ÏÏ§ÏÏ7¹³´IF (mySet.is_Member (setC, i)) THEN
ÏÏ§ÏÏ5Ï6¨¹¹Ïfruit_io.put (i);
ÏÏ§ÏÏ5Ï6¾¹¹ÏAda.text_io.new_line;
ÏÏ§ÏÏ5Ï¶ÏEND IF;
ÏÏ§ÏÏ°END LOOP;
ÏÏ¨¹¹ÏAda.text_io.new_line;
ÏÏ§
ÏÏ§   -- removing peach and plum from setC
ÏÏ¨¹¹ÏsetC := mySet."-" (setC, peach);
ÏÏ¨¹¹ÏsetC := mySet."-" (setC, plum);
ÏÏ§      
ÏÏ§   -- now printing the elements in setC   
ÏÏ¨¹¹±FOR i IN fruit LOOP
ÏÏ§ÏÏ7¹³´IF (mySet.is_Member (setC, i)) THEN
ÏÏ§ÏÏ5Ï6¨¹¹Ïfruit_io.put (i);
ÏÏ§ÏÏ5Ï6¾¹¹ÏAda.text_io.new_line;
ÏÏ§ÏÏ5Ï¶ÏEND IF;
ÏÏ§ÏÏ°END LOOP;
ÏÏ¨¹¹ÏAda.text_io.new_line;
ÏÏ§ 
ÏÏ©END set_test;