How to declare constants to use as bound variables in Z3_mk_forall_const?

岁酱吖の 提交于 2019-12-11 05:55:36

问题


Suppose I want to universally quantify x and y in the following formula:

f(x,y) <=> x=y 

using Z3_mk_forall_const . I will have to first construct the formula above, which requires constants x and y of type Z3_ast . Using Z3_mk_const to create x and y results in a global declaration. I would ideally like to avoid that. Is there an alternative?


回答1:


Yes there is an alternative; you can use Z3_mk_forall which uses de-Brujin variable indexes. Instead of constants, you can create indexed variables using Z3_mk_bound and then pass an array of their sorts (sorts) and names (decl_names) to mk_forall or mk_exists.



来源:https://stackoverflow.com/questions/22644077/how-to-declare-constants-to-use-as-bound-variables-in-z3-mk-forall-const

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