Ejemplo n.º 1
0
        private static void Verify(Expr e, Expr[] vars, bool[] truthTable)
        {
            var exprMap = Enumerable.Range(0, vars.Length).ToDictionary(i => vars[i], i => i);

            for (int i = 0; i < truthTable.Length; i++)
            {
                var bits       = new VisitorBooleanSimplification.Bits(i);
                var calculated = VisitorBooleanSimplification.EvalVisitor.Eval(bits, exprMap, e);
                var expected   = truthTable[i];
                Assert.That(calculated, Is.EqualTo(expected));
            }
        }
 private static void Verify(Expr e, Expr[] vars, bool[] truthTable) {
     var exprMap = Enumerable.Range(0, vars.Length).ToDictionary(i => vars[i], i => i);
     for (int i = 0; i < truthTable.Length; i++) {
         var bits = new VisitorBooleanSimplification.Bits(i);
         var calculated = VisitorBooleanSimplification.EvalVisitor.Eval(bits, exprMap, e);
         var expected = truthTable[i];
         Assert.That(calculated, Is.EqualTo(expected));
     }
 }