// Functional Union public static GSet <T> /*!*/ Union(GSet <T> /*!*/ a, GSet <T> /*!*/ b) { Contract.Requires(a != null); Contract.Requires(b != null); Contract.Ensures(Contract.Result <GSet <T> >() != null); // Contract.Ensures(Contract.ForAll(result, x => a[x] || b[x] )); GSet <T> /*!*/ res = (GSet <T> /*!*/)cce.NonNull(a.Clone()); res.AddRange(b); return(res); }
//----------------------------- Static Methods --------------------------------- // Functional Intersect public static GSet <T> /*!*/ Intersect(GSet <T> /*!*/ a, GSet <T> /*!*/ b) { Contract.Requires(b != null); Contract.Requires(a != null); Contract.Ensures(Contract.Result <GSet <T> >() != null); //Contract.Ensures(Contract.ForAll(result, x => a[x] && b[x] )); GSet <T> /*!*/ res = (GSet <T> /*!*/)cce.NonNull(a.Clone()); res.Intersect(b); return(res); }