本文整理汇总了C#中Microsoft.Z3.Context.MkBVSLT方法的典型用法代码示例。如果您正苦于以下问题:C# Context.MkBVSLT方法的具体用法?C# Context.MkBVSLT怎么用?C# Context.MkBVSLT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Z3.Context
的用法示例。
在下文中一共展示了Context.MkBVSLT方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public void Run()
{
Dictionary<string, string> cfg = new Dictionary<string, string>() {
{ "AUTO_CONFIG", "true" } };
using (Context ctx = new Context(cfg))
{
BitVecExpr x = ctx.MkBVConst("x", 16);
BitVecExpr y = ctx.MkBVConst("y", 16);
Params p = ctx.MkParams();
p.Add(":mul2concat", true);
Tactic t = ctx.Then(ctx.UsingParams(ctx.MkTactic("simplify"), p),
ctx.MkTactic("solve-eqs"),
ctx.MkTactic("bit-blast"),
ctx.MkTactic("aig"),
ctx.MkTactic("sat"));
Solver s = ctx.MkSolver(t);
s.Assert(ctx.MkEq(ctx.MkBVAdd(ctx.MkBVMul(x, ctx.MkBV(32, 16)), y), ctx.MkBV(13, 16)));
s.Assert(ctx.MkBVSLT(ctx.MkBVAND(x, y), ctx.MkBV(10, 16)));
s.Assert(ctx.MkBVSGT(y, ctx.MkBV(-100, 16)));
Console.WriteLine(s.Check());
Model m = s.Model;
Console.WriteLine(m);
Console.WriteLine(ctx.MkBVAdd(ctx.MkBVMul(x, ctx.MkBV(32, 16)), y) + " == " + m.Evaluate(ctx.MkBVAdd(ctx.MkBVMul(x, ctx.MkBV(32, 16)), y)));
Console.WriteLine(ctx.MkBVAND(x, y) + " == " + m.Evaluate(ctx.MkBVAND(x, y)) );
}
}
示例2: Run
public void Run()
{
Dictionary<string, string> cfg = new Dictionary<string, string>() {
{ "AUTO_CONFIG", "true" } };
using (Context ctx = new Context(cfg))
{
BitVecExpr x = ctx.MkBVConst("x", 32);
BitVecExpr y = ctx.MkBVConst("y", 32);
BitVecExpr zero = ctx.MkBV(0, 32);
BoolExpr trick = ctx.MkBVSLT(ctx.MkBVXOR(x, y), zero);
BoolExpr opposite = ctx.MkOr(ctx.MkAnd(ctx.MkBVSLT(x, zero), ctx.MkBVSGE(y, zero)),
ctx.MkAnd(ctx.MkBVSGE(x, zero), ctx.MkBVSLT(y, zero)));
Solver s = ctx.MkSolver();
s.Assert(ctx.MkNot(ctx.MkEq(trick, opposite)));
Console.WriteLine(s.Check());
}
}
示例3: Run
public void Run()
{
Dictionary<string, string> cfg = new Dictionary<string, string>() {
{ "AUTO_CONFIG", "true" } };
using (Context ctx = new Context(cfg))
{
BitVecExpr x = ctx.MkBVConst("x", 32);
BitVecExpr y = ctx.MkBVConst("y", 32);
BoolExpr q = ctx.MkAnd(ctx.MkEq(ctx.MkBVAdd(x, y), ctx.MkBV(2, 32)),
ctx.MkBVSGT(x, ctx.MkBV(0, 32)),
ctx.MkBVSGT(y, ctx.MkBV(0, 32)));
Console.WriteLine(q);
Solver s = ctx.MkSolver();
s.Assert(q);
Console.WriteLine(s.Check());
Console.WriteLine(s.Model);
q = ctx.MkEq(ctx.MkBVAND(x, y), ctx.MkBVNeg(y));
Console.WriteLine(q);
s = ctx.MkSolver();
s.Assert(q);
Console.WriteLine(s.Check());
Console.WriteLine(s.Model);
q = ctx.MkBVSLT(x, ctx.MkBV(0, 32));
Console.WriteLine(q);
s = ctx.MkSolver();
s.Assert(q);
Console.WriteLine(s.Check());
Console.WriteLine(s.Model);
q = ctx.MkBVULT(x, ctx.MkBV(0, 32));
Console.WriteLine(q);
s = ctx.MkSolver();
s.Assert(q);
Console.WriteLine(s.Check());
}
}