Statistics in Z3

谁说胖子不能爱 提交于 2020-01-15 07:36:44

问题


I am using Java API of Z3 and I would like to get some statistics from the solver such as solving time, number of variables/symbols, memory usage. The post here (Z3py: how to get the list of variables from a formula?) claims that there is a utility implementation in Python but I was wondering if there is any for JavaAPI.

Thanks.


回答1:


Those particular utilities are an external contribution to Z3 and only available for the Python API. It should be possible to follow the same ideas in Java though.

The Solver object has a function called getStatistics() that returns Statistics object, which is essentially a collection of key/value pairs. Note that zero-valued statistical values are not reported (see e.g., also the discussion here).

There is currently no documentation for the statistical values reported (or the precision with which they are tracked), so all these values should be treated with care.

See also the following related questions:

Interpretation of Z3 Statistics

How to interpret statistics Z3

Which statistics indicate an efficient run of Z3?



来源:https://stackoverflow.com/questions/23064533/statistics-in-z3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!