Ejemplo n.º 1
0
        public static BitVecExpr Create_SF_BV(BitVecExpr value, uint nBits, Context ctx)
        {
            Debug.Assert(value != null, "BitVecExpr value cannot be null");
            Debug.Assert(ctx != null, "Context cannot be null");
            Debug.Assert(nBits <= value.SortSize);
            Debug.Assert(nBits >= 1);
            uint bitPos = nBits - 1;

            return(ToolsZ3.GetBit_BV(value, bitPos, ctx));
        }
Ejemplo n.º 2
0
        public static BoolExpr Create_PF(BitVecExpr value, Context ctx)
        {
            Debug.Assert(value != null, "BitVecExpr value cannot be null");
            Debug.Assert(ctx != null, "Context cannot be null");
            BitVecExpr v01       = ctx.MkBVAdd(ToolsZ3.GetBit_BV(value, 0, ctx), ToolsZ3.GetBit_BV(value, 1, ctx));
            BitVecExpr v23       = ctx.MkBVAdd(ToolsZ3.GetBit_BV(value, 2, ctx), ToolsZ3.GetBit_BV(value, 3, ctx));
            BitVecExpr v45       = ctx.MkBVAdd(ToolsZ3.GetBit_BV(value, 4, ctx), ToolsZ3.GetBit_BV(value, 5, ctx));
            BitVecExpr v67       = ctx.MkBVAdd(ToolsZ3.GetBit_BV(value, 6, ctx), ToolsZ3.GetBit_BV(value, 7, ctx));
            BitVecExpr v0123     = ctx.MkBVAdd(v01, v23);
            BitVecExpr v4567     = ctx.MkBVAdd(v45, v67);
            BitVecExpr v01234567 = ctx.MkBVAdd(v0123, v4567);

            return(ctx.MkEq(v01234567, ctx.MkBV(0, 1)));
        }