Microsoft.Z3.Context.MkLe C# (CSharp) Méthode

MkLe() public méthode

Create an expression representing t1 <= t2
public MkLe ( ArithExpr t1, ArithExpr t2 ) : BoolExpr
t1 ArithExpr
t2 ArithExpr
Résultat BoolExpr
        public BoolExpr MkLe(ArithExpr t1, ArithExpr t2)
        {
            Contract.Requires(t1 != null);
            Contract.Requires(t2 != null);
            Contract.Ensures(Contract.Result<BoolExpr>() != null);

            CheckContextMatch(t1);
            CheckContextMatch(t2);
            return new BoolExpr(this, Native.Z3_mk_le(nCtx, t1.NativeObject, t2.NativeObject));
        }

Usage Example

Exemple #1
0
    public void Run()
    {
        Dictionary<string, string> settings = new Dictionary<string, string>() { { "AUTO_CONFIG", "true" }, { "MODEL", "true" } };

        using (Context ctx = new Context(settings))
        {
            IntExpr a = ctx.MkIntConst("a");
            IntExpr b = ctx.MkIntConst("b");
            IntExpr c = ctx.MkIntConst("c");
            RealExpr d = ctx.MkRealConst("d");
            RealExpr e = ctx.MkRealConst("e");

            BoolExpr q = ctx.MkAnd(
                ctx.MkGt(a, ctx.MkAdd(b, ctx.MkInt(2))),
                ctx.MkEq(a, ctx.MkAdd(ctx.MkMul(ctx.MkInt(2), c), ctx.MkInt(10))),
                ctx.MkLe(ctx.MkAdd(c, b), ctx.MkInt(1000)),
                ctx.MkGe(d, e));

            Solver s = ctx.MkSolver();
            s.Assert(q);

            Console.WriteLine(s.Check());

            Console.WriteLine(s.Model);
        }
    }
All Usage Examples Of Microsoft.Z3.Context::MkLe
Context