with Monitor;
generic
    type Item is (<>);
package Bag_Discrete_Multiple_Bounded_Managed_Noniterator 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;

    Item_Is_Not_In_Bag : exception;

private
    type Items is array (Item) of Natural;
    type Bag is
        record
            Guard : Monitor.Kind;
            The_Items : Items := Items'(others => 0);
        end record;
end Bag_Discrete_Multiple_Bounded_Managed_Noniterator;