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

MkEq() public méthode

Creates the equality x = y.
public MkEq ( Expr x, Expr y ) : BoolExpr
x Expr
y Expr
Résultat BoolExpr
        public BoolExpr MkEq(Expr x, Expr y)
        {
            Contract.Requires(x != null);
            Contract.Requires(y != null);
            Contract.Ensures(Contract.Result<BoolExpr>() != null);

            CheckContextMatch(x);
            CheckContextMatch(y);
            return new BoolExpr(this, Native.Z3_mk_eq(nCtx, x.NativeObject, y.NativeObject));
        }

Usage Example

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

        using (Context ctx = new Context(cfg))
        {
            EnumSort color = ctx.MkEnumSort("Color", new string[] { "red", "green", "blue" });

            Expr red = color.Consts[0];
            Expr green = color.Consts[1];
            Expr blue = color.Consts[2];

            Console.WriteLine(ctx.MkEq(green, blue));
            Console.WriteLine(ctx.MkEq(green, blue).Simplify());

            Expr c = ctx.MkConst("c", color);

            Solver s = ctx.MkSolver();
            s.Assert(ctx.MkNot(ctx.MkEq(c, green)));
            s.Assert(ctx.MkNot(ctx.MkEq(c, blue)));
            Console.WriteLine(s.Check());
            Console.WriteLine(s.Model);
        }
    }
All Usage Examples Of Microsoft.Z3.Context::MkEq
Context