Beispiel #1
0
        public void Repeat1()
        {
            var dist = StringDistribution.Repeat(StringDistribution.OneOf("ab", "cd"), minTimes: 1, maxTimes: 3);

            Assert.True(dist.IsProper());
            StringInferenceTestUtilities.TestProbability(dist, StringInferenceTestUtilities.StringUniformProbability(1, 3, 2), "ab", "cd", "abab", "abcd", "cdabcd", "cdcdcd");
        }
Beispiel #2
0
        public void MessageOpsTest()
        {
            const double Eps = 1e-6;

            StringDistribution str1 = StringOfLengthOp.StrAverageConditional(DiscreteChar.Letter(), 10);

            Assert.Equal(StringDistribution.Repeat(DiscreteChar.Letter(), 10, 10), str1);

            StringDistribution str2 = StringOfLengthOp.StrAverageConditional(
                DiscreteChar.PointMass('a'), Discrete.UniformInRange(5, 2, 4));

            Assert.Equal(StringDistribution.OneOf("aa", "aaa", "aaaa"), str2);

            StringDistribution str3 = StringOfLengthOp.StrAverageConditional(
                DiscreteChar.OneOf('a', 'b'), new Discrete(0.1, 0.0, 0.6, 0.3));

            StringInferenceTestUtilities.TestProbability(str3, 0.1, string.Empty);
            StringInferenceTestUtilities.TestProbability(str3, 0.6 / 4, "aa", "ab", "ba", "bb");
            StringInferenceTestUtilities.TestProbability(str3, 0.3 / 8, "aaa", "bbb", "abb", "bab");

            Discrete length1 = StringOfLengthOp.LengthAverageConditional(
                StringDistribution.OneOf("aa", "bbb"), DiscreteChar.PointMass('a'), Discrete.Uniform(10));

            Assert.Equal(Discrete.PointMass(2, 10), length1);

            Discrete length2 = StringOfLengthOp.LengthAverageConditional(
                StringDistribution.OneOf("aab", "ab", "b", "bc"), DiscreteChar.OneOf('a', 'b'), Discrete.Uniform(10));

            Assert.Equal(4.0 / 7.0, length2[1], Eps);
            Assert.Equal(2.0 / 7.0, length2[2], Eps);
            Assert.Equal(1.0 / 7.0, length2[3], Eps);
        }
        public void SemanticWebTest3b()
        {
            var prop0 = Variable.Random(NamePrior());

            var dateStrings = Variable.Observed(new[] { "6 May 1953", "May 6, 1953" });
            var dateFormat  = Variable.DiscreteUniform(dateStrings.Range);
            var prop1       = ArrayIndex(dateStrings, dateFormat);

            var template = Variable.Random(StringDistribution.String("{0}") + WordStrings.WordMiddle() + StringDistribution.String("{1}"));
            var text     = Variable.StringFormat(template, prop0, prop1);

            text.ObservedValue = "Tony Blair was born on May 6, 1953";

            var engine = new InferenceEngine();

            engine.Compiler.RecommendedQuality = QualityBand.Experimental;
            engine.NumberOfIterations          = 1;

            var prop0Dist      = engine.Infer <StringDistribution>(prop0);
            var prop1Dist      = engine.Infer <StringDistribution>(prop1);
            var templateDist   = engine.Infer <StringDistribution>(template);
            var dateFormatDist = engine.Infer <Discrete>(dateFormat);

            StringInferenceTestUtilities.TestProbability(prop0Dist, 1.0, "Tony Blair");
            StringInferenceTestUtilities.TestProbability(prop1Dist, 1.0, "May 6, 1953");
            StringInferenceTestUtilities.TestProbability(templateDist, 1.0, "{0} was born on {1}");

            //Assert.AreEqual(1.0, dateFormatDist[1]); // TODO: fix me
        }
        public void SemanticWebTest3()
        {
            // Simplified name model
            var prop0 = Variable.Random(NamePrior()).Named("prop0");
            // Simplified date model any string ending in a digit
            var prop1 = Variable.Random(
                StringDistribution.Char(DiscreteChar.Digit()) + StringDistribution.Any() + StringDistribution.Char(DiscreteChar.Digit()))
                        .Named("prop1");
            var template = Variable.Random(StringDistribution.String("{0}") + WordStrings.WordMiddle() + StringDistribution.String("{1}"))
                           .Named("template");
            var text = Variable.StringFormat(template, prop0, prop1).Named("text");

            text.ObservedValue = "Tony Blair was born on 6 May 1953";

            var engine = new InferenceEngine();

            engine.Compiler.RecommendedQuality = QualityBand.Experimental;
            engine.NumberOfIterations          = 1;

            var prop0Dist    = engine.Infer <StringDistribution>(prop0);
            var prop1Dist    = engine.Infer <StringDistribution>(prop1);
            var templateDist = engine.Infer <StringDistribution>(template);

            StringInferenceTestUtilities.TestProbability(prop0Dist, 1.0, "Tony Blair");
            StringInferenceTestUtilities.TestProbability(prop1Dist, 0.5, "1953", "6 May 1953");
            StringInferenceTestUtilities.TestProbability(templateDist, 0.5, "{0} was born on {1}", "{0} was born on 6 May {1}");
        }
