generic
    type Item is private;
package Bag_Simple_Sequential_Unbounded_Controlled_Iterator is

    type Bag is limited private;

    procedure Copy (From_The_Bag : in Bag; To_The_Bag : in out Bag);
    procedure Clear (The_Bag : in out Bag);
    procedure Add (The_Item : in Item; To_The_Bag : in out Bag);
    procedure Remove (The_Item : in Item; From_The_Bag : in out Bag);
    procedure Union (Of_The_Bag : in Bag;
                     And_The_Bag : in Bag;
                     To_The_Bag : in out Bag);
    procedure Intersection (Of_The_Bag : in Bag;
                            And_The_Bag : in Bag;
                            To_The_Bag : in out Bag);
    procedure Difference (Of_The_Bag : in Bag;
                          And_The_Bag : in Bag;
                          To_The_Bag : in out Bag);

    function Is_Equal (Left : in Bag; Right : in Bag) return Boolean;
    function Extent_Of (The_Bag : in Bag) return Natural;
    function Unique_Extent_Of (The_Bag : in Bag) return Natural;
    function Number_Of
                (The_Item : in Item; In_The_Bag : in Bag) return Positive;
    function Is_Empty (The_Bag : in Bag) return Boolean;
    function Is_A_Member
                (The_Item : in Item; Of_The_Bag : in Bag) return Boolean;
    function Is_A_Subset (Left : in Bag; Right : in Bag) return Boolean;
    function Is_A_Proper_Subset (Left : in Bag; Right : in Bag) return Boolean;

    generic
        with procedure Process (The_Item : in Item;
                                The_Count : in Positive;
                                Continue : out Boolean);
    procedure Iterate (Over_The_Bag : in Bag);

    Overflow : exception;
    Item_Is_Not_In_Bag : exception;

private
    type Node;
    type Bag is access Node;
end Bag_Simple_Sequential_Unbounded_Controlled_Iterator;