diff options
Diffstat (limited to 'gcc/ada/a-cofuse.adb')
-rw-r--r-- | gcc/ada/a-cofuse.adb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ada/a-cofuse.adb b/gcc/ada/a-cofuse.adb index e0ea2ff..22bf688 100644 --- a/gcc/ada/a-cofuse.adb +++ b/gcc/ada/a-cofuse.adb @@ -113,6 +113,17 @@ package body Ada.Containers.Functional_Sets with SPARK_Mode => Off is function Is_Empty (Container : Set) return Boolean is (Length (Container.Content) = 0); + ------------------ + -- Is_Singleton -- + ------------------ + + function Is_Singleton + (Container : Set; + New_Item : Element_Type) return Boolean + is + (Length (Container.Content) = 1 + and New_Item = Get (Container.Content, 1)); + ------------ -- Length -- ------------ @@ -120,6 +131,25 @@ package body Ada.Containers.Functional_Sets with SPARK_Mode => Off is function Length (Container : Set) return Count_Type is (Length (Container.Content)); + ----------------- + -- Not_In_Both -- + ----------------- + + function Not_In_Both + (Container : Set; + Left : Set; + Right : Set) return Boolean + is + (for all Item of Container => + not Contains (Right, Item) or not Contains (Left, Item)); + + ---------------- + -- No_Overlap -- + ---------------- + + function No_Overlap (Left : Set; Right : Set) return Boolean is + (Num_Overlaps (Left.Content, Right.Content) = 0); + ------------------ -- Num_Overlaps -- ------------------ |