Beispiel #5
0
        public void AppendPointMass()
        {
            var dist = StringDistribution.OneOf("13", "313");

            dist.AppendInPlace(StringDistribution.String("37"));
            StringInferenceTestUtilities.TestProbability(dist, 0.5, "1337", "31337");
        }
Beispiel #6
0
        public void Concat()
        {
            var hello      = StringDistribution.String("hello");
            var world      = StringDistribution.String("world");
            var helloworld = hello + world;

            StringInferenceTestUtilities.TestProbability(helloworld, 1.0, "helloworld");
            StringInferenceTestUtilities.TestProbability(helloworld, 0.0, string.Empty, "hello", "world");

            var any       = StringDistribution.Any();
            var hellostar = hello + any;

            StringInferenceTestUtilities.TestProbability(hellostar, 1.0, "helloworld", "hello", "hello world");
            StringInferenceTestUtilities.TestProbability(hellostar, 0.0, "hhelloworld", string.Empty, "hell", "hhello");

            var starhello = any + hello;

            StringInferenceTestUtilities.TestProbability(starhello, 1.0, "hhello", "hello", "well hello");
            StringInferenceTestUtilities.TestProbability(starhello, 0.0, "hhelloworld", string.Empty, "hell", "hello!!");

            var starhellostar = any + hello + any;

            StringInferenceTestUtilities.TestProbability(starhellostar, 1.0, "hello!!", "hhelloworld", "hhello", "hello", "well hello");
            StringInferenceTestUtilities.TestProbability(starhellostar, 0.0, string.Empty, "hell");

            var hellostarworld = hello + any + world;

            StringInferenceTestUtilities.TestProbability(hellostarworld, 1.0, "hello world", "helloworld", "hello uncertain world");
            StringInferenceTestUtilities.TestProbability(hellostarworld, 0.0, "hello", "world", "hello world!!");
        }
Beispiel #7
0
        public void ZeroDetection()
        {
            StringDistribution dist1 = StringDistribution.OneOf(1.0, StringDistribution.Zero(), 0.0, StringDistribution.Any());

            Assert.True(dist1.IsZero());
            StringInferenceTestUtilities.TestProbability(dist1, 0.0, string.Empty, "a", "bc");

            StringDistribution dist2 = StringDistribution.Capitalized(2, 4).Product(StringDistribution.Any(minLength: 5, maxLength: 7));

            Assert.True(dist2.IsZero());
            StringInferenceTestUtilities.TestProbability(dist2, 0.0, string.Empty, "Abc", "Abcdef");

            StringDistribution dist3 = StringDistribution.Digits(minLength: 3, maxLength: 3).Product(StringDistribution.String("12a"));

            Assert.True(dist3.IsZero());
            StringInferenceTestUtilities.TestProbability(dist3, 0.0, string.Empty, "12a", "1", "2", "666");

            StringDistribution dist4 = StringDistribution.Any(minLength: 1, maxLength: 2).Product(StringDistribution.Any(minLength: 2, maxLength: 3).Product(StringDistribution.Any(minLength: 3, maxLength: 4)));

            Assert.True(dist4.IsZero());
            StringInferenceTestUtilities.TestProbability(dist4, 0.0, string.Empty, "a", "ab", "abc", "abcd");

            StringDistribution dist5 = StringDistribution.Any().Append(StringDistribution.Zero());

            Assert.True(dist5.IsZero());
            StringInferenceTestUtilities.TestProbability(dist5, 0.0, string.Empty, "a", "bc");

            StringDistribution dist6 = StringDistribution.Zero().Append(StringDistribution.OneOf("abc", "def"));

            Assert.True(dist6.IsZero());
            StringInferenceTestUtilities.TestProbability(dist6, 0.0, string.Empty, "a", "bc");
        }
        public void SimpleGatedModelTest3()
        {
            const double SelectorProbabilityTrue = 0.3;

            string[] options = new[] { "a", "b", "c" };

            Variable <string> str      = Variable.Random(StringDistribution.OneOf(options)).Named("str");
            Variable <bool>   selector = Variable.Bernoulli(SelectorProbabilityTrue).Named("selector");

            using (Variable.If(selector))
            {
                Variable.ConstrainEqual(str, options[0]);
            }

            var engine       = new InferenceEngine();
            var strPosterior = engine.Infer <StringDistribution>(str);

            double normalizer = (SelectorProbabilityTrue / options.Length) + (1 - SelectorProbabilityTrue);
            double nonFirstOptionProbability = (1 - SelectorProbabilityTrue) / (options.Length * normalizer);
            double firstOptionProbability    = nonFirstOptionProbability + (SelectorProbabilityTrue / (options.Length * normalizer));

            for (int i = 0; i < options.Length; ++i)
            {
                double expectedProbability = i == 0 ? firstOptionProbability : nonFirstOptionProbability;
                StringInferenceTestUtilities.TestProbability(strPosterior, expectedProbability, options[i]);
            }
        }
