Automata.Z3.Tests.Z3_TreeTransducerTests.TestInvalidAcceptorStateInOutput C# (CSharp) Method

TestInvalidAcceptorStateInOutput() private method

private TestInvalidAcceptorStateInOutput ( ) : void
return void
        public void TestInvalidAcceptorStateInOutput()
        {
            Z3Provider Z = new Z3Provider();
            var A = (Z.TT.MkRankedAlphabet("A", Z.IntSort, new string[] { "zero", "one", "two" }, new int[] { 0, 1, 2 }));

            Func<int, int, Expr> q = (state, var) => { return A.MkTrans(A, state, var); };

            //two(1+x0,one(x1),one(x2))
            var b = A.MkTree("two",
                        Z.MkAdd(Z.MkInt(1), A.AttrVar),
                        A.MkTree("one", Z.MkAdd(Z.MkInt(1), A.AttrVar), q(0, 1)),
                        A.MkTree("one", Z.MkAdd(Z.MkInt(2), A.AttrVar), q(0, 2)));

            var rule0 = Z.TT.MkTreeRule(A, A, 0, "zero", Z.True, A.MkTree("zero", A.AttrVar));
            var rule1 = Z.TT.MkTreeRule(A, A, 0, "one", Z.True, A.MkTree("one", A.AttrVar, q(0, 1)));
            var rule2 = Z.TT.MkTreeRule(A, A, 0, "two", Z.True, A.MkTree("two", A.AttrVar, q(0, 2), q(1, 1)));
            var rule3 = Z.TT.MkTreeRule(A, A, 1, "two", Z.True, null, new int[]{1}, new int[]{1});
            var rule4 = Z.TT.MkTreeRule(A, A, 1, "zero", Z.True, null);

            try
            {
                var F = Z.TT.MkTreeAutomaton(0, A, A, new TreeRule[] { rule0, rule1, rule2, rule3, rule4 });
            }
            catch (AutomataException e)
            {
                Assert.AreEqual(AutomataExceptionKind.TreeTransducer_InvalidUseOfAcceptorState, e.kind);
            }
        }