当前位置: 首页>>代码示例>>C#>>正文


C# CharSetSolver.GenerateMinterms方法代码示例

本文整理汇总了C#中CharSetSolver.GenerateMinterms方法的典型用法代码示例。如果您正苦于以下问题:C# CharSetSolver.GenerateMinterms方法的具体用法?C# CharSetSolver.GenerateMinterms怎么用?C# CharSetSolver.GenerateMinterms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CharSetSolver的用法示例。


在下文中一共展示了CharSetSolver.GenerateMinterms方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateMintermsTest4

        public void GenerateMintermsTest4()
        {
            CharSetSolver solver = new CharSetSolver(BitWidth.BV7);

            BDD a = solver.MkRangeConstraint( '\0', '\x7E');
            BDD b = solver.MkRangeConstraint( '1', '1');
            BDD c = solver.MkRangeConstraint( '1', '3');

            var Z = new List<Pair<bool[], BDD>>(solver.GenerateMinterms(new BDD[] { a, b, c })).ToArray();
            var Y = Array.ConvertAll(Z, x => x.Second);
            var X = new HashSet<BDD>(Y);
            Assert.AreEqual<int>(4, X.Count);

            Assert.IsTrue(X.Contains(solver.MkRangeConstraint( '1', '1')));
            Assert.IsTrue(X.Contains(solver.MkRangeConstraint( '2', '3')));
            Assert.IsTrue(X.Contains(solver.MkRangesConstraint(false, new char[][] {new char[] { '\x7F', '\x7F' } })));
            Assert.IsTrue(X.Contains(solver.MkRangesConstraint(false, new char[][] { new char[] { '4', '\x7E' }, new char[] { '\0', '0' } })));
        }
开发者ID:AutomataDotNet,项目名称:Automata,代码行数:18,代码来源:CharSetSolverTests.cs

示例2: GenerateMintermsTest2

        public void GenerateMintermsTest2()
        {
            CharSetSolver bddb = new CharSetSolver(BitWidth.BV16);

            BDD a = bddb.MkRangeConstraint( 'b', 'c');
            BDD b = bddb.MkRangeConstraint( 'b', 'b');
            BDD b2 = bddb.MkRangeConstraint( 'b', 'b');
            BDD c = bddb.MkRangeConstraint( 'c', 'c');
            BDD b3 = bddb.MkRangeConstraint( 'b', 'b');

            var combinations = new List<Pair<bool[], BDD>>(bddb.GenerateMinterms(new BDD[] { a, b, b2, c, b3 }));
            Assert.AreEqual<int>(3, combinations.Count, "only three combinations are possible");
        }
开发者ID:AutomataDotNet,项目名称:Automata,代码行数:13,代码来源:CharSetSolverTests.cs

示例3: GenerateMintermsTest3

        public void GenerateMintermsTest3()
        {
            CharSetSolver bddb = new CharSetSolver(BitWidth.BV16);

            BDD A = bddb.MkRangeConstraint( '1', '4');
            BDD A1 = bddb.MkRangesConstraint(false, new char[][] { new char[] { '1', '3' }, new char[] { '3', '4' }});
            BDD B = bddb.MkRangesConstraint(false, new char[][] { new char[] { '2', '3' }, new char[] { '5', '6' }, new char[] { '8', '8' } });
            BDD C = bddb.MkRangesConstraint(false, new char[][] { new char[] { '3', '4' }, new char[] { '6', '7' }, new char[] { '9', '9' } });
            BDD D = bddb.MkRangesConstraint(false, new char[][] { new char[] { '0', '0' }, new char[] { '8', '9' } });

            var combinations = new List<Pair<bool[], BDD>>(bddb.GenerateMinterms(new BDD[] { A, B, C, A1, D }));
            Assert.AreEqual<int>(11, combinations.Count, "exactly 11 combinations must be possible");
        }
开发者ID:AutomataDotNet,项目名称:Automata,代码行数:13,代码来源:CharSetSolverTests.cs

示例4: GenerateMintermsTest1

        public void GenerateMintermsTest1()
        {
            CharSetSolver bddb = new CharSetSolver(BitWidth.BV16);

            BDD a = bddb.MkRangeConstraint( 'a', 'a');
            BDD b = bddb.MkRangeConstraint( 'b', 'b');
            BDD c = bddb.MkRangeConstraint( 'c', 'c');

            var combinations = new List<Pair<bool[], BDD>>(bddb.GenerateMinterms(new BDD[] { a, b, c }));
            Assert.AreEqual<int>(4, combinations.Count);
        }
开发者ID:AutomataDotNet,项目名称:Automata,代码行数:11,代码来源:CharSetSolverTests.cs


注:本文中的CharSetSolver.GenerateMinterms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。