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