Microsoft Z3 naming assertions

2019-05-23 09:53发布

I need to name some assertions im my z3 model so that it is able to generate unsat cores.

I can do this manually like this:

(assert (! (assertion) :named x))

I just need to do it using the .NET API directly.

any help?

标签: assert z3 named
1条回答
Rolldiameter
2楼-- · 2019-05-23 10:48

Z3 does not support this directly through the .NET API. Instead, a Boolean constant should be created (the name, e.g., x), which can then be used to assert conditional constraints, e.g.,

solver.AssertAndTrack(constraint, x);

The constraint is then named x and this constant is used to refer to it in the unsat cores. For an example in Python, see also this other question; the strategy is the same in the .NET API, only the function names differ slightly.

查看更多
登录 后发表回答