Z3 real arithmetic and statistics

后端 未结 1 1429
你的背包
你的背包 2020-12-21 21:31

Given a problem that is encoded using Z3\'s reals, which of the statistics that Z3 /smt2 /st produces might be helpful in order to judge if the reals engine \"h

相关标签:
1条回答
  • 2020-12-21 21:52

    The new nonlinear arithmetic solver is only used on problems that contain only arithmetic. Since your problem uses quantifiers, the new nonlinear solver will not be used. Thus, Z3 will use the old approach based on a combination of: Simplex (pivots stat), Groebner Basis (groebner stat), and Interval Propagation (horner stat). This is not a complete method. Moreover, based on the fragments you posted in gist, Groebner basis will not be very effective. This method is usually effective on problems that contain a lot of equalities. So, it is probably just overhead. You can disable it by using option NL_ARITH_GB=false. Of course, this is just a guess based on the problem fragment you posted.

    The differences between encoding A and B are substantial. Encoding A is essentially a linear problem, since several constants were fixed to real values. Z3 was always complete for linear arithmetic problems. So, this should explain the difference in performance.

    Regarding your question about aliases, the preferred way to introduce aliases is:

    (define-const $Perms.$Zero $Perms 0.0)
    (define-const $Perms.$Write $Perms 1.0)
    

    Z3 also contains a preprocessor that eliminates variables using linear equations. This preprocessor is disabled by default in problems that contain quantifiers. This design decision is motivated by program verification tools that make extensive use of triggers/patterns in quantifiers. The variable elimination process may modify the careful designed triggers/patterns, and affect the total run-time. You can use the new tactic/strategy framework in Z3 to force it to apply this preprocessor. You can replace the command

    (check-sat)
    

    with

    (check-sat-using (then simplify solve-eqs smt))
    

    This strategy is telling Z3 to execute the simplifier, then solve equations (and eliminate variables) and then execute the default solver engine smt. You can find more about tactics and strategies in the following tutorial.

    0 讨论(0)
提交回复
热议问题