Getting the smaller model for a SMT formula

走远了吗. 提交于 2020-01-15 10:09:34

问题


Let say that I have some formulas that can be sat but I want to get the smaller (or larger) possible value so sat that formula.

Is there a way to tell the SMT solver to give that kind of small solution?

Example:

a+1>10

In that example I want the SMT solver to give me the solution 10 instead of 100.

Cheers

NOTE: I have just seen a similar question answered by one of the z3 authors saying, three years ago, that they were implementing that functionality in z3. Do you know if it is already implemented?


回答1:


It can be done using maximize and minimize More info

(declare-const x Int)
(assert (> (+ x 1) 10))
(minimize x)
(check-sat)
(get-model)


来源:https://stackoverflow.com/questions/37200359/getting-the-smaller-model-for-a-smt-formula

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