Z3: timeout for optimize in C++

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 06:25:30

问题


I'm trying to understand how to set a timeout for the optimize class of Z3 using C++ API.

This i my code:

context c;
optimize opt(c);
z3::params par(c);
par.set("timeout", 1000);
opt.set(par);

But I get "unknown parameter 'timeout'" exception on the line opt.set(par). Is it possible to set the timeout for the optimize class (after the timeout, I would like to obtain the best solution found)?

Thank you!


回答1:


I know this is an old question, but if anyone's still looking for an answer, you need:

Z3_global_param_set("timeout", timeout);

And your timeout should be given as a C string.



来源:https://stackoverflow.com/questions/38674049/z3-timeout-for-optimize-in-c

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