Beispiel #9
0
        public void LengthBounds()
        {
            var lengthDist1 = StringDistribution.Any(minLength: 1, maxLength: 3);

            Assert.True(lengthDist1.IsProper());
            StringInferenceTestUtilities.TestProbability(lengthDist1, StringInferenceTestUtilities.StringUniformProbability(1, 3, 65536), "a", "aa", "aaa");
            StringInferenceTestUtilities.TestProbability(lengthDist1, 0.0, string.Empty, "aaaa");

            var lengthDist2 = StringDistribution.Repeat(DiscreteChar.OneOf('a', 'b'), minTimes: 1, maxTimes: 3);

            Assert.True(lengthDist2.IsProper());
            StringInferenceTestUtilities.TestProbability(lengthDist2, StringInferenceTestUtilities.StringUniformProbability(1, 3, 2), "a", "ab", "aba");
            StringInferenceTestUtilities.TestProbability(lengthDist2, 0.0, string.Empty, "aaaa", "abab", "cc");

            var lengthDist3 = StringDistribution.Repeat(DiscreteChar.OneOf('a', 'b'), minTimes: 2, maxTimes: 2);

            Assert.True(lengthDist3.IsProper());
            StringInferenceTestUtilities.TestProbability(lengthDist3, StringInferenceTestUtilities.StringUniformProbability(2, 2, 2), "aa", "ab", "ba", "bb");
            StringInferenceTestUtilities.TestProbability(lengthDist3, 0.0, string.Empty, "a", "abab", "cc");

            var minLengthDist = StringDistribution.Any(minLength: 2);

            Assert.False(minLengthDist.IsProper());
            StringInferenceTestUtilities.TestProbability(minLengthDist, 1.0, "aa", "123", "@*(@*&(@)");
            StringInferenceTestUtilities.TestProbability(minLengthDist, 0.0, string.Empty, "a", "!");

            var maxLengthDist = StringDistribution.ZeroOrMore(DiscreteChar.Digit(), maxTimes: 3);

            Assert.True(maxLengthDist.IsProper());
            StringInferenceTestUtilities.TestProbability(maxLengthDist, StringInferenceTestUtilities.StringUniformProbability(0, 3, 10), string.Empty, "1", "32", "432");
            StringInferenceTestUtilities.TestProbability(maxLengthDist, 0.0, "abc", "1234");
        }
Beispiel #10
0
        public void CaseInvariant()
        {
            var caseInvariantDist = StringDistribution.CaseInvariant("0aBC");

            Assert.True(caseInvariantDist.IsProper());
            StringInferenceTestUtilities.TestProbability(caseInvariantDist, 1.0 / 8.0, "0aBC", "0abc", "0Abc");
            StringInferenceTestUtilities.TestProbability(caseInvariantDist, 0.0, "0aB", string.Empty);
        }
