Ejemplo n.º 1
0
        public void BVULT()
        {
            var cfb     = GetConstantFoldingBuilder();
            var x       = GetVarAndIdExpr("x", Microsoft.Boogie.Type.GetBvType(4)).Item2;
            var y       = GetVarAndIdExpr("y", Microsoft.Boogie.Type.GetBvType(4)).Item2;
            var e       = cfb.Not(cfb.BVULT(x, y));
            var asBVUGE = ExprUtil.AsBVUGE(e);

            Assert.IsNotNull(asBVUGE);
            Assert.AreSame(x, asBVUGE.Args[0]);
            Assert.AreSame(y, asBVUGE.Args[1]);
        }
Ejemplo n.º 2
0
        public void NoFold()
        {
            var builders = GetSimpleAndConstantFoldingBuilder();
            SimpleExprBuilder          sfb = builders.Item1;
            ConstantFoldingExprBuilder cfb = builders.Item2;
            var arg0         = GetVarAndIdExpr("x", BasicType.GetBvType(8)).Item2;
            var arg1         = GetVarAndIdExpr("y", BasicType.GetBvType(8)).Item2;
            var simpleResult = sfb.BVUGE(arg0, arg1);
            var result       = cfb.BVUGE(arg0, arg1);

            CheckIsBoolType(result);
            CheckIsBoolType(simpleResult);
            Assert.IsNull(ExprUtil.AsLiteral(result));
            Assert.IsNotNull(ExprUtil.AsBVUGE(result));
            Assert.IsTrue(ExprUtil.StructurallyEqual(result, simpleResult));
        }