How get a a value from a Lambda expression?

房东的猫 提交于 2019-12-01 18:52:02

Z3 produces Lambda abstractions for arrays by default; which are useful but hard to see what's going on in a model. I'd recommend turning that off, by putting the following line in your python program:

z3.set_param('model_compress', False)

You should do this right after you import z3.

With this, if you print the model in your program, you get:

>>> m
[a = [3 -> 1, else -> 1],
 another = [1 -> 1, else -> 1],
 k!0 = [3 -> 1, else -> 1],
 k!1 = [1 -> 1, else -> 1]]

which should be more readable. (It's essentially saying both a and another are arrays that map everything to 1; though a bit convoluted.)

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