Beispiel #11
0
        public void AppendPointMassUniform()
        {
            var unifPlusH = StringDistribution.Any() + StringDistribution.String("h");

            Assert.False(unifPlusH.IsProper());
            StringInferenceTestUtilities.TestProbability(unifPlusH, 1.0, "h", "hh", "advahbdkjshbfjlhh");
            StringInferenceTestUtilities.TestProbability(unifPlusH, 0.0, string.Empty, "jam");
        }
Beispiel #12
0
        public void AppendInPlace()
        {
            var dist = StringDistribution.OneOf("x", "y");

            StringInferenceTestUtilities.TestProbability(dist, 0.5, "x", "y");
            dist.AppendInPlace(StringDistribution.OneOf("z", "w"));
            StringInferenceTestUtilities.TestProbability(dist, 0.25, "xz", "xw", "yz", "yw");
        }
Beispiel #13
0
        public void AppendToPointMass()
        {
            var dist1 = StringDistribution.String("x");
            var dist2 = StringDistribution.OneOf("y", "z");

            dist1.AppendInPlace(dist2);
            StringInferenceTestUtilities.TestProbability(dist1, 0.5, "xy", "xz");
        }
Beispiel #14
0
        public void Repeat4()
        {
            var dist = StringDistribution.Repeat(StringDistribution.OneOf("ab", "cd", "ef", "gh"), minTimes: 0, maxTimes: 3);

            Assert.True(dist.IsProper());
            StringInferenceTestUtilities.TestProbability(dist, StringInferenceTestUtilities.StringUniformProbability(0, 3, 4),
                                                         "", "ab", "cd", "ef", "gh", "abab", "abcd", "cdef", "cdgh", "ghef", "cdabcd", "cdcdcd", "abcdef", "ghefcd");
        }
Beispiel #15
0
        public void Product2()
        {
            var ab   = StringDistribution.ZeroOrMore(DiscreteChar.OneOf('a', 'b'));
            var a    = StringDistribution.ZeroOrMore('a');
            var prod = ab.Product(a);

            StringInferenceTestUtilities.TestProbability(prod, 1.0, string.Empty, "a", "aa", "aaa");
            StringInferenceTestUtilities.TestProbability(prod, 0.0, "b", "bb", "ab", "ba");
        }
Beispiel #16
0
        public void Mixture3()
        {
            var unifMix = StringDistribution.Zero();

            Assert.False(unifMix.IsProper());
            unifMix.SetToSum(0.5, StringDistribution.Any(), 0.5, StringDistribution.String("hello"));
            StringInferenceTestUtilities.TestProbability(unifMix, 1.0, "hello");
            StringInferenceTestUtilities.TestProbability(unifMix, 0.5, string.Empty, "something else");
        }
Beispiel #17
0
        public void Mixture1()
        {
            var dist1   = StringDistribution.OneOf("a", "b");
            var dist2   = StringDistribution.OneOf("c", "d", "e");
            var mixture = StringDistribution.OneOf(dist1, dist2);

            StringInferenceTestUtilities.TestProbability(mixture, 0.5 / 2, "a", "b");
            StringInferenceTestUtilities.TestProbability(mixture, 0.5 / 3, "c", "d", "e");
        }
Beispiel #18
0
        public void Zero()
        {
            var zero = StringDistribution.Zero();

            Assert.False(zero.IsUniform());
            Assert.False(zero.IsPointMass);
            Assert.False(zero.IsProper());
            StringInferenceTestUtilities.TestProbability(zero, 0.0, "hello", "!", string.Empty);
        }
Beispiel #19
0
        public void Empty()
        {
            var empty = StringDistribution.Empty();

            StringInferenceTestUtilities.TestProbability(empty, 1.0, string.Empty);
            StringInferenceTestUtilities.TestProbability(empty, 0.0, "something");
            Assert.True(empty.IsPointMass);
            Assert.Equal(string.Empty, empty.Point);
        }
Beispiel #20
0
        public void FromProbabilities()
        {
            var probabilities = new Dictionary <string, double> {
                { "abc", 3.0 }, { "b", 2.0 }, { "bc", 5.0 }
            };
            var dist = StringDistribution.OneOf(probabilities);

            StringInferenceTestUtilities.TestProbability(dist, 0.3, "abc");
            StringInferenceTestUtilities.TestProbability(dist, 0.2, "b");
            StringInferenceTestUtilities.TestProbability(dist, 0.5, "bc");
        }
