6 implementations of IValueSet
Microsoft.CodeAnalysis.CSharp (6)
Utilities\ValueSetFactory.BoolValueSet.cs (1)
13private sealed class BoolValueSet : IValueSet<bool>
Utilities\ValueSetFactory.EnumeratedValueSet.cs (1)
21private sealed class EnumeratedValueSet<T> : IValueSet<T>
Utilities\ValueSetFactory.FloatingValueSet.cs (1)
20private sealed class FloatingValueSet<TFloating> : IValueSet<TFloating>
Utilities\ValueSetFactory.NintValueSet.cs (1)
15private sealed class NintValueSet : IValueSet<int>, IValueSet
Utilities\ValueSetFactory.NuintValueSet.cs (1)
15private sealed class NuintValueSet : IValueSet<uint>, IValueSet
Utilities\ValueSetFactory.NumericValueSet.cs (1)
22private sealed class NumericValueSet<T> : IValueSet<T>
132 references to IValueSet
Microsoft.CodeAnalysis.CSharp (73)
Binder\DecisionDagBuilder.cs (3)
1486var lengthValues = (IValueSet<int>)state.RemainingValues[s1LengthTemp]; 2255var possibleValues = fac.Related(BinaryOperatorKind.LessThanOrEqual, int.MaxValue - offset);
Binder\PatternExplainer.cs (2)
404var lengthValues = (IValueSet<int>)computeRemainingValues(ValueSetFactory.ForLength, getArray(constraintMap, lengthTemp));
Utilities\IValueSet.cs (5)
70IValueSet<T> Intersect(IValueSet<T> other); 75IValueSet<T> Union(IValueSet<T> other); 80new IValueSet<T> Complement();
Utilities\IValueSetFactory.cs (1)
55IValueSet<T> Related(BinaryOperatorKind relation, T value);
Utilities\ValueSetFactory.BoolValueSet.cs (7)
73public IValueSet<bool> Complement() => Create(!_hasFalse, !_hasTrue); 77public IValueSet<bool> Intersect(IValueSet<bool> other) 85public IValueSet Intersect(IValueSet other) => this.Intersect((IValueSet<bool>)other); 87public IValueSet<bool> Union(IValueSet<bool> other) 95IValueSet IValueSet.Union(IValueSet other) => this.Union((IValueSet<bool>)other);
Utilities\ValueSetFactory.BoolValueSetFactory.cs (1)
28public IValueSet<bool> Related(BinaryOperatorKind relation, bool value)
Utilities\ValueSetFactory.DecimalValueSetFactory.cs (1)
21public IValueSet<decimal> Related(BinaryOperatorKind relation, decimal value) => _underlying.Related(relation, DecimalTC.Normalize(value));
Utilities\ValueSetFactory.EnumeratedValueSet.cs (7)
113public IValueSet<T> Complement() => new EnumeratedValueSet<T>(!_included, _membersIncludedOrExcluded, _tc); 117public IValueSet<T> Intersect(IValueSet<T> o) 138IValueSet IValueSet.Intersect(IValueSet other) => Intersect((IValueSet<T>)other); 140public IValueSet<T> Union(IValueSet<T> o) 161IValueSet IValueSet.Union(IValueSet other) => Union((IValueSet<T>)other);
Utilities\ValueSetFactory.EnumeratedValueSetFactory.cs (2)
27public IValueSet<T> Related(BinaryOperatorKind relation, T value) 50IValueSet<T> result = EnumeratedValueSet<T>.NoValues(_tc);
Utilities\ValueSetFactory.FloatingValueSet.cs (14)
22private readonly IValueSet<TFloating> _numbers; 26private FloatingValueSet(IValueSet<TFloating> numbers, bool hasNaN, FloatingTC<TFloating> tc) 32internal static IValueSet<TFloating> AllValues(FloatingTC<TFloating> tc) => new FloatingValueSet<TFloating>( 35internal static IValueSet<TFloating> NoValues(FloatingTC<TFloating> tc) => new FloatingValueSet<TFloating>( 38internal static IValueSet<TFloating> Random(int expectedSize, Random random, FloatingTC<TFloating> tc) 46numbers: (IValueSet<TFloating>)new NumericValueSetFactory<TFloating>(tc).Random(expectedSize, random), hasNaN: hasNan, tc); 70public static IValueSet<TFloating> Related(BinaryOperatorKind relation, TFloating value, FloatingTC<TFloating> tc) 98public IValueSet<TFloating> Intersect(IValueSet<TFloating> o) 111IValueSet IValueSet.Intersect(IValueSet other) => this.Intersect((IValueSet<TFloating>)other); 113public IValueSet<TFloating> Union(IValueSet<TFloating> o) 126IValueSet IValueSet.Union(IValueSet other) => this.Union((IValueSet<TFloating>)other); 128public IValueSet<TFloating> Complement()
Utilities\ValueSetFactory.FloatingValueSetFactory.cs (1)
24public IValueSet<TFloating> Related(BinaryOperatorKind relation, TFloating value) =>
Utilities\ValueSetFactory.NintValueSet.cs (7)
21private readonly IValueSet<int> _values; 39internal NintValueSet(bool hasSmall, IValueSet<int> values, bool hasLarge) 87public IValueSet<int> Complement() 98public IValueSet<int> Intersect(IValueSet<int> o) 110public IValueSet<int> Union(IValueSet<int> o)
Utilities\ValueSetFactory.NintValueSetFactory.cs (2)
23public IValueSet<int> Related(BinaryOperatorKind relation, int value) 36values: (IValueSet<int>)new NumericValueSetFactory<int>(IntTC.DefaultInstance).Random(expectedSize, random),
Utilities\ValueSetFactory.NonNegativeIntValueSetFactory.cs (1)
25public IValueSet<int> Related(BinaryOperatorKind relation, int value)
Utilities\ValueSetFactory.NuintValueSet.cs (7)
21private readonly IValueSet<uint> _values; 31internal NuintValueSet(IValueSet<uint> values, bool hasLarge) 74public IValueSet<uint> Complement() 84public IValueSet<uint> Intersect(IValueSet<uint> o) 95public IValueSet<uint> Union(IValueSet<uint> o)
Utilities\ValueSetFactory.NuintValueSetFactory.cs (2)
23public IValueSet<uint> Related(BinaryOperatorKind relation, uint value) 34values: (IValueSet<uint>)new NumericValueSetFactory<uint>(UIntTC.Instance).Random(expectedSize, random),
Utilities\ValueSetFactory.NumericValueSet.cs (9)
64var gz = new NumericValueSetFactory<T>(_tc).Related(BinaryOperatorKind.GreaterThanOrEqual, _tc.Zero); 131public IValueSet<T> Complement() 162public IValueSet<T> Intersect(IValueSet<T> o) 237IValueSet IValueSet.Intersect(IValueSet other) => this.Intersect((IValueSet<T>)other); 239public IValueSet<T> Union(IValueSet<T> o) 288IValueSet IValueSet.Union(IValueSet other) => this.Union((IValueSet<T>)other); 293internal static IValueSet<T> Random(int expectedSize, Random random, INumericTC<T> tc)
Utilities\ValueSetFactory.NumericValueSetFactory.cs (1)
29public IValueSet<T> Related(BinaryOperatorKind relation, T value)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (59)
Utilities\ValueSetTests.cs (59)
36IValueSet<int> values = ForInt.Related(GreaterThanOrEqual, i1); 46IValueSet<int> values = ForInt.Related(GreaterThanOrEqual, i1); 65IValueSet<int> values = ForInt.Related(GreaterThan, i1); 75IValueSet<int> values = ForInt.Related(GreaterThan, i1); 94IValueSet<int> values = ForInt.Related(LessThanOrEqual, i1); 104IValueSet<int> values = ForInt.Related(LessThanOrEqual, i1); 123IValueSet<int> values = ForInt.Related(LessThan, i1); 133IValueSet<int> values = ForInt.Related(LessThan, i1); 152IValueSet<int> values = ForInt.Related(Equal, i1); 162IValueSet<int> values = ForInt.Related(Equal, i1); 175IValueSet<int> values1 = ForInt.Related(GreaterThanOrEqual, i1).Intersect(ForInt.Related(LessThanOrEqual, i2)); 177IValueSet<int> values2 = ForInt.Related(LessThanOrEqual, i2).Intersect(ForInt.Related(GreaterThanOrEqual, i1)); 191IValueSet<int> values1 = ForInt.Related(GreaterThanOrEqual, i1).Intersect(ForInt.Related(LessThanOrEqual, i2)); 193IValueSet<int> values2 = ForInt.Related(LessThanOrEqual, i2).Intersect(ForInt.Related(GreaterThanOrEqual, i1)); 207IValueSet<int> values1 = ForInt.Related(LessThanOrEqual, i1).Union(ForInt.Related(GreaterThanOrEqual, i2)); 209IValueSet<int> values2 = ForInt.Related(GreaterThanOrEqual, i2).Union(ForInt.Related(LessThanOrEqual, i1)); 222IValueSet<int> values1 = ForInt.Related(LessThanOrEqual, i1).Union(ForInt.Related(GreaterThanOrEqual, i2)); 224IValueSet<int> values2 = ForInt.Related(GreaterThanOrEqual, i2).Union(ForInt.Related(LessThanOrEqual, i1)); 238IValueSet<int> values1 = ForInt.Related(LessThanOrEqual, i1).Union(ForInt.Related(GreaterThanOrEqual, i2)); 240IValueSet<int> values2 = values1.Complement(); 254IValueSet<int> values = ForInt.Related(GreaterThanOrEqual, i1).Intersect(ForInt.Related(LessThanOrEqual, i2)); 282IValueSet<int> values = ForInt.Related(GreaterThanOrEqual, i1).Intersect(ForInt.Related(LessThanOrEqual, i2)); 295IValueSet<double> values = ForDouble.Related(GreaterThanOrEqual, d1).Intersect(ForDouble.Related(LessThanOrEqual, d2)); 303IValueSet<char> gea1 = ForChar.Related(GreaterThanOrEqual, 'a'); 304IValueSet<char> lez1 = ForChar.Related(LessThanOrEqual, 'z'); 305IValueSet<char> gea2 = ForChar.Related(GreaterThanOrEqual, 'A'); 306IValueSet<char> lez2 = ForChar.Related(LessThanOrEqual, 'Z'); 307var letters = gea1.Intersect(lez1).Union(gea2.Intersect(lez2)); 315var lt = ForDouble.Related(LessThan, 0.0); 317var gt = ForDouble.Related(GreaterThan, 0.0); 319var eq = ForDouble.Related(Equal, 0.0); 321var none = lt.Complement().Intersect(gt.Complement()).Intersect(eq.Complement()); 330var lt = ForFloat.Related(LessThan, 0.0f); 332var gt = ForFloat.Related(GreaterThan, 0.0f); 334var eq = ForFloat.Related(Equal, 0.0f); 336var none = lt.Complement().Intersect(gt.Complement()).Intersect(eq.Complement()); 357var neg = ForDouble.Related(LessThan, 0.0); 361var mi = ForDouble.Related(Equal, double.NegativeInfinity); 371var i = ForDouble.Related(Equal, double.PositiveInfinity); 385var notaset = ForString.Related(Equal, "a").Complement(); 386var bset = ForString.Related(Equal, "b"); 387var intersect = bset.Intersect(notaset); 394var t = ForBool.Related(Equal, true); 395var f = ForBool.Related(Equal, false); 396var em = t.Intersect(f); 398var q = t.Intersect(t); 408var s = ForByte.Related(GreaterThan, 10).Intersect(ForByte.Related(LessThan, 100)); 415var s1 = ForString.Related(Equal, "a"); 416var s2 = ForString.Related(Equal, "b"); 429var s1 = ForDouble.Related(LessThan, 3.14d); 433var s2 = ForDouble.Related(GreaterThan, 31.4d); 443var s1 = ForLong.Related(LessThan, 2); 462var s2 = ForLong.Related(GreaterThan, -5).Intersect(s1); 721var s1 = ForInt.Related(BinaryOperatorKind.Equal, i); 743var s1 = ForInt.Related(BinaryOperatorKind.Equal, j); 764var s1 = ForInt.Related(BinaryOperatorKind.LessThan, i); 789var s1 = ForInt.Related(BinaryOperatorKind.LessThan, j); 813var s1 = ForInt.Related(BinaryOperatorKind.Equal, i); 835var s1 = ForInt.Related(BinaryOperatorKind.Equal, j);