问题
I have some code, which I want to check with help of some tactics. Since I have lot of if-then-else
statements, I want to apply elim-term-ite
tactic.
I have made use of following tactics
(check-sat-using (then (! simplify :arith-lhs true) elim-term-ite solve-eqs lia2pb pb2bv bit-blast sat))
However, if I an error with this as - "goal is in a fragment unsupported by lia2pb"
So then, if I try to remove the tactics lia2pb
and the ones next to them, I get another error as unknown "incomplete"
.
I tried to remove all the tactics except for the simplify
, however I would still get an incomplete
error.
What is that I should try to help the sat solver solve the problem? Should I try another tactics?
回答1:
To use lia2pb
(aka linear integer arithmetic to pseudo-boolean), all integer variables must be bounded. That is, they must have a lower and upper bound.
The tactic sat
is only complete if the input goal does not contain theory atoms. That is, the goal contains only Boolean connectives and Boolean constants. If that is not the case, then it will return "unknown" if it cannot show the (Boolean abstraction of the input) goal to be unsatisfiable.
You can ask Z3 to display the input goal for lia2pb
by using the following command:
(apply (then (! simplify :arith-lhs true) elim-term-ite solve-eqs)
If some of your formulas contain unbounded integer variables, you can build a strategy that reduces to SAT when possible, and invokes a general purpose solver otherwise. This can be accomplished using the or-else
combinator. Here is an example:
(check-sat-using (then (! simplify :arith-lhs true) elim-term-ite solve-eqs
(or-else (then lia2pb pb2bv bit-blast sat)
smt)))
EDIT: The tactic lia2pb
also assumes that the lower bound of every bounded integer variable is zero. This is not a big problem in practice, since we can use the tactic normalize-bounds
before applying lia2pb
. The tactic normalize-bounds
will replace a bound variable x
with y + l_x
, where y
is a fresh variable and l_x
is the lower bound for x. For example, in a goal containing 3 <= x
, x
is replaced with y+3
, where y
is a new fresh variable.
来源:https://stackoverflow.com/questions/12481347/goal-unsupported-by-tactic