Beispiel #21
0
        public void InferConcatenationFromArgumentsTest()
        {
            var str1           = Variable.Random(StringDistribution.OneOf("No man ", "Man "));
            var str2           = Variable.Random(StringDistribution.OneOf("is an island", "is not an island"));
            var s              = str1 + str2;
            var engine         = new InferenceEngine();
            var posteriorOverS = engine.Infer <StringDistribution>(s);

            StringInferenceTestUtilities.TestProbability(
                posteriorOverS, 0.25, "No man is an island", "Man is an island", "Man is not an island", "No man is not an island");
            StringInferenceTestUtilities.TestProbability(posteriorOverS, 0.0, "No man ", "Man ", "is an island", "is not an island");
        }
Beispiel #22
0
        public void Uniform()
        {
            var unif1 = StringDistribution.Any();
            var unif2 = StringDistribution.Uniform();

            Assert.True(unif1.IsUniform());
            Assert.True(unif2.IsUniform());
            Assert.False(unif1.IsProper());
            Assert.False(unif2.IsProper());
            StringInferenceTestUtilities.TestProbability(unif1, 1.0, "hello", string.Empty);
            StringInferenceTestUtilities.TestProbability(unif2, 1.0, "hello", string.Empty);
        }
Beispiel #23
0
        public void OneOf()
        {
            StringDistribution uniformOver1 = StringDistribution.OneOf("hello", "world", "hi");

            StringInferenceTestUtilities.TestProbability(uniformOver1, 1.0 / 3.0, "hello", "world", "hi");
            StringInferenceTestUtilities.TestProbability(uniformOver1, 0.0, string.Empty, "x", "hello world", "h");

            StringDistribution uniformOver2 = StringDistribution.OneOf(string.Empty, "a", "aa");

            StringInferenceTestUtilities.TestProbability(uniformOver2, 1.0 / 3.0, string.Empty, "a", "aa");
            StringInferenceTestUtilities.TestProbability(uniformOver2, 0.0, "x", "hello world", "h", "aaa");
        }
Beispiel #24
0
        public void InferArgumentsFromEqualityTest()
        {
            Variable <string> str1  = Variable.Random(StringDistribution.OneOf("a", "b"));
            Variable <string> str2  = Variable.Random(StringDistribution.OneOf("a", "b", "c"));
            Variable <bool>   equal = str1 == str2;

            equal.ObservedValue = true;

            var engine        = new InferenceEngine();
            var str2Posterior = engine.Infer <StringDistribution>(str2);

            StringInferenceTestUtilities.TestProbability(str2Posterior, 0.5, "a", "b");
        }
Beispiel #25
0
        public void RepeatPointMass()
        {
            var dist1 = StringDistribution.Repeat(StringDistribution.PointMass("ab"), minTimes: 2, maxTimes: 2);

            Assert.Equal(StringDistribution.PointMass("abab"), dist1);

            var dist2 = StringDistribution.Repeat(StringDistribution.PointMass("ab"), minTimes: 1, maxTimes: 3);

            Assert.True(dist2.IsProper());
            StringInferenceTestUtilities.TestProbability(dist2, 1.0 / 3.0, "ab", "abab", "ababab");

            var dist3 = StringDistribution.Repeat(StringDistribution.PointMass("ab"), minTimes: 0, maxTimes: 0);

            Assert.Equal(StringDistribution.PointMass(string.Empty), dist3);
        }
Beispiel #26
0
        public void PointMass()
        {
            const string       Point      = "hello world";
            StringDistribution pointMass1 = StringDistribution.String(Point);
            StringDistribution pointMass2 = StringDistribution.PointMass(Point);

            Assert.True(pointMass1.IsPointMass);
            Assert.True(pointMass2.IsPointMass);
            Assert.Equal(pointMass1.Point, Point);
            Assert.Equal(pointMass2.Point, Point);
            StringInferenceTestUtilities.TestProbability(pointMass1, 1.0, Point);
            StringInferenceTestUtilities.TestProbability(pointMass2, 1.0, Point);
            StringInferenceTestUtilities.TestProbability(pointMass1, 0.0, string.Empty, "x", "hello", "world");
            StringInferenceTestUtilities.TestProbability(pointMass2, 0.0, string.Empty, "x", "hello", "world");
        }
Beispiel #27
0
        public void Upper()
        {
            int uppercaseCharacterCount = DiscreteChar.Upper().GetProbs().Count(p => p > 0);

            var uppercaseAutomaton1 = StringDistribution.Upper(minLength: 1, maxLength: 2);

            Assert.True(uppercaseAutomaton1.IsProper());
            StringInferenceTestUtilities.TestProbability(uppercaseAutomaton1, StringInferenceTestUtilities.StringUniformProbability(1, 2, uppercaseCharacterCount), "A", "BC");
            StringInferenceTestUtilities.TestProbability(uppercaseAutomaton1, 0.0, "ABC", "bc", "a", string.Empty);

            var uppercaseAutomaton2 = StringDistribution.Upper(minLength: 2);

            Assert.False(uppercaseAutomaton2.IsProper());
            StringInferenceTestUtilities.TestProbability(uppercaseAutomaton2, 1.0, "BC", "HFJLHFLJN");
            StringInferenceTestUtilities.TestProbability(uppercaseAutomaton2, 0.0, "A", "bc", "JDFJjjlkJ", string.Empty);
        }
Beispiel #28
0
        public void Lower()
        {
            int lowercaseCharacterCount = DiscreteChar.Lower().GetProbs().Count(p => p > 0);

            var lowercaseAutomaton1 = StringDistribution.Lower(minLength: 1, maxLength: 2);

            Assert.True(lowercaseAutomaton1.IsProper());
            StringInferenceTestUtilities.TestProbability(lowercaseAutomaton1, StringInferenceTestUtilities.StringUniformProbability(1, 2, lowercaseCharacterCount), "a", "bc");
            StringInferenceTestUtilities.TestProbability(lowercaseAutomaton1, 0.0, "abc", "BC", "A", string.Empty);

            var lowercaseAutomaton2 = StringDistribution.Lower(minLength: 2);

            Assert.False(lowercaseAutomaton2.IsProper());
            StringInferenceTestUtilities.TestProbability(lowercaseAutomaton2, 1.0, "bc", "abvhrbfijbr");
            StringInferenceTestUtilities.TestProbability(lowercaseAutomaton2, 0.0, "a", "BC", "adasdADNdej", string.Empty);
        }
Beispiel #29
0
        public void Product3()
        {
            StringAutomaton weights1 = StringAutomaton.Sum(
                StringAutomaton.ConstantOn(1.0, "a"),
                StringAutomaton.ConstantOn(2.0, "b"),
                StringAutomaton.ConstantOn(4.0, "c"));
            StringAutomaton weights2 = StringAutomaton.Sum(
                StringAutomaton.ConstantOn(2.0, "a"),
                StringAutomaton.ConstantOn(5.0, "b"),
                StringAutomaton.ConstantOn(7.0, "c"));
            StringDistribution dist1   = StringDistribution.FromWeightFunction(weights1);
            StringDistribution dist2   = StringDistribution.FromWeightFunction(weights2);
            StringDistribution product = dist1.Product(dist2);

            StringInferenceTestUtilities.TestProbability(product, 2.0 / 40.0, "a");
            StringInferenceTestUtilities.TestProbability(product, 10.0 / 40.0, "b");
            StringInferenceTestUtilities.TestProbability(product, 28.0 / 40.0, "c");
        }
Beispiel #30
0
        public void UniformDetection()
        {
            StringDistribution dist1 = StringDistribution.OneOf(0.0, StringDistribution.Zero(), 1.0, StringDistribution.Any());

            Assert.True(dist1.IsUniform());
            StringInferenceTestUtilities.TestProbability(dist1, 1.0, string.Empty, "a", "bc");

            StringDistribution dist2 = StringDistribution.OneOf(0.3, StringDistribution.Any(), 0.7, StringDistribution.Any());

            Assert.True(dist2.IsUniform());
            StringInferenceTestUtilities.TestProbability(dist1, 1.0, string.Empty, "a", "bc");

            StringDistribution dist3 =
                StringDistribution.OneOf(1.0, StringDistribution.Any(), 2.0, StringDistribution.OneOf(0.1, StringDistribution.Any(), 0.2, StringDistribution.Any()));

            Assert.True(dist3.IsUniform());
            StringInferenceTestUtilities.TestProbability(dist3, 1.0, string.Empty, "a", "bc");
        }