1 interface inheriting from IValueSet
Microsoft.CodeAnalysis.CSharp (1)
Utilities\IValueSet.cs (1)
65
internal interface IValueSet<T> :
IValueSet
2 implementations of IValueSet
Microsoft.CodeAnalysis.CSharp (2)
Utilities\ValueSetFactory.NintValueSet.cs (1)
15
private sealed class NintValueSet : IValueSet<int>,
IValueSet
Utilities\ValueSetFactory.NuintValueSet.cs (1)
15
private sealed class NuintValueSet : IValueSet<uint>,
IValueSet
162 references to IValueSet
Microsoft.CodeAnalysis.CSharp (154)
Binder\DecisionDagBuilder.cs (41)
714
var
values = fac?.Related(rel.Relation.Operator(), rel.ConstantValue);
828
DagState uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp,
IValueSet
> remainingValues)
841
var newRemainingValues = ImmutableDictionary.CreateBuilder<BoundDagTemp,
IValueSet
>();
846
if (existingState.RemainingValues.TryGetValue(dagTemp, out
var
existingValuesForTemp))
848
var
newExistingValuesForTemp = existingValuesForTemp.Union(valuesForTemp);
854
!existingState.RemainingValues.All(kv => newRemainingValues.TryGetValue(kv.Key, out
IValueSet
? values) && kv.Value.Equals(values)))
887
ImmutableDictionary<BoundDagTemp,
IValueSet
>.Empty);
930
case BoundDagAssignmentEvaluation e when state.RemainingValues.TryGetValue(e.Input, out
IValueSet
? currentValues):
935
if (state.RemainingValues.TryGetValue(e.Target, out
IValueSet
? targetValues))
1073
IValueSet
? whenTrueValues,
1074
IValueSet
? whenFalseValues,
1088
out ImmutableDictionary<BoundDagTemp,
IValueSet
> whenTrueValues,
1090
out ImmutableDictionary<BoundDagTemp,
IValueSet
> whenFalseValues,
1102
whenTrueValues.TryGetValue(test.Input, out
IValueSet
? whenTrueValuesOpt);
1103
whenFalseValues.TryGetValue(test.Input, out
IValueSet
? whenFalseValuesOpt);
1125
ImmutableDictionary<BoundDagTemp,
IValueSet
> whenTrueValues,
1126
ImmutableDictionary<BoundDagTemp,
IValueSet
> whenFalseValues,
1130
ImmutableDictionary<BoundDagTemp,
IValueSet
> values,
1149
ImmutableDictionary<BoundDagTemp,
IValueSet
> whenTrueValues,
1150
ImmutableDictionary<BoundDagTemp,
IValueSet
> whenFalseValues,
1162
IValueSet
fromTestPassing = valueFac.Related(relation.Operator(), value);
1163
IValueSet
fromTestFailing = fromTestPassing.Complement();
1164
if (values.TryGetValue(input, out
IValueSet
? tempValuesBeforeTest))
1244
IValueSet
? whenTrueValues,
1245
IValueSet
? whenFalseValues,
1854
public ImmutableDictionary<BoundDagTemp,
IValueSet
> RemainingValues { get; private set; } = null!;
1883
public static DagState GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp,
IValueSet
> remainingValues)
1927
internal void UpdateRemainingValues(ImmutableDictionary<BoundDagTemp,
IValueSet
> newRemainingValues)
2071
IValueSet
? whenTrueValues,
2072
IValueSet
? whenFalseValues,
2095
IValueSet
? whenTrueValues,
2096
IValueSet
? whenFalseValues,
2116
IValueSet
? whenTrueValues,
2117
IValueSet
? whenFalseValues,
2140
IValueSet
? whenTrueValues,
2141
IValueSet
? whenFalseValues,
2256
var
lengthValues = fac.Related(relation, constant);
2307
IValueSet
? whenTrueValues,
2308
IValueSet
? whenFalseValues,
2334
IValueSet
? whenTrueValues,
2335
IValueSet
? whenFalseValues,
Binder\PatternExplainer.cs (5)
510
IValueSet
remainingValues = computeRemainingValues(fac, constraints);
596
IValueSet
computeRemainingValues(IValueSetFactory fac, ImmutableArray<(BoundDagTest test, bool sense)> constraints)
598
var
remainingValues = fac.AllValues;
616
var
filtered = fac.Related(relation, value);
641
private static string SampleValueString(
IValueSet
remainingValues, TypeSymbol type, bool requireExactType, ref bool unnamedEnumValue)
Utilities\IValueSet.cs (6)
21
IValueSet
Intersect(
IValueSet
other);
26
IValueSet
Union(
IValueSet
other);
31
IValueSet
Complement();
63
/// An interface representing a set of values of a specific type. Like <see cref="
IValueSet
"/> but strongly typed to <typeparamref name="T"/>.
Utilities\IValueSetFactory.cs (4)
18
IValueSet
Related(BinaryOperatorKind relation, ConstantValue value);
28
IValueSet
Random(int expectedSize, Random random);
38
IValueSet
AllValues { get; }
43
IValueSet
NoValues { get; }
Utilities\ValueSetFactory.BoolValueSet.cs (11)
39
bool
IValueSet
.IsEmpty => !_hasFalse && !_hasTrue;
41
ConstantValue
IValueSet
.Sample => ConstantValue.Create(_hasTrue ? true : _hasFalse ? false : throw new ArgumentException());
56
bool
IValueSet
.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, value.BooleanValue);
71
bool
IValueSet
.All(BinaryOperatorKind relation, ConstantValue value) => !value.IsBad && All(relation, value.BooleanValue);
75
IValueSet
IValueSet
.Complement() => this.Complement();
85
public
IValueSet
Intersect(
IValueSet
other) => this.Intersect((IValueSet<bool>)other);
95
IValueSet
IValueSet
.Union(
IValueSet
other) => this.Union((IValueSet<bool>)other);
Utilities\ValueSetFactory.BoolValueSetFactory.cs (4)
24
IValueSet
IValueSetFactory.AllValues => BoolValueSet.AllValues;
26
IValueSet
IValueSetFactory.NoValues => BoolValueSet.None;
42
IValueSet
IValueSetFactory.Random(int expectedSize, Random random) => random.Next(4) switch
53
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value)
Utilities\ValueSetFactory.DecimalValueSetFactory.cs (4)
17
IValueSet
IValueSetFactory.AllValues => NumericValueSet<decimal>.AllValues(DecimalTC.Instance);
19
IValueSet
IValueSetFactory.NoValues => NumericValueSet<decimal>.NoValues(DecimalTC.Instance);
23
IValueSet
IValueSetFactory.Random(int expectedSize, Random random) => _underlying.Random(expectedSize, random);
27
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value) =>
Utilities\ValueSetFactory.EnumeratedValueSet.cs (11)
48
ConstantValue
IValueSet
.Sample
88
bool
IValueSet
.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, _tc.FromConstantValue(value));
111
bool
IValueSet
.All(BinaryOperatorKind relation, ConstantValue value) => !value.IsBad && All(relation, _tc.FromConstantValue(value));
115
IValueSet
IValueSet
.Complement() => this.Complement();
138
IValueSet
IValueSet
.Intersect(
IValueSet
other) => Intersect((IValueSet<T>)other);
161
IValueSet
IValueSet
.Union(
IValueSet
other) => Union((IValueSet<T>)other);
Utilities\ValueSetFactory.EnumeratedValueSetFactory.cs (4)
21
IValueSet
IValueSetFactory.AllValues => EnumeratedValueSet<T>.AllValues(_tc);
23
IValueSet
IValueSetFactory.NoValues => EnumeratedValueSet<T>.NoValues(_tc);
38
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value) =>
47
public
IValueSet
Random(int expectedSize, Random random)
Utilities\ValueSetFactory.FloatingValueSet.cs (11)
51
ConstantValue
IValueSet
.Sample
111
IValueSet
IValueSet
.Intersect(
IValueSet
other) => this.Intersect((IValueSet<TFloating>)other);
126
IValueSet
IValueSet
.Union(
IValueSet
other) => this.Union((IValueSet<TFloating>)other);
136
IValueSet
IValueSet
.Complement() => this.Complement();
138
bool
IValueSet
.Any(BinaryOperatorKind relation, ConstantValue value) =>
148
bool
IValueSet
.All(BinaryOperatorKind relation, ConstantValue value) => !value.IsBad && All(relation, _tc.FromConstantValue(value));
Utilities\ValueSetFactory.FloatingValueSetFactory.cs (4)
20
IValueSet
IValueSetFactory.AllValues => FloatingValueSet<TFloating>.AllValues(_tc);
22
IValueSet
IValueSetFactory.NoValues => FloatingValueSet<TFloating>.NoValues(_tc);
27
IValueSet
IValueSetFactory.Random(int expectedSize, Random random) =>
35
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value) =>
Utilities\ValueSetFactory.NintValueSet.cs (11)
48
ConstantValue?
IValueSet
.Sample
74
bool
IValueSet
.All(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || All(relation, value.Int32Value);
85
bool
IValueSet
.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, value.Int32Value);
96
IValueSet
IValueSet
.Complement() => this.Complement();
108
IValueSet
IValueSet
.Intersect(
IValueSet
other) => this.Intersect((NintValueSet)other);
120
IValueSet
IValueSet
.Union(
IValueSet
other) => this.Union((NintValueSet)other);
Utilities\ValueSetFactory.NintValueSetFactory.cs (4)
19
IValueSet
IValueSetFactory.AllValues => NintValueSet.AllValues;
21
IValueSet
IValueSetFactory.NoValues => NintValueSet.NoValues;
32
IValueSet
IValueSetFactory.Random(int expectedSize, Random random)
43
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value)
Utilities\ValueSetFactory.NonNegativeIntValueSetFactory.cs (4)
21
public
IValueSet
AllValues => NumericValueSet<int>.AllValues(IntTC.NonNegativeInstance);
23
public
IValueSet
NoValues => NumericValueSet<int>.NoValues(IntTC.NonNegativeInstance);
53
IValueSet
IValueSetFactory.Random(int expectedSize, Random random) => s_underlying.Random(expectedSize, random);
57
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value) =>
Utilities\ValueSetFactory.NuintValueSet.cs (11)
39
ConstantValue?
IValueSet
.Sample
63
bool
IValueSet
.All(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || All(relation, value.UInt32Value);
72
bool
IValueSet
.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, value.UInt32Value);
82
IValueSet
IValueSet
.Complement() => this.Complement();
93
IValueSet
IValueSet
.Intersect(
IValueSet
other) => this.Intersect((NuintValueSet)other);
104
IValueSet
IValueSet
.Union(
IValueSet
other) => this.Union((NuintValueSet)other);
Utilities\ValueSetFactory.NuintValueSetFactory.cs (4)
19
IValueSet
IValueSetFactory.AllValues => NuintValueSet.AllValues;
21
IValueSet
IValueSetFactory.NoValues => NuintValueSet.NoValues;
31
IValueSet
IValueSetFactory.Random(int expectedSize, Random random)
41
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value)
Utilities\ValueSetFactory.NumericValueSet.cs (11)
56
ConstantValue
IValueSet
.Sample
107
bool
IValueSet
.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, _tc.FromConstantValue(value));
129
bool
IValueSet
.All(BinaryOperatorKind relation, ConstantValue value) => !value.IsBad && All(relation, _tc.FromConstantValue(value));
160
IValueSet
IValueSet
.Complement() => this.Complement();
237
IValueSet
IValueSet
.Intersect(
IValueSet
other) => this.Intersect((IValueSet<T>)other);
288
IValueSet
IValueSet
.Union(
IValueSet
other) => this.Union((IValueSet<T>)other);
Utilities\ValueSetFactory.NumericValueSetFactory.cs (4)
23
IValueSet
IValueSetFactory.AllValues => NumericValueSet<T>.AllValues(_tc);
25
IValueSet
IValueSetFactory.NoValues => NumericValueSet<T>.NoValues(_tc);
52
IValueSet
IValueSetFactory.Related(BinaryOperatorKind relation, ConstantValue value) =>
55
public
IValueSet
Random(int expectedSize, Random random) =>
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Utilities\ValueSetTests.cs (8)
434
var
s3 = b.Complement().Intersect(s2.Complement());
436
var
s4 = b.Union(s2).Complement();
603
var
s1 = fac.Random(10, Random);
604
var
s2 = fac.Random(10, Random);
605
var
u1 = s1.Union(s2);
606
var
u2 = s1.Complement().Intersect(s2.Complement()).Complement();
608
var
i1 = s1.Intersect(s2);
609
var
i2 = s1.Complement().Union(s2.Complement()).Complement();