------------------------------------------------------------------------------
--                                                                          --
--                   AI-302 Reference Implementation                        --
--                                                                          --
--              Copyright (C) 2003-2004 Matthew J Heaney                    --
--                                                                          --
-- The AI-302 Reference Implementation ("AI-302") is free software; you can --
-- redistribute it and/or modify it under terms of the GNU General Public   --
-- License as published by the Free Software Foundation; either version 2,  --
-- or (at your option) any later version.  AI-302 is distributed in the     --
-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the  --
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- See the GNU General Public License for more details.  You should have    --
-- received a copy of the GNU General Public License distributed with       --
-- AI-302;  see file COPYING.TXT.  If not, write to the Free Software       --
-- Foundation,  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.    --
--                                                                          --
-- As a special exception, if other files instantiate generics from this    --
-- unit, or you link this unit with other files to produce an executable,   --
-- this unit does not by itself cause the resulting executable to be        --
-- covered by the GNU General Public License.  This exception does not      --
-- however invalidate any other reasons why the executable file might be    --
-- covered by the GNU Public License.                                       --
--                                                                          --
-- The AI-302 Reference Implementation is maintained by Matthew J Heaney.   --
--                                                                          --
-- mailto:matthewjheaney@earthlink.net                                      --
-- http://home.earthlink.net/~matthewjheaney/index.html                     --
-- http://charles.tigris.org/                                               --
--                                                                          --
------------------------------------------------------------------------------

with Ada.Containers.Red_Black_Trees.Generic_Operations;

generic

   with package Tree_Operations is
     new Generic_Operations (<>);

   use Tree_Operations.Tree_Types;

   with procedure Insert_With_Hint
     (Dst_Tree : in out Tree_Type;
      Dst_Hint : in     Node_Access;
      Src_Node : in     Node_Access;
      Dst_Node :    out Node_Access);

   with function Copy_Tree (Source_Root : Node_Access)
       return Node_Access;

   with procedure Delete_Tree (X : in out Node_Access);

   with function Is_Less (Left, Right : Node_Access) return Boolean;

   with procedure Free (X : in out Node_Access);

package Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
   pragma Pure (Generic_Set_Operations);


   procedure Union (Target : in out Tree_Type;
                    Source : in     Tree_Type);

   function Union (Left, Right : Tree_Type) return Tree_Type;


   procedure Intersection (Target : in out Tree_Type;
                           Source : in     Tree_Type);

   function Intersection (Left, Right : Tree_Type) return Tree_Type;


   procedure Difference (Target : in out Tree_Type;
                         Source : in     Tree_Type);

   function Difference (Left, Right : Tree_Type) return Tree_Type;


   procedure Symmetric_Difference (Target : in out Tree_Type;
                                   Source : in     Tree_Type);

   function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type;


   function Is_Subset (Subset : Tree_Type;
                       Of_Set : Tree_Type) return Boolean;

   function Overlap (Left, Right : Tree_Type) return Boolean;


end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
