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

MkIntConst() public méthode

Creates an integer constant.
public MkIntConst ( Symbol name ) : IntExpr
name Symbol
Résultat IntExpr
        public IntExpr MkIntConst(Symbol name)
        {
            Contract.Requires(name != null);
            Contract.Ensures(Contract.Result<IntExpr>() != null);

            return (IntExpr)MkConst(name, IntSort);
        }

Same methods

Context::MkIntConst ( string name ) : IntExpr

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::MkIntConst
Context