【发布时间】:2015-07-02 21:31:16
【问题描述】:
(declare-const a Int)
(declare-const b Int)
(declare-const c Int)
(assert (exists ((a0 Int) (b0 Int) (c0 Int))
(and (<= a 3)
(>= a 0)
(<= b 3)
(>= b 0)
(<= c 3)
(>= c 0)
(= 3 (+ a b c))
(> a 1)
(= a0 a)
(= b0 b)
(= c0 c)
(= a0 2)
(= b0 0)
(= c0 1))))
(apply (then qe ctx-solver-simplify propagate-ineqs))
我正在尝试使用为 Z3 Solver 提供的 Java-API 生成此代码。但是,这最终会引发以下异常:
Z3 托管异常:propagate-ineqs 不支持 unsat 核心生产
Goal g = ctx.mkGoal(true, true, false);
g.add((BoolExpr) exp);
Tactic qe = ctx.mkTactic("qe");
Tactic simpify = ctx.mkTactic("simplify");
Tactic ctxSimpify = ctx.mkTactic("ctx-simplify");
Tactic ctxSolverSimplify = ctx.mkTactic("ctx-solver-simplify");
Tactic propagateIneqs = ctx.mkTactic("propagate-ineqs");
Tactic then = ctx.then(qe, simpify, ctxSimpify, ctxSolverSimplify,
propagateIneqs);
ApplyResult ar = then.apply(g);
BoolExpr result = ctx.mkAnd(ar.getSubgoals()[0].getFormulas());
请让我知道我哪里出错了,以及如何在 Java-API 中使用 propagate-ineqs 策略。这样,我可以得到简化的不等式的答案。
【问题讨论】: