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

MkGoal() public méthode

Creates a new Goal.
Note that the Context must have been created with proof generation support if proofs is set to true here.
public MkGoal ( bool models = true, bool unsatCores = false, bool proofs = false ) : Goal
models bool Indicates whether model generation should be enabled.
unsatCores bool Indicates whether unsat core generation should be enabled.
proofs bool Indicates whether proof generation should be enabled.
Résultat Goal
        public Goal MkGoal(bool models = true, bool unsatCores = false, bool proofs = false)
        {
            Contract.Ensures(Contract.Result<Goal>() != null);

            return new Goal(this, models, unsatCores, proofs);
        }

Usage Example

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

        using (Context ctx = new Context(cfg))
        {
            RealExpr x = ctx.MkRealConst("x");
            RealExpr y = ctx.MkRealConst("y");
            RealExpr z = ctx.MkRealConst("z");
            RatNum zero = ctx.MkReal(0);
            RatNum two = ctx.MkReal(2);

            Goal g = ctx.MkGoal();

            g.Assert(ctx.MkGe(ctx.MkSub(ctx.MkPower(x, two), ctx.MkPower(y, two)), zero));

            Probe p = ctx.MkProbe("num-consts");
            Probe p2 = ctx.Gt(p, ctx.Const(2));
            Tactic t = ctx.Cond(p2, ctx.MkTactic("simplify"), ctx.MkTactic("factor"));

            Console.WriteLine(t[g]);

            g = ctx.MkGoal();
            g.Assert(ctx.MkGe(ctx.MkAdd(x, x, y, z), zero));
            g.Assert(ctx.MkGe(ctx.MkSub(ctx.MkPower(x, two), ctx.MkPower(y, two)), zero));

            Console.WriteLine(t[g]);
        }
    }
All Usage Examples Of Microsoft.Z3.Context::MkGoal
Context