我正在使用 Z3_solver 进行非线性实数算术。我还想为求解器设置超时。我正在使用以下代码,但看起来超时不起作用,因为求解器永远运行。谁能帮我找出问题所在?
Z3_solver solver;
cfg = Z3_mk_config();
ctx = Z3_mk_context(cfg);
Z3_symbol logic_symbol = Z3_mk_string_symbol(ctx, "QF_UFNRA");
solver = Z3_mk_solver_for_logic((Z3_context)ctx, logic_symbol);
Z3_solver_inc_ref(ctx, solver);
Z3_params params = Z3_mk_params(ctx);
Z3_params_inc_ref(ctx, params);
Z3_symbol r = Z3_mk_string_symbol(ctx, ":timeout");
Z3_params_set_uint(ctx, params, r, 10);
Z3_solver_set_params(ctx, solver, params);
Z3_params_dec_ref(ctx, params);
Z3_del_config(cfg);
....
Z3_solver_assert(ctx,solver,pred);
Z3_lbool b = Z3_solver_check(ctx, solver);