Beispiel #1
0
        private Z3Expr MkCoercion(Z3Expr t, AppFreeCanUnn unn, PosIntegerEmbedding te)
        {
            var zero = Context.MkInt(0);
            var one  = Context.MkInt(1);
            var i    = (Z3IntExpr)te.UnboxingFun.Apply(t);

            var negCase = BoxingFun.Apply(i.Neg(Context).Add(Context, one));

            var coercion = i.Gt(Context, zero).Ite(
                Context,
                BoxingFun.Apply(i.Neg(Context)),
                negCase);

            coercion = i.Eq(Context, zero).Ite(
                Context,
                BoxingFun.Apply(one),
                coercion);
            return(coercion);
        }
Beispiel #2
0
 private Z3Expr MkCoercion(Z3Expr t, AppFreeCanUnn unn, PosIntegerEmbedding te)
 {
     return(BoxingFun.Apply(
                ((Z3IntExpr)Context.MkSub(te.MkIntCoercion(t), Context.MkInt(Lower.ToString()))).Int2BV(Context, bvSort.Size)));
 }
 private Z3Expr MkCoercion(Z3Expr t, AppFreeCanUnn unn, PosIntegerEmbedding te)
 {
     return(CreationFun.Apply());
 }
Beispiel #4
0
 private Z3Expr MkCoercion(Z3Expr t, AppFreeCanUnn unn, PosIntegerEmbedding te)
 {
     return(te.MkIntCoercion(t));
 }