API Reference

type Set , function "+" , function Union , function "+" , function "+"

  
   type Set is private; -- Initial value: empty.  
  
   Empty : constant Set; -- No members.  
   Full  : constant Set; -- Every possible member.  
  
   function "+" (Left : Set; Right : Set) return Set; -- Union.  
   function Union (Left : Set; Right : Set) return Set renames "+";  
  
   function "+" (Left : Set;     Right : Element) return Set;  
   function "+" (Left : Element; Right : Set)     return Set;  

These two perform the union of the Set and a Set consisting of the Element.

function Union , function Union , function "*" , function Intersection , function "-" , function Difference , function "-"

   function Union (Left : Set;     Right : Element) return Set renames "+";   
   function Union (Left : Element; Right : Set)     return Set renames "+";  
  
   function "*" (Left : Set; Right : Set) return Set; -- Intersection.  
   function Intersection (Left : Set; Right : Set) return Set renames "*";  
  
   function "-" (Left : Set; Right : Set) return Set; -- Difference.  
   function Difference (Left : Set; Right : Set) return Set renames "-";  
  
   function "-" (Left : Set; Right : Element) return Set;  

function Difference, function "/" , function Symmetric_Difference , function "<=" , function Subset , function "<" , function Proper_Subset , function ">=" , function Superset , function ">" , function Proper_Superset , function Member , type Member_List , function Make_Set

   function Difference(Left : Set; Right : Element) return Set renames "-";   
  
   function "/" (Left : Set; Right : Set) return Set; -- Symmetric difference.  
   function Symmetric_Difference (Left : Set; Right : Set) return Set  
   renames "/";  
  
   function "<=" (Left : Set; Right : Set) return Boolean; -- Subset.  
   function Subset (Left : Set; Right : Set) return Boolean renames "<=";  
  
   function "<" (Left : Set; Right : Set) return Boolean; -- Proper subset.  
   function Proper_Subset (Left : Set; Right : Set) return Boolean renames "<";  
  
   function ">=" (Left : Set; Right : Set) return Boolean; -- Superset.  
   function Superset (Left : Set; Right : Set) return Boolean renames ">=";  
  
   function ">" (Left : Set; Right : Set) return Boolean; -- Proper superset.  
   function Proper_Superset (Left : Set; Right : Set) return Boolean  
   renames ">";  
  
   function Member (Item : Element; Group : Set) return Boolean; -- Membership.  
  
   type Member_List is array (Positive range <>) of Element;  
  
   function Make_Set (List : Member_List) return Set;  

Allows a sort of Set literal:

My_Set := Make_Set ( (An_Element, Another_Element, Yet_A_3rd_Element) );

function Size

   function Size (Group : Set) return Natural; -- Number of members.