Automata.Z3.Tests.Z3_STTests.TestDecodeVsDecodeWithBug C# (CSharp) Method

TestDecodeVsDecodeWithBug() private method

private TestDecodeVsDecodeWithBug ( ) : void
return void
        public void TestDecodeVsDecodeWithBug()
        {
            STBuilderZ3 stb = new STBuilderZ3(new Z3Provider(BitWidth.BV16));
            STz3 D = MkDecode(stb, stb.Solver.IntSort);
            STz3 D2 = MkDecodeWithBug(stb, stb.Solver.IntSort);
            var w = D.Diff(D2);
            IValue<Expr> i = w.Input;
            IValue<Expr> a = w.Output1;
            IValue<Expr> b = w.Output2;
            int k = w.InputLength;
            //any shortest input witness has length 6
            Assert.AreEqual<int>(6, k);
            string input = i.GetStringValue(false);
            string outA = a.GetStringValue(false);
            string outB = b.GetStringValue(false);

            //any shortest input witness must match the following pattern
            Assert.IsTrue(System.Text.RegularExpressions.Regex.IsMatch(input, "^&#....$"));

            //the following characters are swapped
            string x = outA.Substring(2, 2);
            string y = outB.Substring(3, 1) + outB.Substring(2, 1);
            Assert.AreEqual<string>(x, y);
        }